1 dnl run autoreconf -iv to produce the configure script.
3 m4_define([cl_version_major], CL_GET_VERSION([MAJOR]))
4 m4_define([cl_version_minor], CL_GET_VERSION([MINOR]))
5 m4_define([cl_version_patchlevel], CL_GET_VERSION([PATCHLEVEL]))
6 m4_define([cl_version], [cl_version_major.cl_version_minor.cl_version_patchlevel])
8 dnl Libtool's library version information for CLN.
9 m4_define([cl_lt_current], CL_GET_LTVERSION([CURRENT]))
10 m4_define([cl_lt_revision], CL_GET_LTVERSION([REVISION]))
11 m4_define([cl_lt_age], CL_GET_LTVERSION([AGE]))
12 m4_define([cl_lt_version], [cl_lt_current:cl_lt_revision:cl_lt_age])
14 AC_INIT([cln], cl_version)
16 AC_CONFIG_SRCDIR(src/integer/gcd/cl_I_gcd.cc)
17 AC_CONFIG_AUX_DIR([build-aux])
18 AC_CONFIG_MACRO_DIR([m4])
19 AC_CONFIG_HEADERS(autoconf/cl_config.h include/cln/config.h include/cln/host_cpu.h src/base/cl_base_config.h src/base/cl_gmpconfig.h src/timing/cl_t_config.h)
20 AM_INIT_AUTOMAKE([foreign 1.10 dist-bzip2 subdir-objects])
21 AH_TOP([#ifndef _CL_CONFIG_H])
22 AH_TOP([#define _CL_CONFIG_H])
23 AH_TOP([#include "cln/host_cpu.h"])
24 AH_TOP([/* prevents cln/config.h from being included, so no macro gets redefined */])
25 AH_TOP([#define _CL_CONFIG_PUBLIC_H])
26 AH_TOP([/* prevents cln/version.h from being included, so no macro gets redefined */])
27 AH_TOP([#define _CL_VERSION_H])
28 AH_BOTTOM([#endif /* _CL_CONFIG_H */])
30 dnl checks for programs
39 dnl sets variable CXXCPP
41 dnl sets variable AS_UNDERSCORE, DEFS ASM_UNDERSCORE
43 dnl sets variable ASMFLAGS
45 dnl sets variables INSTALL, INSTALL_DATA, INSTALL_PROGRAM
47 dnl check for host type
50 dnl sets variables host, host_cpu, host_vendor, host_os
52 dnl DEFS __${host_cpu}__
56 dnl Shared libraries are not supported on some platforms [yet]
63 dnl sets variable LIBTOOL
65 LT_VERSION_INFO=cl_lt_version
66 AC_SUBST(LT_VERSION_INFO)
70 dnl checks for compiler characteristics
73 AX_CXX_COMPILE_STDCXX([11], [ext], [optional])
75 AC_CHECK_ALIGNOF([void*])
76 AC_DEFINE_UNQUOTED([cl_word_alignment], [$ac_cv_alignof_voidp], [Normal alignment of void*])
78 dnl checks for header files
80 AC_CHECK_HEADERS([unistd.h])
81 dnl DEFS HAVE_UNISTD_H if exist unistd.h
83 dnl checks for typedefs
86 dnl checks for functions and declarations
89 dnl set variable ALLOCA, DEFS NO_ALLOCA
91 dnl DEFS HAVE_GETTIMEOFDAY, GETTIMEOFDAY_DOTS, GETTIMEOFDAY_TZP_T
93 dnl don't use ftime(3) even if it's available
95 dnl DEFS HAVE_SYS_RESOURCE_H, HAVE_GETRUSAGE, HAVE_SYS_TIMES_H
97 dnl DEFS HAVE_PERROR_DECL
99 dnl DEFS CL_HAVE_ATTRIBUTE_FLATTEN
101 dnl checks for compiler characteristics
104 dnl DEFS __CHAR_UNSIGNED__ if char is unsigned
106 dnl Create a subdirectory in the ${top_builddir} to hold auto-generated
107 dnl headers. This subdirectory does not exist when ${top_builddir} != ${top_srcdir}
108 dnl (a.k.a. "VPATH build").
109 if test ! -d include/cln; then
110 AS_MKDIR_P([include/cln])
112 CL_MACHINE([integer types and behaviour],${srcdir}/autoconf/intparam.c,[CL_INTPARAM_CROSS],include/cln/intparam.h,cl_cv_file_intparam_h)
113 dnl builds include/cln/intparam.h
114 CL_MACHINE([floating-point types and behaviour],${srcdir}/autoconf/floatparam.c,[CL_FLOATPARAM_CROSS],include/cln/floatparam.h,cl_cv_file_floatparam_h)
115 dnl builds include/cln/floatparam.h
117 dnl DEFS CL_USE_GMP, GMP_DEMANDS_UINTD_*
119 CLNLIB_LIBS='-L${libdir} -lcln'
120 AC_LIB_LINKFLAGS_FROM_LIBS([CLNLIB_RPATH], [$CLNLIB_LIBS])
125 AC_OUTPUT([Makefile src/Makefile tests/Makefile examples/Makefile doc/Makefile benchmarks/Makefile cln.spec cln.pc])