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

« back to all changes in this revision

Viewing changes to .pc/04-fix-sparc-ftbfs.diff/configure.ac

  • 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,7.1,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.35 $)
 
26
GC_SET_VERSION
 
27
AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects nostdinc])
 
28
AM_MAINTAINER_MODE
 
29
 
 
30
AC_SUBST(PACKAGE)
 
31
AC_SUBST(GC_VERSION)
 
32
 
 
33
AM_PROG_CC_C_O
 
34
AC_PROG_CXX
 
35
 
 
36
AM_PROG_AS
 
37
## FIXME: really needed? (AC_LIBTOOL already provides this)
 
38
AC_CHECK_TOOL(AR, ar)
 
39
AC_CHECK_TOOL(RANLIB, ranlib, :)  # :)
 
40
 
 
41
AC_PROG_INSTALL
 
42
 
 
43
. ${srcdir}/configure.host
 
44
 
 
45
GC_CFLAGS=${gc_cflags}
 
46
AC_SUBST(GC_CFLAGS)
 
47
 
 
48
AC_ARG_ENABLE(threads,
 
49
  [AC_HELP_STRING([--enable-threads=TYPE], [choose threading package])],
 
50
  THREADS=$enableval,
 
51
  [ AC_MSG_CHECKING([for thread model used by GCC])
 
52
    THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
 
53
    if test -z "$THREADS"; then
 
54
      THREADS=no
 
55
    fi
 
56
    AC_MSG_RESULT([$THREADS]) ])
 
57
 
 
58
AC_ARG_ENABLE(parallel-mark,
 
59
   [AC_HELP_STRING([--enable-parallel-mark],
 
60
        [parallelize marking and free list construction])],
 
61
   [case "$THREADS" in
 
62
      no | none | single)
 
63
        AC_MSG_ERROR([Parallel mark requires --enable-threads=x spec])
 
64
        ;;
 
65
    esac ]
 
66
)
 
67
 
 
68
AC_ARG_ENABLE(cplusplus,
 
69
    [AC_HELP_STRING([--enable-cplusplus], [install C++ support])])
 
70
 
 
71
INCLUDES=-I${srcdir}/include
 
72
THREADDLLIBS=
 
73
need_atomic_ops_asm=false
 
74
## Libraries needed to support dynamic loading and/or threads.
 
75
case "$THREADS" in
 
76
 no | none | single)
 
77
    THREADS=none
 
78
    ;;
 
79
 posix | pthreads)
 
80
    THREADS=posix
 
81
    THREADDLLIBS=-lpthread
 
82
    case "$host" in
 
83
     *-*-linux*)
 
84
        AC_DEFINE(GC_LINUX_THREADS)
 
85
        AC_DEFINE(_REENTRANT)
 
86
        if test "${enable_parallel_mark}" = yes; then
 
87
          AC_DEFINE(PARALLEL_MARK)
 
88
        fi
 
89
        AC_DEFINE(THREAD_LOCAL_ALLOC)
 
90
        AC_MSG_WARN("Explict GC_INIT() calls may be required.");
 
91
        ;;
 
92
     *-*-aix*)
 
93
        AC_DEFINE(GC_AIX_THREADS)
 
94
        AC_DEFINE(_REENTRANT)
 
95
        ;;
 
96
     *-*-hpux11*)
 
97
        AC_MSG_WARN("Only HP/UX 11 POSIX threads are supported.")
 
98
        AC_DEFINE(GC_HPUX_THREADS)
 
99
        AC_DEFINE(_POSIX_C_SOURCE,199506L)
 
100
        if test "${enable_parallel_mark}" = yes; then
 
101
          AC_DEFINE(PARALLEL_MARK)
 
102
        fi
 
103
        AC_DEFINE(THREAD_LOCAL_ALLOC)
 
104
        AC_MSG_WARN("Explict GC_INIT() calls may be required.");
 
105
        THREADDLLIBS="-lpthread -lrt"
 
106
        # HPUX needs REENTRANT for the _r calls.
 
107
        AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads])
 
