]> www.ginac.de Git - cln.git/blobdiff - configure.in
* */*: cl_istream -> std::istream, cl_ostream -> std::ostream.
[cln.git] / configure.in
index 5576f36a4e86ad85a12f22e83cee1f97fc3ae9b2..836c30ca34776348db62a56c4bf7e63b73a2530c 100644 (file)
@@ -4,7 +4,8 @@ dnl
 dnl  configure.in ---<autoconf>--->> configure
 dnl
 dnl  configure    ---<sh>--->> config.status
-dnl                      --->> include/cl_config.h
+dnl                      --->> include/cln/config.h
+dnl        cln-config.in --->> cln-config
 dnl          Makefile.in --->> Makefile
 dnl      src/Makefile.in --->> src/Makefile
 dnl
@@ -12,7 +13,7 @@ dnl  Makefile   ---<make>--->> libcln.a
 dnl
 dnl
 AC_INIT(src/integer/gcd/cl_I_gcd.cc)
-AC_CONFIG_HEADER(include/cl_config.h src/base/cl_base_config.h src/base/cl_gmpconfig.h src/float/cl_float_config.h src/timing/cl_t_config.h)
+AC_CONFIG_HEADER(include/cln/config.h include/cln/version.h src/base/cl_base_config.h src/base/cl_gmpconfig.h src/float/cl_float_config.h src/timing/cl_t_config.h)
 AC_PROG_MAKE_SET
 dnl This piece of sed script replaces every line containing '@subdir@'
 dnl by several consecutive lines, each referencing one subdir.
@@ -64,24 +65,40 @@ CL_CANONICAL_HOST_CPU
 dnl
 dnl           check for build configuration
 dnl
+                      dnl libcln depends on libm
 PACKAGE=cln
-AM_DISABLE_SHARED
+                      dnl libtool wants PACKAGE
 AM_PROG_LIBTOOL
+                      dnl sets variable LIBTOOL
+
 dnl Libtool's library version information for CLN.
-dnl (Not to be confused with CLN's release number.)
+dnl (Not to be confused with CLN's release version.)
 dnl Making new releases:
 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
+CL_CURRENT=1
+CL_REVISION=0
+CL_AGE=0
+dnl make substitutions
+AC_SUBST(CL_CURRENT)
+AC_SUBST(CL_REVISION)
+AC_SUBST(CL_AGE)
+dnl release version
+CL_VERSION_MAJOR=1
+CL_VERSION_MINOR=1
+CL_VERSION_PATCHLEVEL=0
+dnl release version for cln/config.h, so it can be tested by the preprocessor
+AC_DEFINE_UNQUOTED(CL_VERSION_MAJOR, $CL_VERSION_MAJOR)
+AC_DEFINE_UNQUOTED(CL_VERSION_MINOR, $CL_VERSION_MINOR)
+AC_DEFINE_UNQUOTED(CL_VERSION_PATCHLEVEL, $CL_VERSION_PATCHLEVEL)
+dnl concatenated release version
+CL_VERSION=$CL_VERSION_MAJOR.$CL_VERSION_MINOR.$CL_VERSION_PATCHLEVEL
+AC_DEFINE_UNQUOTED(CL_VERSION, $CL_VERSION)
+AC_SUBST(CL_VERSION)
+
 dnl
 dnl           checks for compiler characteristics
 dnl
@@ -127,37 +144,25 @@ dnl           checks for compiler characteristics
 dnl
 CL_CHAR_UNSIGNED
                       dnl DEFS __CHAR_UNSIGNED__ if char is unsigned
-test -d 'include' || mkdir 'include'
-CL_MACHINE([integer types and behaviour],${srcdir}/autoconf/intparam.c,include/cl_intparam.h,cl_cv_file_intparam_h)
-                      dnl builds include/cl_intparam.h
-CL_MACHINE([floating-point types and behaviour],${srcdir}/autoconf/floatparam.c,include/cl_floatparam.h,cl_cv_file_floatparam_h)
-                      dnl builds include/cl_floatparam.h
+CL_MACHINE([integer types and behaviour],${srcdir}/autoconf/intparam.c,include/cln/intparam.h,cl_cv_file_intparam_h)
+                      dnl builds include/cln/intparam.h
+CL_MACHINE([floating-point types and behaviour],${srcdir}/autoconf/floatparam.c,include/cln/floatparam.h,cl_cv_file_floatparam_h)
+                      dnl builds include/cln/floatparam.h
 dnl
 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
-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 <gmp.h>
-#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")
-])
-if test "$cl_cv_new_gmp_h" = no; then with_gmp="no"; fi
+AC_ARG_WITH(gmp, [  --with-gmp              use external fast low-level functions from GNU MP 3.
+                          [default=yes]], ,with_gmp="yes")
 if test "$with_gmp" = yes; then
-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 <gmp.h>],[mpn_divexact_by3(0,0,0)],
-cl_cv_new_libgmp="yes", cl_cv_new_libgmp="no"; LIBS=$SAVELIBS)
-])
-if test "$cl_cv_new_libgmp" = no; then with_gmp="no"; fi
-fi
+  CL_GMP_H_VERSION
+  if test "$cl_cv_new_gmp_h" = no; then with_gmp="no"; fi
+  if test "$with_gmp" = yes; then
+    CL_GMP_CHECK
+    if test "$cl_cv_new_libgmp" = no; then with_gmp="no"; fi
+  fi
 fi
 if test "$with_gmp" = yes; then
+  CL_GMP_SET_UINTD
   AC_DEFINE(CL_USE_GMP)
 else
   AC_MSG_WARN([disabling external GNU MP library])
@@ -175,4 +180,4 @@ changequote([,])dnl
     cp "$srcdir/$f" "$f"
   fi
 done
-AC_OUTPUT(Makefile src/Makefile tests/Makefile benchmarks/Makefile examples/Makefile doc/Makefile)
+AC_OUTPUT([Makefile src/Makefile tests/Makefile benchmarks/Makefile examples/Makefile doc/Makefile cln-config cln-config.1 cln.spec], [chmod +x cln-config])