From 5c1f31d2d47110f49d16bd56295125d656401855 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 10 Apr 2002 22:47:09 +0000 Subject: [PATCH] Readline and Zlib now required by default. Add options --without-readline and --without-zlib to turn them off. --- config/programs.m4 | 23 +- configure | 962 +++++++++++++++++++++++---------- configure.in | 87 +-- doc/src/sgml/installation.sgml | 36 +- doc/src/sgml/release.sgml | 3 +- src/bin/psql/input.c | 14 +- src/bin/psql/input.h | 32 +- src/bin/psql/startup.c | 13 +- src/include/pg_config.h.in | 8 +- 9 files changed, 800 insertions(+), 378 deletions(-) diff --git a/config/programs.m4 b/config/programs.m4 index 04e67e68a9..371b21b918 100644 --- a/config/programs.m4 +++ b/config/programs.m4 @@ -1,4 +1,4 @@ -# $Header: /cvsroot/pgsql/config/programs.m4,v 1.9 2002/04/10 16:45:24 petere Exp $ +# $Header: /cvsroot/pgsql/config/programs.m4,v 1.10 2002/04/10 22:46:33 petere Exp $ # PGAC_PATH_FLEX @@ -115,6 +115,27 @@ fi])# PGAC_CHECK_READLINE +# PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER +# --------------------------------------- +# Readline versions < 2.1 don't have rl_completion_append_character + +AC_DEFUN([PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER], +[AC_MSG_CHECKING([for rl_completion_append_character]) +AC_TRY_LINK([#include +#ifdef HAVE_READLINE_READLINE_H +# include +#elif defined(HAVE_READLINE_H) +# include +#endif +], +[rl_completion_append_character = 'x';], +[AC_MSG_RESULT(yes) +AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER, 1, + [Define if you have rl_completion_append_character])], +[AC_MSG_RESULT(no)])])# PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER + + + # PGAC_CHECK_GETTEXT # ------------------ diff --git a/configure b/configure index 4e312afadc..7b8e847ad1 100755 --- a/configure +++ b/configure @@ -877,6 +877,8 @@ Optional Packages: --with-krb-srvnam=NAME name of the service principal in Kerberos postgres --with-pam build with PAM support --with-openssl[=DIR] build with OpenSSL support [/usr/local/ssl] + --without-readline do not use Readline + --without-zlib do not use Zlib --with-unixodbc build ODBC driver for unixODBC --with-iodbc build ODBC driver for iODBC --with-odbcinst=DIR default directory for odbcinst.ini sysconfdir @@ -3446,6 +3448,67 @@ fi +# +# Readline +# + + + +# Check whether --with-readline or --without-readline was given. +if test "${with_readline+set}" = set; then + withval="$with_readline" + + case $withval in + yes) + : + ;; + no) + : + ;; + *) + { { echo "$as_me:$LINENO: error: no argument expected for --with-readline option" >&5 +echo "$as_me: error: no argument expected for --with-readline option" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + +else + with_readline=yes + +fi; + + +# +# Zlib +# + + + +# Check whether --with-zlib or --without-zlib was given. +if test "${with_zlib+set}" = set; then + withval="$with_zlib" + + case $withval in + yes) + : + ;; + no) + : + ;; + *) + { { echo "$as_me:$LINENO: error: no argument expected for --with-zlib option" >&5 +echo "$as_me: error: no argument expected for --with-zlib option" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + +else + with_zlib=yes + +fi; + + + # # Optionally enable the building of the ODBC driver @@ -5023,206 +5086,6 @@ fi ## Libraries ## - -echo "$as_me:$LINENO: checking for readline" >&5 -echo $ECHO_N "checking for readline... $ECHO_C" >&6 - -if test "${pgac_cv_check_readline+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - pgac_cv_check_readline=no -for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do - for pgac_rllib in -lreadline -ledit ; do - pgac_save_LIBS=$LIBS - LIBS="${pgac_rllib}${pgac_lib} $LIBS" - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char readline (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ -readline (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - - # NetBSD and OpenBSD have a broken linker that does not - # recognize dependent libraries - case $host_os in netbsd* | openbsd* ) - case $pgac_lib in - *curses*) ;; - *) pgac_lib=" -lcurses" ;; - esac - esac - - pgac_cv_check_readline="${pgac_rllib}${pgac_lib}" - break 2 - -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - LIBS=$pgac_save_LIBS - done -done -LIBS=$pgac_save_LIBS - -fi - -if test "$pgac_cv_check_readline" != no ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIBREADLINE 1 -_ACEOF - - LIBS="$pgac_cv_check_readline $LIBS" - echo "$as_me:$LINENO: result: yes ($pgac_cv_check_readline)" >&5 -echo "${ECHO_T}yes ($pgac_cv_check_readline)" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi -echo "$as_me:$LINENO: checking for library containing using_history" >&5 -echo $ECHO_N "checking for library containing using_history... $ECHO_C" >&6 -if test "${ac_cv_search_using_history+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -ac_cv_search_using_history=no -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char using_history (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ -using_history (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_using_history="none required" -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_using_history" = no; then - for ac_lib in history; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char using_history (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ -using_history (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_using_history="-l$ac_lib" -break -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - done -fi -LIBS=$ac_func_search_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_search_using_history" >&5 -echo "${ECHO_T}$ac_cv_search_using_history" >&6 -if test "$ac_cv_search_using_history" != no; then - test "$ac_cv_search_using_history" = "none required" || LIBS="$ac_cv_search_using_history $LIBS" - -cat >>confdefs.h <<\_ACEOF -#define HAVE_HISTORY_FUNCTIONS 1 -_ACEOF - -fi - - if test "$PORTNAME" != "aix" -a "$PORTNAME" != "alpha" then @@ -6410,88 +6273,6 @@ _ACEOF fi -# Only consider libz to be present if we find as well; -# furthermore, check that defines z_streamp (versions before -# about 1.0.4 did not). While we could work around the lack of z_streamp, -# it seems unwise to encourage people to use such old zlib versions... -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "z_streamp" >/dev/null 2>&1; then - - -echo "$as_me:$LINENO: checking for inflate in -lz" >&5 -echo $ECHO_N "checking for inflate in -lz... $ECHO_C" >&6 -if test "${ac_cv_lib_z_inflate+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lz $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char inflate (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ -inflate (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_z_inflate=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_z_inflate=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflate" >&5 -echo "${ECHO_T}$ac_cv_lib_z_inflate" >&6 -if test $ac_cv_lib_z_inflate = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBZ 1 -_ACEOF - - LIBS="-lz $LIBS" - -fi - - -fi -rm -f conftest* - # Solaris: echo "$as_me:$LINENO: checking for library containing fdatasync" >&5 echo $ECHO_N "checking for library containing fdatasync... $ECHO_C" >&6 @@ -6602,6 +6383,177 @@ if test "$ac_cv_search_fdatasync" != no; then fi +if test "$with_readline" = yes; then + +echo "$as_me:$LINENO: checking for readline" >&5 +echo $ECHO_N "checking for readline... $ECHO_C" >&6 + +if test "${pgac_cv_check_readline+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + pgac_cv_check_readline=no +for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do + for pgac_rllib in -lreadline -ledit ; do + pgac_save_LIBS=$LIBS + LIBS="${pgac_rllib}${pgac_lib} $LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char readline (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +readline (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + # NetBSD and OpenBSD have a broken linker that does not + # recognize dependent libraries + case $host_os in netbsd* | openbsd* ) + case $pgac_lib in + *curses*) ;; + *) pgac_lib=" -lcurses" ;; + esac + esac + + pgac_cv_check_readline="${pgac_rllib}${pgac_lib}" + break 2 + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + LIBS=$pgac_save_LIBS + done +done +LIBS=$pgac_save_LIBS + +fi + +if test "$pgac_cv_check_readline" != no ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIBREADLINE 1 +_ACEOF + + LIBS="$pgac_cv_check_readline $LIBS" + echo "$as_me:$LINENO: result: yes ($pgac_cv_check_readline)" >&5 +echo "${ECHO_T}yes ($pgac_cv_check_readline)" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + if test x"$pgac_cv_check_readline" = x"no"; then + { { echo "$as_me:$LINENO: error: readline library not found +Use --without-readline to disable readline support." >&5 +echo "$as_me: error: readline library not found +Use --without-readline to disable readline support." >&2;} + { (exit 1); exit 1; }; } + fi +fi + +if test "$with_zlib" = yes; then + +echo "$as_me:$LINENO: checking for inflate in -lz" >&5 +echo $ECHO_N "checking for inflate in -lz... $ECHO_C" >&6 +if test "${ac_cv_lib_z_inflate+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char inflate (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +inflate (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_z_inflate=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_z_inflate=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflate" >&5 +echo "${ECHO_T}$ac_cv_lib_z_inflate" >&6 +if test $ac_cv_lib_z_inflate = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBZ 1 +_ACEOF + + LIBS="-lz $LIBS" + +else + { { echo "$as_me:$LINENO: error: zlib library not found +Use --without-zlib to disable zlib support." >&5 +echo "$as_me: error: zlib library not found +Use --without-zlib to disable zlib support." >&2;} + { (exit 1); exit 1; }; } +fi + +fi + if test "$with_krb4" = yes ; then echo "$as_me:$LINENO: checking for des_encrypt in -ldes" >&5 @@ -7796,9 +7748,9 @@ fi done +if test "$with_readline" = yes; then - -for ac_header in readline/readline.h readline.h +for ac_header in readline/readline.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then @@ -7906,14 +7858,10 @@ if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - break -fi -done +else - - -for ac_header in readline/history.h history.h +for ac_header in readline.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then @@ -8021,11 +7969,372 @@ if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF - break + +else + { { echo "$as_me:$LINENO: error: readline header not found +Use --without-readline to disable readline support." >&5 +echo "$as_me: error: readline header not found +Use --without-readline to disable readline support." >&2;} + { (exit 1); exit 1; }; } fi done +fi + +done + + +for ac_header in readline/history.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +else + +for ac_header in history.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +else + { { echo "$as_me:$LINENO: error: history header not found +Use --without-readline to disable readline support." >&5 +echo "$as_me: error: history header not found +Use --without-readline to disable readline support." >&2;} + { (exit 1); exit 1; }; } +fi + +done + +fi + +done + +fi + +if test "$with_zlib" = yes; then + if test "${ac_cv_header_zlib_h+set}" = set; then + echo "$as_me:$LINENO: checking for zlib.h" >&5 +echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_zlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_zlib_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking zlib.h usability" >&5 +echo $ECHO_N "checking zlib.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking zlib.h presence" >&5 +echo $ECHO_N "checking zlib.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for zlib.h" >&5 +echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_zlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_zlib_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_zlib_h" >&6 + +fi +if test $ac_cv_header_zlib_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: zlib header not found +Use --without-zlib to disable zlib support." >&5 +echo "$as_me: error: zlib header not found +Use --without-zlib to disable zlib support." >&2;} + { (exit 1); exit 1; }; } +fi + + +fi if test "$with_krb4" = yes ; then if test "${ac_cv_header_krb_h+set}" = set; then @@ -9474,6 +9783,71 @@ _ACEOF fi +if test "$with_zlib" = yes; then + # Check that defines z_streamp (versions before about 1.0.4 + # did not). While we could work around the lack of z_streamp, it + # seems unwise to encourage people to use such old zlib versions... + echo "$as_me:$LINENO: checking for z_streamp" >&5 +echo $ECHO_N "checking for z_streamp... $ECHO_C" >&6 +if test "${ac_cv_type_z_streamp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +if ((z_streamp *) 0) + return 0; +if (sizeof (z_streamp)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_z_streamp=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_z_streamp=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_z_streamp" >&5 +echo "${ECHO_T}$ac_cv_type_z_streamp" >&6 +if test $ac_cv_type_z_streamp = yes; then + : +else + { { echo "$as_me:$LINENO: error: zlib version is too old +Use --without-zlib to disable zlib support." >&5 +echo "$as_me: error: zlib version is too old +Use --without-zlib to disable zlib support." >&2;} + { (exit 1); exit 1; }; } +fi + +fi + if test "$with_krb5" = yes; then # Check for differences between MIT and Heimdal (KTH) releases echo "$as_me:$LINENO: checking for krb5_ticket.enc_part2" >&5 @@ -11559,8 +11933,8 @@ done -# Readline versions < 2.1 don't have rl_completion_append_character -echo "$as_me:$LINENO: checking for rl_completion_append_character" >&5 +if test "$with_readline" = yes; then + echo "$as_me:$LINENO: checking for rl_completion_append_character" >&5 echo $ECHO_N "checking for rl_completion_append_character... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" @@ -11614,7 +11988,6 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - for ac_func in rl_completion_matches rl_filename_completion_function do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` @@ -11690,6 +12063,7 @@ _ACEOF fi done +fi echo "$as_me:$LINENO: checking for finite" >&5 diff --git a/configure.in b/configure.in index c2a8641d7b..b829d6ee9b 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -dnl $Header: /cvsroot/pgsql/configure.in,v 1.176 2002/04/10 16:45:24 petere Exp $ +dnl $Header: /cvsroot/pgsql/configure.in,v 1.177 2002/04/10 22:46:31 petere Exp $ dnl Developers, please strive to achieve this order: dnl @@ -511,6 +511,19 @@ PGAC_ARG_OPTARG(with, openssl, AC_SUBST(with_openssl) +# +# Readline +# +PGAC_ARG_BOOL(with, readline, yes, + [ --without-readline do not use Readline]) + +# +# Zlib +# +PGAC_ARG_BOOL(with, zlib, yes, + [ --without-zlib do not use Zlib]) + + # # Optionally enable the building of the ODBC driver @@ -676,11 +689,6 @@ fi ## Libraries ## -PGAC_CHECK_READLINE -AC_SEARCH_LIBS(using_history, history, - [AC_DEFINE(HAVE_HISTORY_FUNCTIONS, 1, - [Define if you have the history functions])]) - if test "$PORTNAME" != "aix" -a "$PORTNAME" != "alpha" then AC_CHECK_LIB(bsd, main) @@ -705,16 +713,23 @@ AC_CHECK_LIB([[unix]], main) AC_SEARCH_LIBS(crypt, crypt) # BeOS: AC_CHECK_LIB(bind, __inet_ntoa) -# Only consider libz to be present if we find as well; -# furthermore, check that defines z_streamp (versions before -# about 1.0.4 did not). While we could work around the lack of z_streamp, -# it seems unwise to encourage people to use such old zlib versions... -AC_EGREP_HEADER(z_streamp, zlib.h, [ -AC_CHECK_LIB(z, inflate) -]) # Solaris: AC_SEARCH_LIBS(fdatasync, [rt posix4]) +if test "$with_readline" = yes; then + PGAC_CHECK_READLINE + if test x"$pgac_cv_check_readline" = x"no"; then + AC_MSG_ERROR([readline library not found +Use --without-readline to disable readline support.]) + fi +fi + +if test "$with_zlib" = yes; then + AC_CHECK_LIB(z, inflate, [], + [AC_MSG_ERROR([zlib library not found +Use --without-zlib to disable zlib support.])]) +fi + if test "$with_krb4" = yes ; then AC_CHECK_LIB(des, [des_encrypt], [], [AC_MSG_ERROR([library 'des' is required for Kerberos 4])]) AC_CHECK_LIB(krb, [krb_sendauth], [], [AC_MSG_ERROR([library 'krb' is required for Kerberos 4])]) @@ -756,8 +771,21 @@ AC_CHECK_HEADERS([netinet/tcp.h], [], [], #endif ]) -AC_CHECK_HEADERS([readline/readline.h readline.h], [break]) -AC_CHECK_HEADERS([readline/history.h history.h], [break]) +if test "$with_readline" = yes; then + AC_CHECK_HEADERS([readline/readline.h], [], + [AC_CHECK_HEADERS([readline.h], [], + [AC_MSG_ERROR([readline header not found +Use --without-readline to disable readline support.])])]) + AC_CHECK_HEADERS([readline/history.h], [], + [AC_CHECK_HEADERS([history.h], [], + [AC_MSG_ERROR([history header not found +Use --without-readline to disable readline support.])])]) +fi + +if test "$with_zlib" = yes; then + AC_CHECK_HEADER(zlib.h, [], [AC_MSG_ERROR([zlib header not found +Use --without-zlib to disable zlib support.])]) +fi if test "$with_krb4" = yes ; then AC_CHECK_HEADER(krb.h, [], [AC_MSG_ERROR([header file is required for Kerberos 4])]) @@ -796,6 +824,15 @@ AC_CHECK_TYPES([struct cmsgcred, struct fcred, struct sockcred], [], [], #include #include ]) +if test "$with_zlib" = yes; then + # Check that defines z_streamp (versions before about 1.0.4 + # did not). While we could work around the lack of z_streamp, it + # seems unwise to encourage people to use such old zlib versions... + AC_CHECK_TYPE(z_streamp, [], [AC_MSG_ERROR([zlib version is too old +Use --without-zlib to disable zlib support.])], + [#include ]) +fi + if test "$with_krb5" = yes; then # Check for differences between MIT and Heimdal (KTH) releases AC_CHECK_MEMBERS([krb5_ticket.enc_part2], [], @@ -914,22 +951,10 @@ AC_CHECK_FUNCS(rint, [], [AC_CHECK_LIB(m, rint, AC_DEFINE(HAVE_RINT), , $HPUXMATHLIB)]) -# Readline versions < 2.1 don't have rl_completion_append_character -AC_MSG_CHECKING([for rl_completion_append_character]) -AC_TRY_LINK([#include -#ifdef HAVE_READLINE_READLINE_H -# include -#elif defined(HAVE_READLINE_H) -# include -#endif -], -[rl_completion_append_character = 'x';], -[AC_MSG_RESULT(yes) -AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER, 1, - [Define if you have rl_completion_append_character])], -[AC_MSG_RESULT(no)]) - -AC_CHECK_FUNCS([rl_completion_matches rl_filename_completion_function]) +if test "$with_readline" = yes; then + PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER + AC_CHECK_FUNCS([rl_completion_matches rl_filename_completion_function]) +fi dnl Cannot use AC_CHECK_FUNC because finite may be a macro diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml index 11e4b92368..a30f2d3db3 100644 --- a/doc/src/sgml/installation.sgml +++ b/doc/src/sgml/installation.sgml @@ -1,4 +1,4 @@ - + <![%standalone-include[<productname>PostgreSQL</>]]> @@ -92,11 +92,12 @@ su - postgres <primary>readline</primary> </indexterm> - The <acronym>GNU</> <productname>Readline</> library (for comfortable - line editing and command history retrieval) will automatically be used - if found. You might wish to install it before proceeding, but it is not - essential. (On <productname>NetBSD</productname>, the - <filename>libedit</filename> library is + The <acronym>GNU</> <productname>Readline</> library (for + comfortable line editing and command history retrieval) will be + used by default. If you don't want to use it then you must + specify the <option>--without-readline</option> option for + <filename>configure</>. (On <productname>NetBSD</productname>, + the <filename>libedit</filename> library is <productname>readline</productname>-compatible and is used if <filename>libreadline</filename> is not found.) </para> @@ -847,6 +848,29 @@ su - postgres </listitem> </varlistentry> + <varlistentry> + <term><option>--without-readline</option></term> + <listitem> + <para> + Prevents the use of the Readline library. This disables + command-line editing and history in + <application>psql</application>, so it is not recommended. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term><option>--without-zlib</option></term> + <listitem> + <para> + Prevents the use of the Zlib library. This disables + compression support in <application>pg_dump</application>. + This option is only intended for those rare systems where this + library is not available. + </para> + </listitem> + </varlistentry> + <varlistentry> <term><option>--enable-debug</option></term> <listitem> diff --git a/doc/src/sgml/release.sgml b/doc/src/sgml/release.sgml index e70bb7fa09..a2ace11be5 100644 --- a/doc/src/sgml/release.sgml +++ b/doc/src/sgml/release.sgml @@ -1,5 +1,5 @@ <!-- -$Header: /cvsroot/pgsql/doc/src/sgml/release.sgml,v 1.131 2002/04/05 00:31:23 tgl Exp $ +$Header: /cvsroot/pgsql/doc/src/sgml/release.sgml,v 1.132 2002/04/10 22:46:48 petere Exp $ --> <appendix id="release"> @@ -24,6 +24,7 @@ CDATA means the content is "SGML-free", so you can write without worries about funny characters. --> <literallayout><![CDATA[ +Readline and Zlib are now required by default and must be turned off explicitly if their use is not desired Define a third class of function volatility to allow indexscans in more cases Locale support is now built by default; choice of locale is set by initdb and/or at run-time ALTER TABLE ALTER COLUMN SET/DROP NOT NULL diff --git a/src/bin/psql/input.c b/src/bin/psql/input.c index 32872e9d71..6e083506f3 100644 --- a/src/bin/psql/input.c +++ b/src/bin/psql/input.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/input.c,v 1.18 2001/10/25 05:49:54 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/input.c,v 1.19 2002/04/10 22:46:58 petere Exp $ */ #include "postgres_fe.h" #include "input.h" @@ -19,8 +19,6 @@ /* (of course there is no runtime command for doing that :) */ #ifdef USE_READLINE static bool useReadline; -#endif -#ifdef USE_HISTORY static bool useHistory; #endif @@ -44,7 +42,7 @@ gets_interactive(char *prompt) { char *s; -#ifdef USE_HISTORY +#ifdef USE_READLINE const char *var; static char *prev_hist = NULL; #endif @@ -62,7 +60,7 @@ gets_interactive(char *prompt) } #endif -#ifdef USE_HISTORY +#ifdef USE_READLINE if (useHistory && s && s[0] != '\0') { var = GetVariable(pset.vars, "HISTCONTROL"); @@ -133,7 +131,7 @@ initializeInput(int flags) } #endif -#ifdef USE_HISTORY +#ifdef USE_READLINE if (flags == 1) { const char *home; @@ -168,7 +166,7 @@ initializeInput(int flags) bool saveHistory(char *fname) { -#ifdef USE_HISTORY +#ifdef USE_READLINE if (useHistory && fname) { if (write_history(fname) != 0) @@ -194,7 +192,7 @@ finishInput(void) finishInput(int exitstatus, void *arg) #endif { -#ifdef USE_HISTORY +#ifdef USE_READLINE if (useHistory) { char *home; diff --git a/src/bin/psql/input.h b/src/bin/psql/input.h index 8c6def33a3..e893b8c539 100644 --- a/src/bin/psql/input.h +++ b/src/bin/psql/input.h @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/input.h,v 1.15 2001/11/05 17:46:31 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/input.h,v 1.16 2002/04/10 22:47:03 petere Exp $ */ #ifndef INPUT_H #define INPUT_H @@ -12,26 +12,20 @@ * If some other file needs to have access to readline/history, include this * file and save yourself all this work. * - * USE_READLINE and USE_HISTORY are the definite pointers regarding existence or not. + * USE_READLINE is the definite pointers regarding existence or not. */ #ifdef HAVE_LIBREADLINE -#if defined(HAVE_READLINE_READLINE_H) -#include <readline/readline.h> -#define USE_READLINE 1 -#elif defined(HAVE_READLINE_H) -#include <readline.h> -#define USE_READLINE 1 -#endif -#endif - -#if defined(HAVE_HISTORY_FUNCTIONS) -#if defined(HAVE_READLINE_HISTORY_H) -#include <readline/history.h> -#define USE_HISTORY 1 -#elif defined(HAVE_HISTORY_H) -#include <history.h> -#define USE_HISTORY 1 -#endif +# define USE_READLINE 1 +# if defined(HAVE_READLINE_READLINE_H) +# include <readline/readline.h> +# elif defined(HAVE_READLINE_H) +# include <readline.h> +# endif +# if defined(HAVE_READLINE_HISTORY_H) +# include <readline/history.h> +# elif defined(HAVE_HISTORY_H) +# include <history.h> +# endif #endif char *gets_interactive(char *prompt); diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c index 3a7b7a0f93..765f6db901 100644 --- a/src/bin/psql/startup.c +++ b/src/bin/psql/startup.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.55 2002/03/27 19:16:13 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.56 2002/04/10 22:47:04 petere Exp $ */ #include "postgres_fe.h" @@ -636,7 +636,7 @@ showVersion(void) { puts("psql (PostgreSQL) " PG_VERSION); -#if defined(USE_READLINE) || defined (USE_HISTORY) || defined(MULTIBYTE) +#if defined(USE_READLINE) || defined(MULTIBYTE) fputs(gettext("contains support for: "), stdout); #ifdef USE_READLINE @@ -644,15 +644,6 @@ showVersion(void) #define _Feature #endif -#ifdef USE_HISTORY -#ifdef _Feature - fputs(", ", stdout); -#else -#define _Feature -#endif - fputs(gettext("history"), stdout); -#endif - #ifdef MULTIBYTE #ifdef _Feature fputs(", ", stdout); diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in index cd27d28fa3..2cfe5b16d6 100644 --- a/src/include/pg_config.h.in +++ b/src/include/pg_config.h.in @@ -8,7 +8,7 @@ * or in pg_config.h afterwards. Of course, if you edit pg_config.h, then your * changes will be overwritten the next time you run configure. * - * $Id: pg_config.h.in,v 1.20 2002/04/03 05:39:33 petere Exp $ + * $Id: pg_config.h.in,v 1.21 2002/04/10 22:47:09 petere Exp $ */ #ifndef PG_CONFIG_H @@ -420,9 +420,6 @@ /* Define if you have the stricmp function. */ #undef HAVE_STRICMP -/* Set to 1 if you have history functions (either in libhistory or libreadline) */ -#undef HAVE_HISTORY_FUNCTIONS - /* Set to 1 if you have <pwd.h> */ #undef HAVE_PWD_H @@ -590,9 +587,6 @@ extern int fdatasync(int fildes); /* Set to 1 if you have libreadline.a */ #undef HAVE_LIBREADLINE -/* Set to 1 if you have libhistory.a */ -#undef HAVE_LIBHISTORY - /* Set to 1 if your libreadline defines rl_completion_append_character */ #undef HAVE_RL_COMPLETION_APPEND_CHARACTER