1 dnl AUTOCONF configuration for CLN
3 dnl configure.in ---<autoconf>--->> configure
5 dnl configure ---<sh>--->> config.status
6 dnl --->> include/cln/config.h
7 dnl cln-config.in --->> cln-config
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/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)
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
67 dnl libcln depends on libm
69 dnl libtool wants PACKAGE
71 dnl sets variable LIBTOOL
73 dnl Libtool's library version information for CLN.
74 dnl (Not to be confused with CLN's release version.)
75 dnl Making new releases:
76 dnl * increment CL_REVISION,
77 dnl * if any functions/classes have been added, removed or changed, increment
78 dnl CL_CURRENT and set CL_REVISION to 0,
79 dnl * if any functions/classes have been added, increment CL_AGE,
80 dnl * if backwards compatibility has been broken, set CL_AGE to 0.
84 dnl make substitutions
91 CL_VERSION_PATCHLEVEL=1
92 dnl release version for cln/config.h, so it can be tested by the preprocessor
93 AC_DEFINE_UNQUOTED(CL_VERSION_MAJOR, $CL_VERSION_MAJOR)
94 AC_DEFINE_UNQUOTED(CL_VERSION_MINOR, $CL_VERSION_MINOR)
95 AC_DEFINE_UNQUOTED(CL_VERSION_PATCHLEVEL, $CL_VERSION_PATCHLEVEL)
96 dnl concatenated release version
97 CL_VERSION=$CL_VERSION_MAJOR.$CL_VERSION_MINOR.$CL_VERSION_PATCHLEVEL
98 AC_DEFINE_UNQUOTED(CL_VERSION, $CL_VERSION)
102 dnl checks for compiler characteristics
107 dnl DEFS HAVE_BOOL, bool
109 dnl DEFS HAVE_LONGLONG
111 dnl DEFS HAVE_LONGDOUBLE
113 dnl DEFS HAVE_TEMPLATE_NULL
114 CL_GLOBAL_CONSTRUCTORS
115 dnl DEFS CL_GLOBAL_CONSTRUCTOR_PREFIX, CL_GLOBAL_DESTRUCTOR_PREFIX
117 dnl checks for header files
120 dnl DEFS HAVE_UNISTD_H if exist unistd.h
122 dnl checks for typedefs
125 dnl checks for functions and declarations
128 dnl set variable ALLOCA, DEFS NO_ALLOCA
130 dnl DEFS HAVE_FPU_CONTROL_T, HAVE_SETFPUCW
132 dnl DEFS HAVE_GETTIMEOFDAY, GETTIMEOFDAY_DOTS, GETTIMEOFDAY_TZP_T
136 dnl DEFS HAVE_TIMES_CLOCK
138 dnl DEFS HAVE_SYS_RESOURCE_H, HAVE_GETRUSAGE, HAVE_SYS_TIMES_H
140 dnl DEFS HAVE_PERROR_DECL
142 dnl checks for compiler characteristics
145 dnl DEFS __CHAR_UNSIGNED__ if char is unsigned
146 test -d 'include/cln' || mkdir -p 'include/cln'
147 CL_MACHINE([integer types and behaviour],${srcdir}/autoconf/intparam.c,include/cln/intparam.h,cl_cv_file_intparam_h)
148 dnl builds include/cln/intparam.h
149 CL_MACHINE([floating-point types and behaviour],${srcdir}/autoconf/floatparam.c,include/cln/floatparam.h,cl_cv_file_floatparam_h)
150 dnl builds include/cln/floatparam.h
152 dnl interfacing to GNU gmp (must be at least version 3)
154 AC_ARG_WITH(gmp, [ --with-gmp use external fast low-level functions from GNU MP 3.
155 [default=yes]], ,with_gmp="yes")
156 if test "$with_gmp" = yes; then
158 if test "$cl_cv_new_gmp_h" = no; then with_gmp="no"; fi
159 if test "$with_gmp" = yes; then
161 if test "$cl_cv_new_libgmp" = no; then with_gmp="no"; fi
164 if test "$with_gmp" = yes; then
166 AC_DEFINE(CL_USE_GMP)
168 AC_MSG_WARN([disabling external GNU MP library])
173 for f in 'tests/.gdbinit'; do
174 if test '!' -f "$f"; then
177 g=`echo "$f" | sed -e 's,/[^/]*$,,'`
179 test "$g" = "$f" || test -d "$g" || mkdir "$g"
183 AC_OUTPUT([Makefile src/Makefile tests/Makefile benchmarks/Makefile examples/Makefile doc/Makefile cln-config cln-config.1 cln.spec], [chmod +x cln-config])