]> www.ginac.de Git - cln.git/blob - configure.ac
[build] Rename cl_asm files to make CMake happy
[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
68 dnl           checks for compiler characteristics
69 dnl
70 AC_LANG([C++])
71 AX_CXX_COMPILE_STDCXX([11], [ext], [optional])
72 dnl
73 AC_CHECK_ALIGNOF([void*])
74 AC_DEFINE_UNQUOTED([cl_word_alignment], [$ac_cv_alignof_voidp], [Normal alignment of void*])
75 dnl
76 dnl           checks for header files
77 dnl
78 AC_CHECK_HEADERS([unistd.h])
79                       dnl DEFS HAVE_UNISTD_H if exist unistd.h
80 dnl
81 dnl           checks for typedefs
82 dnl
83 dnl
84 dnl           checks for functions and declarations
85 dnl
86 CL_ALLOCA
87                       dnl set variable ALLOCA, DEFS NO_ALLOCA
88 CL_GETTIMEOFDAY
89                       dnl DEFS HAVE_GETTIMEOFDAY, GETTIMEOFDAY_DOTS, GETTIMEOFDAY_TZP_T
90 ac_cv_func_ftime=no
91                       dnl don't use ftime(3) even if it's available
92 CL_RUSAGE
93                       dnl DEFS HAVE_SYS_RESOURCE_H, HAVE_GETRUSAGE, HAVE_SYS_TIMES_H
94 CL_PERROR
95                       dnl DEFS HAVE_PERROR_DECL
96 CL_ATTRIBUTE_FLATTEN
97                       dnl DEFS CL_HAVE_ATTRIBUTE_FLATTEN
98 dnl
99 dnl           checks for compiler characteristics
100 dnl
101 AC_C_CHAR_UNSIGNED
102                       dnl DEFS __CHAR_UNSIGNED__ if char is unsigned
103
104 dnl Create a subdirectory in the ${top_builddir} to hold auto-generated
105 dnl headers. This subdirectory does not exist when ${top_builddir} != ${top_srcdir}
106 dnl (a.k.a. "VPATH build").
107 if test ! -d include/cln; then
108         AS_MKDIR_P([include/cln])
109 fi
110 CL_MACHINE([integer types and behaviour],${srcdir}/autoconf/intparam.c,[CL_INTPARAM_CROSS],include/cln/intparam.h,cl_cv_file_intparam_h)
111                       dnl builds include/cln/intparam.h
112 CL_MACHINE([floating-point types and behaviour],${srcdir}/autoconf/floatparam.c,[CL_FLOATPARAM_CROSS],include/cln/floatparam.h,cl_cv_file_floatparam_h)
113                       dnl builds include/cln/floatparam.h
114 CL_LIBGMP
115                       dnl DEFS CL_USE_GMP, GMP_DEMANDS_UINTD_*
116
117 CLNLIB_LIBS='-L${libdir} -lcln'
118 AC_LIB_LINKFLAGS_FROM_LIBS([CLNLIB_RPATH], [$CLNLIB_LIBS])
119
120 dnl
121 dnl           That's it.
122 dnl
123 AC_OUTPUT([Makefile src/Makefile tests/Makefile examples/Makefile doc/Makefile benchmarks/Makefile cln.spec cln.pc])