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