108
        ;;
 
109
     *-*-hpux10*)
 
110
        AC_MSG_WARN("Only HP-UX 11 POSIX threads are supported.")
 
111
        ;;
 
112
     *-*-freebsd*)
 
113
        AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
 
114
        AC_DEFINE(GC_FREEBSD_THREADS)
 
115
        INCLUDES="$INCLUDES -pthread"
 
116
        ;;
 
117
     *-*-kfreebsd*-gnu)
 
118
        AC_DEFINE(GC_FREEBSD_THREADS)
 
119
        INCLUDES="$INCLUDES -pthread"
 
120
        THREADDLLIBS=-pthread
 
121
        AC_DEFINE(_REENTRANT)
 
122
        if test "${enable_parallel_mark}" = yes; then
 
123
          AC_DEFINE(PARALLEL_MARK)
 
124
        fi
 
125
        AC_DEFINE(THREAD_LOCAL_ALLOC)
 
126
        AC_DEFINE(USE_COMPILER_TLS)
 
127
        ;;
 
128
     *-*-gnu*)
 
129
        AC_DEFINE(GC_GNU_THREADS)
 
130
        AC_DEFINE(_REENTRANT)
 
131
        AC_DEFINE(THREAD_LOCAL_ALLOC)
 
132
        ;;
 
133
     *-*-netbsd*)
 
134
        AC_MSG_WARN("Only on NetBSD 2.0 or later.")
 
135
        AC_DEFINE(GC_NETBSD_THREADS)
 
136
        AC_DEFINE(_REENTRANT)
 
137
        AC_DEFINE(_PTHREADS)
 
138
        THREADDLLIBS="-lpthread -lrt"
 
139
        ;;
 
140
     *-*-solaris*)
 
141
        AC_DEFINE(GC_SOLARIS_THREADS)
 
142
        AC_DEFINE(THREAD_LOCAL_ALLOC)
 
143
        THREADDLLIBS="-lpthread -lrt"
 
144
        if test "$GCC" != yes; then
 
145
          CFLAGS="$CFLAGS -O"
 
146
          need_atomic_ops_asm=true
 
147
        fi
 
148
        ;;
 
149
     *-*-irix*)
 
150
        AC_DEFINE(GC_IRIX_THREADS)
 
151
        ;;
 
152
     *-*-cygwin*)
 
153
        AC_DEFINE(GC_WIN32_THREADS)
 
154
        AC_DEFINE(THREAD_LOCAL_ALLOC)
 
155
        win32_threads=true
 
156
        ;;
 
157
     *-*-darwin*)
 
158
        AC_DEFINE(GC_DARWIN_THREADS)
 
159
        AC_DEFINE(THREAD_LOCAL_ALLOC)
 
160
        AC_MSG_WARN("Explict GC_INIT() calls may be required.");
 
161
        # Parallel-mark is currently unreliable on Darwin; ignore request
 
162
        # if test "${enable_parallel_mark}" = yes; then
 
163
        #   AC_DEFINE(PARALLEL_MARK)
 
164
        # fi
 
165
        darwin_threads=true
 
166
        ;;
 
167
     *-*-osf*)
 
168
        AC_DEFINE(GC_OSF1_THREADS)
 
169
        if test "${enable_parallel_mark}" = yes; then
 
170
          AC_DEFINE(PARALLEL_MARK)
 
171
          AC_DEFINE(THREAD_LOCAL_ALLOC)
 
172
          AC_MSG_WARN("Explict GC_INIT() calls may be required.");
 
173
          # May want to enable it in other cases, too.
 
174
          # Measurements havent yet been done.
 
175
        fi
 
176
        INCLUDES="$INCLUDES -pthread"
 
177
        THREADDLLIBS="-lpthread -lrt"
 
178
        ;;
 
179
      *)
 
180
        AC_MSG_ERROR("Pthreads not supported by the GC on this platform.")
 
181
        ;;
 
182
    esac
 
183
    ;;
 
184
 win32)
 
185
    AC_DEFINE(GC_WIN32_THREADS)
 
