From 9d90de5de70d284966826d50c14a7abe46e37820 Mon Sep 17 00:00:00 2001 From: "Marc G. Fournier" Date: Sun, 17 Aug 1997 00:48:51 +0000 Subject: [PATCH] Changes so that it actually checks for , instead of assuming it does exist --- src/bin/psql/psql.c | 6 +- src/configure | 190 ++++++++++++++++++++++++---------------- src/configure.in | 1 + src/include/config.h.in | 3 + 4 files changed, 122 insertions(+), 78 deletions(-) diff --git a/src/bin/psql/psql.c b/src/bin/psql/psql.c index 98742dc93a..e8ef009229 100644 --- a/src/bin/psql/psql.c +++ b/src/bin/psql/psql.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.81 1997/08/03 02:37:58 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.82 1997/08/17 00:48:45 scrappy Exp $ * *------------------------------------------------------------------------- */ @@ -37,12 +37,12 @@ #ifdef HAVE_LIBREADLINE # ifdef HAVE_READLINE_H # include -# if defined(HAVE_HISTORY) || defined(HAVE_LIBHISTORY) +# if defined(HAVE_HISTORY) # include # endif # else # include -# if defined(HAVE_HISTORY) || defined(HAVE_LIBHISTORY) +# if defined(HAVE_READLINE_HISTORY_H) # include # endif # endif diff --git a/src/configure b/src/configure index 400aa4c256..67845b165a 100755 --- a/src/configure +++ b/src/configure @@ -643,7 +643,7 @@ EOT TEMPLATE=generic GUESS=`grep "$host_os" template/.similar 2>/dev/null` if test ! "$GUESS" - then host_os_no_ver=`echo "$host_os" | sed 's/[0-9.]*$//'` + then host_os_no_ver=`echo "$host_os" | sed 's/0-9.*$//'` GUESS=`grep "$host_os_no_ver" template/.similar 2>/dev/null` fi if test "$GUESS" @@ -2773,14 +2773,54 @@ else fi done +for ac_hdr in readline/history.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2781: checking for $ac_hdr" >&5 +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:2791: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2779: checking for working const" >&5 +echo "configure:2819: checking for working const" >&5 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:2873: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2850,12 +2890,12 @@ EOF fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:2854: checking for uid_t in sys/types.h" >&5 +echo "configure:2894: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -2884,21 +2924,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2888: checking for inline" >&5 +echo "configure:2928: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2942: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -2924,12 +2964,12 @@ EOF esac echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:2928: checking for mode_t" >&5 +echo "configure:2968: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2957,12 +2997,12 @@ EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2961: checking for off_t" >&5 +echo "configure:3001: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2990,12 +3030,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2994: checking for size_t" >&5 +echo "configure:3034: checking for size_t" >&5 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 @@ -3023,12 +3063,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:3027: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:3067: checking whether time.h and sys/time.h may both be included" >&5 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 @@ -3037,7 +3077,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:3041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3081: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -3058,12 +3098,12 @@ EOF fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:3062: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:3102: checking whether struct tm is in sys/time.h or time.h" >&5 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 @@ -3071,7 +3111,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:3075: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -3093,16 +3133,16 @@ fi echo $ac_n "checking for int timezone""... $ac_c" 1>&6 -echo "configure:3097: checking for int timezone" >&5 +echo "configure:3137: checking for int timezone" >&5 cat > conftest.$ac_ext < int main() { int res = timezone / 60; ; return 0; } EOF -if { (eval echo configure:3106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_INT_TIMEZONE 1 @@ -3117,9 +3157,9 @@ fi rm -f conftest* echo $ac_n "checking for union semun""... $ac_c" 1>&6 -echo "configure:3121: checking for union semun" >&5 +echo "configure:3161: checking for union semun" >&5 cat > conftest.$ac_ext < #include @@ -3128,7 +3168,7 @@ int main() { union semun semun; ; return 0; } EOF -if { (eval echo configure:3132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_UNION_SEMUN 1 @@ -3144,13 +3184,13 @@ rm -f conftest* if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:3148: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:3188: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP @@ -3168,7 +3208,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -3190,7 +3230,7 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6 fi echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:3194: checking for 8-bit clean memcmp" >&5 +echo "configure:3234: checking for 8-bit clean memcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3198,7 +3238,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else @@ -3226,12 +3266,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o" echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:3230: checking return type of signal handlers" >&5 +echo "configure:3270: checking return type of signal handlers" >&5 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 @@ -3248,7 +3288,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:3252: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3292: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -3267,12 +3307,12 @@ EOF echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:3271: checking for vprintf" >&5 +echo "configure:3311: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -3319,12 +3359,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:3323: checking for _doprnt" >&5 +echo "configure:3363: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -3374,12 +3414,12 @@ fi for ac_func in isinf tzset getrusage vfork memmove sigsetjmp kill sysconf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3378: checking for $ac_func" >&5 +echo "configure:3418: checking for $ac_func" >&5 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; } && test -s conftest; then +if { (eval echo configure:3446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3429,12 +3469,12 @@ done for ac_func in sigprocmask waitpid setsid random fcvt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3433: checking for $ac_func" >&5 +echo "configure:3473: checking for $ac_func" >&5 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; } && test -s conftest; then +if { (eval echo configure:3501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3482,12 +3522,12 @@ fi done echo $ac_n "checking for inet_aton""... $ac_c" 1>&6 -echo "configure:3486: checking for inet_aton" >&5 +echo "configure:3526: checking for inet_aton" >&5 if eval "test \"`echo '$''{'ac_cv_func_inet_aton'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_inet_aton=yes" else @@ -3534,12 +3574,12 @@ INET_ATON='inet_aton.o' fi echo $ac_n "checking for strerror""... $ac_c" 1>&6 -echo "configure:3538: checking for strerror" >&5 +echo "configure:3578: checking for strerror" >&5 if eval "test \"`echo '$''{'ac_cv_func_strerror'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_strerror=yes" else @@ -3586,12 +3626,12 @@ STRERROR='strerror.o' fi echo $ac_n "checking for strerror""... $ac_c" 1>&6 -echo "configure:3590: checking for strerror" >&5 +echo "configure:3630: checking for strerror" >&5 if eval "test \"`echo '$''{'ac_cv_func_strerror'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_strerror=yes" else @@ -3638,12 +3678,12 @@ STRERROR2='../../backend/port/strerror.o' fi echo $ac_n "checking for strdup""... $ac_c" 1>&6 -echo "configure:3642: checking for strdup" >&5 +echo "configure:3682: checking for strdup" >&5 if eval "test \"`echo '$''{'ac_cv_func_strdup'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_strdup=yes" else @@ -3694,12 +3734,12 @@ fi echo $ac_n "checking for cbrt""... $ac_c" 1>&6 -echo "configure:3698: checking for cbrt" >&5 +echo "configure:3738: checking for cbrt" >&5 if eval "test \"`echo '$''{'ac_cv_func_cbrt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_cbrt=yes" else @@ -3743,7 +3783,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for cbrt in -lm""... $ac_c" 1>&6 -echo "configure:3747: checking for cbrt in -lm" >&5 +echo "configure:3787: checking for cbrt in -lm" >&5 ac_lib_var=`echo m'_'cbrt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3751,7 +3791,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3788,12 +3828,12 @@ fi fi echo $ac_n "checking for rint""... $ac_c" 1>&6 -echo "configure:3792: checking for rint" >&5 +echo "configure:3832: checking for rint" >&5 if eval "test \"`echo '$''{'ac_cv_func_rint'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_rint=yes" else @@ -3837,7 +3877,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for rint in -lm""... $ac_c" 1>&6 -echo "configure:3841: checking for rint in -lm" >&5 +echo "configure:3881: checking for rint in -lm" >&5 ac_lib_var=`echo m'_'rint | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3845,7 +3885,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3883,7 +3923,7 @@ fi echo $ac_n "checking setting USE_LOCALE""... $ac_c" 1>&6 -echo "configure:3887: checking setting USE_LOCALE" >&5 +echo "configure:3927: checking setting USE_LOCALE" >&5 if test "$USE_LOCALE" = "yes" then echo "$ac_t""enabled" 1>&6 @@ -3895,14 +3935,14 @@ else echo "$ac_t""disabled" 1>&6 fi echo $ac_n "checking setting DEF_PGPORT""... $ac_c" 1>&6 -echo "configure:3899: checking setting DEF_PGPORT" >&5 +echo "configure:3939: checking setting DEF_PGPORT" >&5 cat >> confdefs.h <&6 echo $ac_n "checking setting HBA""... $ac_c" 1>&6 -echo "configure:3906: checking setting HBA" >&5 +echo "configure:3946: checking setting HBA" >&5 if test "$NOHBA" = "no" then echo "$ac_t""enabled" 1>&6 diff --git a/src/configure.in b/src/configure.in index 2c60ff9205..6fbe22faa1 100644 --- a/src/configure.in +++ b/src/configure.in @@ -383,6 +383,7 @@ AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(limits.h unistd.h termios.h values.h sys/select.h) AC_CHECK_HEADERS(sys/resource.h netdb.h) AC_CHECK_HEADERS(readline.h history.h dld.h crypt.h endian.h float.h) +AC_CHECK_HEADERS(readline/history.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST diff --git a/src/include/config.h.in b/src/include/config.h.in index da9122aee2..2d2b599fd5 100644 --- a/src/include/config.h.in +++ b/src/include/config.h.in @@ -44,6 +44,9 @@ /* Set to 1 if you have */ #undef HAVE_HISTORY +/* Set to 1 if you have */ +#undef HAVE_READLINE_HISTORY_H + /* Set to 1 if you have */ #undef HAVE_DLD_H -- 2.40.0