~ubuntu-branches/ubuntu/quantal/libgc/quantal

« back to all changes in this revision

Viewing changes to configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Egger
  • Date: 2011-02-19 12:19:56 UTC
  • mfrom: (1.3.2 upstream) (0.1.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: james.westby@ubuntu.com-20110219121956-67rb69xlt5nud3v2
Tags: 1:7.1-5
Upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (c) 1999-2001 by Red Hat, Inc. All rights reserved.
2
 
3
 
# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
4
 
# OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
5
 
6
 
# Permission is hereby granted to use or copy this program
7
 
# for any purpose,  provided the above notices are retained on all copies.
8
 
# Permission to modify the code and to distribute modified code is granted,
9
 
# provided the above notices are retained, and a notice that the code was
10
 
# modified is included with the above copyright notice.
11
 
#
12
 
# Original author: Tom Tromey
13
 
# Modified by: Grzegorz Jakacki <jakacki at acm dot org>
14
 
 
15
 
dnl Process this file with autoconf to produce configure.
16
 
 
17
 
# Initialization
18
 
# ==============
19
 
 
20
 
AC_INIT(gc,6.8,Hans.Boehm@hp.com) 
21
 
    ## version must conform to [0-9]+[.][0-9]+(alpha[0-9]+)?
22
 
AC_CONFIG_SRCDIR(gcj_mlc.c)
23
 
AC_CANONICAL_TARGET 
24
 
AC_PREREQ(2.53)
25
 
AC_REVISION($Revision: 1.2 $)
26
 
GC_SET_VERSION
27
 
AM_INIT_AUTOMAKE
28
 
 
29
 
AC_SUBST(PACKAGE)
30
 
AC_SUBST(GC_VERSION)
31
 
 
32
 
AC_PROG_CC
33
 
AC_PROG_CXX
34
 
 
35
 
AM_PROG_AS
36
 
AC_CHECK_TOOL(AR, ar)
37
 
AC_CHECK_TOOL(RANLIB, ranlib, :)  # :)
38
 
 
39
 
AC_PROG_INSTALL
40
 
 
41
 
AM_MAINTAINER_MODE
42
 
 
43
 
. [$]{srcdir}/configure.host
44
 
 
45
 
GC_CFLAGS=${gc_cflags}
46
 
AC_SUBST(GC_CFLAGS)
47
 
 
48
 
AC_ARG_ENABLE(threads, [  --enable-threads=TYPE   choose threading package],
49
 
  THREADS=$enableval,
50
 
  [ AC_MSG_CHECKING([for thread model used by GCC])
51
 
    THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
52
 
    if test -z "$THREADS"; then
53
 
      THREADS=no
54
 
    fi
55
 
    AC_MSG_RESULT([$THREADS])])
56
 
 
57
 
AC_ARG_ENABLE(parallel-mark,
58
 
[  --enable-parallel-mark       parallelize marking and free list construction],
59
 
   [case "$THREADS" in
60
 
      no | none | single)
61
 
        AC_MSG_ERROR([Parallel mark requires --enable-threads=x spec])
62
 
        ;;
63
 
    esac]
64
 
)
65
 
 
66
 
AC_ARG_ENABLE(cplusplus,
67
 
[  --enable-cplusplus           install C++ support],
68
 
)
69
 
 
70
 
INCLUDES=-I${srcdir}/include
71
 
THREADDLLIBS=
72
 
## Libraries needed to support dynamic loading and/or threads.
73
 
case "$THREADS" in
74
 
 no | none | single)
75
 
    THREADS=none
76
 
    ;;
77
 
 posix | pthreads)
78
 
    THREADS=posix
79
 
    THREADDLLIBS=-lpthread
80
 
    case "$host" in
81
 
     *-*-linux*)
82
 
        AC_DEFINE(GC_LINUX_THREADS)
83
 
        AC_DEFINE(_REENTRANT)
84
 
        if test "${enable_parallel_mark}" = yes; then
85
 
          AC_DEFINE(PARALLEL_MARK)
86
 
        fi
87
 
        AC_DEFINE(THREAD_LOCAL_ALLOC)
88
 
        ;;
89
 
     *-*-aix*)
90
 
        AC_DEFINE(GC_AIX_THREADS)
91
 
        AC_DEFINE(_REENTRANT)
92
 
        ;;
93
 
     *-*-hpux11*)
94
 
        AC_MSG_WARN("Only HP-UX 11 POSIX threads are supported.")
95
 
        AC_DEFINE(GC_HPUX_THREADS)
96
 
        AC_DEFINE(_POSIX_C_SOURCE,199506L)
