X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=configure;h=c37d4a0c03b284bdb2276ab4da30fbfaa02fa49b;hb=91bd424e18017a225bc500e5ac94f71382a6a03f;hp=24b194a7f8f4df20af4e200e41a6a617a5f6165b;hpb=19af2bd8dfd21731cc978beccd1346133d614c67;p=yaz-moved-to-github.git diff --git a/configure b/configure index 24b194a..c37d4a0 100755 --- a/configure +++ b/configure @@ -12,11 +12,11 @@ ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help - --enable-yc compile using YAZ' ASN.1 Compiler" + --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" ac_help="$ac_help - --enable-threads enable threads if available" + --disable-threads disable threads" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -1178,15 +1178,15 @@ fi -# Check whether --enable-yc or --disable-yc was given. -if test "${enable_yc+set}" = set; then - enableval="$enable_yc" +# Check whether --enable-comp or --disable-comp was given. +if test "${enable_comp+set}" = set; then + enableval="$enable_comp" : else - enable_yc=yes + enable_comp=yes fi -if test "$enable_yc" = "yes"; then +if test "$enable_comp" = "yes"; then ASNMODULE="z39.50" ILLMODULE="ill" ILLLIB=../ill/libill.a @@ -1588,6 +1588,61 @@ fi done fi +for ac_func in vsnprintf +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1595: 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 < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1623: \"$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 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + # Check whether --enable-tcpd or --disable-tcpd was given. if test "${enable_tcpd+set}" = set; then enableval="$enable_tcpd" @@ -1596,11 +1651,11 @@ fi if test "$enable_tcpd" = "yes"; then echo $ac_n "checking for working tcpd.h""... $ac_c" 1>&6 -echo "configure:1600: checking for working tcpd.h" >&5 +echo "configure:1655: checking for working tcpd.h" >&5 oldLibs=$LIBS LIBS="$LIBS -lwrap -lnsl" cat > conftest.$ac_ext < #include @@ -1611,7 +1666,7 @@ struct request_info request_info; int i; i = hosts_access(&request_info); ; return 0; } EOF -if { (eval echo configure:1615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* tcpd_ok=1 else @@ -1633,12 +1688,12 @@ EOF fi fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1637: checking for ANSI C header files" >&5 +echo "configure:1692: 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 @@ -1646,7 +1701,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1650: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1705: \"$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* @@ -1663,7 +1718,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 @@ -1681,7 +1736,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 @@ -1702,7 +1757,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1713,7 +1768,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1742,101 +1797,14 @@ fi # Check whether --enable-threads or --disable-threads was given. if test "${enable_threads+set}" = set; then enableval="$enable_threads" - : -fi - -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:1754: 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:1764: \"$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 pthread_mutex_lock""... $ac_c" 1>&6 -echo "configure:1791: 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 < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char pthread_mutex_lock(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_pthread_mutex_lock) || defined (__stub___pthread_mutex_lock) -choke me -#else -pthread_mutex_lock(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1819: \"$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" + enable_threads=$enableval else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_pthread_mutex_lock=no" -fi -rm -f conftest* + enable_threads=yes fi -if eval "test \"`echo '$ac_cv_func_'pthread_mutex_lock`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -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:1840: checking for main in -lpthread" >&5 +if test "$enable_threads" = "yes"; then + echo $ac_n "checking for main in -lpthread""... $ac_c" 1>&6 +echo "configure:1808: 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 @@ -1844,14 +1812,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:1823: \"$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 @@ -1878,11 +1846,43 @@ else echo "$ac_t""no" 1>&6 fi - fi - cat >> confdefs.h <<\EOF + echo $ac_n "checking for working POSIX Threads""... $ac_c" 1>&6 +echo "configure:1851: checking for working POSIX Threads" >&5 + cat > conftest.$ac_ext < + int func(void *p) { return 0; } + +int main() { + + pthread_t pthread_id; + int r = pthread_create (&pthread_id, 0, func, 0); +; return 0; } +EOF +if { (eval echo configure:1864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + thread_ok=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + thread_ok=no +fi +rm -f conftest* + if test "$thread_ok" = "yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_PTHREAD_H 1 +EOF + + cat >> confdefs.h <<\EOF #define _REENTRANT 1 EOF + else + echo "$ac_t""no" 1>&6 + fi fi SUBDIRS_VAR="util odr $ASNMODULE $ILLMODULE zutil comstack ccl tab retrieval server include lib client ztest"