[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/graphics/showimg/kexi/kexidb/drivers
From:       Martin Ellis <martin.ellis () kdemail ! net>
Date:       2005-08-11 9:54:45
Message-ID: 1123754085.476493.32491.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 445599 by martin:

Update PostgreSQL check to use pg_config, rather than look
for headers directly.  Needed for PostgreSQL 8.0.


 M  +76 -59    configure.in.in  


--- trunk/extragear/graphics/showimg/kexi/kexidb/drivers/configure.in.in \
#445598:445599 @@ -59,39 +59,103 @@
 
 AM_CONDITIONAL(compile_mysql_plugin, test "$compile_mysql_plugin" = "yes")
 
+
+
 dnl ========================================
-dnl checks for PostgreSQL
+dnl Checks for PostgreSQL
 dnl ========================================
 
-dnl add configure-args
 dnl ========================================
+dnl libpq
+dnl   Add configure-args
+dnl ========================================
 
+dnl Assume we're building until something fails, unless explicitly disabled
 AC_ARG_ENABLE(pgsql,
 AC_HELP_STRING([--enable-pgsql],[build PostgreSQL-plugin [default=yes]]),
  pgsql_plugin=$enableval, pgsql_plugin=yes)
 
-dnl ========================================
-dnl Libpq header/library directories
-dnl ========================================
+if test "x$pgsql_plugin" = "xyes"; then
+  compile_pgsql_plugin="yes"
+else
+  compile_pgsql_plugin="no"
+fi
 
 AC_ARG_WITH(pgsqlincdir,
 AC_HELP_STRING([--with-pgsqlincdir=DIR],[use PostgreSQL(libpq)-includes installed in \
this directory ]),  [
   ac_pgsql_incdir=$withval
-], ac_pgsql_incdir=/usr/local/include
+], ac_pgsql_incdir=
 )
 
 AC_ARG_WITH(pgsqllibdir,
 AC_HELP_STRING([  --with-pgsqllibdir=DIR],[use PostgreSQL(libpq)-libraries installed \
in this directory ]),  [
   ac_pgsql_libdir=$withval
-], ac_pgsql_libdir=/usr/local/lib
+], ac_pgsql_libdir=
 )
 
+
 dnl ========================================
-dnl Libpqxx header/library directories
+dnl   header/library directories
 dnl ========================================
 
+if test "$compile_pgsql_plugin" = "yes" -a \
+        ! -n "$ac_pgsql_incdir" -a ! -n "$ac_pgsql_libdir"; then
+dnl *** No configure arguments for includes or libs given ***
+dnl *** and not explicitly disabled.                      ***
+  KDE_FIND_PATH(pg_config, PG_CONFIG, 
+    [${prefix}/bin ${exec_prefix}/bin /usr/local/bin \
+     /opt/local/bin /usr/bin ], [
+    AC_MSG_RESULT([not found])
+  ])
+
+  if test -n "$PG_CONFIG"; then
+    pg_incdir=`$PG_CONFIG --includedir`
+    pg_libdir=`$PG_CONFIG --libdir`
+    PG_INCDIR=$pg_incdir
+    PG_LIBDIR=$pg_libdir
+    AC_SUBST(PG_LIBDIR)
+    compile_pgsql_plugin="yes"
+  else
+    compile_pgsql_plugin="no"
+  fi
+elif test "$compile_pgsql_plugin" = "yes"; then
+dnl *** Configure arguments for includes or libs given    ***
+dnl *** and not explicitly disabled.                      ***
+dnl *** Check that the paths given to configure are valid ***
+  AC_MSG_CHECKING([for PostgreSQL C API headers])
+  if test -r $ac_pgsql_incdir/libpq-fe.h; then
+    PG_INCDIR=$ac_pgsql_incdir
+    AC_MSG_RESULT([$PG_INCDIR])
+    AC_SUBST(PG_INCDIR)
+  else
+    AC_MSG_RESULT([not found])
+    compile_pgsql_plugin="no"
+  fi
+
+  AC_MSG_CHECKING([for PostgreSQL C API libraries])
+  if test -r $ac_pgsql_libdir/libpq.so; then
+    PG_LIBDIR=$ac_pgsql_libdir
+    AC_MSG_RESULT([$PG_LIBDIR])
+    AC_SUBST(PG_LIBDIR)
+  else
+    compile_pgsql_plugin="no"
+    AC_MSG_RESULT([not found])
+  fi
+else
+dnl *** PostgreSQL plugin explicitly disabled.            ***
+dnl *** Show that we are doing as requested.              ***
+  AC_MSG_NOTICE([Not attempting to configure PostgreSQL as requested])
+fi
+
+AM_CONDITIONAL(compile_pgsql_plugin, test "$compile_pgsql_plugin" = "yes")
+
+
+dnl ========================================
+dnl libpqxx checks
+dnl ========================================
+
 AC_ARG_WITH(pqxxincdir,
 AC_HELP_STRING([--with-pqxxincdir=DIR],[use PostgreSQL(libpqxx)-includes installed \
in this directory ]),  [
@@ -106,59 +170,12 @@
 ], ac_pqxx_libdir=/usr/local/lib
 )
 
