]> www.ginac.de Git - cln.git/blob - configure.ac
Janitorial clean-up.
[cln.git] / configure.ac
1 dnl run autoreconf -iv to produce the configure script.
2
3 m4_define([cl_version_major], [1])
4 m4_define([cl_version_minor], [3])
5 m4_define([cl_version_patchlevel], [3])
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 dnl (Not to be confused with CLN's release version.)
10 dnl Making new releases:
11 dnl * increment cl_lt_revision,
12 dnl * if any interfaces have been added, removed, or changed, then increment
13 dnl   cl_lt_current and set cl_lt_revision to 0,
14 dnl * if any interfaces have been added, then increment cl_lt_age,
15 dnl * if any interfaces have been removed, set cl_lt_age to 0.
16 dnl (On many systems, $(cl_lt_current):$(cl_lt_revision):$(cl_lt_age) results in
17 dnl libcln.so.$(cl_lt_current)-$(cl_lt_age).)
18 m4_define([cl_lt_current], [6])
19 m4_define([cl_lt_revision], [3])
20 m4_define([cl_lt_age], [0])
21 m4_define([cl_lt_version], [cl_lt_current:cl_lt_revision:cl_lt_age])
22
23 AC_INIT([cln], cl_version)
24 AC_PREREQ(2.59)
25 AC_CONFIG_SRCDIR(src/integer/gcd/cl_I_gcd.cc)
26 AC_CONFIG_AUX_DIR([autoconf])
27 AC_CONFIG_MACRO_DIR([m4])
28 AC_CONFIG_HEADERS(autoconf/cl_config.h include/cln/config.h include/cln/host_cpu.h include/cln/version.h src/base/cl_base_config.h src/base/cl_gmpconfig.h src/timing/cl_t_config.h)
29 AM_INIT_AUTOMAKE([foreign 1.10 dist-bzip2 subdir-objects])
30 AH_TOP([#ifndef _CL_CONFIG_H])
31 AH_TOP([#define _CL_CONFIG_H])
32 AH_TOP([#include "cln/host_cpu.h"])
33 AH_TOP([/* prevents cln/config.h from being included, so no macro gets redefined */])
34 AH_TOP([#define _CL_CONFIG_PUBLIC_H])
35 AH_TOP([/* prevents cln/version.h from being included, so no macro gets redefined */])
36 AH_TOP([#define _CL_VERSION_H])
37 AH_BOTTOM([#endif /* _CL_CONFIG_H */])
38
39 dnl           checks for programs
40 dnl
41 AC_PROG_CC
42                       dnl sets variable CC
43 AC_PROG_CPP
44                       dnl sets variable CPP
45 AC_PROG_CXX
46                       dnl sets variable CXX
47 AC_PROG_CXXCPP
48                       dnl sets variable CXXCPP
49 CL_AS_UNDERSCORE
50                       dnl sets variable AS_UNDERSCORE, DEFS ASM_UNDERSCORE
51 CL_AS_NOEXECSTACK
52                       dnl sets variable ASMFLAGS
53 AC_PROG_INSTALL
54                       dnl sets variables INSTALL, INSTALL_DATA, INSTALL_PROGRAM
55 dnl
56 dnl           check for host type
57 dnl
58 CL_CANONICAL_HOST(autoconf)
59                       dnl sets variables host, host_cpu, host_vendor, host_os
60 CL_CANONICAL_HOST_CPU
61                       dnl DEFS __${host_cpu}__
62 case $host_os in
63     *mingw*)
64      AC_DISABLE_SHARED
65   dnl Shared libraries are not supported on some platforms [yet]
66     ;;
67     *)
68      AC_ENABLE_SHARED
69     ;;
70 esac
71 AC_PROG_LIBTOOL
72                       dnl sets variable LIBTOOL
73
74 LT_VERSION_INFO=cl_lt_version
75 AC_SUBST(LT_VERSION_INFO)
76
77 dnl release version
78 CL_VERSION_MAJOR=cl_version_major
79 CL_VERSION_MINOR=cl_version_minor
80 CL_VERSION_PATCHLEVEL=cl_version_patchlevel
81 dnl release version for cln/config.h, so it can be tested by the preprocessor
82 AC_DEFINE_UNQUOTED(CL_VERSION_MAJOR, $CL_VERSION_MAJOR, [Major version number of CLN])
83 AC_DEFINE_UNQUOTED(CL_VERSION_MINOR, $CL_VERSION_MINOR, [Minor version number of CLN])
84 AC_DEFINE_UNQUOTED(CL_VERSION_PATCHLEVEL, $CL_VERSION_PATCHLEVEL, [Patchlevel version number of CLN])
85 dnl concatenated release version
86 CL_VERSION=cl_version
87 AC_DEFINE_UNQUOTED(CL_VERSION, $CL_VERSION, [CLN release number])
88 AC_SUBST(CL_VERSION)
89
90 dnl           checks for compiler characteristics
91 dnl
92 AC_LANG([C++])
93 dnl
94 CL_LONGLONG
95                       dnl DEFS HAVE_LONGLONG
96 CL_LONGDOUBLE
97                       dnl DEFS HAVE_LONGDOUBLE
98 dnl
99 dnl           checks for header files
100 dnl
101 AC_CHECK_HEADERS([unistd.h])
102                       dnl DEFS HAVE_UNISTD_H if exist unistd.h
103 dnl
104 dnl           checks for typedefs
105 dnl
106 dnl
107 dnl           checks for functions and declarations
108 dnl
109 CL_ALLOCA
110                       dnl set variable ALLOCA, DEFS NO_ALLOCA
111 CL_GETTIMEOFDAY
112                       dnl DEFS HAVE_GETTIMEOFDAY, GETTIMEOFDAY_DOTS, GETTIMEOFDAY_TZP_T
113 ac_cv_func_ftime=no
114                       dnl don't use ftime(3) even if it's available
115 CL_TIMES_CLOCK
116                       dnl DEFS HAVE_TIMES_CLOCK
117 CL_RUSAGE
118                       dnl DEFS HAVE_SYS_RESOURCE_H, HAVE_GETRUSAGE, HAVE_SYS_TIMES_H
119 CL_PERROR
120                       dnl DEFS HAVE_PERROR_DECL
121 CL_ATTRIBUTE_FLATTEN
122                       dnl DEFS CL_HAVE_ATTRIBUTE_FLATTEN
123 dnl
124 dnl           checks for compiler characteristics
125 dnl
126 AC_C_CHAR_UNSIGNED
127                       dnl DEFS __CHAR_UNSIGNED__ if char is unsigned
128
129 dnl Create a subdirectory in the ${top_builddir} to hold auto-generated
130 dnl headers. This subdirectory does not exist when ${top_builddir} != ${top_srcdir}
131 dnl (a.k.a. "VPATH build").
132 if test ! -d include/cln; then
133         AS_MKDIR_P([include/cln])
134 fi
135 CL_MACHINE([integer types and behaviour],${srcdir}/autoconf/intparam.c,[CL_INTPARAM_CROSS],include/cln/intparam.h,cl_cv_file_intparam_h)
136                       dnl builds include/cln/intparam.h
137 CL_MACHINE([floating-point types and behaviour],${srcdir}/autoconf/floatparam.c,[CL_FLOATPARAM_CROSS],include/cln/floatparam.h,cl_cv_file_floatparam_h)
138                       dnl builds include/cln/floatparam.h
139 CL_LIBGMP
140                       dnl DEFS CL_USE_GMP, GMP_DEMANDS_UINTD_*
141
142 CLNLIB_LIBS='-L${libdir} -lcln'
143 AC_LIB_LINKFLAGS_FROM_LIBS([CLNLIB_RPATH], [$CLNLIB_LIBS])
144
145 dnl
146 dnl           That's it.
147 dnl
148 AC_OUTPUT([Makefile src/Makefile tests/Makefile examples/Makefile doc/Makefile benchmarks/Makefile cln.spec cln.pc])