From 74de4174845f5bcf3c2ff1e637f678aec1e3e6d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Thu, 23 Jun 2016 12:14:57 +0200 Subject: [PATCH] Build [Postgres]: Improved diagnostics for the path search. Adds a bit of logging to config.log. This should make it easier to find out why it sometimes doesn't find the include files. --- src/modules/Postgres/configure.in | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/modules/Postgres/configure.in b/src/modules/Postgres/configure.in index fa2b1b4f53..feb2d904b1 100644 --- a/src/modules/Postgres/configure.in +++ b/src/modules/Postgres/configure.in @@ -27,13 +27,36 @@ include_searchpath="" lib_searchpath="" for a in $with_root/usr/local $with_root/usr $with_root/opt $with_root/usr/lib $HOME; do for b in postgres95 postgres pgsql postgresql .; do - include_searchpath="$include_searchpath $a/$b/include $a/include/$b" - lib_searchpath="$lib_searchpath $a/$b/lib $a/lib/$b" + for d in "$a/$b/include" "$a/include/$b"; do + if test -d "$d/."; then + if test "$b" = "."; then + # Special case to avoid duplicates : $a/./include ~= $a/include/. + include_searchpath="$include_searchpath $a/include" + break; + else + include_searchpath="$include_searchpath $d" + fi + fi + done + for d in "$a/$b/lib" "$a/lib/$b"; do + if test -d "$d/."; then + if test "$b" = "."; then + # Special case to avoid duplicates : $a/./lib ~= $a/lib/. + lib_searchpath="$lib_searchpath $a/lib" + break; + else + lib_searchpath="$lib_searchpath $d" + fi + fi + done done done include_searchpath="$pike_postgres_user_include_directory $include_searchpath" lib_searchpath="$pike_postgres_user_lib_directory $lib_searchpath" +echo "include searchpath: $include_searchpath" >&AC_FD_CC +echo "lib searchpath: $lib_searchpath" >&AC_FD_CC + dnl check for dirname and locate, we might need them AC_CHECK_PROG(dirname,dirname,yes) AC_CHECK_PROG(locate,locate,yes) @@ -55,12 +78,14 @@ dnl see if we can find the include files in any of the standard locations AC_MSG_CHECKING(for location of the Postgres include files) AC_CACHE_VAL(pike_cv_pgres_include_dir, [ for pike_cv_pgres_include_dir in $include_searchpath no; do + echo "Trying $pike_cv_pgres_include_dir/server/catalog/pg_type.h" >&AC_FD_CC if test -f $pike_cv_pgres_include_dir/server/catalog/pg_type.h; then break fi done if test x$pike_cv_pgres_include_dir = xno; then for pike_cv_pgres_include_dir in $include_searchpath no; do + echo "Trying $pike_cv_pgres_include_dir/libpq-fe.h" >&AC_FD_CC if test -f $pike_cv_pgres_include_dir/libpq-fe.h; then break fi -- GitLab