186
    dnl Wine getenv may not return NULL for missing entry
 
187
    AC_DEFINE(NO_GETENV)
 
188
    ;;
 
189
 dgux386)
 
190
    THREADS=dgux386
 
191
    AC_MSG_RESULT($THREADDLLIBS)
 
192
    # Use pthread GCC  switch
 
193
    THREADDLLIBS=-pthread
 
194
    if test "${enable_parallel_mark}" = yes; then
 
195
        AC_DEFINE(PARALLEL_MARK)
 
196
    fi
 
197
    AC_DEFINE(THREAD_LOCAL_ALLOC)
 
198
    AC_MSG_WARN("Explict GC_INIT() calls may be required.");
 
199
    AC_DEFINE(GC_DGUX386_THREADS)
 
200
    AC_DEFINE(DGUX_THREADS)
 
201
    # Enable _POSIX4A_DRAFT10_SOURCE with flag -pthread
 
202
    INCLUDES="-pthread $INCLUDES"
 
203
    ;;
 
204
 aix)
 
205
    THREADS=posix
 
206
    THREADDLLIBS=-lpthread
 
207
    AC_DEFINE(GC_AIX_THREADS)
 
208
    AC_DEFINE(_REENTRANT)
 
209
    ;;
 
210
 decosf1 | irix | mach | os2 | solaris | dce | vxworks)
 
211
    AC_MSG_ERROR(thread package $THREADS not yet supported)
 
212
    ;;
 
213
 *)
 
214
    AC_MSG_ERROR($THREADS is an unknown thread package)
 
215
    ;;
 
216
esac
 
217
AC_SUBST(THREADDLLIBS)
 
218
AM_CONDITIONAL(THREADS, test x$THREADS != xnone)
 
219
AM_CONDITIONAL(PTHREADS, test x$THREADS = xposix)
 
220
AM_CONDITIONAL(DARWIN_THREADS, test x$darwin_threads = xtrue)
 
221
AM_CONDITIONAL(WIN32_THREADS, test x$win32_threads = xtrue)
 
222
 
 
223
case "$host" in 
 
224
   powerpc-*-darwin*)
 
225
      powerpc_darwin=true
 
226
      ;;
 
227
esac
 
228
 
 
229
# Darwin needs a few extra special tests to deal with variation in the
 
230
# system headers.
 
231
case "$host" in
 
232
  powerpc*-*-darwin*)
 
