Build scalosgfx.library with actual defs.h
[AROS-Contrib.git] / gc / configure.in
blobfcc0c710ee2afa878ce66d68474c1b21eef4cf88
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.
12 # Original author: Tom Tromey
14 dnl Process this file with autoconf to produce configure.
16 AC_INIT(gcj_mlc.c)
18 dnl Can't be done in GC_CONFIGURE because that confuses automake. 
19 AC_CONFIG_AUX_DIR(.)
21 AC_CANONICAL_SYSTEM
23 GC_CONFIGURE(.)
25 AM_PROG_LIBTOOL
27 dnl We use these options to decide which functions to include.
28 AC_ARG_WITH(target-subdir,
29 [  --with-target-subdir=SUBDIR
30                           configuring with a cross compiler])
31 AC_ARG_WITH(cross-host,
32 [  --with-cross-host=HOST  configuring with a cross compiler])
34 AM_MAINTAINER_MODE
35 # automake wants to see AC_EXEEXT.  But we don't need it.  And having
36 # it is actually a problem, because the compiler we're passed can't
37 # necessarily do a full link.  So we fool automake here.
38 if false; then
39   # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
40   # to nothing, so nothing would remain between `then' and `fi' if it
41   # were not for the `:' below.
42   :
43   AC_EXEEXT
46 AC_MSG_CHECKING([for threads package to use])
47 AC_ARG_ENABLE(threads, [  --enable-threads=TYPE   choose threading package],
48   THREADS=$enableval,
49   [ AC_MSG_CHECKING([for thread model used by GCC])
50     THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
51     if test -z "$THREADS"; then
52       THREADS=no
53     fi
54     AC_MSG_RESULT([$THREADS])])
56 AC_ARG_ENABLE(parallel-mark,
57 [  --enable-parallel-mark       parallelize marking and free list construction],
58    [case "$THREADS" in
59       no | none | single)
60         AC_MSG_ERROR([Parallel mark requires --enable-threads=x spec])
61         ;;
62     esac]
65 INCLUDES=-I${srcdir}/include
66 THREADLIBS=
67 case "$THREADS" in
68  no | none | single)
69     THREADS=none
70     ;;
71  posix | pthreads)
72     THREADS=posix
73     THREADLIBS=-lpthread
74     case "$host" in
75      x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux*)
76         AC_DEFINE(GC_LINUX_THREADS)
77         AC_DEFINE(_REENTRANT)
78         if test "${enable_parallel_mark}"; then
79           AC_DEFINE(PARALLEL_MARK)
80         fi
81         AC_DEFINE(THREAD_LOCAL_ALLOC)
82         ;;
83      *-*-linux*)
84         AC_DEFINE(GC_LINUX_THREADS)
85         AC_DEFINE(_REENTRANT)
86         ;;
87      *-*-hpux*)
88         AC_MSG_WARN("Only HP/UX 11 threads are supported.")
89         AC_DEFINE(GC_HPUX_THREADS)
90         AC_DEFINE(_POSIX_C_SOURCE,199506L)
91         if test "${enable_parallel_mark}" = yes; then
92           AC_DEFINE(PARALLEL_MARK)
93         fi
94         AC_DEFINE(THREAD_LOCAL_ALLOC)
95         THREADLIBS="-lpthread -lrt"
96         ;;
97      *-*-freebsd*)
98         AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
99         AC_DEFINE(GC_FREEBSD_THREADS)
100         INCLUDES="$INCLUDES -pthread"
101         THREADLIBS=-pthread
102         ;;
103      *-*-solaris*)
104         AC_DEFINE(GC_SOLARIS_THREADS)
105         AC_DEFINE(GC_SOLARIS_PTHREADS)
106         ;;
107      *-*-irix*)
108         AC_DEFINE(GC_IRIX_THREADS)
109         ;;
110     esac
111     ;;
112  decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks)
113     AC_MSG_ERROR(thread package $THREADS not yet supported)
114     ;;
115  *)
116     AC_MSG_ERROR($THREADS is an unknown thread package)
117     ;;
118 esac
119 AC_SUBST(THREADLIBS)
121 AC_CHECK_LIB(dl, dlopen, EXTRA_TEST_LIBS="$EXTRA_TEST_LIBS -ldl")
122 AC_SUBST(EXTRA_TEST_LIBS)
124 target_all=libgc.la
125 AC_SUBST(target_all)
127 dnl If the target is an eCos system, use the appropriate eCos
128 dnl I/O routines.
129 dnl FIXME: this should not be a local option but a global target
130 dnl system; at present there is no eCos target.
131 TARGET_ECOS="no"
132 AC_ARG_WITH(ecos,
133 [  --with-ecos             enable runtime eCos target support],
134 TARGET_ECOS="$with_ecos"
137 addobjs=
138 CXXINCLUDES=
139 case "$TARGET_ECOS" in
140    no)
141       ;;
142    *)
143       AC_DEFINE(ECOS)
144       CXXINCLUDES="-I${TARGET_ECOS}/include"
145       addobjs="$addobjs ecos.lo"
146       ;;
147 esac
148 AC_SUBST(CXX)
150 AC_SUBST(INCLUDES)
151 AC_SUBST(CXXINCLUDES)
153 machdep=
154 case "$host" in
155 # alpha_mach_dep.s assumes that pointers are not saved in fp registers.
156 # Gcc on a 21264 can spill pointers to fp registers.  Oops.
157 # alpha*-*-*)
158 #    machdep="alpha_mach_dep.lo"
159 #    ;;
160  alpha-*-openbsd*)
161     if test x"${ac_cv_lib_dl_dlopen}" != xyes ; then
162        AC_MSG_WARN(OpenBSD/Alpha without dlopen(). Shared library support is disabled)
163        AM_DISABLE_SHARED
164     fi
165     ;;
166  mipstx39-*-elf*)
167     machdep="mips_ultrix_mach_dep.lo"
168     AC_DEFINE(STACKBASE, __stackbase)
169     AC_DEFINE(DATASTART_IS_ETEXT)
170     ;;
171  mips-dec-ultrix*)
172     machdep="mips_ultrix_mach-dep.lo"
173     ;;
174  mips-*-*)
175     machdep="mips_sgi_mach_dep.lo"
176     AC_DEFINE(NO_EXECUTE_PERMISSION)
177     ;;
178  sparc-sun-solaris2.3*)
179     AC_DEFINE(SUNOS53_SHARED_LIB)
180     ;;
181  ia64-*-hpux*)
182     machdep="mach_dep.lo ia64_save_regs_in_stack.lo"
183     ;;
184 esac
185 if test x"$machdep" = x; then
186    machdep="mach_dep.lo"
188 addobjs="$addobjs $machdep"
189 AC_SUBST(addobjs)
191 dnl As of 4.13a2, the collector will not properly work on Solaris when
192 dnl built with gcc and -O.  So we remove -O in the appropriate case.
193 case "$host" in
194  sparc-sun-solaris2*)
195     if test "$GCC" = yes; then
196        new_CFLAGS=
197        for i in $CFLAGS; do
198           case "$i" in
199            -O*)
200               ;;
201            *)
202               new_CFLAGS="$new_CFLAGS $i"
203               ;;
204           esac
205        done
206        CFLAGS="$new_CFLAGS"
207     fi
208     ;;
209 esac
211 dnl We need to override the top-level CFLAGS.  This is how we do it.
212 MY_CFLAGS="$CFLAGS"
213 AC_SUBST(MY_CFLAGS)
215 dnl Include defines that have become de facto standard.
216 dnl ALL_INTERIOR_POINTERS can be overridden in startup code.
217 AC_DEFINE(SILENT)
218 AC_DEFINE(NO_SIGNALS)
219 AC_DEFINE(NO_EXECUTE_PERMISSION)
220 AC_DEFINE(ALL_INTERIOR_POINTERS)
222 dnl By default, make the library as general as possible.
223 AC_DEFINE(JAVA_FINALIZATION)
224 AC_DEFINE(GC_GCJ_SUPPORT)
225 AC_DEFINE(ATOMIC_UNCOLLECTABLE)
227 dnl This is something of a hack.  When cross-compiling we turn off
228 dnl some functionality.  We also enable the "small" configuration.
229 dnl These is only correct when targetting an embedded system.  FIXME.
230 if test -n "${with_cross_host}"; then
231    AC_DEFINE(NO_SIGSET)
232    AC_DEFINE(NO_CLOCK)
233    AC_DEFINE(SMALL_CONFIG)
234    AC_DEFINE(NO_DEBUGGING)
237 AC_ARG_ENABLE(full-debug,
238 [  --enable-full-debug  include full support for pointer backtracing etc.],
239 [ if test "$enable_full_debug" = "yes"; then
240     AC_MSG_WARN("Must define GC_DEBUG and use debug alloc. in clients.")
241     AC_DEFINE(KEEP_BACK_PTRS)
242     AC_DEFINE(DBG_HDRS_ALL)
243     case $host in
244       x86-*-linux* | i586-*-linux* | i686-*-linux* )
245         AC_MSG_WARN("Client must not use -fomit-frame-pointer.")
246         AC_DEFINE(SAVE_CALL_COUNT, 8)
247       ;;
248     esac ]
249   fi)
251 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
253 if test "${multilib}" = "yes"; then
254   multilib_arg="--enable-multilib"
255 else
256   multilib_arg=
259 AC_OUTPUT(Makefile,,
260 srcdir=${srcdir}
261 host=${host}
262 target=${target}
263 with_multisubdir=${with_multisubdir}
264 ac_configure_args="${multilib_arg} ${ac_configure_args}"
265 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
266 gc_basedir=${gc_basedir}
267 CC="${CC}"
268 DEFS="$DEFS"