From 04bb1765f48598e0a1c271c10980352f698f5046 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 9 Jun 1999 14:23:58 +0000 Subject: [PATCH] Added enable-yc (removed with-yc) and enable-tcpd. --- configure | 134 ++++++++++++++++++++++++++++++---------------------------- configure.in | 44 ++++++++++--------- 2 files changed, 93 insertions(+), 85 deletions(-) diff --git a/configure b/configure index f89c327..a5ff5c4 100755 --- a/configure +++ b/configure @@ -12,7 +12,9 @@ ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help - --with-yc compile using YC: The Yaz Compiler" + --enable-yc compile using YAZ' ASN.1 Compiler (YC)" +ac_help="$ac_help + --enable-tcpd enable TCP wrapper for server if available" ac_help="$ac_help --enable-threads enable threads if available" @@ -528,7 +530,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:532: checking for $ac_word" >&5 +echo "configure:534: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -558,7 +560,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:562: checking for $ac_word" >&5 +echo "configure:564: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -609,7 +611,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:613: checking for $ac_word" >&5 +echo "configure:615: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -641,7 +643,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:645: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:647: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -652,12 +654,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 656 "configure" +#line 658 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -683,12 +685,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:687: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:689: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:692: checking whether we are using GNU C" >&5 +echo "configure:694: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -697,7 +699,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:701: \"$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:703: \"$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 @@ -716,7 +718,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:720: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:722: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -748,7 +750,7 @@ else fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:752: checking how to run the C preprocessor" >&5 +echo "configure:754: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -763,13 +765,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:773: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:775: \"$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 : @@ -780,13 +782,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:790: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:792: \"$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 : @@ -797,13 +799,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:807: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:809: \"$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 : @@ -858,7 +860,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:862: checking for a BSD compatible install" >&5 +echo "configure:864: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -913,7 +915,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:917: checking for $ac_word" >&5 +echo "configure:919: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -941,15 +943,13 @@ else fi -# Check whether --with-yc or --without-yc was given. -if test "${with_yc+set}" = set; then - withval="$with_yc" - YCDIR=$withval -else - YCDIR="" +# Check whether --enable-yc or --disable-yc was given. +if test "${enable_yc+set}" = set; then + enableval="$enable_yc" + : fi -if test "$YCDIR" = "yes"; then +if test "$enable_yc" = "yes"; then ASNMODULE="z39.50" cp -f include/z-proto.h include/proto.h else @@ -1303,23 +1303,30 @@ fi done fi -echo $ac_n "checking for working tcpd.h""... $ac_c" 1>&6 -echo "configure:1308: checking for working tcpd.h" >&5 -oldLibs=$LIBS -LIBS="$LIBS -lwrap" -cat > conftest.$ac_ext <&6 +echo "configure:1315: checking for working tcpd.h" >&5 + oldLibs=$LIBS + LIBS="$LIBS -lwrap" + cat > conftest.$ac_ext < -#include -int allow_severity = LOG_INFO; -int deny_severity = LOG_WARNING; + #include + int allow_severity = LOG_INFO; + int deny_severity = LOG_WARNING; int main() { struct request_info request_info; int i; -i = hosts_access(&request_info); + i = hosts_access(&request_info); ; return 0; } EOF -if { (eval echo configure:1323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* tcpd_ok=1 else @@ -1329,23 +1336,24 @@ else tcpd_ok=0 fi rm -f conftest* -if test "$tcpd_ok" = "0"; then - echo "$ac_t""no" 1>&6 - LIBS=$oldLibs -else - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF + if test "$tcpd_ok" = "0"; then + echo "$ac_t""no" 1>&6 + LIBS=$oldLibs + else + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF #define HAVE_TCPD_H 1 EOF + fi fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1344: checking for ANSI C header files" >&5 +echo "configure:1352: checking for ANSI C header files" >&5 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 @@ -1353,7 +1361,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1357: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1365: \"$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* @@ -1370,7 +1378,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 @@ -1388,7 +1396,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 @@ -1409,7 +1417,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1420,7 +1428,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1449,27 +1457,25 @@ fi # Check whether --enable-threads or --disable-threads was given. if test "${enable_threads+set}" = set; then enableval="$enable_threads" - threads_ok=$enableval -else - threads_ok=no + : fi -if test "$threads_ok" = "yes"; then +if test "$enable_threads" = "yes"; then for ac_hdr in pthread.h threads.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1463: checking for $ac_hdr" >&5 +echo "configure:1469: 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:1473: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1479: \"$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* @@ -1496,12 +1502,12 @@ fi done echo $ac_n "checking for pthread_mutex_lock""... $ac_c" 1>&6 -echo "configure:1500: checking for pthread_mutex_lock" >&5 +echo "configure:1506: checking for pthread_mutex_lock" >&5 if eval "test \"`echo '$''{'ac_cv_func_pthread_mutex_lock'+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${ac_exeext}; then +if { (eval echo configure:1534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_pthread_mutex_lock=yes" else @@ -1545,7 +1551,7 @@ fi if test "$ac_cv_func_pthread_mutex_lock" = "no"; then echo $ac_n "checking for main in -lpthread""... $ac_c" 1>&6 -echo "configure:1549: checking for main in -lpthread" >&5 +echo "configure:1555: checking for main in -lpthread" >&5 ac_lib_var=`echo pthread'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1553,14 +1559,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1570: \"$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 diff --git a/configure.in b/configure.in index bde016a..3551f37 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ dnl YAZ Toolkit dnl (c) Index Data 1994-1999 dnl See the file LICENSE for details. -dnl $Id: configure.in,v 1.10 1999-06-08 13:11:55 adam Exp $ +dnl $Id: configure.in,v 1.11 1999-06-09 14:23:58 adam Exp $ AC_INIT(include/yaz-version.h) dnl dnl ------ Checking programs @@ -12,8 +12,8 @@ AC_PROG_RANLIB dnl dnl ----- YC: The Yaz Compiler AC_SUBST(ASNMODULE) -AC_ARG_WITH(yc,[ --with-yc compile using YC: The Yaz Compiler], [YCDIR=$withval],[YCDIR=""]) -if test "$YCDIR" = "yes"; then +AC_ARG_ENABLE(yc,[ --enable-yc compile using YAZ' ASN.1 Compiler (YC)]) +if test "$enable_yc" = "yes"; then ASNMODULE="z39.50" cp -f include/z-proto.h include/proto.h else @@ -42,21 +42,24 @@ if test "$ac_cv_lib_readline_readline" = "yes"; then fi dnl dnl ------ tcpd -AC_MSG_CHECKING(for working tcpd.h) -oldLibs=$LIBS -LIBS="$LIBS -lwrap" -AC_TRY_LINK([#include -#include -int allow_severity = LOG_INFO; -int deny_severity = LOG_WARNING;], -[struct request_info request_info; int i; -i = hosts_access(&request_info);],tcpd_ok=1, tcpd_ok=0) -if test "$tcpd_ok" = "0"; then - AC_MSG_RESULT(no) - LIBS=$oldLibs -else - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_TCPD_H) +AC_ARG_ENABLE(tcpd,[ --enable-tcpd enable TCP wrapper for server if available]) +if test "$enable_tcpd" = "yes"; then + AC_MSG_CHECKING(for working tcpd.h) + oldLibs=$LIBS + LIBS="$LIBS -lwrap" + AC_TRY_LINK([#include + #include + int allow_severity = LOG_INFO; + int deny_severity = LOG_WARNING;], + [struct request_info request_info; int i; + i = hosts_access(&request_info);],tcpd_ok=1, tcpd_ok=0) + if test "$tcpd_ok" = "0"; then + AC_MSG_RESULT(no) + LIBS=$oldLibs + else + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_TCPD_H) + fi fi dnl dnl ------ Headers @@ -66,9 +69,8 @@ if test "$ac_cv_header_stdc" = "no"; then fi dnl dnl ------ Threads -AC_ARG_ENABLE(threads, [ --enable-threads enable threads if available], - [threads_ok=$enableval], [threads_ok=no]) -if test "$threads_ok" = "yes"; then +AC_ARG_ENABLE(threads, [ --enable-threads enable threads if available]) +if test "$enable_threads" = "yes"; then AC_CHECK_HEADERS(pthread.h threads.h) AC_CHECK_FUNC(pthread_mutex_lock) if test "$ac_cv_func_pthread_mutex_lock" = "no"; then -- 1.7.10.4