97
 
        if test "${enable_parallel_mark}" = yes; then
98
 
          AC_DEFINE(PARALLEL_MARK)
99
 
        fi
100
 
        AC_DEFINE(THREAD_LOCAL_ALLOC)
101
 
        THREADDLLIBS="-lpthread -lrt"
102
 
        # HPUX needs REENTRANT for the _r calls.
103
 
        AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads])
104
 
        ;;
105
 
     *-*-hpux10*)
106
 
        AC_MSG_WARN("Only HP-UX 11 POSIX threads are supported.")
107
 
        ;;
108
 
     *-*-freebsd*)
109
 
        AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
110
 
        AC_DEFINE(GC_FREEBSD_THREADS)
111
 
        INCLUDES="$INCLUDES -pthread"
112
 
        THREADDLLIBS=-pthread
113
 
        ;;
114
 
     *-*-kfreebsd*-gnu)
115
 
        AC_DEFINE(GC_FREEBSD_THREADS)
116
 
        INCLUDES="$INCLUDES -pthread"
117
 
        THREADDLLIBS=-pthread
118
 
        AC_DEFINE(_REENTRANT)
119
 
        if test "${enable_parallel_mark}" = yes; then
120
 
          AC_DEFINE(PARALLEL_MARK)
121
 
        fi
122
 
        AC_DEFINE(THREAD_LOCAL_ALLOC)
123
 
        AC_DEFINE(USE_COMPILER_TLS)
124
 
        ;;
125
 
     *-*-netbsd*)
126
 
        AC_MSG_WARN("Only on NetBSD 2.0 or later.")
127
 
        AC_DEFINE(GC_NETBSD_THREADS)
128
 
        AC_DEFINE(_REENTRANT)
129
 
        AC_DEFINE(_PTHREADS)
130
 
        THREADDLLIBS="-lpthread -lrt"
131
 
        ;;
132
 
     *-*-solaris*)
133
 
        AC_DEFINE(GC_SOLARIS_THREADS)
134
 
        AC_DEFINE(GC_SOLARIS_PTHREADS)
135
 
        ;;
136
 
     *-*-irix*)
137
 
        AC_DEFINE(GC_IRIX_THREADS)
138
 
        ;;
139
 
     *-*-cygwin*)
140
 
        AC_DEFINE(GC_WIN32_THREADS)
141
 
        ;;
142
 
     *-*-darwin*)
143
 
        AC_DEFINE(GC_DARWIN_THREADS)
144
 
        AC_DEFINE(THREAD_LOCAL_ALLOC)
145
 
        if test "${enable_parallel_mark}" = yes; then
146
 
          AC_DEFINE(PARALLEL_MARK)
147
 
        fi
148
 
        ;;
149
 
     *-*-osf*)
150
 
        AC_DEFINE(GC_OSF1_THREADS)
151
 
        if test "${enable_parallel_mark}" = yes; then
152
 
          AC_DEFINE(PARALLEL_MARK)
153
 
          AC_DEFINE(THREAD_LOCAL_ALLOC)
154
 
          # May want to enable it in other cases, too.
155
 
          # Measurements havent yet been done.
156
 
        fi
157
 
        INCLUDES="$INCLUDES -pthread"
158
 
        THREADDLLIBS="-lpthread -lrt"
159
 
        ;;
160
 
      *)
161
 
        AC_MSG_ERROR("Pthreads not supported by the GC on this platform.")
162
 
        ;;
163
 
    esac
164
 
    ;;
165
 
 win32)
166
 
    AC_DEFINE(GC_WIN32_THREADS)
167
 
    dnl Wine getenv may not return NULL for missing entry
168
 
    AC_DEFINE(NO_GETENV)
169
 
    ;;
170
 
 dgux386)
171
 
    THREADS=dgux386
172
 
    AC_MSG_RESULT($THREADDLLIBS)
173
 
    # Use pthread GCC  switch
174
 
    THREADDLLIBS=-pthread
175
 
    if test "${enable_parallel_mark}" = yes; then
176
 
        AC_DEFINE(PARALLEL_MARK)
177
 
    fi
178
 
    AC_DEFINE(THREAD_LOCAL_ALLOC)
179
 
    AC_DEFINE(GC_DGUX386_THREADS)
180
 
    AC_DEFINE(DGUX_THREADS)
181
 
    # Enable _POSIX4A_DRAFT10_SOURCE with flag -pthread
182
 
    INCLUDES="-pthread $INCLUDES"
183
 
    ;;
184
 
 aix)
185
 
    THREADS=posix
186
 
    THREADDLLIBS=-lpthread
