From 15e39db2afda7ea21432e73bddaf56e220ff64bf Mon Sep 17 00:00:00 2001 From: fritz Date: Sat, 29 Mar 1997 12:47:26 +0000 Subject: [PATCH] Make POSTGRESDIR configureable from Menuconfig. --- isdnlog/aclocal.m4 | 14 +++++- isdnlog/configure | 113 ++++++++++++++++++++++++------------------- isdnlog/configure.in | 1 + 3 files changed, 75 insertions(+), 53 deletions(-) diff --git a/isdnlog/aclocal.m4 b/isdnlog/aclocal.m4 index 2ff4b967..24b8731f 100644 --- a/isdnlog/aclocal.m4 +++ b/isdnlog/aclocal.m4 @@ -5,39 +5,49 @@ dnl AC_DEFUN(AC_CHECK_POSTGRES, [ POSTGRESDIR="" pqdir="no" + tst_postgresdir="$CONFIG_ISDNLOG_POSTGRESDIR" AC_ARG_WITH(postgres, [ --with-postgres=DIR Set postgres directory []], tst_postgresdir="${withval}") if test "$tst_postgresdir" != "" || test "$CONFIG_ISDNLOG_POSTGRES" = "y" ; then - AC_MSG_CHECKING([for postgres]) + AC_MSG_CHECKING([for postgres in ${tst_postgresdir}]) if test "${tst_postgresdir}" != "" ; then CPPFLAGS="-nostdinc -I${tst_postgresdir}/include" AC_TRY_CPP([#include ], pqdir=${tst_postgresdir}) fi if test "$pqdir" = "no" ; then + AC_MSG_RESULT("$pqdir") + AC_MSG_CHECKING([for postgres in /lib/postgres95]) CPPFLAGS="-nostdinc -I/lib/postgres95/include" AC_TRY_CPP([#include ], pqdir=/lib/postgres95) fi if test "$pqdir" = "no" ; then + AC_MSG_RESULT("$pqdir") + AC_MSG_CHECKING([for postgres in /usr/lib/postgres95]) CPPFLAGS="-nostdinc -I/usr/lib/postgres95/include" AC_TRY_CPP([#include ], pqdir=/usr/lib/postgres95) fi if test "$pqdir" = "no" ; then + AC_MSG_RESULT("$pqdir") + AC_MSG_CHECKING([for postgres in /usr/local/postgres95]) CPPFLAGS="-nostdinc -I/usr/local/postgres95/include" AC_TRY_CPP([#include ], pqdir=/usr/local/postgres95) fi if test "$pqdir" = "no" ; then + AC_MSG_RESULT("$pqdir") + AC_MSG_CHECKING([for postgres in /usr/local/lib/postgres95]) CPPFLAGS="-nostdinc -I/usr/local/lib/postgres95/include" AC_TRY_CPP([#include ], pqdir=/usr/local/lib/postgres95) fi - AC_MSG_RESULT("$pqdir") fi if test "$pqdir" != "no" ; then + AC_MSG_RESULT("yes") POSTGRES=1 AC_DEFINE_UNQUOTED(POSTGRES,1) else + AC_MSG_RESULT("no POSTGRES DISABLED") pqdir="" fi POSTGRESDIR="$pqdir" diff --git a/isdnlog/configure b/isdnlog/configure index 5394287a..6e7377b6 100755 --- a/isdnlog/configure +++ b/isdnlog/configure @@ -569,6 +569,7 @@ CHARGEFILE=charge.dat RELOADCMD=reload STOPCMD=stop REBOOTCMD=/sbin/reboot +CONFIG_ISDNLOG_POSTGRESDIR="" fi @@ -713,7 +714,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:717: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:718: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -863,7 +864,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldbm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -902,7 +903,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgdbm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -952,13 +953,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:962: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:963: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -967,13 +968,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:977: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:978: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -996,6 +997,7 @@ echo "$ac_t""$CPP" 1>&6 POSTGRESDIR="" pqdir="no" + tst_postgresdir="$CONFIG_ISDNLOG_POSTGRESDIR" # Check whether --with-postgres or --without-postgres was given. if test "${with_postgres+set}" = set; then @@ -1005,16 +1007,16 @@ fi if test "$tst_postgresdir" != "" || test "$CONFIG_ISDNLOG_POSTGRES" = "y" ; then - echo $ac_n "checking for postgres""... $ac_c" 1>&6 + echo $ac_n "checking for postgres in ${tst_postgresdir}""... $ac_c" 1>&6 if test "${tst_postgresdir}" != "" ; then CPPFLAGS="-nostdinc -I${tst_postgresdir}/include" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1018: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1020: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1025,14 +1027,16 @@ fi rm -f conftest* fi if test "$pqdir" = "no" ; then + echo "$ac_t"""$pqdir"" 1>&6 + echo $ac_n "checking for postgres in /lib/postgres95""... $ac_c" 1>&6 CPPFLAGS="-nostdinc -I/lib/postgres95/include" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1036: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1040: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1043,14 +1047,16 @@ fi rm -f conftest* fi if test "$pqdir" = "no" ; then + echo "$ac_t"""$pqdir"" 1>&6 + echo $ac_n "checking for postgres in /usr/lib/postgres95""... $ac_c" 1>&6 CPPFLAGS="-nostdinc -I/usr/lib/postgres95/include" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1054: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1060: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1061,14 +1067,16 @@ fi rm -f conftest* fi if test "$pqdir" = "no" ; then + echo "$ac_t"""$pqdir"" 1>&6 + echo $ac_n "checking for postgres in /usr/local/postgres95""... $ac_c" 1>&6 CPPFLAGS="-nostdinc -I/usr/local/postgres95/include" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1072: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1080: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1079,14 +1087,16 @@ fi rm -f conftest* fi if test "$pqdir" = "no" ; then + echo "$ac_t"""$pqdir"" 1>&6 + echo $ac_n "checking for postgres in /usr/local/lib/postgres95""... $ac_c" 1>&6 CPPFLAGS="-nostdinc -I/usr/local/lib/postgres95/include" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1090: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1100: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1096,15 +1106,16 @@ else fi rm -f conftest* fi - echo "$ac_t"""$pqdir"" 1>&6 fi if test "$pqdir" != "no" ; then + echo "$ac_t"""yes"" 1>&6 POSTGRES=1 cat >> confdefs.h <&6 pqdir="" fi POSTGRESDIR="$pqdir" @@ -1127,11 +1138,11 @@ else ac_cv_c_cross=yes else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } +{ (eval echo configure:1146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } if test -s conftest && (./conftest; exit) 2>/dev/null; then ac_cv_c_cross=no else @@ -1149,7 +1160,7 @@ if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1157,7 +1168,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1161: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1172,7 +1183,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1190,7 +1201,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1211,7 +1222,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1222,7 +1233,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -{ (eval echo configure:1226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } +{ (eval echo configure:1237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } if test -s conftest && (./conftest; exit) 2>/dev/null; then : else @@ -1246,7 +1257,7 @@ if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1263,7 +1274,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:1267: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1278: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -1290,12 +1301,12 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1299: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1310: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1374,7 +1385,7 @@ if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1439: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1448,7 +1459,7 @@ if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1479,7 +1490,7 @@ if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1510,7 +1521,7 @@ if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1520,7 +1531,7 @@ int t() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:1524: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -1544,7 +1555,7 @@ if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1553,7 +1564,7 @@ int t() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:1557: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1568: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -1580,7 +1591,7 @@ if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP @@ -1598,7 +1609,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -1627,7 +1638,7 @@ else ac_cv_func_memcmp=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } +{ (eval echo configure:1652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } if test -s conftest && (./conftest; exit) 2>/dev/null; then ac_cv_func_memcmp=yes else @@ -1655,7 +1666,7 @@ if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1673,7 +1684,7 @@ int t() { int i; ; return 0; } EOF -if { (eval echo configure:1677: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1688: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -1700,7 +1711,7 @@ if test "$cross_compiling" = yes; then ac_cv_func_utime_null=no else cat > conftest.$ac_ext < #include @@ -1711,7 +1722,7 @@ exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0 && t.st_mtime - s.st_mtime < 120)); } EOF -{ (eval echo configure:1715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } +{ (eval echo configure:1726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } if test -s conftest && (./conftest; exit) 2>/dev/null; then ac_cv_func_utime_null=yes else @@ -1737,7 +1748,7 @@ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else diff --git a/isdnlog/configure.in b/isdnlog/configure.in index d3c477e2..75b9a45b 100644 --- a/isdnlog/configure.in +++ b/isdnlog/configure.in @@ -48,6 +48,7 @@ CHARGEFILE=charge.dat RELOADCMD=reload STOPCMD=stop REBOOTCMD=/sbin/reboot +CONFIG_ISDNLOG_POSTGRESDIR="" fi