1999-04-22 10:48:28 +08:00
|
|
|
dnl $Id$
|
|
|
|
|
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])
|
|
|
|
|
2000-07-11 20:38:06 +08:00
|
|
|
PHP_ARG_WITH(pgsql,for PostgreSQL support,
|
|
|
|
[ --with-pgsql[=DIR] Include PostgreSQL support. DIR is the PostgreSQL
|
1999-09-03 22:58:51 +08:00
|
|
|
base install directory, defaults to /usr/local/pgsql.
|
2000-10-03 01:36:01 +08:00
|
|
|
Set DIR to "shared" to build as a dl, or "shared,DIR"
|
2000-05-02 05:32:26 +08:00
|
|
|
to build as a dl and still specify DIR.])
|
|
|
|
|
|
|
|
if test "$PHP_PGSQL" != "no"; then
|
2001-02-19 15:49:16 +08:00
|
|
|
AC_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_RESULT(Cannot find libpq-fe.h. Please specify the installation path of PostgreSQL)
|
|
|
|
fi
|
|
|
|
|
|
|
|
PGSQL_INCLUDE="-I$PGSQL_INCDIR"
|
|
|
|
PGSQL_LIBDIR=$PGSQL_DIR/lib
|
|
|
|
test -d $PGSQL_DIR/lib/pgsql && PGSQL_LIBDIR=$PGSQL_DIR/lib/pgsql
|
|
|
|
|
|
|
|
old_LIBS="$LIBS"
|
|
|
|
old_LDFLAGS="$LDFLAGS"
|
|
|
|
LDFLAGS="$LDFLAGS -L$PGSQL_LIBDIR"
|
|
|
|
AC_CHECK_LIB(pq, PQcmdTuples,AC_DEFINE(HAVE_PQCMDTUPLES,1,[ ]))
|
2000-05-23 14:03:34 +08:00
|
|
|
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,[ ]))
|
2000-05-02 05:32:26 +08:00
|
|
|
LIBS="$old_LIBS"
|
|
|
|
LDFLAGS="$old_LDFLAGS"
|
|
|
|
|
|
|
|
AC_DEFINE(HAVE_PGSQL,1,[ ])
|
|
|
|
|
2000-05-02 12:01:15 +08:00
|
|
|
AC_ADD_LIBRARY_WITH_PATH(pq, $PGSQL_LIBDIR, PGSQL_SHARED_LIBADD)
|
2000-05-02 05:32:26 +08:00
|
|
|
|
|
|
|
PHP_EXTENSION(pgsql,$ext_shared)
|
|
|
|
fi
|
|
|
|
|
1999-12-30 10:59:53 +08:00
|
|
|
PHP_SUBST(PGSQL_INCLUDE)
|
2000-05-02 05:32:26 +08:00
|
|
|
PHP_SUBST(PGSQL_SHARED_LIBADD)
|