-dnl ========================================
-dnl Check if PostgreSQL should be compiled
-dnl and where headers and libraries are installed
-dnl if present compile postgresql-plugin
-dnl ========================================
 
-
-compile_pgsql_plugin="yes"
-
-if test "x$pgsql_plugin" != "xyes"; then
-  compile_pgsql_plugin="no"
-fi
-
 dnl ========================================
-dnl First check for libpq headers
+dnl   libpqxx headers
 dnl ========================================
 if test "$compile_pgsql_plugin" = "yes"; then
-  AC_MSG_CHECKING([for PostgreSQL... Step 1 of 4])
-  pgsql_incdirs="$ac_pgsql_incdir /usr/include /usr/include/pgsql \
/usr/include/postgresql /usr/local/include /usr/local/pgsql/include \
                /opt/postgres/include"
-  AC_FIND_FILE(libpq-fe.h, $pgsql_incdirs, pgsql_incdir)
-  if test ! -r $pgsql_incdir/libpq-fe.h; then
-    compile_pgsql_plugin="no"
-    AC_MSG_RESULT([not found])
-  else
-    PG_INCDIR=$pgsql_incdir
-    AC_MSG_RESULT([$PG_INCDIR])
-    AC_SUBST(PG_INCDIR)
-  fi
-fi
-
-dnl ========================================
-dnl Next check for libpq libraries
-dnl ========================================
-if test "$compile_pgsql_plugin" = "yes"; then
-  AC_MSG_CHECKING([for PostgreSQL... Step 2 of 4])
-  pgsql_libdirs="$ac_pgsql_libdir /usr/lib /usr/local/lib /usr/local/pgsql/lib \
                /opt/postgres/lib"
-  AC_FIND_FILE(libpq.so, $pgsql_libdirs, pgsql_libdir)
-  if test ! -r $pgsql_libdir/libpq.so; then
-    compile_pgsql_plugin="no"
-    AC_MSG_RESULT([not found])
-  else
-    PG_LIBDIR=$pgsql_libdir
-    AC_MSG_RESULT([$PG_LIBDIR])
-    AC_SUBST(PG_LIBDIR)
-  fi
-fi
-
-
-dnl ========================================
-dnl Next check for libpqxx headers
-dnl ========================================
-if test "$compile_pgsql_plugin" = "yes"; then
-  AC_MSG_CHECKING([for PostgreSQL... Step 3 of 4])
+  AC_MSG_CHECKING([for PostgreSQL C++ includes])
   pqxx_incdirs="$ac_pqxx_incdir /usr/include /usr/local/pqxx/include \
/usr/local/include"  AC_FIND_FILE(pqxx/pqxx, $pqxx_incdirs, pqxx_incdir)
   if test ! -r $pqxx_incdir/pqxx/pqxx; then
@@ -172,10 +189,10 @@
 fi
 
 dnl ========================================
-dnl Finally check for libpqxx libraries
+dnl   libpqxx libraries
 dnl ========================================
 if test "$compile_pgsql_plugin" = "yes"; then
-  AC_MSG_CHECKING([for PostgreSQL... Step 4 of 4])
+  AC_MSG_CHECKING([for PostgreSQL C++ libraries])
   pqxx_libdirs="$ac_pqxx_libdir /usr/lib /usr/local/lib /usr/local/pqxx/lib"
   AC_FIND_FILE(libpqxx.so, $pqxx_libdirs, pqxx_libdir)
   if test ! -r $pqxx_libdir/libpqxx.so; then


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic