php-src/ext/pgsql/config.m4

47 lines
1.4 KiB
Plaintext
Raw Normal View History

2001-12-01 03:00:13 +08:00
dnl
dnl $Id$
2001-12-01 03:00:13 +08:00
dnl
2000-05-02 05:32:26 +08:00
AC_DEFUN(PGSQL_INC_CHK,[if test -r $i$1/libpq-fe.h; then PGSQL_DIR=$i; PGSQL_INCDIR=$i$1])
PHP_ARG_WITH(pgsql,for PostgreSQL support,
[ --with-pgsql[=DIR] Include PostgreSQL support. DIR is the PostgreSQL
2001-12-01 03:00:13 +08:00
base install directory, defaults to /usr/local/pgsql.])
2000-05-02 05:32:26 +08:00
if test "$PHP_PGSQL" != "no"; then
PHP_EXPAND_PATH($PHP_PGSQL, PHP_PGSQL)
2000-05-02 05:32:26 +08:00
for i in /usr /usr/local /usr/local/pgsql $PHP_PGSQL; do
PGSQL_INC_CHK(/include)
el[]PGSQL_INC_CHK(/include/pgsql)
el[]PGSQL_INC_CHK(/include/postgresql)
1999-09-03 22:58:51 +08:00
fi
2000-05-02 05:32:26 +08:00
done
if test -z "$PGSQL_DIR"; then
AC_MSG_ERROR(Cannot find libpq-fe.h. Please specify the installation path of PostgreSQL)
2000-05-02 05:32:26 +08:00
fi
2001-05-12 19:09:05 +08:00
PGSQL_INCLUDE=-I$PGSQL_INCDIR
2000-05-02 05:32:26 +08:00
PGSQL_LIBDIR=$PGSQL_DIR/lib
test -d $PGSQL_DIR/lib/pgsql && PGSQL_LIBDIR=$PGSQL_DIR/lib/pgsql
2001-05-12 19:09:05 +08:00
old_LIBS=$LIBS
old_LDFLAGS=$LDFLAGS
2000-05-02 05:32:26 +08:00
LDFLAGS="$LDFLAGS -L$PGSQL_LIBDIR"
AC_CHECK_LIB(pq, PQcmdTuples,AC_DEFINE(HAVE_PQCMDTUPLES,1,[ ]))
AC_CHECK_LIB(pq, PQoidValue,AC_DEFINE(HAVE_PQOIDVALUE,1,[ ]))
2000-07-29 12:24:11 +08:00
AC_CHECK_LIB(pq, PQclientEncoding,AC_DEFINE(HAVE_PQCLIENTENCODING,1,[ ]))
AC_CHECK_LIB(pq, pg_encoding_to_char,AC_DEFINE(HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT,1,[ ]))
2001-05-12 19:09:05 +08:00
LIBS=$old_LIBS
LDFLAGS=$old_LDFLAGS
2000-05-02 05:32:26 +08:00
AC_DEFINE(HAVE_PGSQL,1,[ ])
PHP_ADD_LIBRARY_WITH_PATH(pq, $PGSQL_LIBDIR, PGSQL_SHARED_LIBADD)
2000-05-02 05:32:26 +08:00
PHP_EXTENSION(pgsql,$ext_shared)
2001-12-01 03:00:13 +08:00
PHP_SUBST(PGSQL_SHARED_LIBADD)
PHP_SUBST(PGSQL_INCLUDE)
2000-05-02 05:32:26 +08:00
fi