* $(HOST_PREFIX_1)errors.o, $(HOST_PREFIX_1)ggc-none.o,
[official-gcc.git] / boehm-gc / configure.in
blob6a75b192b703bd7d8eda565fdbac52c30fe16ac9
1 dnl Process this file with autoconf to produce configure.
3 AC_INIT(gc_mark.h)
5 dnl Can't be done in BOEHM_CONFIGURE because that confuses automake. 
6 AC_CONFIG_AUX_DIR(..)
8 AC_CANONICAL_SYSTEM
10 BOEHM_CONFIGURE(.)
12 AM_PROG_LIBTOOL
14 dnl We use these options to decide which functions to include.
15 AC_ARG_WITH(target-subdir,
16 [  --with-target-subdir=SUBDIR
17                           configuring with a cross compiler])
18 AC_ARG_WITH(cross-host,
19 [  --with-cross-host=HOST  configuring with a cross compiler])
21 AM_MAINTAINER_MODE
22 # automake wants to see AC_EXEEXT.  But we don't need it.  And having
23 # it is actually a problem, because the compiler we're passed can't
24 # necessarily do a full link.  So we fool automake here.
25 if test "x" = "y"; then
26    AC_EXEEXT
29 AC_MSG_CHECKING([for threads package to use])
30 AC_ARG_ENABLE(threads, [  --enable-threads=TYPE   choose threading package],
31   THREADS=$enableval,
32   dnl FIXME: figure out native threads to use here.
33   THREADS=no)
35 if test "$THREADS" = yes; then
36    case "$host" in
37     *-*-vxworks*)
38        THREADS=vxworks
39        ;;
40     *-*-linux*)
41        # FIXME: this isn't correct in all cases.
42        THREADS=posix
43        ;;
44     *-*-win*)
45        THREADS=win32
46        ;;
47     *-*-irix[[1-5]].*)
48        # No built-in threads library on IRIX 5.* and older.
49        THREADS=none
50        ;;
51     *-*-irix*)
52        # FIXME: for now, choose POSIX, because we implement that.
53        # Later, choose irix threads.
54        THREADS=posix
55        ;;
56     *-*-solaris*)
57        # FIXME: for now, choose POSIX, because we implement that.
58        # Later, choose solaris threads.
59        THREADS=posix
60        ;;
61     *)
62        # For now.
63        THREADS=none
64        ;;
65    esac
68 INCLUDES=
69 THREADLIBS=
70 case "$THREADS" in
71  no | none | single)
72     THREADS=none
73     ;;
74  posix | pthreads)
75     THREADS=posix
76     case "$host" in
77      *-*-linux*)
78         AC_DEFINE(LINUX_THREADS)
79         AC_DEFINE(_REENTRANT)
80         ;;
81      *-*-solaris*)
82         AC_DEFINE(SOLARIS_THREADS)
83         AC_DEFINE(_SOLARIS_PTHREADS)
84         ;;
85      *-*-irix*)
86         AC_DEFINE(IRIX_THREADS)
87         ;;
88     esac
89     THREADLIBS=-lpthread
90     ;;
91  decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks)
92     AC_MSG_ERROR(thread package $THREADS not yet supported)
93     ;;
94  *)
95     AC_MSG_ERROR($THREADS is an unknown thread package)
96     ;;
97 esac
98 AC_MSG_RESULT($THREADS)
99 AC_SUBST(THREADLIBS)
101 AC_CHECK_LIB(dl, dlopen, EXTRA_TEST_LIBS="$EXTRA_TEST_LIBS -ldl")
102 AC_SUBST(EXTRA_TEST_LIBS)
104 AC_ARG_ENABLE(java-gc,
105 changequote(<<,>>)dnl
106 <<  --enable-java-gc=TYPE   choose garbage collector [boehm]>>,
107 changequote([,])
108   GC=$enableval,
109   GC=boehm)
110 target_all=
111 if test "$GC" = "boehm"; then
112    target_all=libgcjgc.la
114 AC_SUBST(target_all)
116 dnl If the target is an eCos system, use the appropriate eCos
117 dnl I/O routines.
118 dnl FIXME: this should not be a local option but a global target
119 dnl system; at present there is no eCos target.
120 TARGET_ECOS="no"
121 AC_ARG_WITH(ecos,
122 [  --with-ecos             enable runtime eCos target support],
123 TARGET_ECOS="$with_ecos"
126 addobjs=
127 CXXINCLUDES=
128 case "$TARGET_ECOS" in
129    no)
130       ;;
131    *)
132       AC_DEFINE(ECOS)
133       CXXINCLUDES="-I${TARGET_ECOS}/include"
134       addobjs="$addobjs ecos.lo"
135       ;;
136 esac
137 AC_SUBST(CXX)
139 AC_SUBST(INCLUDES)
140 AC_SUBST(CXXINCLUDES)
142 machdep=
143 case "$host" in
144 # alpha_mach_dep.s assumes that pointers are not saved in fp registers.
145 # Gcc on a 21264 can spill pointers to fp registers.  Oops.
146 # alpha*-*-*)
147 #    machdep="alpha_mach_dep.lo"
148 #    ;;
149  mipstx39-*-elf*)
150     machdep="mips_ultrix_mach_dep.lo"
151     AC_DEFINE(STACKBASE, __stackbase)
152     AC_DEFINE(DATASTART_IS_ETEXT)
153     ;;
154  mips-dec-ultrix*)
155     machdep="mips_ultrix_mach-dep.lo"
156     ;;
157  mips-*-*)
158     machdep="mips_sgi_mach_dep.lo"
159     AC_DEFINE(NO_EXECUTE_PERMISSION)
160     ;;
161  sparc-sun-solaris2.3*)
162     AC_DEFINE(SUNOS53_SHARED_LIB)
163     ;;
164 esac
165 if test x"$machdep" = x; then
166    machdep="mach_dep.lo"
168 addobjs="$addobjs $machdep"
169 AC_SUBST(addobjs)
171 dnl As of 4.13a2, the collector will not properly work on Solaris when
172 dnl built with gcc and -O.  So we remove -O in the appropriate case.
173 case "$host" in
174  sparc-sun-solaris2*)
175     if test "$GCC" = yes; then
176        new_CFLAGS=
177        for i in $CFLAGS; do
178           case "$i" in
179            -O*)
180               ;;
181            *)
182               new_CFLAGS="$new_CFLAGS $i"
183               ;;
184           esac
185        done
186        CFLAGS="$new_CFLAGS"
187     fi
188     ;;
189 esac
191 dnl We need to override the top-level CFLAGS.  This is how we do it.
192 MY_CFLAGS="$CFLAGS"
193 AC_SUBST(MY_CFLAGS)
195 dnl Define a few things to retarget the library towards
196 dnl embedded Java.
197 AC_DEFINE(SILENT)
198 AC_DEFINE(NO_SIGNALS)
199 AC_DEFINE(JAVA_FINALIZATION)
200 AC_DEFINE(GC_GCJ_SUPPORT)
202 dnl This is something of a hack.  When cross-compiling we turn off
203 dnl some functionality.  We also enable the "small" configuration.
204 dnl These is only correct when targetting an embedded system.  FIXME.
205 if test -n "${with_cross_host}"; then
206    AC_DEFINE(NO_SIGSET)
207    AC_DEFINE(NO_CLOCK)
208    AC_DEFINE(SMALL_CONFIG)
209    AC_DEFINE(NO_DEBUGGING)
212 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
214 if test "${multilib}" = "yes"; then
215   multilib_arg="--enable-multilib"
216 else
217   multilib_arg=
220 AC_OUTPUT(Makefile,
222 dnl Put all the -D options in a file.  These are required before
223 dnl boehm-config.h can be included.  This is a huge hack brought
224 dnl about by overall poor structuring of this entire library.
225 echo "$DEFS" > boehm-cflags
227 if test -n "$CONFIG_FILES"; then
228   ac_file=Makefile . ${boehm_gc_basedir}/../config-ml.in
229 fi],
230 srcdir=${srcdir}
231 host=${host}
232 target=${target}
233 with_multisubdir=${with_multisubdir}
234 ac_configure_args="${multilib_arg} ${ac_configure_args}"
235 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
236 boehm_gc_basedir=${boehm_gc_basedir}
237 CC="${CC}"
238 DEFS="$DEFS"