1 dnl AUTOCONF configuration for CLN
3 dnl configure.ac ---<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_AUX_DIR(autoconf)
16 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)
18 dnl This piece of sed script replaces every line containing '@subdir@'
19 dnl by several consecutive lines, each referencing one subdir.
30 s/@subdir@/benchmarks/
42 dnl checks for programs
51 dnl sets variable CXXCPP
53 dnl sets variable AS_UNDERSCORE, DEFS ASM_UNDERSCORE
55 dnl sets variable ASMFLAGS
57 dnl sets variable RANLIB
59 dnl sets variables INSTALL, INSTALL_DATA, INSTALL_PROGRAM
61 dnl check for host type
63 CL_CANONICAL_HOST(autoconf)
64 dnl sets variables host, host_cpu, host_vendor, host_os
66 dnl DEFS __${host_cpu}__
68 dnl check for build configuration
71 dnl libtool wants PACKAGE
75 dnl Shared libraries are not supported on some platforms [yet]
82 dnl sets variable LIBTOOL
84 dnl Libtool's library version information for CLN.
85 dnl (Not to be confused with CLN's release version.)
86 dnl Making new releases:
87 dnl * increment CL_REVISION,
88 dnl * if any functions/classes have been added, removed or changed, increment
89 dnl CL_CURRENT and set CL_REVISION to 0,
90 dnl * if any functions/classes have been added, increment CL_AGE,
91 dnl * if backwards compatibility has been broken, set CL_AGE to 0.
92 dnl $(CL_CURRENT):$(CL_REVISION):$(CL_AGE) results in
93 dnl libcln.so.$(CL_CURRENT)-$(CL_AGE)
97 dnl make substitutions
104 CL_VERSION_PATCHLEVEL=0
105 dnl release version for cln/config.h, so it can be tested by the preprocessor
106 AC_DEFINE_UNQUOTED(CL_VERSION_MAJOR, $CL_VERSION_MAJOR)
107 AC_DEFINE_UNQUOTED(CL_VERSION_MINOR, $CL_VERSION_MINOR)
108 AC_DEFINE_UNQUOTED(CL_VERSION_PATCHLEVEL, $CL_VERSION_PATCHLEVEL)
109 dnl concatenated release version
110 CL_VERSION=$CL_VERSION_MAJOR.$CL_VERSION_MINOR.$CL_VERSION_PATCHLEVEL
111 AC_DEFINE_UNQUOTED(CL_VERSION, $CL_VERSION)
115 dnl checks for compiler characteristics
120 dnl DEFS HAVE_LONGLONG
122 dnl DEFS HAVE_LONGDOUBLE
123 CL_GLOBAL_CONSTRUCTORS
124 dnl DEFS CL_GLOBAL_CONSTRUCTOR_PREFIX, CL_GLOBAL_DESTRUCTOR_PREFIX
126 dnl checks for header files
128 AC_CHECK_HEADERS([unistd.h])
129 dnl DEFS HAVE_UNISTD_H if exist unistd.h
131 dnl checks for typedefs
134 dnl checks for functions and declarations
137 dnl set variable ALLOCA, DEFS NO_ALLOCA
139 dnl DEFS HAVE_FPU_CONTROL_T, HAVE_SETFPUCW
141 dnl DEFS HAVE_GETTIMEOFDAY, GETTIMEOFDAY_DOTS, GETTIMEOFDAY_TZP_T
143 dnl don't use ftime(3) even if it's available
145 dnl DEFS HAVE_TIMES_CLOCK
147 dnl DEFS HAVE_SYS_RESOURCE_H, HAVE_GETRUSAGE, HAVE_SYS_TIMES_H
149 dnl DEFS HAVE_PERROR_DECL
151 dnl checks for compiler characteristics
154 dnl DEFS __CHAR_UNSIGNED__ if char is unsigned
155 test -d 'include/cln' || mkdir -p 'include/cln'
156 CL_MACHINE([integer types and behaviour],${srcdir}/autoconf/intparam.c,[CL_INTPARAM_CROSS],include/cln/intparam.h,cl_cv_file_intparam_h)
157 dnl builds include/cln/intparam.h
158 CL_MACHINE([floating-point types and behaviour],${srcdir}/autoconf/floatparam.c,[CL_FLOATPARAM_CROSS],include/cln/floatparam.h,cl_cv_file_floatparam_h)
159 dnl builds include/cln/floatparam.h
161 dnl interfacing to GNU gmp (must be at least version 3)
163 AC_ARG_WITH(gmp, AS_HELP_STRING([--with-gmp],
164 [use external fast low-level functions from GNU MP (default: yes).]),
167 if test "$with_gmp" = yes; then
169 if test "$cl_cv_new_gmp_h" = no; then with_gmp="no"; fi
170 if test "$with_gmp" = yes; then
172 if test "$cl_cv_new_libgmp" = no; then with_gmp="no"; fi
175 if test "$with_gmp" = yes; then
177 AC_DEFINE(CL_USE_GMP)
179 AC_MSG_WARN([disabling external GNU MP library])
184 for f in 'tests/.gdbinit'; do
185 if test '!' -f "$f"; then
188 g=`echo "$f" | sed -e 's,/[^/]*$,,'`
190 test "$g" = "$f" || test -d "$g" || mkdir "$g"
194 AC_OUTPUT([Makefile src/Makefile tests/Makefile benchmarks/Makefile examples/Makefile doc/Makefile cln.spec cln.pc])