233
    AC_CHECK_MEMBER(ppc_thread_state_t.r0,
 
234
      AC_DEFINE(HAS_PPC_THREAD_STATE_R0,1,
 
235
        [ppc_thread_state_t has field r0]),,
 
236
      [#include <mach/thread_status.h>])
 
237
    AC_CHECK_MEMBER(ppc_thread_state_t.__r0,
 
238
      AC_DEFINE(HAS_PPC_THREAD_STATE___R0,1,dnl
 
239
        [ppc_thread_state_t has field __r0]),,
 
240
      [#include <mach/thread_status.h>])
 
241
    AC_CHECK_MEMBER(ppc_thread_state64_t.r0,
 
242
      AC_DEFINE(HAS_PPC_THREAD_STATE64_R0,1,dnl
 
243
        [ppc_thread_state64_t has field r0]),,
 
244
      [#include <mach/thread_status.h>])
 
245
    AC_CHECK_MEMBER(ppc_thread_state64_t.__r0,
 
246
      AC_DEFINE(HAS_PPC_THREAD_STATE64___R0,1,dnl
 
247
        [ppc_thread_state64_t has field __r0]),,
 
248
      [#include <mach/thread_status.h>])
 
249
    ;;
 
250
  i?86*-*-darwin*)
 
251
    AC_CHECK_MEMBER(x86_thread_state32_t.eax,
 
252
      AC_DEFINE(HAS_X86_THREAD_STATE32_EAX,1,dnl
 
253
        [x86_thread_state32_t has field eax]),,
 
254
      [#include <sys/cdefs.h>
 
255
      #include <mach/thread_status.h>])
 
256
    AC_CHECK_MEMBER(x86_thread_state32_t.__eax,
 
257
      AC_DEFINE(HAS_X86_THREAD_STATE32___EAX,1,dnl
 
258
        [x86_thread_state32_t has field __eax]),,
 
259
      [#include <sys/cdefs.h>
 
260
      #include <mach/thread_status.h>])
 
261
    ;;
 
262
  x86_64-*-darwin*)
 
263
    AC_CHECK_MEMBER(x86_thread_state64_t.rax,
 
264
      AC_DEFINE(HAS_X86_THREAD_STATE64_RAX,1,dnl
 
265
        [x86_thread_state64_t has field rax]),,
 
266
      [#include <sys/cdefs.h>
 
267
      #include <mach/thread_status.h>])
 
268
    AC_CHECK_MEMBER(x86_thread_state64_t.__rax,
 
269
      AC_DEFINE(HAS_X86_THREAD_STATE64___RAX,1,dnl
 
270
        [x86_thread_state64_t has field __rax]),,
 
271
      [#include <sys/cdefs.h>
 
272
      #include <mach/thread_status.h>])
 
273
     ;;
 
274
  *) ;;
 
275
esac
 
276
 
 
277
AC_MSG_CHECKING(for xlc)
 
278
AC_TRY_COMPILE([],[
 
279
 #ifndef __xlC__
 
280
 # error
 
281
 #endif
 
282
], [compiler_xlc=yes], [compiler_xlc=no])
 
283
AC_MSG_RESULT($compiler_xlc)
 
284
AM_CONDITIONAL(COMPILER_XLC,test $compiler_xlc = yes)
 
285
if test $compiler_xlc = yes -a "$powerpc_darwin" = true; then
 
286
  # the darwin stack-frame-walking code is completely broken on xlc
 
287
  AC_DEFINE(DARWIN_DONT_PARSE_STACK)
 
288
fi
 
289
 
 
290
# We never want libdl on darwin. It is a fake libdl that just ends up making
 
291
# dyld calls anyway
 
292
case "$host" in
 
293
  *-*-darwin*) ;;
 
294
  *)
 
295
    AC_CHECK_LIB(dl, dlopen, THREADDLLIBS="$THREADDLLIBS -ldl")
 
296
    ;;
 
297
esac
 
298
 
 
299
case "$host" in
 
300
  *-*-hpux*)
 
301
    avoid_cpp_lib=yes;;
 
302
  *)
 
303
    avoid_cpp_lib=no;
 
304
    ;;
 
305
esac
 
306
AM_CONDITIONAL(AVOID_CPP_LIB,test $avoid_cpp_lib = yes)
 
307
 
 
308
# extra LD Flags which are required for targets
 
309
case "${host}" in
 
310
  *-*-darwin*)
 
311
    extra_ldflags_libgc=-Wl,-single_module
 
312
    ;;
 
313
esac
 
314
AC_SUBST(extra_ldflags_libgc)
 
315
 
 
316
AC_SUBST(EXTRA_TEST_LIBS)
 
317
 
 
318
target_all=libgc.la
 
319
AC_SUBST(target_all)
 
320
 
 
321
dnl If the target is an eCos system, use the appropriate eCos
 
322
dnl I/O routines.
 
323
dnl FIXME: this should not be a local option but a global target
 
324
dnl system; at present there is no eCos target.
 
325
TARGET_ECOS="no"
 
326
AC_ARG_WITH(ecos,
 
327
[  --with-ecos             enable runtime eCos target support],
 
328
TARGET_ECOS="$with_ecos"
 
329
)
 
330
 
 
331
addobjs=
 
332
addlibs=
 
333
CXXINCLUDES=
 
334
case "$TARGET_ECOS" in
 
335
   no)
 
336
      ;;
 
337
   *)
 
338
      AC_DEFINE(ECOS)
 
339
      CXXINCLUDES="-I${TARGET_ECOS}/include"
 
340
      addobjs="$addobjs ecos.lo"
 
341
      ;;
 
342
esac
 
343
 
 
344
AM_CONDITIONAL(CPLUSPLUS, test "${enable_cplusplus}" = yes)
 
345
 
 
346
AC_SUBST(CXX)
 
347
 
 
348
AC_SUBST(INCLUDES)
 
349
AC_SUBST(CXXINCLUDES)
 
350
 
 
351
# Configuration of shared libraries
 
352
#
 
353
AC_MSG_CHECKING(whether to build shared libraries)
 
354
AC_ENABLE_SHARED
 
355
 
 
356
case "$host" in
 
357
 alpha-*-openbsd*)
 
358
     enable_shared=no
 
359
     ;;
 
360
 *)
 
361
     ;;
 
362
esac
 
363
 
 
364
AC_MSG_RESULT($enable_shared)
 
365
 
 
366
# Configuration of machine-dependent code
 
367
#
 
368
AC_MSG_CHECKING(which machine-dependent code should be used) 
 
369
machdep=
 
370
case "$host" in
 
371
 alpha-*-openbsd*)
 
372
    machdep="mach_dep.lo"
 
373
    if test x"${ac_cv_lib_dl_dlopen}" != xyes ; then
 
374
       AC_MSG_WARN(OpenBSD/Alpha without dlopen(). Shared library support is disabled)
 
375
    fi
 
376
    ;;
 
377
 alpha*-*-linux*)
 
378
    machdep="mach_dep.lo"
 
379
    ;;
 
380
 i?86-*-solaris2.[[89]] | i?86-*-solaris2.1?)
 
381
    AC_DEFINE(SOLARIS25_PROC_VDB_BUG_FIXED)
 
382
    ;;
 
383
 mipstx39-*-elf*)
 
