Make POSTGRESDIR configureable from Menuconfig.

This commit is contained in:
fritz 1997-03-29 12:47:26 +00:00
parent 7daf7bbf26
commit 15e39db2af
3 changed files with 75 additions and 53 deletions

14
isdnlog/aclocal.m4 vendored
View File

@ -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 <libpq-fe.h>], 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 <libpq-fe.h>], 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 <libpq-fe.h>], 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 <libpq-fe.h>], 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 <libpq-fe.h>], 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"

113
isdnlog/configure vendored
View File

@ -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 <<EOF
#line 867 "configure"
#line 868 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -875,7 +876,7 @@ int t() {
dbm_open()
; return 0; }
EOF
if { (eval echo configure:879: \"$ac_link\") 1>&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 <<EOF
#line 906 "configure"
#line 907 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -914,7 +915,7 @@ int t() {
gdbm_open()
; return 0; }
EOF
if { (eval echo configure:918: \"$ac_link\") 1>&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 <<EOF
#line 956 "configure"
#line 957 "configure"
#include "confdefs.h"
#include <assert.h>
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 <<EOF
#line 971 "configure"
#line 972 "configure"
#include "confdefs.h"
#include <assert.h>
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
#line 1013 "configure"
#line 1015 "configure"
#include "confdefs.h"
#include <libpq-fe.h>
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
#line 1031 "configure"
#line 1035 "configure"
#include "confdefs.h"
#include <libpq-fe.h>
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
#line 1049 "configure"
#line 1055 "configure"
#include "confdefs.h"
#include <libpq-fe.h>
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
#line 1067 "configure"
#line 1075 "configure"
#include "confdefs.h"
#include <libpq-fe.h>
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
#line 1085 "configure"
#line 1095 "configure"
#include "confdefs.h"
#include <libpq-fe.h>
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 <<EOF
#define POSTGRES 1
EOF
else
echo "$ac_t"""no POSTGRES DISABLED"" 1>&6
pqdir=""
fi
POSTGRESDIR="$pqdir"
@ -1127,11 +1138,11 @@ else
ac_cv_c_cross=yes
else
cat > conftest.$ac_ext <<EOF
#line 1131 "configure"
#line 1142 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
{ (eval echo configure:1135: \"$ac_link\") 1>&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 <<EOF
#line 1153 "configure"
#line 1164 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@ -1157,7 +1168,7 @@ else
#include <float.h>
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
#line 1176 "configure"
#line 1187 "configure"
#include "confdefs.h"
#include <string.h>
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
#line 1194 "configure"
#line 1205 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@ -1211,7 +1222,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
#line 1215 "configure"
#line 1226 "configure"
#include "confdefs.h"
#include <ctype.h>
#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 <<EOF
#line 1250 "configure"
#line 1261 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
@ -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
#line 1294 "configure"
#line 1305 "configure"
#include "confdefs.h"
#include <$ac_hdr>
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 <<EOF
#line 1378 "configure"
#line 1389 "configure"
#include "confdefs.h"
int main() { return 0; }
@ -1424,7 +1435,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
if { (eval echo configure:1428: \"$ac_compile\") 1>&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 <<EOF
#line 1452 "configure"
#line 1463 "configure"
#include "confdefs.h"
#include <sys/types.h>
#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 <<EOF
#line 1483 "configure"
#line 1494 "configure"
#include "confdefs.h"
#include <sys/types.h>
#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 <<EOF
#line 1514 "configure"
#line 1525 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@ -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 <<EOF
#line 1548 "configure"
#line 1559 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
@ -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 <<EOF
#line 1584 "configure"
#line 1595 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
@ -1598,7 +1609,7 @@ rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF
#line 1602 "configure"
#line 1613 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
@ -1627,7 +1638,7 @@ else
ac_cv_func_memcmp=no
else
cat > conftest.$ac_ext <<EOF
#line 1631 "configure"
#line 1642 "configure"
#include "confdefs.h"
main()
@ -1637,7 +1648,7 @@ main()
}
EOF
{ (eval echo configure:1641: \"$ac_link\") 1>&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 <<EOF
#line 1659 "configure"
#line 1670 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@ -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 <<EOF
#line 1704 "configure"
#line 1715 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@ -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 <<EOF
#line 1741 "configure"
#line 1752 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -1761,7 +1772,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:1765: \"$ac_link\") 1>&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

View File

@ -48,6 +48,7 @@ CHARGEFILE=charge.dat
RELOADCMD=reload
STOPCMD=stop
REBOOTCMD=/sbin/reboot
CONFIG_ISDNLOG_POSTGRESDIR=""
fi