cvs: /php4/ext/pgsql Makefile.in config.m4

From: Date: Mon, 01 May 2000 21:32:56 +0000
Subject: cvs: /php4/ext/pgsql Makefile.in config.m4
Groups: php.version4 
Request: Send a blank email to php-version4+get-14289@lists.php.net to get a copy of this message
sas Mon May 1 14:32:56 2000 EDT Modified files: /php4/ext/pgsql Makefile.in config.m4 Log: Revamp config stuff Index: php4/ext/pgsql/Makefile.in diff -u php4/ext/pgsql/Makefile.in:1.3 php4/ext/pgsql/Makefile.in:1.4 --- php4/ext/pgsql/Makefile.in:1.3 Sun Apr 30 19:41:45 2000 +++ php4/ext/pgsql/Makefile.in Mon May 1 14:32:26 2000 @@ -2,8 +2,9 @@ LTLIBRARY_NAME = libpgsql.la LTLIBRARY_SOURCES = pgsql.c LTLIBRARY_SHARED_NAME = pgsql.la -LTLIBRARY_SHARED_LIBADD = $(PGSQL_LFLAGS) $(PGSQL_LIBS) +LTLIBRARY_SHARED_LIBADD = $(PGSQL_SHARED_LIBADD) EXTRA_INCLUDES = $(PGSQL_INCLUDE) include $(top_srcdir)/build/dynlib.mk + Index: php4/ext/pgsql/config.m4 diff -u php4/ext/pgsql/config.m4:1.9 php4/ext/pgsql/config.m4:1.10 --- php4/ext/pgsql/config.m4:1.9 Wed Dec 29 20:52:11 1999 +++ php4/ext/pgsql/config.m4 Mon May 1 14:32:26 2000 @@ -1,61 +1,47 @@ -dnl $Id: config.m4,v 1.9 1999/12/30 04:52:11 sas Exp $ +dnl $Id: config.m4,v 1.10 2000/05/01 21:32:26 sas Exp $ -AC_MSG_CHECKING(for PostgresSQL support) -AC_ARG_WITH(pgsql, +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 PostgresSQL support, [ --with-pgsql[=DIR] Include PostgresSQL support. DIR is the PostgresSQL base install directory, defaults to /usr/local/pgsql. Set DIR to "shared" to build as a dl, or "shared,DIR" - to build as a dl and still specify DIR.], -[ - case $withval in - shared) - shared=yes - withval=yes - ;; - shared,*) - shared=yes - withval=echo $withval | sed -e 's/^shared,//' - ;; - *) - shared=no - ;; - esac - if test "$withval" != "no"; then - if test "$withval" = "yes"; then - PGSQL_INCDIR=/usr/local/pgsql/include - PGSQL_LIBDIR=/usr/local/pgsql/lib - else - PGSQL_INCDIR=$withval/include - test -d $withval/include/pgsql && PGSQL_INCDIR=$withval/include/pgsql - test -d $withval/include/postgresql && PGSQL_INCDIR=$withval/include/postgresql - PGSQL_LIBDIR=$withval/lib - test -d $withval/lib/pgsql && PGSQL_LIBDIR=$withval/lib/pgsql - fi - PGSQL_INCLUDE=-I$PGSQL_INCDIR - PGSQL_LFLAGS=-L$PGSQL_LIBDIR - PGSQL_LIBS=-lpq - - old_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS $PGSQL_INCLUDE" - AC_DEFINE(HAVE_PGSQL,1,[ ]) - if test "$shared" = "yes"; then - AC_MSG_RESULT(yes (shared)) - PGSQL_SHARED="pgsql.la" - else - AC_MSG_RESULT(yes (static)) - AC_ADD_LIBRARY_WITH_PATH(pq, $PGSQL_LIBDIR) - AC_ADD_INCLUDE($PGSQL_INCDIR) - PGSQL_STATIC="libphpext_pgsql.la" + to build as a dl and still specify DIR.]) + +if test "$PHP_PGSQL" != "no"; then + 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) fi - AC_CHECK_FUNC(PQcmdTuples,AC_DEFINE(HAVE_PQCMDTUPLES,1,[ ])) - CFLAGS=$old_CFLAGS - PHP_EXTENSION(pgsql,$shared) + 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,[ ])) + LIBS="$old_LIBS" + LDFLAGS="$old_LDFLAGS" + + AC_DEFINE(HAVE_PGSQL,1,[ ]) + + if test "$ext_shared" = "yes"; then + PGSQL_SHARED_LIBADD="-R$PGSQL_LIBDIR -L$PGSQL_LIBDIR -lpq" else - AC_MSG_RESULT(no) + AC_ADD_LIBRARY_WITH_PATH(pq, $PGSQL_LIBDIR) fi -],[ - AC_MSG_RESULT(no) -]) -PHP_SUBST(PGSQL_LIBS) -PHP_SUBST(PGSQL_LFLAGS) + + PHP_EXTENSION(pgsql,$ext_shared) +fi + PHP_SUBST(PGSQL_INCLUDE) +PHP_SUBST(PGSQL_SHARED_LIBADD)

« previous php.version4 (#14289) next »