384
    machdep="mach_dep.lo"
 
385
    AC_DEFINE(STACKBASE, __stackbase)
 
386
    AC_DEFINE(DATASTART_IS_ETEXT)
 
387
    ;;
 
388
 mips-dec-ultrix*)
 
389
    machdep="mach-dep.lo"
 
390
    ;;
 
391
 mips-nec-sysv*|mips-unknown-sysv*)
 
392
    ;;
 
393
 mips*-*-linux*) 
 
394
    ;; 
 
395
 mips-*-*)
 
396
    machdep="mach_dep.lo"
 
397
    dnl AC_DEFINE(NO_EXECUTE_PERMISSION)
 
398
    dnl This is now redundant, but it is also important for incremental GC
 
399
    dnl performance under Irix.
 
400
    ;;
 
401
 sparc-*-netbsd*)
 
402
    machdep="mach_dep.lo sparc_netbsd_mach_dep.lo"
 
403
    ;;
 
404
 sparc-sun-solaris2.3)
 
405
    machdep="mach_dep.lo sparc_mach_dep.lo"
 
406
    AC_DEFINE(SUNOS53_SHARED_LIB)
 
407
    ;;
 
408
 sparc*-sun-solaris2.*)
 
409
    machdep="mach_dep.lo sparc_mach_dep.lo"
 
410
    ;;
 
411
 ia64-*-*)
 
412
    machdep="mach_dep.lo ia64_save_regs_in_stack.lo"
 
413
    ;;
 
414
esac
 
415
if test x"$machdep" = x; then
 
416
AC_MSG_RESULT($machdep)
 
417
   machdep="mach_dep.lo"
 
418
fi
 
419
addobjs="$addobjs $machdep"
 
420
AC_SUBST(addobjs)
 
421
AC_SUBST(addlibs)
 
422
 
 
423
AC_PROG_LIBTOOL
 
424
 
 
425
#
 
426
# Check for AViiON Machines running DGUX
 
427
#
 
428
ac_is_dgux=no
 
429
AC_CHECK_HEADER(sys/dg_sys_info.h,
 
430
[ac_is_dgux=yes;])
 
431
 
 
432
    ## :GOTCHA: we do not check anything but sys/dg_sys_info.h
 
433
if test $ac_is_dgux = yes; then
 
434
    if test "$enable_full_debug" = "yes"; then
 
