X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=configure;h=25ba5c6f11948bd1345821b010bc39faba3a4995;hp=6f4628ede7ba362cbab086f6f7080bd0a8143634;hb=eaf27c9dc97e048dcd9a90dc05aa8133b3020c5b;hpb=70f0ff9bf920e65b47211fd88f409e2b1a2b8e43 diff --git a/configure b/configure index 6f4628e..25ba5c6 100755 --- a/configure +++ b/configure @@ -24,9 +24,9 @@ ac_help="$ac_help ac_help="$ac_help --disable-comp use old encoders, i.e. disable the YAZ ASN.1 Compiler" ac_help="$ac_help - --enable-tcpd enable TCP wrapper for server if available" + --enable-tcpd[=PREFIX] enable TCP wrapper for server if available" ac_help="$ac_help - --disable-threads disable threads" + --enable-threads enable POSIX threads" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -1628,31 +1628,34 @@ if test "$enable_comp" = "yes"; then ILLMODULE="ill" ILLLIB=../ill/libill.la ASN_MAKEFILES="z39.50/Makefile ill/Makefile" - HFILE=z-proto.h + HFILE=${srcdir}/include/yaz/z-proto.h else ILLMODULE="" ASNMODULE=asn ILLLIB="" ASN_MAKEFILES="asn/Makefile" - HFILE=prt-proto.h + HFILE=${srcdir}/asn/prt-proto.h fi echo $ac_n "checking whether proto.h needs to be generated""... $ac_c" 1>&6 echo "configure:1641: checking whether proto.h needs to be generated" >&5 yaz_include=${srcdir}/include/yaz -if test -r ${yaz_include}/proto.h && cmp -s ${yaz_include}/$HFILE ${yaz_include}/proto.h; then +if test -r ${yaz_include}/proto.h && cmp -s $HFILE ${yaz_include}/proto.h; then echo "$ac_t""no" 1>&6 else echo "$ac_t""yes" 1>&6 - cp -f ${yaz_include}/$HFILE ${yaz_include}/proto.h + cp -f $HFILE ${yaz_include}/proto.h + if test "$enable_comp" != "yes"; then + cp ${srcdir}/asn/*.h ${yaz_include} + fi fi checkBoth=0 echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:1651: checking for connect" >&5 +echo "configure:1654: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+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:1682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -1696,7 +1699,7 @@ fi if test "$ac_cv_func_connect" = "no"; then echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6 -echo "configure:1700: checking for main in -lsocket" >&5 +echo "configure:1703: checking for main in -lsocket" >&5 ac_lib_var=`echo socket'_'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 @@ -1704,14 +1707,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1718: \"$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 @@ -1737,12 +1740,12 @@ if test "$checkBoth" = "1"; then oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" echo $ac_n "checking for accept""... $ac_c" 1>&6 -echo "configure:1741: checking for accept" >&5 +echo "configure:1744: checking for accept" >&5 if eval "test \"`echo '$''{'ac_cv_func_accept'+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:1772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_accept=yes" else @@ -1787,12 +1790,12 @@ fi fi echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:1791: checking for gethostbyname" >&5 +echo "configure:1794: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+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:1822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -1833,7 +1836,7 @@ if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 -echo "configure:1837: checking for main in -lnsl" >&5 +echo "configure:1840: checking for main in -lnsl" >&5 ac_lib_var=`echo nsl'_'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 @@ -1841,14 +1844,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1855: \"$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 @@ -1872,7 +1875,7 @@ fi READLINE_LIBS="" echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 -echo "configure:1876: checking for readline in -lreadline" >&5 +echo "configure:1879: 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 @@ -1880,7 +1883,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lreadline $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1898: \"$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 @@ -1913,7 +1916,7 @@ fi if test "$ac_cv_lib_readline_readline" = "no"; then echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 -echo "configure:1917: checking for readline in -lreadline" >&5 +echo "configure:1920: 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 @@ -1921,7 +1924,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lreadline $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1939: \"$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 @@ -1954,7 +1957,7 @@ fi fi echo $ac_n "checking for add_history in -lhistory""... $ac_c" 1>&6 -echo "configure:1958: checking for add_history in -lhistory" >&5 +echo "configure:1961: checking for add_history in -lhistory" >&5 ac_lib_var=`echo history'_'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 @@ -1962,7 +1965,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lhistory $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1980: \"$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 @@ -1998,17 +2001,17 @@ if test "$ac_cv_lib_readline_readline" = "yes"; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2002: checking for $ac_hdr" >&5 +echo "configure:2005: 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:2012: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2015: \"$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* @@ -2038,12 +2041,12 @@ fi for ac_func in vsnprintf gettimeofday do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2042: checking for $ac_func" >&5 +echo "configure:2045: 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${ac_exeext}; then +if { (eval echo configure:2073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2096,16 +2099,21 @@ if test "${enable_tcpd+set}" = set; then : fi -if test "$enable_tcpd" = "yes"; then - echo $ac_n "checking for working tcpd.h""... $ac_c" 1>&6 -echo "configure:2102: checking for working tcpd.h" >&5 +if test "$enable_tcpd" != ""; then oldLibs=$LIBS + oldCPPFLAGS=$CPPFLAGS + if test "$enable_tcpd" != "yes"; then + LIBS="$LIBS -L$enable_tcpd/lib" + CPPFLAGS="$CPPFLAGS -I$enable_tcpd/include" + fi + echo $ac_n "checking for working tcpd.h""... $ac_c" 1>&6 +echo "configure:2111: checking for working tcpd.h" >&5 LIBS="$LIBS -lwrap -lnsl" cat > conftest.$ac_ext < - #include +#include int allow_severity = LOG_INFO; int deny_severity = LOG_WARNING; int main() { @@ -2113,7 +2121,7 @@ struct request_info request_info; int i; i = hosts_access(&request_info); ; return 0; } EOF -if { (eval echo configure:2117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* tcpd_ok=1 else @@ -2126,6 +2134,7 @@ rm -f conftest* if test "$tcpd_ok" = "0"; then echo "$ac_t""no" 1>&6 LIBS=$oldLibs + CPPFLAGS=$oldCPPFLAGS else echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -2135,12 +2144,12 @@ EOF fi fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2139: checking for ANSI C header files" >&5 +echo "configure:2148: 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 @@ -2148,7 +2157,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2152: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2161: \"$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* @@ -2165,7 +2174,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 @@ -2183,7 +2192,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 @@ -2204,7 +2213,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2215,7 +2224,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2246,12 +2255,12 @@ if test "${enable_threads+set}" = set; then enableval="$enable_threads" enable_threads=$enableval else - enable_threads=yes + enable_threads=no fi if test "$enable_threads" = "yes"; then echo $ac_n "checking for main in -lpthread""... $ac_c" 1>&6 -echo "configure:2255: checking for main in -lpthread" >&5 +echo "configure:2264: 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 @@ -2259,14 +2268,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:2279: \"$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 @@ -2294,9 +2303,9 @@ else fi echo $ac_n "checking for working POSIX Threads""... $ac_c" 1>&6 -echo "configure:2298: checking for working POSIX Threads" >&5 +echo "configure:2307: checking for working POSIX Threads" >&5 cat > conftest.$ac_ext < int func(void *p) { return 0; } @@ -2307,7 +2316,7 @@ int main() { int r = pthread_create (&pthread_id, 0, func, 0); ; return 0; } EOF -if { (eval echo configure:2311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* thread_ok=yes else @@ -2331,8 +2340,14 @@ EOF echo "$ac_t""no" 1>&6 fi fi + +YAZ_SRC_ROOT=`pwd` SUBDIRS_VAR="util odr $ASNMODULE $ILLMODULE zutil comstack ccl tab retrieval server include lib client ztest" +if test -f lib/yaz-config.in; then + rm lib/yaz-config.in +fi +sed s%yaz_echo_source=yes%yaz_echo_source=no%g < yaz-config.in >lib/yaz-config.in trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -2465,7 +2480,9 @@ lib/Makefile client/Makefile ztest/Makefile doc/Makefile -lib/yaz-config" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +yaz-config +lib/yaz-config +" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then @@ -2653,7 +2673,7 @@ cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -chmod +x lib/yaz-config +chmod +x yaz-config lib/yaz-config exit 0 EOF chmod +x $CONFIG_STATUS