* c-decl.c (finish_decl): Don't set DECL_C_HARD_REGISTER for
[official-gcc.git] / boehm-gc / configure.in
blob6a88a95cd4420fdf0a1a4a13bd9d38ff84c716a3
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 thread model used by GCC])
30 THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
31 AC_MSG_RESULT([$THREADS])
33 INCLUDES=
34 THREADLIBS=
35 case "$THREADS" in
36  no | none | single)
37     THREADS=none
38     ;;
39  posix | pthreads)
40     THREADS=posix
41     case "$host" in
42      *-*-linux*)
43         AC_DEFINE(LINUX_THREADS)
44         AC_DEFINE(_REENTRANT)
45         ;;
46      *-*-solaris*)
47         AC_DEFINE(SOLARIS_THREADS)
48         AC_DEFINE(_SOLARIS_PTHREADS)
49         ;;
50      *-*-irix*)
51         AC_DEFINE(IRIX_THREADS)
52         ;;
53     esac
54     THREADLIBS=-lpthread
55     ;;
56  decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks)
57     AC_MSG_ERROR(thread package $THREADS not yet supported)
58     ;;
59  *)
60     AC_MSG_ERROR($THREADS is an unknown thread package)
61     ;;
62 esac
63 AC_SUBST(THREADLIBS)
65 AC_CHECK_LIB(dl, dlopen, EXTRA_TEST_LIBS="$EXTRA_TEST_LIBS -ldl")
66 AC_SUBST(EXTRA_TEST_LIBS)
68 AC_ARG_ENABLE(java-gc,
69 changequote(<<,>>)dnl
70 <<  --enable-java-gc=TYPE   choose garbage collector [boehm]>>,
71 changequote([,])
72   GC=$enableval,
73   GC=boehm)
74 target_all=
75 if test "$GC" = "boehm"; then
76    target_all=libgcjgc.la
78 AC_SUBST(target_all)
80 dnl If the target is an eCos system, use the appropriate eCos
81 dnl I/O routines.
82 dnl FIXME: this should not be a local option but a global target
83 dnl system; at present there is no eCos target.
84 TARGET_ECOS="no"
85 AC_ARG_WITH(ecos,
86 [  --with-ecos             enable runtime eCos target support],
87 TARGET_ECOS="$with_ecos"
90 addobjs=
91 CXXINCLUDES=
92 case "$TARGET_ECOS" in
93    no)
94       ;;
95    *)
96       AC_DEFINE(ECOS)
97       CXXINCLUDES="-I${TARGET_ECOS}/include"
98       addobjs="$addobjs ecos.lo"
99       ;;
100 esac
101 AC_SUBST(CXX)
103 AC_SUBST(INCLUDES)
104 AC_SUBST(CXXINCLUDES)
106 machdep=
107 case "$host" in
108 # alpha_mach_dep.s assumes that pointers are not saved in fp registers.
109 # Gcc on a 21264 can spill pointers to fp registers.  Oops.
110 # alpha*-*-*)
111 #    machdep="alpha_mach_dep.lo"
112 #    ;;
113  mipstx39-*-elf*)
114     machdep="mips_ultrix_mach_dep.lo"
115     AC_DEFINE(STACKBASE, __stackbase)
116     AC_DEFINE(DATASTART_IS_ETEXT)
117     ;;
118  mips-dec-ultrix*)
119     machdep="mips_ultrix_mach-dep.lo"
120     ;;
121  mips-*-*)
122     machdep="mips_sgi_mach_dep.lo"
123     AC_DEFINE(NO_EXECUTE_PERMISSION)
124     ;;
125  sparc-sun-solaris2.3*)
126     AC_DEFINE(SUNOS53_SHARED_LIB)
127     ;;
128 esac
129 if test x"$machdep" = x; then
130    machdep="mach_dep.lo"
132 addobjs="$addobjs $machdep"
133 AC_SUBST(addobjs)
135 dnl As of 4.13a2, the collector will not properly work on Solaris when
136 dnl built with gcc and -O.  So we remove -O in the appropriate case.
137 case "$host" in
138  sparc-sun-solaris2*)
139     if test "$GCC" = yes; then
140        new_CFLAGS=
141        for i in $CFLAGS; do
142           case "$i" in
143            -O*)
144               ;;
145            *)
146               new_CFLAGS="$new_CFLAGS $i"
147               ;;
148           esac
149        done
150        CFLAGS="$new_CFLAGS"
151     fi
152     ;;
153 esac
155 dnl We need to override the top-level CFLAGS.  This is how we do it.
156 MY_CFLAGS="$CFLAGS"
157 AC_SUBST(MY_CFLAGS)
159 dnl Define a few things to retarget the library towards
160 dnl embedded Java.
161 AC_DEFINE(SILENT)
162 AC_DEFINE(NO_SIGNALS)
163 AC_DEFINE(JAVA_FINALIZATION)
164 AC_DEFINE(GC_GCJ_SUPPORT)
166 dnl This is something of a hack.  When cross-compiling we turn off
167 dnl some functionality.  We also enable the "small" configuration.
168 dnl These is only correct when targetting an embedded system.  FIXME.
169 if test -n "${with_cross_host}"; then
170    AC_DEFINE(NO_SIGSET)
171    AC_DEFINE(NO_CLOCK)
172    AC_DEFINE(SMALL_CONFIG)
173    AC_DEFINE(NO_DEBUGGING)
176 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
178 if test "${multilib}" = "yes"; then
179   multilib_arg="--enable-multilib"
180 else
181   multilib_arg=
184 AC_OUTPUT(Makefile,
186 dnl Put all the -D options in a file.  These are required before
187 dnl boehm-config.h can be included.  This is a huge hack brought
188 dnl about by overall poor structuring of this entire library.
189 echo "$DEFS" > boehm-cflags
191 if test -n "$CONFIG_FILES"; then
192   ac_file=Makefile . ${boehm_gc_basedir}/../config-ml.in
193 fi],
194 srcdir=${srcdir}
195 host=${host}
196 target=${target}
197 with_multisubdir=${with_multisubdir}
198 ac_configure_args="${multilib_arg} ${ac_configure_args}"
199 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
200 boehm_gc_basedir=${boehm_gc_basedir}
201 CC="${CC}"
202 DEFS="$DEFS"