435
      CFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
 
436
      CXXFLAGS="-g -mstandard -DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
 
437
    else
 
438
      CFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
 
439
      CXXFLAGS="-DDGUX -D_DGUX_SOURCE -Di386 -mno-legend -O2"
 
440
    fi
 
441
    AC_SUBST(CFLAGS)
 
442
    AC_SUBST(CXXFLAGS)
 
443
fi
 
444
 
 
445
dnl We use these options to decide which functions to include.
 
446
AC_ARG_WITH(target-subdir,
 
447
[  --with-target-subdir=SUBDIR
 
448
                          configuring with a cross compiler])
 
449
AC_ARG_WITH(cross-host,
 
450
[  --with-cross-host=HOST  configuring with a cross compiler])
 
451
 
 
452
# automake wants to see AC_EXEEXT.  But we don't need it.  And having
 
453
# it is actually a problem, because the compiler we're passed can't
 
454
# necessarily do a full link.  So we fool automake here.
 
455
if false; then
 
456
  # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
 
457
  # to nothing, so nothing would remain between `then' and `fi' if it
 
458
  # were not for the `:' below.
 
459
  :
 
460
  AC_EXEEXT
 
461
fi
 
462
 
 
463
dnl As of 4.13a2, the collector will not properly work on Solaris when
 
464
dnl built with gcc and -O.  So we remove -O in the appropriate case.
 
465
dnl Not needed anymore on Solaris.
 
466
AC_MSG_CHECKING(whether Solaris gcc optimization fix is necessary)
 
467
case "$host" in
 
468
 *aix*)
 
469
    if test "$GCC" = yes; then
 
470
       AC_MSG_RESULT(yes)
 
471
       new_CFLAGS=
 
472
       for i in $CFLAGS; do
 
473
          case "$i" in
 
474
           -O*)
 
475
              ;;
 
476
           *)
 
477
              new_CFLAGS="$new_CFLAGS $i"
 
478
              ;;
 
479
          esac
 
480
       done
 
481
       CFLAGS="$new_CFLAGS"
 
482
    else
 
483
       AC_MSG_RESULT(no)
 
484
    fi
 
485
    ;;
 
486
 *) AC_MSG_RESULT(no) ;;
 
487
esac
 
488
 
 
489
dnl Include defines that have become de facto standard.
 
490
dnl ALL_INTERIOR_POINTERS can be overridden in startup code.
 
491
AC_DEFINE(NO_EXECUTE_PERMISSION)
 
492
AC_DEFINE(ALL_INTERIOR_POINTERS)
 
493
 
 
494
 
 
495
dnl Interface Selection
 
496
dnl -------------------
 
497
dnl
 
498
dnl By default, make the library as general as possible.
 
499
dnl enable_gcj_support=no
 
500
AC_ARG_ENABLE(gcj-support,
 
501
    [AC_HELP_STRING([--disable-gcj-support],
 
502
        [Disable support for gcj.])])
 
503
AM_CONDITIONAL(ENABLE_GCJ_SUPPORT,
 
504
    [test x"$enable_gcj_support" != xno])
 
505
if test x"$enable_gcj_support" != xno; then
 
506
    AC_DEFINE(GC_GCJ_SUPPORT, 1, [Define to include support for gcj])
 
507
fi
 
508
 
 
509
AC_ARG_ENABLE(java-finalization,
 
510
    [AC_HELP_STRING([--disable-java-finalization],
 
511
        [Disable support for java finalization.])])
 
512
if test x"$enable_java_finalization" != xno; then
 
513
    AC_DEFINE(JAVA_FINALIZATION)
 
514
fi
 
515
 
 
516
AC_ARG_ENABLE(atomic-uncollectable,
 
517
    [AC_HELP_STRING([--disable-atomic-uncollectible],
 
518
        [Disable support for atomic uncollectible allocation.])])
 
519
if test x"$enable_atomic_uncollectible" != x"no"; then
 
520
    AC_DEFINE(ATOMIC_UNCOLLECTABLE, 1,
 
521
        [Define to enable atomic uncollectible allocation.])
 
