update tests
[m6w6/ext-pq] / config.m4
1 PHP_ARG_WITH(pq, [whether to enable libpq (PostgreSQL) support],
2 [ --with-pq[=DIR] Include libpq 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_ERROR(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="\
36 src/php_pq_module.c\
37 src/php_pq_misc.c\
38 src/php_pq_callback.c\
39 src/php_pq_object.c\
40 src/php_pq_params.c\
41 src/php_pqcancel.c\
42 src/php_pqconn.c\
43 src/php_pqconn_event.c\
44 src/php_pqcopy.c\
45 src/php_pqexc.c\
46 src/php_pqlob.c\
47 src/php_pqres.c\
48 src/php_pqstm.c\
49 src/php_pqtxn.c\
50 src/php_pqtypes.c\
51 src/php_pqcur.c\
52 "
53 PHP_NEW_EXTENSION(pq, $PQ_SRC, $ext_shared)
54 PHP_ADD_BUILD_DIR($ext_builddir/src)
55 PHP_ADD_INCLUDE($ext_srcdir/src)
56 PHP_ADD_EXTENSION_DEP(pq, raphf)
57
58 fi
59