187
 
    AC_DEFINE(GC_AIX_THREADS)
188
 
    AC_DEFINE(_REENTRANT)
189
 
    ;;
190
 
 decosf1 | irix | mach | os2 | solaris | dce | vxworks)
191
 
    AC_MSG_ERROR(thread package $THREADS not yet supported)
192
 
    ;;
193
 
 *)
194
 
    AC_MSG_ERROR($THREADS is an unknown thread package)
195
 
    ;;
196
 
esac
197
 
AC_SUBST(THREADDLLIBS)
198
 
 
199
 
case "$host" in 
200
 
   powerpc-*-darwin*)
201
 
      powerpc_darwin=true
202
 
      ;;
203
 
esac
204
 
AM_CONDITIONAL(POWERPC_DARWIN,test x$powerpc_darwin = xtrue)
205
 
 
206
 
AC_MSG_CHECKING(for xlc)
207
 
AC_TRY_COMPILE([],[
208
 
 #ifndef __xlC__
209
 
 # error
210
 
 #endif
211
 
], [compiler_xlc=yes], [compiler_xlc=no])
212
 
AC_MSG_RESULT($compiler_xlc)
213
 
AM_CONDITIONAL(COMPILER_XLC,test $compiler_xlc = yes)
214
 
if test $compiler_xlc = yes -a "$powerpc_darwin" = true; then
215
 
  # the darwin stack-frame-walking code is completely broken on xlc
216
 
  AC_DEFINE(DARWIN_DONT_PARSE_STACK)
217
 
fi
218
 
 
219
 
# We never want libdl on darwin. It is a fake libdl that just ends up making
220
 
# dyld calls anyway
221
 
case "$host" in
222
 
  *-*-darwin*) ;;
223
 
  *) 
224
 
    AC_CHECK_LIB(dl, dlopen, THREADDLLIBS="$THREADDLLIBS -ldl")
225
 
    ;;
226
 
esac
227
 
 
228
 
AC_SUBST(EXTRA_TEST_LIBS)
229
 
 
230
 
target_all=libgc.la
231
 
AC_SUBST(target_all)
232
 
 
233
 
dnl If the target is an eCos system, use the appropriate eCos
234
 
dnl I/O routines.
235
 
dnl FIXME: this should not be a local option but a global target
236
 
dnl system; at present there is no eCos target.
237
 
TARGET_ECOS="no"
238
 
AC_ARG_WITH(ecos,
239
 
[  --with-ecos             enable runtime eCos target support],
240
 
TARGET_ECOS="$with_ecos"
241
 
)
242
 
 
243
 
addobjs=
244
 
addlibs=
245
 
addincludes=
246
 
addtests=
247
 
CXXINCLUDES=
248
 
case "$TARGET_ECOS" in
249
 
   no)
250
 
      ;;
251
 
   *)
252
 
      AC_DEFINE(ECOS)
253
 
      CXXINCLUDES="-I${TARGET_ECOS}/include"
254
 
      addobjs="$addobjs ecos.lo"
255
 
      ;;
256
 
esac
257
 
 
258
 
if test "${enable_cplusplus}" = yes; then
259
 
      addincludes="$addincludes include/gc_cpp.h include/gc_allocator.h"
260
 
      addtests="$addtests test_cpp"
261
 
fi
262
 
 
263
 
AM_CONDITIONAL(CPLUSPLUS, test "${enable_cplusplus}" = yes)
264
 
 
265
 
AC_SUBST(CXX)
266
 
 
267
 
AC_SUBST(INCLUDES)
268
 
AC_SUBST(CXXINCLUDES)
269
 
 
270
 
# Configuration of shared libraries
271
 
#
272
 
AC_MSG_CHECKING(whether to build shared libraries)
273
 
AC_ENABLE_SHARED
274
 
 
275
 
case "$host" in
276
 
 alpha-*-openbsd*)
277
 
     enable_shared=no
278
 
     AC_MSG_RESULT(no)
279
 
     ;;
280
 
 *)
281
 
     AC_MSG_RESULT(yes)
282
 
     ;;
283
 
esac
284
 
 
285
 
# Configuration of machine-dependent code
286
 
#
287
 
AC_MSG_CHECKING(which machine-dependent code should be used) 
288
 
machdep=
289
 
case "$host" in
290
 
 alpha-*-openbsd*)
291
 
    machdep="alpha_mach_dep.lo"
292
 
    if test x"${ac_cv_lib_dl_dlopen}" != xyes ; then
293
 
       AC_MSG_WARN(OpenBSD/Alpha without dlopen(). Shared library support is disabled)
294
 
    fi
295
 
    ;;