522
fi
 
523
 
 
524
AC_ARG_ENABLE(redirect-malloc,
 
525
    [AC_HELP_STRING([--enable-redirect-malloc],
 
526
        [Redirect malloc and friends to GC routines])])
 
527
 
 
528
if test "${enable_redirect_malloc}" = yes; then
 
529
    if test "${enable_full_debug}" = yes; then
 
530
        AC_DEFINE(REDIRECT_MALLOC, GC_debug_malloc_replacement)
 
531
        AC_DEFINE(REDIRECT_REALLOC, GC_debug_realloc_replacement)
 
532
        AC_DEFINE(REDIRECT_FREE, GC_debug_free)
 
533
    else
 
534
        AC_DEFINE(REDIRECT_MALLOC, GC_malloc)
 
535
    fi
 
536
    AC_DEFINE(GC_USE_DLOPEN_WRAP)
 
537
fi
 
538
 
 
539
AC_ARG_ENABLE(large-config,
 
540
    [AC_HELP_STRING([--enable-large-config],
 
541
        [Optimize for large (> 100 MB) heap or root set])])
 
542
 
 
543
if test "${enable_large_config}" = yes; then
 
544
    AC_DEFINE(LARGE_CONFIG, 1, [Define to optimize for large heaps or root sets])
 
545
fi
 
546
 
 
547
dnl This is something of a hack.  When cross-compiling we turn off
 
548
dnl some functionality.  We also enable the "small" configuration.
 
549
dnl These is only correct when targetting an embedded system.  FIXME.
 
550
if test -n "${with_cross_host}"; then
 
551
   AC_DEFINE(NO_CLOCK)
 
552
   AC_DEFINE(SMALL_CONFIG)
 
553
   AC_DEFINE(NO_DEBUGGING)
 
554
fi
 
555
 
 
556
 
 
557
dnl Debugging
 
558
dnl ---------
 
559
 
 
560
UNWINDLIBS=
 
561
AC_ARG_ENABLE(gc-debug,
 
562
[AC_HELP_STRING([--enable-gc-debug],
 
563
    [include full support for pointer backtracing etc.])],
 
564
[ if test "$enable_gc_debug" = "yes"; then
 
565
    AC_MSG_WARN("Should define GC_DEBUG and use debug alloc. in clients.")
 
566
    AC_DEFINE(KEEP_BACK_PTRS)
 
567
    AC_DEFINE(DBG_HDRS_ALL)
 
568
    case $host in
 
569
      ia64-*-linux* )
 
570
        AC_DEFINE(MAKE_BACK_GRAPH)
 
571
        AC_DEFINE(SAVE_CALL_COUNT, 8)
 
572
        AC_CHECK_LIB(unwind, backtrace, [
 
573
          AC_DEFINE(GC_HAVE_BUILTIN_BACKTRACE)
 
574
          UNWINDLIBS=-lunwind
 
575
          AC_MSG_WARN("Client code may need to link against libunwind.")
 
576
        ])
 
577
      ;;
 
578
      x86-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* )
 
579
        AC_DEFINE(MAKE_BACK_GRAPH)
 
580
        AC_MSG_WARN("Client must not use -fomit-frame-pointer.")
 
581
        AC_DEFINE(SAVE_CALL_COUNT, 8)
 
582
      ;;
 
583
      i[3456]86-*-dgux*)
 
584
        AC_DEFINE(MAKE_BACK_GRAPH)
 
585
      ;;
 
586
    esac ]
 
587
  fi)
 
588
 
 
589
AC_SUBST(UNWINDLIBS)
 
590
 
 
591
AC_ARG_ENABLE(gc-assertions,
 
592
    [AC_HELP_STRING([--enable-gc-assertions],
 
593
        [collector-internal assertion checking])])
 
594
if test "${enable_gc_assertions}" = yes; then
 
595
    AC_DEFINE(GC_ASSERTIONS)
 
596
fi
 
