1 dnl AUTOCONF configuration for CLN
2 dnl Bruno Haible 8.1.1999
4 dnl configure.in ---<autoconf>--->> configure
6 dnl configure ---<sh>--->> config.status
7 dnl --->> include/cl_config.h
8 dnl Makefile.in --->> Makefile
9 dnl src/Makefile.in --->> src/Makefile
11 dnl Makefile ---<make>--->> libcln.a
14 AC_INIT(src/integer/gcd/cl_I_gcd.cc)
15 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)
17 dnl This piece of sed script replaces every line containing '@subdir@'
18 dnl by several consecutive lines, each referencing one subdir.
29 s/@subdir@/benchmarks/
41 dnl checks for programs
50 dnl sets variable CXXCPP
52 dnl sets variable AS_UNDERSCORE, DEFS ASM_UNDERSCORE
54 dnl sets variable RANLIB
56 dnl sets variables INSTALL, INSTALL_DATA, INSTALL_PROGRAM
58 dnl check for host type
60 CL_CANONICAL_HOST(autoconf)
61 dnl sets variables host, host_cpu, host_vendor, host_os
63 dnl DEFS __${host_cpu}__
65 dnl check for build configuration
70 dnl Libtool's library version information for CLN.
71 dnl (Not to be confused with CLN's release number.)
72 dnl Making new releases:
73 dnl * increment CLN_REVISION,
74 dnl * if any functions/classes have been added, removed or changed, increment
75 dnl CLN_CURRENT and set CLN_REVISION to 0,
76 dnl * if any functions/classes have been added, increment CLN_AGE,
77 dnl * if backwards compatibility has been broken, set CLN_AGE to 0.
82 AC_SUBST(CLN_REVISION)
84 dnl sets variable LIBTOOL
86 dnl checks for compiler characteristics
91 dnl DEFS HAVE_BOOL, bool
93 dnl DEFS HAVE_LONGLONG
95 dnl DEFS HAVE_LONGDOUBLE
97 dnl DEFS HAVE_TEMPLATE_NULL
98 CL_GLOBAL_CONSTRUCTORS
99 dnl DEFS CL_GLOBAL_CONSTRUCTOR_PREFIX, CL_GLOBAL_DESTRUCTOR_PREFIX
101 dnl checks for header files
104 dnl DEFS HAVE_UNISTD_H if exist unistd.h
106 dnl checks for typedefs
109 dnl checks for functions and declarations
112 dnl set variable ALLOCA, DEFS NO_ALLOCA
114 dnl DEFS HAVE_FPU_CONTROL_T, HAVE_SETFPUCW
116 dnl DEFS HAVE_GETTIMEOFDAY, GETTIMEOFDAY_DOTS, GETTIMEOFDAY_TZP_T
120 dnl DEFS HAVE_TIMES_CLOCK
122 dnl DEFS HAVE_SYS_RESOURCE_H, HAVE_GETRUSAGE, HAVE_SYS_TIMES_H
124 dnl DEFS HAVE_PERROR_DECL
126 dnl checks for compiler characteristics
129 dnl DEFS __CHAR_UNSIGNED__ if char is unsigned
130 test -d 'include' || mkdir 'include'
131 CL_MACHINE([integer types and behaviour],${srcdir}/autoconf/intparam.c,include/cl_intparam.h,cl_cv_file_intparam_h)
132 dnl builds include/cl_intparam.h
133 CL_MACHINE([floating-point types and behaviour],${srcdir}/autoconf/floatparam.c,include/cl_floatparam.h,cl_cv_file_floatparam_h)
134 dnl builds include/cl_floatparam.h
136 dnl interfacing to GNU gmp (must be at least version 3)
138 AC_ARG_WITH(gmp, [ --with-gmp use external fast GNU gmp low-level functions])
139 if test "$with_gmp" = yes; then
140 dnl Is the gmp header file new enough? (i.e. >= 3.0)
141 AC_CACHE_CHECK([for recent enough gmp.h], cl_cv_new_gmp_h, [
142 AC_TRY_CPP([#include <gmp.h>
143 #if !defined(__GNU_MP_VERSION) || (__GNU_MP_VERSION < 3)
144 #error "ancient gmp.h"
146 cl_cv_new_gmp_h="yes", cl_cv_new_gmp_h="no")
148 if test "$cl_cv_new_gmp_h" = no; then with_gmp="no"; fi
149 if test "$with_gmp" = yes; then
150 dnl Does the library match the header file have 3.0 features?
151 AC_CACHE_CHECK([for working libgmp], cl_cv_new_libgmp, [
154 AC_TRY_LINK([#include <gmp.h>],[mpn_divexact_by3(0,0,0)],
155 cl_cv_new_libgmp="yes", cl_cv_new_libgmp="no"; LIBS=$SAVELIBS)
157 if test "$cl_cv_new_libgmp" = no; then with_gmp="no"; fi
160 if test "$with_gmp" = yes; then
161 AC_DEFINE(CL_USE_GMP)
163 AC_MSG_WARN([disabling external GNU MP library])
168 for f in 'tests/.gdbinit'; do
169 if test '!' -f "$f"; then
172 g=`echo "$f" | sed -e 's,/[^/]*$,,'`
174 test "$g" = "$f" || test -d "$g" || mkdir "$g"
178 AC_OUTPUT(Makefile src/Makefile tests/Makefile benchmarks/Makefile examples/Makefile doc/Makefile)