]> www.ginac.de Git - cln.git/blob - configure.in
cln-config.1: change title.
[cln.git] / configure.in
1 dnl  AUTOCONF configuration for CLN
2 dnl  Bruno Haible 8.1.1999
3 dnl
4 dnl  configure.in ---<autoconf>--->> configure
5 dnl
6 dnl  configure    ---<sh>--->> config.status
7 dnl                      --->> include/cln/config.h
8 dnl        cln-config.in --->> cln-config
9 dnl          Makefile.in --->> Makefile
10 dnl      src/Makefile.in --->> src/Makefile
11 dnl
12 dnl  Makefile   ---<make>--->> libcln.a
13 dnl
14 dnl
15 AC_INIT(src/integer/gcd/cl_I_gcd.cc)
16 AC_CONFIG_HEADER(include/cln/config.h src/base/cl_base_config.h src/base/cl_gmpconfig.h src/float/cl_float_config.h src/timing/cl_t_config.h)
17 AC_PROG_MAKE_SET
18 dnl This piece of sed script replaces every line containing '@subdir@'
19 dnl by several consecutive lines, each referencing one subdir.
20 extrasub="$extrasub"'
21 /@subdir@/{
22 h
23 g
24 s/@subdir@/src/
25 p
26 g
27 s/@subdir@/tests/
28 p
29 g
30 s/@subdir@/benchmarks/
31 p
32 g
33 s/@subdir@/examples/
34 p
35 g
36 s/@subdir@/doc/
37 p
38 d
39 }
40 '
41 dnl
42 dnl           checks for programs
43 dnl
44 AC_PROG_CC
45                       dnl sets variable CC
46 AC_PROG_CPP
47                       dnl sets variable CPP
48 AC_PROG_CXX
49                       dnl sets variable CXX
50 AC_PROG_CXXCPP
51                       dnl sets variable CXXCPP
52 CL_AS_UNDERSCORE
53                       dnl sets variable AS_UNDERSCORE, DEFS ASM_UNDERSCORE
54 CL_PROG_RANLIB
55                       dnl sets variable RANLIB
56 CL_PROG_INSTALL
57                       dnl sets variables INSTALL, INSTALL_DATA, INSTALL_PROGRAM
58 dnl
59 dnl           check for host type
60 dnl
61 CL_CANONICAL_HOST(autoconf)
62                       dnl sets variables host, host_cpu, host_vendor, host_os
63 CL_CANONICAL_HOST_CPU
64                       dnl DEFS __${host_cpu}__
65 dnl
66 dnl           check for build configuration
67 dnl
68 LIBS=-lm
69                       dnl libcln depends on libm
70 PACKAGE=cln
71                       dnl libtool wants PACKAGE
72 AM_PROG_LIBTOOL
73                       dnl sets variable LIBTOOL
74
75 dnl Libtool's library version information for CLN.
76 dnl (Not to be confused with CLN's release version.)
77 dnl Making new releases:
78 dnl * increment CLN_REVISION,
79 dnl * if any functions/classes have been added, removed or changed, increment
80 dnl   CLN_CURRENT and set CLN_REVISION to 0,
81 dnl * if any functions/classes have been added, increment CLN_AGE,
82 dnl * if backwards compatibility has been broken, set CLN_AGE to 0.
83 CL_CURRENT=1
84 CL_REVISION=0
85 CL_AGE=0
86 dnl make substitutions
87 AC_SUBST(CL_CURRENT)
88 AC_SUBST(CL_REVISION)
89 AC_SUBST(CL_AGE)
90 dnl release version
91 CL_VERSION_MAJOR=1
92 CL_VERSION_MINOR=1
93 CL_VERSION_PATCHLEVEL=0
94 dnl release version for cln/config.h, so it can be tested by the preprocessor
95 AC_DEFINE_UNQUOTED(CL_VERSION_MAJOR, $CL_VERSION_MAJOR)
96 AC_DEFINE_UNQUOTED(CL_VERSION_MINOR, $CL_VERSION_MINOR)
97 AC_DEFINE_UNQUOTED(CL_VERSION_PATCHLEVEL, $CL_VERSION_PATCHLEVEL)
98 dnl concatenated release version
99 CL_VERSION=$CL_VERSION_MAJOR.$CL_VERSION_MINOR.$CL_VERSION_PATCHLEVEL
100 AC_DEFINE_UNQUOTED(CL_VERSION, $CL_VERSION)
101 AC_SUBST(CL_VERSION)
102
103 dnl
104 dnl           checks for compiler characteristics
105 dnl
106 AC_LANG_CPLUSPLUS
107 dnl
108 CL_BOOL
109                       dnl DEFS HAVE_BOOL, bool
110 CL_LONGLONG
111                       dnl DEFS HAVE_LONGLONG
112 CL_LONGDOUBLE
113                       dnl DEFS HAVE_LONGDOUBLE
114 CL_TEMPLATE_NULL
115                       dnl DEFS HAVE_TEMPLATE_NULL
116 CL_GLOBAL_CONSTRUCTORS
117                       dnl DEFS CL_GLOBAL_CONSTRUCTOR_PREFIX, CL_GLOBAL_DESTRUCTOR_PREFIX
118 dnl
119 dnl           checks for header files
120 dnl
121 CL_UNISTD_H
122                       dnl DEFS HAVE_UNISTD_H if exist unistd.h
123 dnl
124 dnl           checks for typedefs
125 dnl
126 dnl
127 dnl           checks for functions and declarations
128 dnl
129 CL_ALLOCA
130                       dnl set variable ALLOCA, DEFS NO_ALLOCA
131 CL_FPU_CONTROL
132                       dnl DEFS HAVE_FPU_CONTROL_T, HAVE_SETFPUCW
133 CL_GETTIMEOFDAY
134                       dnl DEFS HAVE_GETTIMEOFDAY, GETTIMEOFDAY_DOTS, GETTIMEOFDAY_TZP_T
135 CL_FTIME
136                       dnl DEFS HAVE_FTIME
137 CL_TIMES_CLOCK
138                       dnl DEFS HAVE_TIMES_CLOCK
139 CL_RUSAGE
140                       dnl DEFS HAVE_SYS_RESOURCE_H, HAVE_GETRUSAGE, HAVE_SYS_TIMES_H
141 CL_PERROR
142                       dnl DEFS HAVE_PERROR_DECL
143 dnl
144 dnl           checks for compiler characteristics
145 dnl
146 CL_CHAR_UNSIGNED
147                       dnl DEFS __CHAR_UNSIGNED__ if char is unsigned
148 CL_MACHINE([integer types and behaviour],${srcdir}/autoconf/intparam.c,include/cln/intparam.h,cl_cv_file_intparam_h)
149                       dnl builds include/cln/intparam.h
150 CL_MACHINE([floating-point types and behaviour],${srcdir}/autoconf/floatparam.c,include/cln/floatparam.h,cl_cv_file_floatparam_h)
151                       dnl builds include/cln/floatparam.h
152 dnl
153 dnl           interfacing to GNU gmp (must be at least version 3)
154 dnl
155 AC_ARG_WITH(gmp, [  --with-gmp              use external fast low-level functions from GNU MP 3.
156                           [default=yes]], ,with_gmp="yes")
157 if test "$with_gmp" = yes; then
158   CL_GMP_H_VERSION
159   if test "$cl_cv_new_gmp_h" = no; then with_gmp="no"; fi
160   if test "$with_gmp" = yes; then
161     CL_GMP_CHECK
162     if test "$cl_cv_new_libgmp" = no; then with_gmp="no"; fi
163   fi
164 fi
165 if test "$with_gmp" = yes; then
166   CL_GMP_SET_UINTD
167   AC_DEFINE(CL_USE_GMP)
168 else
169   AC_MSG_WARN([disabling external GNU MP library])
170 fi
171 dnl
172 dnl           That's it.
173 dnl
174 for f in 'tests/.gdbinit'; do
175   if test '!' -f "$f"; then
176     echo "creating $f"
177 changequote(,)dnl
178     g=`echo "$f" | sed -e 's,/[^/]*$,,'`
179 changequote([,])dnl
180     test "$g" = "$f" || test -d "$g" || mkdir "$g"
181     cp "$srcdir/$f" "$f"
182   fi
183 done
184 AC_OUTPUT([Makefile src/Makefile tests/Makefile benchmarks/Makefile examples/Makefile doc/Makefile cln-config cln-config.1 cln.spec], [chmod +x cln-config])