597
 
 
598
AC_ARG_ENABLE(munmap,
 
599
    [AC_HELP_STRING([--enable-munmap=N],
 
600
        [return page to the os if empty for N collections])],
 
601
  MUNMAP_THRESHOLD=$enableval;
 
602
   [case "$MMAP" in
 
603
      no)
 
604
        AC_MSG_ERROR([--enable-munmap requires --enable-mmap])
 
605
        ;;
 
606
    esac]
 
607
   )
 
608
if test "${enable_munmap}" != ""; then
 
609
    AC_DEFINE(USE_MMAP)
 
610
    AC_DEFINE(USE_MUNMAP)
 
611
    if test "${MUNMAP_THRESHOLD}" = "yes"; then
 
612
      MUNMAP_THRESHOLD=6
 
613
    fi
 
614
    AC_DEFINE_UNQUOTED(MUNMAP_THRESHOLD, ${MUNMAP_THRESHOLD})
 
615
fi
 
616
 
 
617
AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
 
618
 
 
619
 
 
620
dnl Atomic Ops
 
621
dnl ----------
 
622
 
 
623
atomic_ops_libs=-latomic_ops
 
624
AC_CHECK_HEADER(atomic_ops.h,
 
625
  [ AC_MSG_NOTICE([Using pre-installed libatomic_ops]) ],
 
626
  [ ao_dir=
 
627
    for candidate in ${srcdir}/libatomic_ops*; do
 
628
        case $candidate in
 
629
            *.tar.gz)
 
630
                ;;
 
631
            *install)
 
632
                dnl generated by alternate Makefile.
 
633
                ;;
 
634
            *)
 
635
                if test -e "$candidate"; then
 
636
                    ao_dir="$candidate"
 
637
                fi
 
638
                ;;
 
639
        esac
 
640
    done
 
641
    if test -z "$ao_dir"; then
 
642
        AC_MSG_ERROR([Missig libatomic_ops.])
 
643
    fi
 
644
    ao_version="${ao_dir#*libatomic_ops-}"
 
645
    AC_MSG_NOTICE([Using internal version of libatomic_ops])
 
646
 
 
647
    dnl Automake does not accept shell variables in AC_CONFIG_SUBDIRS
 
648
    test -e libatomic_ops \
 
649
        || ln -s ${ao_dir} libatomic_ops
 
650
    AC_CONFIG_SUBDIRS(libatomic_ops)
 
651
 
 
652
    dnl Also copy the source files to be linked in.
 
653
    test -e atomic_ops.c \
 
654
        || ln -s libatomic_ops/src/atomic_ops.c \
 
655
                 atomic_ops.c
 
656
 
 
657
    test -e atomic_ops_sysdeps.S \
 
658
        || ln -s libatomic_ops/src/atomic_ops_sysdeps.S \
 
659
                 atomic_ops_sysdeps.S
 
660
 
 
661
    dnl This gets the source include files, which is often close enough.
 
662
    dnl It also makes atomic_ops_sysdeps.S assemble.
 
663
    GC_CFLAGS="${GC_CFLAGS} -I libatomic_ops/src"
 
664
    maybe_libatomic_ops="libatomic_ops"
 
665
  ])
 
666
 
 
667
AM_CONDITIONAL(USE_INTERNAL_LIBATOMIC_OPS,
 
668
                test -n "$maybe_libatomic_ops" -a "$THREADS" != "none")
 
669
AM_CONDITIONAL(NEED_ATOMIC_OPS_ASM, test -n "$maybe_libatomic_ops" -a x$need_atomic_ops_asm = xtrue)
 
670
AC_SUBST(atomic_ops_libs)
 
671
 
 
672
dnl Produce the Files
 
673
dnl -----------------
 
674
 
 
675
AC_CONFIG_FILES([Makefile bdw-gc.pc])
 
676
 
 
677
AC_CONFIG_COMMANDS([default],,
 
678
  [ srcdir=${srcdir}
 
679
    host=${host}
 
680
    CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
 
681
    CC="${CC}"
 
682
    DEFS="$DEFS" ])
 
683
 
 
684
AC_OUTPUT