async listen/notify
[m6w6/ext-pq] / config.m4
1 PHP_ARG_WITH(pq, for pq support,
2 [ --with-pq Include pq support])
3
4 if test "$PHP_PQ" != "no"; then
5 SEARCH_PATH="/usr/local /usr /opt"
6 if test "$PHP_PQ" != "yes"; then
7 SEARCH_PATH="$PHP_PQ $SEARCH_PATH"
8 fi
9 for i in $SEARCH_PATH; do
10 AC_MSG_CHECKING(for $i/include/libpq-events.h)
11 if test -f "$i/include/libpq-events.h"; then
12 PQ_DIR=$i
13 AC_MSG_RESULT(yep)
14 break
15 fi
16 AC_MSG_RESULT(nope)
17 done
18
19 if test -z "$PQ_DIR"; then
20 AC_MSG_FAILURE(could not find include/libpq-events.h)
21 fi
22 PHP_ADD_INCLUDE($PQ_DIR/include)
23
24 PQ_SYM=PQregisterEventProc
25 PHP_CHECK_LIBRARY(pq, $PQ_SYM, [
26 PHP_ADD_LIBRARY_WITH_PATH(pq, $PQ_DIR/$PHP_LIBDIR, PQ_SHARED_LIBADD)
27 PHP_SUBST(PQ_SHARED_LIBADD)
28 ],[
29 AC_MSG_ERROR(could not find $PQ_SYM in -lpq)
30 ],[
31 -L$PQ_DIR/$PHP_LIBDIR
32 ])
33 PHP_CHECK_LIBRARY(pq, PQlibVersion, AC_DEFINE(HAVE_PQLIBVERSION, 1, Have PQlibVersion))
34
35 PQ_SRC="src/php_pq.c"
36 PHP_NEW_EXTENSION(pq, $PQ_SRC, $ext_shared)
37 PHP_ADD_BUILD_DIR($ext_builddir/src, 1)
38 fi
39