296
 
 alpha*-*-linux*)
297
 
    machdep="alpha_mach_dep.lo"
298
 
    ;;
299
 
 i?86-*-solaris2.[[89]] | i?86-*-solaris2.1?)
300
 
    AC_DEFINE(SOLARIS25_PROC_VDB_BUG_FIXED)
301
 
    ;;
302
 
 mipstx39-*-elf*)
303
 
    machdep="mips_ultrix_mach_dep.lo"
304
 
    AC_DEFINE(STACKBASE, __stackbase)
305
 
    AC_DEFINE(DATASTART_IS_ETEXT)
306
 
    ;;
307
 
 mips-dec-ultrix*)
308
 
    machdep="mips_ultrix_mach-dep.lo"
309
 
    ;;
310
 
 mips-nec-sysv*|mips-unknown-sysv*)
311
 
    ;;
312
 
 mips*-*-linux*) 
313
 
    ;; 
314
 
 mips-*-*)
315
 
    machdep="mips_sgi_mach_dep.lo"
316
 
    AC_DEFINE(NO_EXECUTE_PERMISSION)
317
 
    ;;
318
 
 sparc-*-netbsd*)
319
 
    machdep="sparc_netbsd_mach_dep.lo"
320
 
    ;;
321
 
 sparc-sun-solaris2.3)
322
 
    machdep="sparc_mach_dep.lo"
323
 
    AC_DEFINE(SUNOS53_SHARED_LIB)
324
 
    ;;
325
 
 sparc*-sun-solaris2.*)
326
 
    machdep="sparc_mach_dep.lo"
327
 
    ;;
328
 
 ia64-*-*)
329
 
    machdep="mach_dep.lo ia64_save_regs_in_stack.lo"
330
 
    ;;
331
 
esac
332
 
if test x"$machdep" = x; then
333
 
AC_MSG_RESULT($machdep)
334
 
   machdep="mach_dep.lo"
335
 
fi
336
 
addobjs="$addobjs $machdep"
337
 
AC_SUBST(addobjs)
338
 
AC_SUBST(addincludes)
339
 
AC_SUBST(addlibs)
340
 
AC_SUBST(addtests)
341
 
 
342
 
AC_PROG_LIBTOOL
343
 
 
344
 
#
345
 
# Check for AViiON Machines running DGUX
346
 
#
347
 
ac_is_dgux=no
348
 
AC_CHECK_HEADER(sys/dg_sys_info.h,
349
 
[ac_is_dgux=yes;])
350
 
 
351
 
    ## :GOTCHA: we do not check anything but sys/dg_sys_info.h
352
 
if test $ac_is_dgux = yes; then
353
 
    if test "$enable_full_debug" = "yes"; then
354
 
      CFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
355
 
      CXXFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
356
 
    else
357
 
      CFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
358
 
      CXXFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
359
 
    fi
360
 
    AC_SUBST(CFLAGS)
361
 
    AC_SUBST(CXXFLAGS)
362
 
fi
363
 
 
364
 
dnl We use these options to decide which functions to include.
365
 
AC_ARG_WITH(target-subdir,
366
 
[  --with-target-subdir=SUBDIR
367
 
                          configuring with a cross compiler])
368
 
AC_ARG_WITH(cross-host,
369
 
[  --with-cross-host=HOST  configuring with a cross compiler])
370
 
 
371
 
# automake wants to see AC_EXEEXT.  But we don't need it.  And having
372
 
# it is actually a problem, because the compiler we're passed can't
373
 
# necessarily do a full link.  So we fool automake here.
374
 
if false; then
375
 
  # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
376
 
  # to nothing, so nothing would remain between `then' and `fi' if it
377
 
  # were not for the `:' below.
378
 
  :
379
 
  AC_EXEEXT
380
 
fi
381
 
 
382
 
dnl As of 4.13a2, the collector will not properly work on Solaris when
383
 
dnl built with gcc and -O.  So we remove -O in the appropriate case.
384
 
dnl Not needed anymore on Solaris.
385
 
AC_MSG_CHECKING(whether Solaris gcc optimization fix is necessary)
386
 
case "$host" in
387
 
 *aix*)
388
 
    if test "$GCC" = yes; then
389
 
       AC_MSG_RESULT(yes)
390
 
       new_CFLAGS=
391
 
       for i in $CFLAGS; do
392
 
          case "$i" in
393
 
           -O*)
394
 
              ;;
395
 
           *)
396
 
              new_CFLAGS="$new_CFLAGS $i"
397
 
              ;;
398
 
          esac
399
 
       done
400
 
       CFLAGS="$new_CFLAGS"
401
 
    else
