]> www.ginac.de Git - cln.git/blob - configure.ac
60003a3e2a13058284dea9ef8aae769b366e5ae6
[cln.git] / configure.ac
1 dnl run autoreconf -iv to produce the configure script.
2
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])
7
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])
13
14 AC_INIT([cln], cl_version)
15 AC_PREREQ(2.59)
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 */])
29
30 dnl           checks for programs
31 dnl
32 AC_PROG_CC
33                       dnl sets variable CC
34 AC_PROG_CPP
35                       dnl sets variable CPP
36 AC_PROG_CXX
37                       dnl sets variable CXX
38 AC_PROG_CXXCPP
39                       dnl sets variable CXXCPP
40 CL_AS_UNDERSCORE
41                       dnl sets variable AS_UNDERSCORE, DEFS ASM_UNDERSCORE
42 CL_AS_NOEXECSTACK
43                       dnl sets variable ASMFLAGS
44 AC_PROG_INSTALL
45                       dnl sets variables INSTALL, INSTALL_DATA, INSTALL_PROGRAM
46 dnl
47 dnl           check for host type
48 dnl
49 CL_CANONICAL_HOST
50                       dnl sets variables host, host_cpu, host_vendor, host_os
51 CL_CANONICAL_HOST_CPU
52                       dnl DEFS __${host_cpu}__
53 case $host_os in
54     *mingw*)
55      AC_DISABLE_SHARED
56   dnl Shared libraries are not supported on some platforms [yet]
57     ;;
58     *)
59      AC_ENABLE_SHARED
60     ;;
61 esac
62 AC_PROG_LIBTOOL
63                       dnl sets variable LIBTOOL
64
65 LT_VERSION_INFO=cl_lt_version
66 AC_SUBST(LT_VERSION_INFO)
67 CL_VERSION=cl_version
68 AC_SUBST(CL_VERSION)
69
70 dnl           checks for compiler characteristics
71 dnl
72 AC_LANG([C++])
73 AX_CXX_COMPILE_STDCXX([11], [ext], [optional])
74 dnl
75 AC_CHECK_ALIGNOF([void*])
76 AC_DEFINE_UNQUOTED([cl_word_alignment], [$ac_cv_alignof_voidp], [Normal alignment of void*])
77 dnl
78 dnl           checks for header files
79 dnl
80 AC_CHECK_HEADERS([unistd.h])
81                       dnl DEFS HAVE_UNISTD_H if exist unistd.h
82 dnl
83 dnl           checks for typedefs
84 dnl
85 dnl
86 dnl           checks for functions and declarations
87 dnl
88 CL_ALLOCA
89                       dnl set variable ALLOCA, DEFS NO_ALLOCA
90 CL_GETTIMEOFDAY
91                       dnl DEFS HAVE_GETTIMEOFDAY, GETTIMEOFDAY_DOTS, GETTIMEOFDAY_TZP_T
92 ac_cv_func_ftime=no
93                       dnl don't use ftime(3) even if it's available
94 CL_RUSAGE
95                       dnl DEFS HAVE_SYS_RESOURCE_H, HAVE_GETRUSAGE, HAVE_SYS_TIMES_H
96 CL_PERROR
97                       dnl DEFS HAVE_PERROR_DECL
98 CL_ATTRIBUTE_FLATTEN
99                       dnl DEFS CL_HAVE_ATTRIBUTE_FLATTEN
100 dnl
101 dnl           checks for compiler characteristics
102 dnl
103 AC_C_CHAR_UNSIGNED
104                       dnl DEFS __CHAR_UNSIGNED__ if char is unsigned
105
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])
111 fi
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
116 CL_LIBGMP
117                       dnl DEFS CL_USE_GMP, GMP_DEMANDS_UINTD_*
118
119 CLNLIB_LIBS='-L${libdir} -lcln'
120 AC_LIB_LINKFLAGS_FROM_LIBS([CLNLIB_RPATH], [$CLNLIB_LIBS])
121
122 dnl
123 dnl           That's it.
124 dnl
125 AC_OUTPUT([Makefile src/Makefile tests/Makefile examples/Makefile doc/Makefile benchmarks/Makefile cln.spec cln.pc])