$NetBSD: patch-ak,v 1.3 2004/03/08 21:13:55 seb Exp $ --- configure.orig 2000-01-08 01:36:11.000000000 +0000 +++ configure @@ -1744,7 +1744,7 @@ else int main() { /* Ultrix mips cc rejects this. */ -typedef int charset[2]; const charset x = {0,0}; +typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; @@ -3567,16 +3567,20 @@ else echo "$ac_t""no" 1>&6 fi -echo $ac_n "checking for mpf_get_str in -lgmp""... $ac_c" 1>&6 -echo "configure:3572: checking for mpf_get_str in -lgmp" >&5 -ac_lib_var=`echo gmp'_'mpf_get_str | sed 'y%./+-%__p_%'` +LIBS="-lgmp $LIBS";GMP_SUBDIRS=;GMP_LIBS= + + + +echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 +echo "configure:3576: checking for tgetent in -ltermcap" >&5 +ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" -LIBS="-lgmp $LIBS" +LIBS="-ltermcap $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3602,25 +3606,69 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - LIBS="-lgmp $LIBS" GMP_SUBDIRS= GMP_LIBS= + LIBS="-ltermcap $LIBS" termcap=yes else echo "$ac_t""no" 1>&6 -GMP_SUBDIRS=gmp GMP_LIBS='$(GMP_LIBS)' +termcap=no fi +if test "$termcap" = yes; then + for ac_hdr in termcap.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:3621: 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:3631: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +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 + cat >> confdefs.h <<\EOF +#define HAVE_LIBTERMCAP 1 +EOF +fi -echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 -echo "configure:3616: checking for tgetent in -lncurses" >&5 -ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` +echo $ac_n "checking for readline in -ledit""... $ac_c" 1>&6 +echo "configure:3664: checking for readline in -ledit" >&5 +ac_lib_var=`echo edit'_'readline | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" -LIBS="-lncurses $LIBS" +LIBS="-ledit $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3646,19 +3694,19 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - LIBS="-lncurses $LIBS" termcap=yes + readlinelib=edit have_readline=yes else echo "$ac_t""no" 1>&6 -echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:3654: checking for tgetent in -ltermcap" >&5 -ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` +echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 +echo "configure:3702: checking for readline in -lreadline" >&5 +ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" -LIBS="-ltermcap $LIBS" +LIBS="-lreadline $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3684,16 +3732,17 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - LIBS="-ltermcap $LIBS" termcap=yes + readlinelib=readline have_readline=yes else echo "$ac_t""no" 1>&6 -termcap=no +readline=no fi fi -if test "$termcap" = yes; then - for ac_hdr in termcap.h +if test "$have_readline" = yes; then + LIBS="-l$readlinelib $LIBS" + for ac_hdr in readline.h readline/readline.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -3734,21 +3783,19 @@ fi done cat >> confdefs.h <<\EOF -#define HAVE_LIBTERMCAP 1 +#define HAVE_LIBREADLINE 1 EOF -fi - -echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 -echo "configure:3744: checking for readline in -lreadline" >&5 -ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'` + echo $ac_n "checking for tilde_expand in -l$readlinelib""... $ac_c" 1>&6 +echo "configure:3791: checking for tilde_expand in -l$readlinelib" >&5 +ac_lib_var=`echo $readlinelib'_'tilde_expand | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" -LIBS="-lreadline $LIBS" +LIBS="-l$readlinelib $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3774,69 +3821,24 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo readline | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <> confdefs.h <<\EOF +#define HAVE_TILDE_EXPAND 1 EOF - LIBS="-lreadline $LIBS" - else echo "$ac_t""no" 1>&6 fi -if test "$ac_cv_lib_readline_readline" = yes; then - for ac_hdr in readline/readline.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3795: 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:3805: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -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 add_history in -lreadline""... $ac_c" 1>&6 -echo "configure:3832: checking for add_history in -lreadline" >&5 -ac_lib_var=`echo readline'_'add_history | sed 'y%./+-%__p_%'` + echo $ac_n "checking for add_history in -l$readlinelib""... $ac_c" 1>&6 +echo "configure:3834: checking for add_history in -l$readlinelib" >&5 +ac_lib_var=`echo $readlinelib'_'add_history | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" -LIBS="-lreadline $LIBS" +LIBS="-l$readlinelib $LIBS" cat > conftest.$ac_ext <&6 @@ -4367,7 +4369,7 @@ else int main() { /* Ultrix mips cc rejects this. */ -typedef int charset[2]; const charset x = {0,0}; +typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; @@ -5573,7 +5575,7 @@ fi if test "$ac_cv_prog_gcc" = yes; then - CFLAGS="-g -Wall -W -Wno-uninitialized -Wwrite-strings \ + CFLAGS="$CFLAGS -g -Wall -W -Wno-uninitialized -Wwrite-strings \ -Wstrict-prototypes -Wpointer-arith" if test "$CC_OPTIONS" != ""; then CFLAGS="$CFLAGS $CC_OPTIONS"