Debian Codegraph @

src/configure.ac

raw ◀ ▶
1 Debian patch touch this file
1 dnl dnl
2 dnl This is an autoconf script.
3 dnl To rebuild the `configure' script from this, execute the command
4 dnl autoconf
5 dnl in the directory containing this script.
6 dnl
7 dnl AUTOCONF configuration for ECL
8 dnl Giuseppe Attardi 25.1.1994
9 dnl
10
11 AC_INIT([ecl],[24.5.10],[])
12 AC_REVISION([$Revision$])
13 AC_CONFIG_SRCDIR([bare.lsp.in])
14 AC_PREREQ(2.69)
15
16 dnl -----------------------------------------------------------------------
17 dnl Make sure we do not configure within source directory
18 if test -f configure; then
19 AC_MSG_ERROR([This program cannot be built within the source directory])
20 fi
21
22 dnl -----------------------------------------------------------------------
23 dnl Configure switches
24
25 AC_ARG_WITH(cross_config,
26 AS_HELP_STRING( [--with-cross-config=f],
27 [supply configuration for a cross compiler]),
28 [], [with_cross_config="`pwd`/cross_config"])
29
30 AC_ARG_ENABLE(shared,
31 AS_HELP_STRING( [--enable-shared],
32 [enable loading compiled files (default=YES)]),
33 [], [enable_shared=yes])
34
35 AC_ARG_ENABLE(rpath,
36 AS_HELP_STRING( [--enable-rpath],
37 [hard-code the location of the ECL shared library.]
38 [(no|yes, default=NO)]),
39 [], [enable_rpath=yes] )
40
41 AC_ARG_ENABLE(threads,
42 AS_HELP_STRING( [--enable-threads],
43 [support for native threads (yes|no|auto, default=auto).]),
44 [], [enable_threads=auto])
45
46 AC_ARG_ENABLE(boehm,
47 AS_HELP_STRING( [--enable-boehm],
48 [use the Boehm-Weiser garbage collector]
49 [(no|included|system|auto, default=auto)] ),
50 [], [enable_boehm=auto] )
51
52 AC_ARG_ENABLE(libatomic,
53 AS_HELP_STRING( [--enable-libatomic],
54 [version of the libatomic-ops library]
55 [(auto|included|system, default=auto)] ),
56 [], [enable_libatomic=auto] )
57
58 AC_ARG_ENABLE(soname,
59 AS_HELP_STRING( [--enable-soname],
60 [link and install the library using version numbers]
61 [(no|yes, default=yes)]),
62 [], [enable_soname=yes] )
63
64 AC_ARG_ENABLE(gmp,
65 AS_HELP_STRING( [--enable-gmp],
66 [version of the GMP library]
67 [(portable|included|system|auto, default=auto)] ),
68 [], [enable_gmp=auto] )
69
70 dnl GMP library options
71 AC_ARG_WITH(C-gmp,
72 AS_HELP_STRING( [--with-C-gmp],
73 [Deprecated! See --enable-gmp]),
74 [with_c_gmp=yes; with_system_gmp=no], [with_c_gmp=no])
75
76 AC_ARG_WITH(system-gmp,
77 AS_HELP_STRING( [--with-system-gmp],
78 [Deprecated! See --enable-gmp]),
79 [], [with_system_gmp="auto"])
80
81 AC_ARG_WITH(gmp,
82 AS_HELP_STRING( [--with-gmp=args],
83 [Deprecated! See --with-gmp-args]),
84 [], [with_gmp_args=""])
85
86 AC_ARG_WITH(gmp-args,
87 AS_HELP_STRING( [--with-gmp-args=args],
88 [supply arguments for configuring GMP library]),
89 [], [with_gmp_args=""])
90
91 AC_ARG_WITH(gmp-prefix,
92 AS_HELP_STRING( [--with-gmp-prefix=path],
93 [prefix for system GMP includes and libraries] ),
94 [GMP_INCDIR="$withval/include"; GMP_LIBDIR="$withval/lib"], [])
95
96 AC_ARG_WITH(gmp-incdir,
97 AS_HELP_STRING( [--with-gmp-incdir=path],
98 [path to system GMP includes (overrides prefix)] ),
99 [GMP_INCDIR="$withval"], [])
100
101 AC_ARG_WITH(gmp-libdir,
102 AS_HELP_STRING( [--with-gmp-libdir=path],
103 [path to system GMP libraries (overrides prefix)] ),
104 [GMP_LIBDIR="$withval"], [])
105
106 dnl LIBFFI library options
107 AC_ARG_WITH(libffi-prefix,
108 AS_HELP_STRING( [--with-libffi-prefix=path],
109 [prefix for system LIBFFI includes and libraries] ),
110 [LIBFFI_INCDIR="$withval/include"; LIBFFI_LIBDIR="$withval/lib"], [])
111
112 AC_ARG_WITH(libffi-incdir,
113 AS_HELP_STRING( [--with-libffi-incdir=path],
114 [path to system LIBFFI includes (overrides prefix)] ),
115 [LIBFFI_INCDIR="$withval"], [])
116
117 AC_ARG_WITH(libffi-libdir,
118 AS_HELP_STRING( [--with-libffi-libdir=path],
119 [path to system LIBFFI libraries (overrides prefix)] ),
120 [LIBFFI_LIBDIR="$withval"], [])
121
122 dnl LIBGC library options
123 AC_ARG_WITH(libgc-prefix,
124 AS_HELP_STRING( [--with-libgc-prefix=path],
125 [prefix for system LIBGC includes and libraries] ),
126 [LIBGC_INCDIR="$withval/include"; LIBGC_LIBDIR="$withval/lib"], [])
127
128 AC_ARG_WITH(libgc-incdir,
129 AS_HELP_STRING( [--with-libgc-incdir=path],
130 [path to system LIBGC includes (overrides prefix)] ),
131 [LIBGC_INCDIR="$withval"], [])
132
133 AC_ARG_WITH(libgc-libdir,
134 AS_HELP_STRING( [--with-libgc-libdir=path],
135 [path to system LIBGC libraries (overrides prefix)] ),
136 [LIBGC_LIBDIR="$withval"], [])
137
138 AC_ARG_WITH(cxx,
139 AS_HELP_STRING( [--with-cxx],
140 [build ECL using C++ compiler (default=NO)]),
141 [], [with_cxx=no])
142
143 AC_ARG_WITH(tcp,
144 AS_HELP_STRING( [--with-tcp],
145 [include socket interface (yes|builtin|no, default=YES)]),
146 [], [with_tcp=yes])
147
148 AC_ARG_WITH(serve_event,
149 AS_HELP_STRING( [--with-serve-event],
150 [include serve-event module (yes|builtin|no, default=YES)]),
151 [], [with_serve_event=${enable_shared}])
152
153 AC_ARG_WITH(clos-streams,
154 AS_HELP_STRING( [--with-clos-streams],
155 [user defined stream objects (yes|builtin|no, default=YES)]),
156 [], [with_clos_streams=yes])
157
158 AC_ARG_WITH(cmuformat,
159 AS_HELP_STRING( [--with-cmuformat],
160 [use CMUCL's FORMAT routine (default=YES)]),
161 [], [with_cmuformat=${with_clos_streams}])
162
163 AC_ARG_WITH(asdf,
164 AS_HELP_STRING( [--with-asdf],
165 [include ASDF building facility]
166 [(yes|builtin|no, default=YES)]),
167 [], [with_asdf=yes])
168
169 AC_ARG_WITH(defsystem,
170 AS_HELP_STRING( [--with-defsystem],
171 [include DEFSYSTEM building facility]
172 [(yes|builtin|no, default=NO)]),
173 [], [with_defsystem=no])
174
175 AC_ARG_WITH(cmp,
176 AS_HELP_STRING( [--with-cmp],
177 [build the compiler (yes|builtin|no, default=YES)] ),
178 [], [with_cmp=yes])
179
180 AC_ARG_WITH(bytecmp,
181 AS_HELP_STRING( [--with-bytecmp],
182 [build the bytecodes compiler (yes|builtin|no, default=YES)] ),
183 [], [with_bytecmp=yes])
184
185 AC_ARG_WITH(rt,
186 AS_HELP_STRING( [--with-rt],
187 [Deprecated! include MIT-RT testing environment]
188 [(yes|builtin|no, default=NO)]),
189 [], [with_rt=no])
190
191 AC_ARG_WITH(profile,
192 AS_HELP_STRING( [--with-profile],
193 [Deprecated! include CMUCL's simple profiler]
194 [(yes|builtin|no, default=NO)]),
195 [], [with_profile=no])
196
197 AC_ARG_WITH(dffi,
198 AS_HELP_STRING( [--with-dffi],
199 [dynamic foreign function interface]
200 [(system|included|auto|no, default=AUTO if libffi available)]),
201 [enable_libffi=${withval}], [enable_libffi=auto])
202
203 AC_ARG_WITH(fpe,
204 AS_HELP_STRING( [--with-fpe],
205 [detect floating point exceptions]
206 [(default=YES)]),
207 [], [with_fpe=yes])
208
209 AC_ARG_WITH(signed-zero,
210 AS_HELP_STRING( [--with-signed-zero={yes|no}],
211 [allow for IEEE signed zeros (default=YES).]),
212 [], [with_signed_zero="yes"])
213
214 AC_ARG_WITH(ieee-fp,
215 AS_HELP_STRING( [--with-ieee-fp={yes|no}],
216 [full IEEE floating point system, including denormals (default=YES).]
217 [Implies signed-zero]),
218 [], [with_ieee_fp="yes"])
219
220 AC_ARG_WITH(sse,
221 AS_HELP_STRING( [--with-sse={yes|no|auto}],
222 [implement SSE intrinsics in ECL (default=NO).]
223 [Only works when supported by the compiler]),
224 [], [with_sse="no"])
225
226 AC_ARG_ENABLE(unicode,
227 AS_HELP_STRING( [--enable-unicode={32|16|no}],
228 [enable support for unicode (default=32)]),
229 [], [enable_unicode=32])
230
231 AC_ARG_ENABLE(c99complex,
232 AS_HELP_STRING( [--enable-c99complex],
233 [include support for c99 complex floats]
234 [(default=auto)]),
235 [enable_c99complex=${enableval}], [enable_c99complex=auto])
236
237 AC_ARG_ENABLE(smallcons,
238 AS_HELP_STRING( [--enable-smallcons],
239 [use small (2 words) cons types. Requires Boehm-Weiser gc.]
240 [(default=YES)]),
241 [enable_smallcons=${enableval}],[enable_smallcons=yes])
242
243 AC_ARG_ENABLE(gengc,
244 AS_HELP_STRING( [--enable-gengc],
245 [use generational garbage collection. Requires Boehm-Weiser gc.]
246 [(no|yes, default=NO)]),
247 [enable_gengc=${enableval}], [enable_gengc=no] )
248
249 AC_ARG_ENABLE(precisegc,
250 AS_HELP_STRING( [--enable-precisegc],
251 [use type information during garbage collection. Requires Boehm-Weiser gc (EXPERIMENTAL).]
252 [(no|yes, default=NO)]),
253 [enable_precisegc=${enableval}], [enable_precisegc=no] )
254
255 AC_ARG_ENABLE(serialization,
256 AS_HELP_STRING( [--enable-serialization],
257 [use serialization framework instead of the reader to save externalizable objects in compiled files (EXPERIMENTAL).]
258 [(no|yes, default=NO)]),
259 [], [enable_serialization=no] )
260
261 AC_ARG_ENABLE(debug,
262 AS_HELP_STRING( [--enable-debug],
263 [enable various debugging features]
264 [(default=NO)]),
265 [DEBUG_CFLAGS="-g -O0"; CFLAGS="$CFLAGS -g -O0"],[])
266
267 AC_ARG_WITH(debug-cflags,
268 AS_HELP_STRING( [--with-debug-cflags],
269 [add debug flags to the compiler invocation]
270 [(yes,no,actual flags,default=YES)]),
271 [],[with_debug_cflags="no"])
272
273 AC_ARG_WITH(profile-cflags,
274 AS_HELP_STRING( [--with-profile-cflags],
275 [add profiling flags to the compiler invocation]
276 [(yes,no,actual flags,default=NO)]),
277 [],[with_profile_cflags="no"])
278
279 AC_ARG_WITH(extra-files,
280 AS_HELP_STRING( [--with-extra-files],
281 [list of additional source files (default="")]),
282 [with_extra_files="${withval}"], [with_extra_files=""])
283
284 AC_ARG_WITH(init-form,
285 AS_HELP_STRING( [--with-init-form],
286 [lisp forms to execute at startup (default="(si::top-level t)")]),
287 [with_init_form="${withval}"], [with_init_form=""])
288
289 AC_ARG_ENABLE(manual,
290 AS_HELP_STRING( [--enable-manual={auto|html|info|no}],
291 [Enable building of the manual]
292 [(default=AUTO)]),
293 [enable_manual=${enableval}],
294 [enable_manual=auto])
295
296 dnl -----------------------------------------------------------------------
297 dnl Installation directories
298 AC_ARG_VAR([ecldir], [the directory where *.fas files are installed])
299 test -z "${ecldir}" && ecldir="${libdir}/ecl-${PACKAGE_VERSION}"
300 AC_SUBST([ecldir])
301
302 dnl -----------------------------------------------------------------------
303 dnl Initialize variables.
304 boehm_configure_flags=""
305
306 AC_EXEEXT dnl Guess whether .exe is needed for executables
307 AC_SUBST(buildir) dnl For top-level Makefile.in
308 AC_SUBST(ECL_CFLAGS) dnl Similar, but specific to ECL (see src/util/ecl-config)
309 AC_SUBST(DEBUG_CFLAGS)
310 AC_SUBST(GMP_CPPFLAGS) dnl CFLAGS needed for compiling with system GMP library
311 AC_SUBST(GMP_LDFLAGS) dnl LDFLAGS needed for compiling with system GMP library
312 AC_SUBST(LIBFFI_LDFLAGS) dnl LDFLAGS needed for compiling with system LIBFFI library
313 AC_SUBST(FASL_LIBS) dnl Libraries to link into all ecl code but not
314 dnl into helper programs.
315 AC_SUBST(CORE_LIBS, []) dnl Locally compiled libs to link into
316 dnl ecl/ecl_min/libecl.so and nowhere else.
317 AC_SUBST(SHARED_LDFLAGS) dnl Flags for shared libraries linker
318 AC_SUBST(BUNDLE_LDFLAGS) dnl Flags for FASL files linker
319 AC_SUBST(PROGRAM_LDFLAGS) dnl Flags for executable program linker
320 AC_SUBST(EXTRA_OBJS) dnl Extra *.o files to be compiled into libecl.a
321 AC_SUBST(TARGETS, ['bin/ecl$(EXE)'])dnl Versions of ECL to be built
322 AC_SUBST(SUBDIRS, ['c doc']) dnl Subdirectories that make should process
323 AC_SUBST(LIBRARIES, []) dnl GMP, Boehm's GC, etc
324 AC_SUBST(LSP_LIBRARIES) dnl Libraries produced by lisp translator
325 AC_SUBST(COMPILATION_FEATURES, ['']) dnl Symbols to add to *FEATURES* for conditional compilation
326 AC_SUBST(LSP_FEATURES, ["${LSP_FEATURES} :ecl :common :common-lisp :ansi-cl :ffi :prefixed-api :cdr-14 :package-local-nicknames :clos :ecl-pde :long-float"]) dnl Symbols to add to *FEATURES* in the final executable
327
328
329 dnl -----------------------------------------------------------------------
330 dnl Guess operating system of host.
331 AC_CANONICAL_BUILD
332 AC_CANONICAL_HOST
333
334
335 dnl =====================================================================
336 dnl Checks for programs
337 AC_PROG_CC # sets variable CC
338 AC_PROG_CC_C99 # checks that CC by default accepts C99 code, if not,
339 # tries adding -std=gnu-99, if this has no effect, throws an error.
340 AC_PROG_CXX # sets variable CXX
341 AC_PROG_CPP # sets variable CPP
342 AC_PROG_RANLIB # sets variable RANLIB
343 AC_PROG_INSTALL # sets variables INSTALL, INSTALL_DATA, INSTALL_PROGRAM
344 AC_PROG_LN_S # sets variable LN_S
345 AC_PROG_MAKE_SET # set $(MAKE) if needed
346 AC_PROG_RANLIB # set variable RANLIB
347 AC_CHECK_TOOL([AR],[ar]) # set variable AR to appropriate `ar' program
348 AC_CHECK_PROGS([CTAGS],[exctags ectags ctags]) # set variable CTAGS to ctags program if found
349 AC_CHECK_PROGS([ETAGS],[etags emacs-etags]) # set variable ETAGS to etags program if found
350
351 dnl -----------------------------------------------------------------------
352 dnl Checks which do not come with autoconf (must be after AC_PROG_CC)
353 ECL_MAKE_ABSOLUTE_SRCDIR
354 ECL_CROSS_CONFIG
355 ECL_GUESS_HOST_OS
356
357 if test "${enable_manual}" != "no"; then
358 AC_MSG_CHECKING([whether to build the manual; finding install-info...])
359 AC_PATH_PROG([INSTALL_INFO], [install-info], [])
360 if test "x${INSTALL_INFO}" = "x"; then
361 if test "${enable_manual}" = "auto"; then
362 AC_MSG_RESULT([ Not building the manual: no install-info found.])
363 enable_manual=no
364 elif test "${enable_manual}" = "info"; then
365 AC_MSG_ERROR([Unable to build the manual: install-info not found.])
366 fi
367 else
368 AC_MSG_RESULT([ install-info found.])
369 AC_MSG_CHECKING([for working makeinfo...])
370 AC_PATH_PROG([MAKEINFO], [makeinfo], [])
371 if test "x${MAKEINFO}" = "x"; then
372 if test "${enable_manual}" = "auto"; then
373 AC_MSG_RESULT([ Not building the manual: no makeinfo found.])
374 enable_manual=no
375 else
376 AC_MSG_ERROR([Unable to build the manual: makeinfo not found.])
377 fi
378 elif test "x`echo \"@inlinefmtifelse{html, foo, bar}\" | makeinfo 2>&1 | grep Unknown`" != "x"; then
379 if test "${enable_manual}" = "auto"; then
380 AC_MSG_RESULT([ Not building the manual: broken/outdated makeinfo.])
381 enable_manual=no
382 else
383 AC_MSG_ERROR([Unable to build the manual: broken/outdated makeinfo.])
384 fi
385 else
386 AC_MSG_RESULT([ Will build the manual.])
387 fi
388 fi
389 fi
390 if test "${enable_manual}" != "no"; then
391 AC_SUBST(INSTALL_INFO)
392 AC_SUBST(MAKEINFO)
393 if test "${enable_manual}" = "html"; then
394 AC_SUBST(MANUAL_MAKE_TARGET, ['html'])
395 AC_SUBST(MANUAL_INSTALL_TARGET, ['install-html'])
396 AC_SUBST(MANUAL_UNINSTALL_TARGET, ['uninstall-html'])
397 else
398 AC_SUBST(MANUAL_MAKE_TARGET, ['info'])
399 AC_SUBST(MANUAL_INSTALL_TARGET, ['install-info'])
400 AC_SUBST(MANUAL_UNINSTALL_TARGET, ['uninstall-info'])
401 fi
402 fi
403
404 dnl ======================================================================
405 dnl GNU multiprecision library
406 dnl
407 dnl This a multi-stage process. First we have to detect whether we must build
408 dnl the GMP library. If this is the case, then we may have to detect the
409 dnl build flags for the library, because GMP may choose to build for 64
410 dnl or 32 bits executables and ECL has to be compiled / linked using precisely
411 dnl the same flags
412 dnl
413 if test "x$GMP_INCDIR" != "x"; then
414 GMP_CPPFLAGS="-I$GMP_INCDIR"
415 fi
416 if test "x$GMP_LIBDIR" != "x"; then
417 GMP_LDFLAGS="-L$GMP_LIBDIR"
418 if test "$enable_rpath" = "yes"; then
419 if (echo "$ECL_LDRPATH" | grep '~A') > /dev/null; then
420 GMP_LDFLAGS=`echo $ECL_LDRPATH | sed "s,~A,$GMP_LIBDIR,"`" $GMP_LDFLAGS"
421 fi
422 fi
423 fi
424 CPPFLAGS="$CPPFLAGS $GMP_CPPFLAGS"
425 LDFLAGS="$LDFLAGS $GMP_LDFLAGS"
426
427 AS_CASE([${enable_gmp}],
428 [portable], [with_system_gmp=no; with_c_gmp=yes],
429 [included], [with_system_gmp=no],
430 [system], [with_system_gmp=yes],
431 [AC_CHECK_LIB( [gmp], [__gmpz_init],
432 [with_system_gmp=yes],
433 [with_system_gmp=no] )])
434
435 ECL_GMP_HEADER=
436 if test "${with_system_gmp}" = "yes"; then
437 AC_CHECK_LIB( [gmp], [__gmpz_init],
438 [FASL_LIBS="${FASL_LIBS} -lgmp"],
439 [AC_MSG_ERROR([System gmp library requested but not found.])])
440 AC_CHECK_HEADER( [gmp.h], [ECL_GMP_HEADER='gmp.h'] )
441 if test "x$ECL_GMP_HEADER" = "x"; then
442 AC_CHECK_HEADER( [gmp/gmp.h], [ECL_GMP_HEADER='gmp/gmp.h'] )
443 fi
444 else
445 SUBDIRS="${SUBDIRS} gmp"
446 CORE_LIBS="-leclgmp ${CORE_LIBS}"
447 if test ${enable_shared} = "no"; then
448 LIBRARIES="${LIBRARIES} ${LIBPREFIX}eclgmp.${LIBEXT}"
449 fi
450 fi
451
452 dnl ----------------------------------------------------------------------
453 dnl Configure local GMP if needed
454 AC_SUBST(ECL_GMP_HEADER)
455 EXTRA_OBJS="${EXTRA_OBJS} big.o"
456 if test "x${with_system_gmp}" = "xno" ; then
457 AC_MSG_NOTICE(Configuring included GMP library:)
458 test -d gmp && rm -rf gmp
459 if test -z "$gmp_build"; then
460 gmp_build="${build}"
461 fi
462 if test "x$with_c_gmp" = "xyes"; then
463 gmp_build=`echo ${gmp_build} | sed 's,@<:@^-@:>@*\(-.*\),none\1,'`
464 echo '***'
465 echo '***' BUILDING GMP WITH C!
466 echo '***' This is a last resort, either because of license or
467 echo '***' porting issues.
468 echo '***'
469 fi
470 ECL_GMP_HEADER='ecl/gmp.h'
471 if test "x$ABI" = "x"; then
472 GMP_ABI=""
473 else
474 GMP_ABI="ABI=$ABI"
475 fi
476 # Crosscompilation for Android on Darwin requires replacing 'NM=nm'
477 # below with 'NM=$PLATFORM_PREFIX/bin/arm-linux-androideabi-nm'.
478 mkdir gmp
479 dnl Notice we need -DPIC to force the assembler to generate PIC code
480 (destdir=`${PWDCMD}`; cd gmp && CC="${CC} ${PICFLAG}" \
481 $srcdir/gmp/configure --disable-shared --prefix=${destdir} \
482 -infodir=${destdir}/doc --includedir=${destdir}/ecl --with-pic \
483 --libdir=${destdir} --build=${gmp_build} --host=${host_alias} \
484 CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" CPPFLAGS="$CPPFLAGS" CC="${CC} ${PICFLAG}" \
485 "$GMP_ABI" $with_gmp_args)
486 if test ! -f gmp/config.status; then
487 AC_MSG_ERROR([Failed to configure the GMP library.])
488 fi
489 else
490 if test "x$ECL_GMP_HEADER" = "x"; then
491 AC_MSG_ERROR([Can not find GMP header.])
492 fi
493 fi
494
495 dnl -----------------------------------------------------------------------
496 dnl GMP-based search of C/C++ compiler and linker flags
497 AC_MSG_CHECKING([GMP autoconf])
498 AC_MSG_RESULT(["${with_system_gmp}.${enable_slow_config}"])
499 if test "x${enable_slow_config}" = "xyes"; then
500 with_system_gmp=no
501 fi
502 if test "x${with_system_gmp}" = "xno"; then
503 ECL_GMP_BASED_CONFIG
504 fi
505
506 dnl ======================================================================
507 dnl LIBFFI library
508 if test "x$LIBFFI_INCDIR" != "x"; then
509 LIBFFI_CPPFLAGS="-I$LIBFFI_INCDIR"
510 fi
511 if test "x$LIBFFI_LIBDIR" != "x"; then
512 LIBFFI_LDFLAGS="-L$LIBFFI_LIBDIR"
513 if test "$enable_rpath" = "yes"; then
514 if (echo "$ECL_LDRPATH" | grep '~A') > /dev/null; then
515 LIBFFI_LDFLAGS=`echo $ECL_LDRPATH | sed "s,~A,$LIBFFI_LIBDIR,"`" $LIBFFI_LDFLAGS"
516 fi
517 fi
518 fi
519 CPPFLAGS="$CPPFLAGS $LIBFFI_CPPFLAGS"
520 LDFLAGS="$LDFLAGS $LIBFFI_LDFLAGS"
521
522 dnl ======================================================================
523 dnl LIBGC library
524 if test "x$LIBGC_INCDIR" != "x"; then
525 LIBGC_CPPFLAGS="-I$LIBGC_INCDIR"
526 fi
527 if test "x$LIBGC_LIBDIR" != "x"; then
528 LIBGC_LDFLAGS="-L$LIBGC_LIBDIR"
529 if test "$enable_rpath" = "yes"; then
530 if (echo "$ECL_LDRPATH" | grep '~A') > /dev/null; then
531 LIBGC_LDFLAGS=`echo $ECL_LDRPATH | sed "s,~A,$LIBGC_LIBDIR,"`" $LIBGC_LDFLAGS"
532 fi
533 fi
534 fi
535 CPPFLAGS="$CPPFLAGS $LIBGC_CPPFLAGS"
536 LDFLAGS="$LDFLAGS $LIBGC_LDFLAGS"
537
538 dnl =====================================================================
539 dnl Checks for libraries
540
541 AC_CHECK_LIB(sun, getpwnam) # on IRIX adds -lsun
542 AC_SEARCH_LIBS([strerror],[cposix])
543
544 dnl ----------------------------------------------------------------------
545 dnl Profiling & debug flags
546 dnl
547 if test "$with_debug_cflags" = "yes"; then
548 with_debug_cflags="-g"
549 fi
550 if test "$with_debug_cflags" != "no"; then
551 DEBUG_CFLAGS="$with_debug_cflags"
552 CFLAGS="$with_debug_cflags $CFLAGS"
553 CXXFLAGS="$with_debug_cflags $CXXFLAGS"
554 LDFLAGS="$with_debug_cflags $LDFLAGS"
555 fi
556 if test "$with_profile_cflags" = "yes"; then
557 with_profile_cflags="-pg"
558 fi
559 if test "$with_profile_cflags" != "no"; then
560 CFLAGS="$with_profile_cflags $CFLAGS"
561 CXXFLAGS="$with_profile_cflags $CFLAGS"
562 LDFLAGS="$with_profile_cflags $LDFLAGS"
563 fi
564
565 dnl ----------------------------------------------------------------------
566 dnl Version of the compiler
567 ECL_CMPDIR=cmp
568 AC_SUBST(ECL_CMPDIR)
569
570 dnl ----------------------------------------------------------------------
571 dnl Native thread support
572 if test "${enable_threads}" = "auto"; then
573 AC_MSG_CHECKING([for threads support])
574 if test -z "${THREAD_OBJ}"; then
575 AC_MSG_RESULT([no])
576 enable_threads="no"
577 else
578 AC_MSG_RESULT([yes])
579 enable_threads="yes"
580 fi
581 fi
582 if test "${enable_threads}" = "yes" ; then
583 if test -z "${THREAD_OBJ}"; then
584 AC_MSG_ERROR([Threads aren't supported on this system.])
585 else
586 LIBS="${THREAD_LIBS} ${LIBS}"
587 CFLAGS="${CFLAGS} ${THREAD_CFLAGS}"
588 ECL_PTHREAD_EXTENSIONS
589 boehm_configure_flags="${boehm_configure_flags} ${THREAD_GC_FLAGS}"
590 for k in $THREAD_OBJ; do EXTRA_OBJS="$EXTRA_OBJS ${k}.${OBJEXT}"; done
591 AC_MSG_CHECKING([for thread object files])
592 AC_MSG_RESULT([${THREAD_OBJ}])
593 AC_DEFINE( [ECL_THREADS], [1], [Userland threads?])
594 fi
595 ECL_ADD_FEATURE(threads)
596 ECL_ADD_FEATURE(ecl-read-write-lock)
597 else
598 boehm_configure_flags="${boehm_configure_flags} --disable-threads"
599 fi
600
601 dnl ----------------------------------------------------------------------
602 dnl Boehm-Weiser garbage collector
603 if test ${enable_boehm} = "no" ; then
604 AC_MSG_ERROR([Boehm GC library is currently needed to build ECL]);
605 EXTRA_OBJS="${EXTRA_OBJS} alloc.${OBJEXT} gbc.${OBJEXT}"
606 enable_smallcons="no"
607 else
608 ECL_BOEHM_GC
609 ECL_ADD_FEATURE(boehm-gc)
610 ECL_ADD_FEATURE(ecl-weak-hash)
611 fi
612 if test ${enable_smallcons} = "yes" ; then
613 AC_DEFINE([ECL_SMALL_CONS], [], [ECL_SMALL_CONS])
614 fi
615
616 ECL_LIBFFI
617
618 dnl ----------------------------------------------------------------------
619 dnl SONAME is only active when SONAME_LDFLAGS and SONAME are non nil
620 dnl
621 AC_MSG_CHECKING(for soname flags)
622 PACKAGE_MAJOR=`echo ${PACKAGE_VERSION} | sed -e 's,\(.*\)\..*\..*,\1,g'`
623 PACKAGE_MINOR=`echo ${PACKAGE_VERSION} | sed -e 's,.*\.\(.*\)\..*,\1,g'`
624 PACKAGE_LEAST=`echo ${PACKAGE_VERSION} | sed -e 's,.*\..*\.\(.*\),\1,g'`
625 if test "${enable_soname}" != yes; then
626 SONAME=''
627 SONAME1=''
628 SONAME2=''
629 SONAME3=''
630 SONAME_ALIASES=''
631 SONAME_LDFLAGS=''
632 AC_MSG_RESULT([none])
633 else
634 i="${PACKAGE_MAJOR}.${PACKAGE_MINOR}.${PACKAGE_LEAST}"
635 SONAME3=`echo $SONAME | sed "s,.SOVERSION,.$i,g"`
636 i="${PACKAGE_MAJOR}.${PACKAGE_MINOR}"
637 SONAME2=`echo $SONAME | sed "s,.SOVERSION,.$i,g"`
638 i="${PACKAGE_MAJOR}"
639 SONAME1=`echo $SONAME | sed "s,.SOVERSION,.$i,g"`
640 SONAME=`echo $SONAME | sed "s,.SOVERSION,,g"`
641 SONAME_LDFLAGS=`echo $SONAME_LDFLAGS | sed "s,SONAME,$SONAME2,g"`
642 AC_MSG_RESULT([${SONAME_LDFLAGS}])
643 fi
644 AC_SUBST(SONAME3)
645 AC_SUBST(SONAME2)
646 AC_SUBST(SONAME1)
647 AC_SUBST(SONAME)
648 AC_SUBST(SONAME_LDFLAGS)
649
650 dnl Related to that, the package version number
651 ECL_VERSION_NUMBER=$(($PACKAGE_MAJOR * 10000 + $PACKAGE_MINOR * 100 + $PACKAGE_LEAST))
652 AC_SUBST(ECL_VERSION_NUMBER)
653
654 dnl ----------------------------------------------------------------------
655 dnl Deactivate floating point exceptions if asked to
656 if test "${with_ieee_fp}" = yes; then
657 with_signed_zero="yes"
658 AC_DEFINE([ECL_IEEE_FP], [], [ECL_IEEE_FP])
659 ECL_ADD_FEATURE(ieee-floating-point)
660 fi
661 if test "${with_fpe}" != yes; then
662 AC_DEFINE([ECL_AVOID_FPE_H], [], [ECL_AVOID_FPE_H])
663 fi
664 if test "${with_signed_zero}" = yes; then
665 AC_DEFINE([ECL_SIGNED_ZERO], [], [ECL_SIGNED_ZERO])
666 fi
667 if test "${with_ieee_fp}" != yes -o "${with_fpe}" = yes; then
668 ECL_ADD_FEATURE(floating-point-exceptions)
669 fi
670
671 dnl =====================================================================
672 dnl Checks for header files
673
674 dnl !!! autoscan
675 AC_PATH_X
676 AC_HEADER_DIRENT
677 AC_HEADER_STDBOOL
678 AC_HEADER_STDC
679 AC_HEADER_TIME
680 AC_CHECK_HEADERS( [fcntl.h limits.h netdb.h netinet/in.h] \
681 [stddef.h stdlib.h string.h sys/param.h] \
682 [sys/socket.h sys/time.h unistd.h fenv.h] \
683 [sched.h] )
684 dnl !!! end autoscan
685
686 AC_CHECK_HEADERS( [sys/utsname.h float.h pwd.h dlfcn.h link.h] \
687 [mach-o/dyld.h dirent.h sys/ioctl.h sys/select.h] \
688 [sys/wait.h] )
689
690
691 AC_CHECK_HEADERS([ulimit.h], [], [],
692 [[#ifdef HAVE_ULIMIT_H
693 # include <ulimit.h>
694 #endif
695 ]])
696
697 dnl =====================================================================
698 dnl Checks for typedefs, structures, and compiler characteristics.
699
700 dnl !!! autoscan
701 AC_C_CONST dnl !!! DNLed
702 AC_C_INLINE
703 AC_TYPE_SIZE_T dnl !!! DNLed
704 AC_STRUCT_TM
705 AC_C_VOLATILE
706 AC_CHECK_TYPES([ptrdiff_t])
707 ECL_LONG_LONG
708 dnl !!! end autoscan
709
710 dnl !!! dnled in original
711 dnl AC_TYPE_PID_T # DEFS pid_t
712 dnl AC_TYPE_UID_T # DEFS uid_t, gid_t
713 dnl AC_TYPE_OFF_T # DEFS off_t
714 dnl AC_C_CHAR_UNSIGNED # DEFS __CHAR_UNSIGNED__ if char is unsigned
715 dnl !!! end dnled
716
717 AC_C_BIGENDIAN([ECL_ADD_FEATURE(big-endian)], [ECL_ADD_FEATURE(little-endian)],
718 [AC_DEFINE(WORDS_BIGENDIAN, [/* EDIT! - Undefine if small endian */])])
719
720 dnl ----------------------------------------------------------------------
721 dnl This flag is an optimization for GNU
722 dnl if test "${GCC}" = "yes"; then
723 dnl CFLAGS="${CFLAGS} -fstrict-aliasing"
724 dnl fi
725
726 dnl ----------------------------------------------------------------------
727 dnl Check the appropriate type for cl_fixnum/cl_index
728 ECL_FIXNUM_TYPE
729 ECL_INTEGER_TYPES
730
731 ECL_LINEFEED_MODE
732 ECL_FIND_SETJMP
733 ECL_FILE_STRUCTURE
734 ECL_FPE_MODEL
735 ECL_SSE
736 ECL_COMPLEX_C99
737
738 dnl -----------------------------------------------------------------------
739 dnl Stack size and growth direction
740 ECL_STACK_DIRECTION
741 ECL_STACK_SIZE
742
743 dnl =====================================================================
744 dnl Checks for library functions
745
746 dnl !!! autoscan
747 AC_FUNC_CLOSEDIR_VOID
748 AC_FUNC_ERROR_AT_LINE
749 AC_FUNC_FORK
750 AC_PROG_GCC_TRADITIONAL
751 AC_FUNC_MALLOC
752 AC_FUNC_MEMCMP
753 AC_FUNC_MMAP
754 AC_FUNC_REALLOC
755 AC_FUNC_SELECT_ARGTYPES
756 AC_TYPE_SIGNAL
757 AC_FUNC_STAT
758 AC_FUNC_STRTOD
759 AC_CHECK_FUNCS( [floor getcwd gethostbyaddr gethostbyname getpagesize] \
760 [memmove memset mkdir putenv socket sqrt] \
761 [strcasecmp strchr strerror strtol] )
762 dnl !!! end autoscan
763
764 AC_CHECK_FUNCS( [nanosleep alarm times select setenv putenv] \
765 [lstat mkstemp sigprocmask isatty tzset] \
766 [gettimeofday getrusage system clock_gettime] )
767
768 AC_CHECK_FUNCS( [expf powf logf sqrtf cosf sinf tanf sinhf coshf tanhf] \
769 [floorf ceilf fabsf frexpf ldexpf log1p log1pf log1pl] \
770 [copysign] )
771
772 AC_CHECK_FUNCS( [sched_yield uname fseeko dladdr backtrace backtrace_symbols] )
773
774 AC_CHECK_HEADER( [sys/mman.h],
775 AC_DEFINE([ECL_USE_MPROTECT], [], [ECL_USE_MPROTECT])
776 AC_DEFINE([HAVE_SYS_MMAN_H], [], [HAVE_SYS_MMAN_H])
777 )
778
779 ECL_POSIX_ENVIRON
780
781 ECL_FLOATING_POINT_EXCEPTIONS
782
783 dnl =====================================================================
784 dnl Checks for system services
785
786 dnl =====================================================================
787 dnl Final pass over configuration files
788 dnl
789 dnl Notice that we build ${builddir}/ecl/configpre.h from
790 dnl ${srcdir}/ecl/config.h.in, and then use all AC_DEF* to build
791 dnl ecl/config.h from ecl/configpre.h
792
793 dnl ----------------------------------------------------------------------
794 dnl Do we use C or C++ compiler to compile ecl?
795 if test ${with_cxx} = "no" ; then
796 AC_SUBST([ECL_CC], [${CC}])
797 else
798 AC_SUBST([ECL_CC], [${CXX}])
799 AC_DEFINE([ECL_CXX_CORE], [1],
800 [Do we use C or C++ compiler to compile ecl?])
801 boehm_configure_flags="${boehm_configure_flags} --enable-cplusplus"
802 ECL_ADD_FEATURE(cxx-core)
803 fi
804
805 ECL_LIBATOMIC_OPS
806
807 dnl ----------------------------------------------------------------------
808 dnl Lisp library and libecl features
809 if test ${enable_shared} = "yes"; then
810 AC_DEFINE(ENABLE_DLOPEN, [1], [Allow loading dynamically linked code])
811 LSP_LIBRARIES="${SHAREDPREFIX}ecl.${SHAREDEXT}"
812 ECL_ADD_LISP_MODULE([dlopen])
813 ECL_ADD_FEATURE(dlopen)
814 else
815 enable_soname=no
816 LSP_LIBRARIES="${LIBPREFIX}ecl.${LIBEXT}"
817 ECL_LDRPATH=''
818 fi
819
820 if test "x${enable_rpath}" = "xno"; then
821 ECL_LDRPATH=''
822 fi
823
824 if test "${with_cmuformat}" = "yes"; then
825 with_clos_streams="yes"
826 AC_DEFINE([ECL_CMU_FORMAT], [1], [Use CMU Common-Lisp's FORMAT routine])
827 ECL_ADD_FEATURE(cmu-format)
828 fi
829
830 if test "${with_clos_streams}" = "yes"; then
831 AC_DEFINE( ECL_CLOS_STREAMS, [1],
832 [Allow STREAM operations to work on arbitrary objects])
833 ECL_ADD_FEATURE(clos-streams)
834 fi
835
836 if test "${with_cmp}" = "builtin"; then
837 ECL_ADD_BUILTIN_MODULE([cmp])
838 with_cmp=yes
839 fi
840 if test "${with_cmp}" = "yes"; then
841 ECL_ADD_LISP_MODULE([cmp])
842 fi
843
844 if test "${with_tcp}" = "builtin"; then
845 ECL_ADD_BUILTIN_MODULE([sockets])
846 with_tcp=yes
847 fi
848 if test "${with_tcp}" = "yes"; then
849 AC_DEFINE(ECL_TCP, [1], [Network streams])
850 EXTRA_OBJS="${EXTRA_OBJS} tcp.${OBJEXT}"
851 ECL_ADD_LISP_MODULE([sockets])
852 LIBS="${LIBS} ${TCPLIBS}"
853 fi
854
855 if test "${with_serve_event}" = "builtin"; then
856 ECL_ADD_BUILTIN_MODULE([serve_event])
857 with_serve_event=yes
858 fi
859 if test "${with_serve_event}" = "yes"; then
860 case "${host_os}" in
861 mingw*|cygwin*) ;;
862 *)
863 ECL_ADD_LISP_MODULE([serve-event])
864 ;;
865 esac
866 fi
867
868 if test "${with_asdf}" = "builtin"; then
869 ECL_ADD_BUILTIN_MODULE([asdf])
870 with_asdf=yes
871 fi
872 if test "${with_asdf}" = "yes"; then
873 ECL_ADD_LISP_MODULE([asdf])
874 fi
875
876 if test "${with_defsystem}" = "builtin"; then
877 ECL_ADD_BUILTIN_MODULE([defsystem])
878 with_defsystem=yes
879 fi
880 if test "${with_defsystem}" = "yes"; then
881 ECL_ADD_LISP_MODULE([defsystem])
882 fi
883
884 if test "${with_profile}" = "builtin"; then
885 ECL_ADD_BUILTIN_MODULE([profile])
886 with_profile=yes
887 fi
888 if test "${with_profile}" = "yes"; then
889 if test "${enable_boehm}" != "no"; then
890 ECL_ADD_LISP_MODULE([profile])
891 fi
892 fi
893
894 if test "${with_bytecmp}" = "builtin"; then
895 ECL_ADD_BUILTIN_MODULE([bytecmp])
896 with_bytecmp=yes
897 fi
898 if test "${with_bytecmp}" = "yes"; then
899 ECL_ADD_LISP_MODULE([bytecmp])
900 fi
901
902 if test "${with_rt}" = "builtin"; then
903 ECL_ADD_BUILTIN_MODULE([rt])
904 with_rt=yes
905 fi
906 if test "${with_rt}" = "yes"; then
907 ECL_ADD_LISP_MODULE([rt])
908 fi
909
910 if test "x${enable_unicode}" != "xno"; then
911 if test "${enable_unicode}" = 16; then
912 AC_DEFINE([ECL_UNICODE], [16], [Support for Unicode])
913 CHAR_CODE_LIMIT=65536
914 ECL_CHARACTER=$ECL_INT16_T
915 EXTRA_OBJS="$EXTRA_OBJS unicode/ucd16.o unicode/ucd16-0000.o unicode/ucd16-0016.o unicode/ucd16-0032.o unicode/ucd16-0048.o unicode/ucd16-0064.o"
916 else
917 AC_DEFINE([ECL_UNICODE], [21], [Support for Unicode])
918 CHAR_CODE_LIMIT=1114112
919 ECL_CHARACTER=$ECL_INT32_T
920 EXTRA_OBJS="$EXTRA_OBJS unicode/ucd.o unicode/ucd-0000.o unicode/ucd-0016.o unicode/ucd-0032.o unicode/ucd-0048.o unicode/ucd-0064.o unicode/ucd-0080.o unicode/ucd-0096.o unicode/ucd-0112.o unicode/ucd-0128.o unicode/ucd-0144.o"
921 fi
922 AC_DEFINE([ECL_UNICODE_NAMES], [1], [Link in the database of Unicode names])
923 EXTRA_OBJS="$EXTRA_OBJS unicode/ucd_names_char.o unicode/ucd_names_codes.o unicode/ucd_names_pair.o unicode/ucd_names_str.o"
924 AC_CHECK_HEADERS([wchar.h])
925 ECL_ADD_FEATURE(unicode)
926 else
927 CHAR_CODE_LIMIT=256
928 ECL_CHARACTER="int"
929 fi
930 AC_SUBST(ECL_CHARACTER)
931 AC_SUBST(CHAR_CODE_LIMIT)
932
933 AC_SUBST(ECL_EXTRA_LISP_FILES)
934 ECL_EXTRA_LISP_FILES=""
935 for i in $with_extra_files; do
936 ECL_EXTRA_LISP_FILES="${ECL_EXTRA_LISP_FILES} \"$i\""
937 done
938 AC_SUBST(ECL_INIT_FORM)
939 echo ${with_init_form} = init form
940 if test "x${with_init_form}" = "x"; then
941 ECL_INIT_FORM='(SI::TOP-LEVEL T)'
942 else
943 ECL_INIT_FORM="${with_init_form}"
944 fi
945
946 ECL_ADD_FEATURE(${ARCHITECTURE})
947
948 AC_CONFIG_FILES([
949 bare.lsp
950 lsp/load.lsp
951 clos/load.lsp
952 cmp/load.lsp
953 ../Makefile
954 Makefile
955 c/Makefile
956 doc/Makefile
957 doc/ecl.man
958 doc/ecl-config.man
959 ecl/configpre.h:h/config.h.in
960 ecl/configpre-int.h:h/config-internal.h.in
961 bin/ecl-config.pre:util/ecl-config
962 lsp/config.lsp:lsp/config.lsp.in
963 compile.pre:compile.lsp.in
964 cmp/cmpdefs.pre:cmp/cmpdefs.lsp
965 tests/config.lsp
966 tests/Makefile
967 c/ecl_features.h
968 ])
969
970 AC_CONFIG_HEADERS([ecl/config.h:ecl/configpre.h])
971 AC_CONFIG_HEADERS([ecl/config-internal.h:ecl/configpre-int.h])
972 AC_OUTPUT
973
974 for i in $srcdir/c/*/; do mkdir -p c/`basename $i`; done