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