]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
pgsql check fixes
authorTimo Sirainen <tss@iki.fi>
Fri, 7 Mar 2003 00:40:33 +0000 (02:40 +0200)
committerTimo Sirainen <tss@iki.fi>
Fri, 7 Mar 2003 00:40:33 +0000 (02:40 +0200)
--HG--
branch : HEAD

configure.in

index a086310db4463d5ff273fe47e434ff9b5136d2f0..efbb45a2a4a4c3342d411ac697c64dcc179a4fc6 100644 (file)
@@ -794,17 +794,29 @@ if test $want_pgsql = yes; then
        done
 
        old_LIBS=$LIBS
-       LIBS="$LIBS -L$PGSQL_LIBDIR"
+       if test "$PGSQL_LIBDIR" != ""; then
+               LIBS="$LIBS -L$PGSQL_LIBDIR"
+       fi
 
        AC_CHECK_LIB(pq, PQconnectdb, [
-               AC_CHECK_HEADER($PGSQL_INCLUDE/libpq-fe.h, [
-                       AUTH_CFLAGS="$AUTH_CFLAGS -I$PGSQL_INCLUDE"
-                       AUTH_LIBS="$AUTH_LIBS -L$PGSQL_LIBDIR -lpq"
+               old_CPPFLAGS=$CPPFLAGS
+               if test "$PGSQL_INCLUDE" != ""; then
+                       CPPFLAGS="$CPPFLAGS -I $PGSQL_INCLUDE"
+               fi
+               AC_CHECK_HEADER(libpq-fe.h, [
+                       if test "$PGSQL_INCLUDE" != ""; then
+                               AUTH_CFLAGS="$AUTH_CFLAGS -I$PGSQL_INCLUDE"
+                       fi
+                       if test "$PGSQL_LIBDIR" != ""; then
+                               AUTH_LIBS="$AUTH_LIBS -L$PGSQL_LIBDIR"
+                       fi
+                       AUTH_LIBS="$AUTH_LIBS -lpq"
                        AC_DEFINE(USERDB_PGSQL,, Build with PostgreSQL support)
                        AC_DEFINE(PASSDB_PGSQL,, Build with PostgreSQL support)
                        userdb="$userdb pgsql"
                        passdb="$passdb pgsql"
                ])
+               CPPFLAGS=$old_CPPFLAGS
        ])
        LIBS=$old_LIBS
 fi