From ba5a48a969550bf9cb2f0824f232067c9be97e8d Mon Sep 17 00:00:00 2001 From: Richard Kreckel Date: Mon, 8 May 2000 21:14:41 +0000 Subject: [PATCH] - Added some $(LDFLAGS) in Makefile.in's so executables will find libgmp. - Wrote a check to see if libgmp can be used. - Added libtool interface versioning (-version-info) for the library. - Added libtool inter-library dependency for -lgmp. (Libtool should care if this works on the current platform.) --- benchmarks/Makefile.in | 2 +- configure | 228 +++++++++++++++++++---------------------- configure.in | 48 ++++++--- doc/Makefile.in | 2 +- examples/Makefile.in | 2 +- src/Makefile.in | 11 +- tests/Makefile.in | 2 +- 7 files changed, 147 insertions(+), 148 deletions(-) diff --git a/benchmarks/Makefile.in b/benchmarks/Makefile.in index ecac462..4c15bac 100644 --- a/benchmarks/Makefile.in +++ b/benchmarks/Makefile.in @@ -87,7 +87,7 @@ timebench2a : $(patsubst %,%.o,$(MODULES_timebench2a)) timebench2ap : $(patsubst %,%.o,$(MODULES_timebench2ap)) timebench2b : $(patsubst %,%.o,$(MODULES_timebench2b)) $(PROGRAMS) : % : $(LIBDEPS) - $(LIBTOOL_LINK) $(CXX) $(CXXFLAGS) $(TARGET_ARCH) $(patsubst %,%.o,$(MODULES_$(*F))) $(LIBS) -o $@ + $(LIBTOOL_LINK) $(CXX) $(CXXFLAGS) $(TARGET_ARCH) $(patsubst %,%.o,$(MODULES_$(*F))) $(LDFLAGS) $(LIBS) -o $@ install : all diff --git a/configure b/configure index 4824dcf..22e9945 100755 --- a/configure +++ b/configure @@ -1544,6 +1544,12 @@ ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \ $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ || { echo "configure: error: libtool configure failed" 1>&2; exit 1; } +CLN_CURRENT=1 +CLN_REVISION=0 +CLN_AGE=1 + + + ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' @@ -1560,20 +1566,20 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking for bool type""... $ac_c" 1>&6 -echo "configure:1564: checking for bool type" >&5 +echo "configure:1570: checking for bool type" >&5 if eval "test \"`echo '$''{'cl_cv_cplusplus_bool'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1583: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cl_cv_cplusplus_bool=yes else @@ -1607,7 +1613,7 @@ cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking for long long type""... $ac_c" 1>&6 -echo "configure:1611: checking for long long type" >&5 +echo "configure:1617: checking for long long type" >&5 if eval "test \"`echo '$''{'cl_cv_c_longlong'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1616,7 +1622,7 @@ if test "$cross_compiling" = yes; then cl_cv_c_longlong="guessing no" else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cl_cv_c_longlong=yes else @@ -1673,7 +1679,7 @@ EOF esac echo $ac_n "checking for long double type""... $ac_c" 1>&6 -echo "configure:1677: checking for long double type" >&5 +echo "configure:1683: checking for long double type" >&5 if eval "test \"`echo '$''{'cl_cv_c_longdouble'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1682,7 +1688,7 @@ if test "$cross_compiling" = yes; then cl_cv_c_longdouble="guessing no" else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cl_cv_c_longdouble=yes else @@ -1723,20 +1729,20 @@ EOF esac echo $ac_n "checking for working template<>""... $ac_c" 1>&6 -echo "configure:1727: checking for working template<>" >&5 +echo "configure:1733: checking for working template<>" >&5 if eval "test \"`echo '$''{'cl_cv_c_templatenull'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < class c {}; template <> class c { int x; }; int main() { ; return 0; } EOF -if { (eval echo configure:1740: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1746: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cl_cv_c_templatenull=yes else @@ -1760,7 +1766,7 @@ fi if test -n "$GCC"; then echo $ac_n "checking for the global constructors function prefix""... $ac_c" 1>&6 -echo "configure:1764: checking for the global constructors function prefix" >&5 +echo "configure:1770: checking for the global constructors function prefix" >&5 if eval "test \"`echo '$''{'cl_cv_cplusplus_ctorprefix'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1770,7 +1776,7 @@ struct foo { foo (); }; foo foobar; EOF # look for the assembly language name in the .s file -{ ac_try='${CXX-g++} $CXXFLAGS -S conftest.cc'; { (eval echo configure:1774: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } >/dev/null 2>&1 +{ ac_try='${CXX-g++} $CXXFLAGS -S conftest.cc'; { (eval echo configure:1780: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } >/dev/null 2>&1 if grep '_GLOBAL_\$I\$foobar' conftest.s >/dev/null ; then cl_cv_cplusplus_ctorprefix='_GLOBAL_$I$' else @@ -1800,7 +1806,7 @@ EOF EOF echo $ac_n "checking whether the global constructors function need to be exported""... $ac_c" 1>&6 -echo "configure:1804: checking whether the global constructors function need to be exported" >&5 +echo "configure:1810: checking whether the global constructors function need to be exported" >&5 if eval "test \"`echo '$''{'cl_cv_cplusplus_ctorexport'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1821,7 +1827,7 @@ foo::foo () {} extern "C" void ctor (void) __asm__ (ASM_UNDERSCORE_PREFIX CL_GLOBAL_CONSTRUCTOR_PREFIX "foobar"); int main() { ctor(); return 0; } EOF -if { ac_try='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest1.cc conftest2.cc $LIBS 1>&5'; { (eval echo configure:1825: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } >/dev/null 2>&1 && test -s conftest${ac_exeext}; then +if { ac_try='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest1.cc conftest2.cc $LIBS 1>&5'; { (eval echo configure:1831: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } >/dev/null 2>&1 && test -s conftest${ac_exeext}; then cl_cv_cplusplus_ctorexport=no else cl_cv_cplusplus_ctorexport=yes @@ -1843,17 +1849,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1847: checking for $ac_hdr" >&5 +echo "configure:1853: 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:1857: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1863: \"$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* @@ -1883,20 +1889,20 @@ done # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:1887: checking for working alloca.h" >&5 +echo "configure:1893: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'cl_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = (char *) alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:1900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cl_cv_header_alloca_h=yes else @@ -1938,20 +1944,20 @@ char *alloca (); #endif " echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:1942: checking for alloca" >&5 +echo "configure:1948: checking for alloca" >&5 if eval "test \"`echo '$''{'cl_cv_func_alloca'+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:1961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cl_cv_func_alloca=yes else @@ -1983,20 +1989,20 @@ EOF fi echo $ac_n "checking for fpu_control_t""... $ac_c" 1>&6 -echo "configure:1987: checking for fpu_control_t" >&5 +echo "configure:1993: checking for fpu_control_t" >&5 if eval "test \"`echo '$''{'cl_cv_type_fpu_control_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { fpu_control_t x; ; return 0; } EOF -if { (eval echo configure:2000: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2006: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cl_cv_type_fpu_control_t=yes else @@ -2018,20 +2024,20 @@ EOF fi echo $ac_n "checking for __setfpucw""... $ac_c" 1>&6 -echo "configure:2022: checking for __setfpucw" >&5 +echo "configure:2028: checking for __setfpucw" >&5 if eval "test \"`echo '$''{'cl_cv_func_setfpucw'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { __setfpucw(_FPU_IEEE); ; return 0; } EOF -if { (eval echo configure:2035: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cl_cv_func_setfpucw=yes else @@ -2057,12 +2063,12 @@ fi for ac_func in gettimeofday do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2061: checking for $ac_func" >&5 +echo "configure:2067: 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:2098: \"$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 @@ -2113,13 +2119,13 @@ fi done if test $ac_cv_func_gettimeofday = yes; then echo $ac_n "checking for gettimeofday declaration""... $ac_c" 1>&6 -echo "configure:2117: checking for gettimeofday declaration" >&5 +echo "configure:2123: checking for gettimeofday declaration" >&5 if eval "test \"`echo '$''{'cl_cv_proto_gettimeofday'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2140,7 +2146,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:2144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2150: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cl_cv_proto_gettimeofday_dots=no cl_cv_proto_gettimeofday_arg2="struct timezone *" @@ -2149,7 +2155,7 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext < @@ -2170,7 +2176,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:2174: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2180: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cl_cv_proto_gettimeofday_dots=no cl_cv_proto_gettimeofday_arg2="void *" @@ -2211,12 +2217,12 @@ fi for ac_func in ftime do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2215: checking for $ac_func" >&5 +echo "configure:2221: 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:2252: \"$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 @@ -2268,12 +2274,12 @@ done if test $ac_cv_func_gettimeofday = no -a $ac_cv_func_ftime = no; then echo $ac_n "checking for times""... $ac_c" 1>&6 -echo "configure:2272: checking for times" >&5 +echo "configure:2278: checking for times" >&5 if eval "test \"`echo '$''{'ac_cv_func_times'+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:2309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_times=yes" else @@ -2320,7 +2326,7 @@ no_times=1 fi if test -z "$no_times"; then echo $ac_n "checking for times return value""... $ac_c" 1>&6 -echo "configure:2324: checking for times return value" >&5 +echo "configure:2330: checking for times return value" >&5 if eval "test \"`echo '$''{'cl_cv_func_times_return'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2329,7 +2335,7 @@ if test "$cross_compiling" = yes; then cl_cv_func_times_return="guessing no" else cat > conftest.$ac_ext <= CLK_TCK/2) && (ticks <= 3*CLK_TCK/2))); } EOF -if { (eval echo configure:2359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cl_cv_func_times_return=yes else @@ -2393,17 +2399,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2397: checking for $ac_hdr" >&5 +echo "configure:2403: 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:2407: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2413: \"$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* @@ -2430,13 +2436,13 @@ fi done if test $ac_cv_header_sys_resource_h = yes; then echo $ac_n "checking for getrusage""... $ac_c" 1>&6 -echo "configure:2434: checking for getrusage" >&5 +echo "configure:2440: checking for getrusage" >&5 if eval "test \"`echo '$''{'cl_cv_func_getrusage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* NetBSD 1.0 needs this */ #include @@ -2445,7 +2451,7 @@ int main() { struct rusage x; int y = RUSAGE_SELF; getrusage(y,&x); x.ru_utime.tv_sec; ; return 0; } EOF -if { (eval echo configure:2449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cl_cv_func_getrusage=yes else @@ -2467,13 +2473,13 @@ EOF fi if test $cl_cv_func_getrusage = yes; then echo $ac_n "checking for getrusage declaration""... $ac_c" 1>&6 -echo "configure:2471: checking for getrusage declaration" >&5 +echo "configure:2477: checking for getrusage declaration" >&5 if eval "test \"`echo '$''{'cl_cv_proto_getrusage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2499,7 +2505,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:2503: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2509: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cl_cv_proto_getrusage_arg1="int" else @@ -2526,13 +2532,13 @@ EOF fi echo $ac_n "checking for perror declaration""... $ac_c" 1>&6 -echo "configure:2530: checking for perror declaration" >&5 +echo "configure:2536: checking for perror declaration" >&5 if eval "test \"`echo '$''{'cl_cv_proto_perror'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <, some in , some don't @@ -2548,7 +2554,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:2552: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cl_cv_proto_perror=no else @@ -2570,7 +2576,7 @@ EOF fi echo $ac_n "checking whether characters are unsigned""... $ac_c" 1>&6 -echo "configure:2574: checking whether characters are unsigned" >&5 +echo "configure:2580: checking whether characters are unsigned" >&5 if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2578,7 +2584,7 @@ else if test $ac_cv_prog_gcc = yes; then # GCC predefines this symbol on systems where it applies. cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_char_unsigned=yes else @@ -2654,7 +2660,7 @@ cl_machine_file_h=include/cl_intparam.h if test $cross_compiling = no; then if test -z "$cl_cv_file_intparam_h"; then echo "checking for integer types and behaviour" 1>&6 -echo "configure:2658: checking for integer types and behaviour" >&5 +echo "configure:2664: checking for integer types and behaviour" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } +{ (eval echo configure:2675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } CC="$ORIGCC" if test -s conftest; then echo "creating $cl_machine_file_h" @@ -2692,7 +2698,7 @@ cl_machine_file_h=include/cl_floatparam.h if test $cross_compiling = no; then if test -z "$cl_cv_file_floatparam_h"; then echo "checking for floating-point types and behaviour" 1>&6 -echo "configure:2696: checking for floating-point types and behaviour" >&5 +echo "configure:2702: checking for floating-point types and behaviour" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } +{ (eval echo configure:2713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } CC="$ORIGCC" if test -s conftest; then echo "creating $cl_machine_file_h" @@ -2732,91 +2738,66 @@ if test "${with_gmp+set}" = set; then fi if test "$with_gmp" = yes; then - ac_safe=`echo "gmp.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for gmp.h""... $ac_c" 1>&6 -echo "configure:2738: checking for gmp.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "checking for recent enough gmp.h""... $ac_c" 1>&6 +echo "configure:2743: checking for recent enough gmp.h" >&5 +if eval "test \"`echo '$''{'cl_cv_new_gmp_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext < +#if !defined(__GNU_MP_VERSION) || (__GNU_MP_VERSION < 3) + #error "ancient gmp.h" +#endif EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2748: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2757: \"$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" + cl_cv_new_gmp_h="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" + cl_cv_new_gmp_h="no"; with_gmp="no" fi rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -with_gmp="no" -fi - echo $ac_n "checking for __gmpn_divexact_by3 in -lgmp""... $ac_c" 1>&6 -echo "configure:2771: checking for __gmpn_divexact_by3 in -lgmp" >&5 -ac_lib_var=`echo gmp___gmpn_divexact_by3 | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then +fi +echo "$ac_t""$cl_cv_new_gmp_h" 1>&6 + echo $ac_n "checking for working libgmp""... $ac_c" 1>&6 +echo "configure:2774: checking for working libgmp" >&5 +if eval "test \"`echo '$''{'cl_cv_new_libgmp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-lgmp $LIBS" -cat > conftest.$ac_ext < conftest.$ac_ext < int main() { -__gmpn_divexact_by3() +mpn_divexact_by3(0,0,0) ; return 0; } EOF -if { (eval echo configure:2793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2789: \"$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" + cl_cv_new_libgmp="yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + cl_cv_new_libgmp="no"; with_gmp="no"; LIBS=$SAVELIBS fi rm -f conftest* -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 gmp | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&6 -with_gmp="no" -fi - +echo "$ac_t""$cl_cv_new_libgmp" 1>&6 fi if test "$with_gmp" = yes; then cat >> confdefs.h <<\EOF @@ -2824,7 +2805,7 @@ if test "$with_gmp" = yes; then EOF else - echo "configure: warning: disabling external gmp" 1>&2 + echo "configure: warning: disabling external GNU MP library" 1>&2 fi for f in 'tests/.gdbinit'; do if test '!' -f "$f"; then @@ -2984,6 +2965,9 @@ s%@LD@%$LD%g s%@NM@%$NM%g s%@LN_S@%$LN_S%g s%@LIBTOOL@%$LIBTOOL%g +s%@CLN_CURRENT@%$CLN_CURRENT%g +s%@CLN_REVISION@%$CLN_REVISION%g +s%@CLN_AGE@%$CLN_AGE%g s%@ALLOCA@%$ALLOCA%g CEOF diff --git a/configure.in b/configure.in index 5d4cd6b..c594a34 100644 --- a/configure.in +++ b/configure.in @@ -67,20 +67,20 @@ dnl PACKAGE=cln AM_DISABLE_SHARED AM_PROG_LIBTOOL -dnl CLN library version information. -dnl +dnl Libtool's library version information for CLN. +dnl (Not to be confused with CLN's release number.) dnl Making new releases: -dnl CLN_MICRO_VERSION += 1; -dnl CLN_INTERFACE_AGE += 1; -dnl CLN_BINARY_AGE += 1; -dnl if any functions have been added, set CLN_INTERFACE_AGE to 0. -dnl if backwards compatibility has been broken, -dnl set CLN_BINARY_AGE and CLN_INTERFACE_AGE to 0. -dnl CLN_MAJOR_VERSION=1 -dnl CLN_MINOR_VERSION=0 -dnl CLN_MICRO_VERSION=4 -dnl CLN_INTERFACE_AGE=1 -dnl CLN_BINARY_AGE=1 +dnl * increment CLN_REVISION, +dnl * if any functions/classes have been added, removed or changed, increment +dnl CLN_CURRENT and set CLN_REVISION to 0, +dnl * if any functions/classes have been added, increment CLN_AGE, +dnl * if backwards compatibility has been broken, set CLN_AGE to 0. +CLN_CURRENT=1 +CLN_REVISION=0 +CLN_AGE=1 +AC_SUBST(CLN_CURRENT) +AC_SUBST(CLN_REVISION) +AC_SUBST(CLN_AGE) dnl sets variable LIBTOOL dnl dnl checks for compiler characteristics @@ -137,14 +137,28 @@ dnl interfacing to GNU gmp (must be at least version 3) dnl AC_ARG_WITH(gmp, [ --with-gmp use external fast GNU gmp low-level functions]) if test "$with_gmp" = yes; then - AC_CHECK_HEADER(gmp.h, , with_gmp="no") -dnl mpn_divexact_by3 was introduced in gmp3 and the symbol has a leading `__g': - AC_CHECK_LIB(gmp, __gmpn_divexact_by3, , with_gmp="no") +dnl Is the gmp header file new enough? (i.e. >= 3.0) + AC_CACHE_CHECK([for recent enough gmp.h], cl_cv_new_gmp_h, [ + AC_TRY_CPP([#include +#if !defined(__GNU_MP_VERSION) || (__GNU_MP_VERSION < 3) + #error "ancient gmp.h" +#endif], +cl_cv_new_gmp_h="yes", +cl_cv_new_gmp_h="no"; with_gmp="no") +]) +dnl Does the library match the header file have 3.0 features? + AC_CACHE_CHECK([for working libgmp], cl_cv_new_libgmp, [ + SAVELIBS=$LIBS + LIBS="$LIBS -lgmp" + AC_TRY_LINK([#include ],[mpn_divexact_by3(0,0,0)], +cl_cv_new_libgmp="yes", +cl_cv_new_libgmp="no"; with_gmp="no"; LIBS=$SAVELIBS) +]) fi if test "$with_gmp" = yes; then AC_DEFINE(CL_USE_GMP) else - AC_MSG_WARN([disabling external gmp]) + AC_MSG_WARN([disabling external GNU MP library]) fi dnl dnl That's it. diff --git a/doc/Makefile.in b/doc/Makefile.in index 7e89470..6430021 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -102,7 +102,7 @@ check : all mostlyclean : clean clean : force - $(RM) *~ *.aux *.toc *.cp *.fn *.ky *.pg *.tp *.vr *.my *.log core + $(RM) *~ *.aux *.toc *.cp *.fn *.ky *.pg *.tp *.vr *.my *.mys *.log core distclean : clean $(RM) Makefile diff --git a/examples/Makefile.in b/examples/Makefile.in index 62b7c97..0a4fbb9 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -87,7 +87,7 @@ lucaslehmer : $(patsubst %,%.o,$(MODULES_lucaslehmer)) nextprime : $(patsubst %,%.o,$(MODULES_nextprime)) perfnum : $(patsubst %,%.o,$(MODULES_perfnum)) $(PROGRAMS) : % : $(LIBDEPS) - $(LIBTOOL_LINK) $(CXX) $(CXXFLAGS) $(TARGET_ARCH) $(patsubst %,%.o,$(MODULES_$(*F))) $(LIBS) -o $@ + $(LIBTOOL_LINK) $(CXX) $(CXXFLAGS) $(TARGET_ARCH) $(patsubst %,%.o,$(MODULES_$(*F))) $(LDFLAGS) $(LIBS) -o $@ install : all diff --git a/src/Makefile.in b/src/Makefile.in index 2257a7c..508e87c 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -26,6 +26,7 @@ CXXFLAGS = @CXXFLAGS@ CXXCPP = @CXXCPP@ INCLUDES = -I../include -I$(top_srcdir)/include CPPFLAGS += $(INCLUDES) +LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_COMPILE = $(LIBTOOL) --mode=compile LIBTOOL_LINK = $(LIBTOOL) --mode=link @@ -38,6 +39,10 @@ MV = mv LN = ln RM = rm -f @SET_MAKE@ +# Libtool's library interface versions: +CLN_CURRENT = @CLN_CURRENT@ +CLN_REVISION = @CLN_REVISION@ +CLN_AGE = @CLN_AGE@ # Programs used by "make install": INSTALL = @INSTALL@ @@ -190,12 +195,8 @@ $(SUBDIRS_DIRDEP) : %.dirdep : ifeq ($(SUBDIR),.) -../gmp/mpn/libmpn.la : $(LIBTOOL) - cd ../gmp && $(MAKE) mpn/libmpn.la mp_clz_tab.lo - - libcln.la : $(LIBTOOL) $(ALLOBJECTS_LO) - $(LIBTOOL_LINK) $(CC) -o libcln.la -rpath $(libdir) $(ALLOBJECTS_LO) + $(LIBTOOL_LINK) $(CC) -o libcln.la -rpath $(libdir) -version-info $(CLN_CURRENT):$(CLN_REVISION):$(CLN_AGE) $(LIBS) $(ALLOBJECTS_LO) install : all force if [ ! -d $(libdir) ] ; then mkdir $(libdir) ; fi diff --git a/tests/Makefile.in b/tests/Makefile.in index 4146f8e..3d696c0 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -160,7 +160,7 @@ timeUPMImul : $(patsubst %,%.o,$(MODULES_timeUPMImul)) timesqrtmodp : $(patsubst %,%.o,$(MODULES_timesqrtmodp)) main : $(patsubst %,%.o,$(MODULES_main)) $(PROGRAMS) : % : $(LIBDEPS) - $(LIBTOOL_LINK) $(CXX) $(CXXFLAGS) $(TARGET_ARCH) $(patsubst %,%.o,$(MODULES_$(*F))) $(LIBS) -o $@ + $(LIBTOOL_LINK) $(CXX) $(CXXFLAGS) $(TARGET_ARCH) $(patsubst %,%.o,$(MODULES_$(*F))) $(LDFLAGS) $(LIBS) -o $@ install : all