402
 
       AC_MSG_RESULT(no)
403
 
    fi
404
 
    ;;
405
 
 *) AC_MSG_RESULT(no) ;;
406
 
esac
407
 
 
408
 
dnl We need to override the top-level CFLAGS.  This is how we do it.
409
 
MY_CFLAGS="$CFLAGS"
410
 
AC_SUBST(MY_CFLAGS)
411
 
 
412
 
dnl Include defines that have become de facto standard.
413
 
dnl ALL_INTERIOR_POINTERS can be overridden in startup code.
414
 
AC_DEFINE(SILENT)
415
 
AC_DEFINE(NO_SIGNALS)
416
 
AC_DEFINE(NO_EXECUTE_PERMISSION)
417
 
AC_DEFINE(ALL_INTERIOR_POINTERS)
418
 
 
419
 
dnl By default, make the library as general as possible.
420
 
AC_DEFINE(JAVA_FINALIZATION)
421
 
AC_DEFINE(GC_GCJ_SUPPORT)
422
 
AC_DEFINE(ATOMIC_UNCOLLECTABLE)
423
 
 
424
 
dnl This is something of a hack.  When cross-compiling we turn off
425
 
dnl some functionality.  We also enable the "small" configuration.
426
 
dnl These is only correct when targetting an embedded system.  FIXME.
427
 
if test -n "${with_cross_host}"; then
428
 
   AC_DEFINE(NO_SIGSET)
429
 
   AC_DEFINE(NO_CLOCK)
430
 
   AC_DEFINE(SMALL_CONFIG)
431
 
   AC_DEFINE(NO_DEBUGGING)
432
 
fi
433
 
 
434
 
UNWINDLIBS=
435
 
AC_ARG_ENABLE(full-debug,
436
 
[  --enable-full-debug  include full support for pointer backtracing etc.],
437
 
[ if test "$enable_full_debug" = "yes"; then
438
 
    AC_MSG_WARN("Should define GC_DEBUG and use debug alloc. in clients.")
439
 
    AC_DEFINE(KEEP_BACK_PTRS)
440
 
    AC_DEFINE(DBG_HDRS_ALL)
441
 
    case $host in
442
 
      ia64-*-linux* )
443
 
        AC_DEFINE(MAKE_BACK_GRAPH)
444
 
        AC_DEFINE(SAVE_CALL_COUNT, 8)
445
 
        AC_CHECK_LIB(unwind, backtrace, [
446
 
          AC_DEFINE(GC_HAVE_BUILTIN_BACKTRACE)
447
 
          UNWINDLIBS=-lunwind
448
 
          AC_MSG_WARN("Client code may need to link against libunwind.")
449
 
        ])
450
 
      ;;
451
 
      x86-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* )
452
 
        AC_DEFINE(MAKE_BACK_GRAPH)
453
 
        AC_MSG_WARN("Client must not use -fomit-frame-pointer.")
454
 
        AC_DEFINE(SAVE_CALL_COUNT, 8)
455
 
      ;;
456
 
      i[3456]86-*-dgux*)
457
 
        AC_DEFINE(MAKE_BACK_GRAPH)
458
 
      ;;
459
 
    esac ]
460
 
  fi)
461
 
 
462
 
AC_SUBST(UNWINDLIBS)
463
 
 
464
 
AC_ARG_ENABLE(redirect-malloc,
465
 
[  --enable-redirect-malloc  redirect malloc and friends to GC routines])
466
 
 
467
 
if test "${enable_redirect_malloc}" = yes; then
468
 
    if test "${enable_full_debug}" = yes; then
469
 
        AC_DEFINE(REDIRECT_MALLOC, GC_debug_malloc_replacement)
470
 
        AC_DEFINE(REDIRECT_REALLOC, GC_debug_realloc_replacement)
471
 
        AC_DEFINE(REDIRECT_FREE, GC_debug_free)
472
 
    else
473
 
        AC_DEFINE(REDIRECT_MALLOC, GC_malloc)
474
 
    fi
475
 
fi
476
 
 
477
 
AC_ARG_ENABLE(gc-assertions,
478
 
[  --enable-gc-assertions  collector-internal assertion checking])
479
 
if test "${enable_gc_assertions}" = yes; then
480
 
    AC_DEFINE(GC_ASSERTIONS)
481
 
fi
482
 
 
483
 
AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
484
 
 
485
 
AC_OUTPUT([Makefile doc/Makefile include/Makefile],,
486
 
srcdir=${srcdir}
487
 
host=${host}
488
 
CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
489
 
CC="${CC}"
490
 
DEFS="$DEFS"
491
 
)