configure.in (THREADS): Don't --enable-threads on IRIX <= 5.*.
[gcc.git] / boehm-gc / configure.in
1 dnl Process this file with autoconf to produce configure.
2
3 AC_INIT(gc_mark.h)
4
5 dnl Can't be done in BOEHM_CONFIGURE because that confuses automake.
6 AC_CONFIG_AUX_DIR(..)
7
8 AC_CANONICAL_SYSTEM
9
10 BOEHM_CONFIGURE(.)
11
12 AM_PROG_LIBTOOL
13
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])
20
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
27 fi
28
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)
34
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
66 fi
67
68 INCLUDES=
69 THREADLIB=
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 THREADLIB=-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(THREADLIB)
100
101 AC_ARG_ENABLE(java-gc,
102 changequote(<<,>>)dnl
103 << --enable-java-gc=TYPE choose garbage collector [boehm]>>,
104 changequote([,])
105 GC=$enableval,
106 GC=boehm)
107 target_all=
108 if test "$GC" = "boehm"; then
109 target_all=libgcjgc.la
110 fi
111 AC_SUBST(target_all)
112
113 dnl If the target is an eCos system, use the appropriate eCos
114 dnl I/O routines.
115 dnl FIXME: this should not be a local option but a global target
116 dnl system; at present there is no eCos target.
117 TARGET_ECOS="no"
118 AC_ARG_WITH(ecos,
119 [ --with-ecos enable runtime eCos target support],
120 TARGET_ECOS="$with_ecos"
121 )
122
123 addobjs=
124 CXXINCLUDES=
125 case "$TARGET_ECOS" in
126 no)
127 ;;
128 *)
129 AC_DEFINE(ECOS)
130 CXXINCLUDES="-I${TARGET_ECOS}/include"
131 addobjs="$addobjs ecos.lo"
132 ;;
133 esac
134 AC_SUBST(CXX)
135
136 AC_SUBST(INCLUDES)
137 AC_SUBST(CXXINCLUDES)
138
139 machdep=
140 case "$host" in
141 # alpha_mach_dep.s assumes that pointers are not saved in fp registers.
142 # Gcc on a 21264 can spill pointers to fp registers. Oops.
143 # alpha*-*-*)
144 # machdep="alpha_mach_dep.lo"
145 # ;;
146 mipstx39-*-elf*)
147 machdep="mips_ultrix_mach_dep.lo"
148 AC_DEFINE(STACKBASE, __stackbase)
149 AC_DEFINE(DATASTART_IS_ETEXT)
150 ;;
151 mips-dec-ultrix*)
152 machdep="mips_ultrix_mach-dep.lo"
153 ;;
154 mips-*-*)
155 machdep="mips_sgi_mach_dep.lo"
156 AC_DEFINE(NO_EXECUTE_PERMISSION)
157 ;;
158 sparc-sun-solaris2.3*)
159 AC_DEFINE(SUNOS53_SHARED_LIB)
160 ;;
161 esac
162 if test x"$machdep" = x; then
163 machdep="mach_dep.lo"
164 fi
165 addobjs="$addobjs $machdep"
166 AC_SUBST(addobjs)
167
168 dnl As of 4.13a2, the collector will not properly work on Solaris when
169 dnl built with gcc and -O. So we remove -O in the appropriate case.
170 case "$host" in
171 sparc-sun-solaris2*)
172 if test "$GCC" = yes; then
173 new_CFLAGS=
174 for i in $CFLAGS; do
175 case "$i" in
176 -O*)
177 ;;
178 *)
179 new_CFLAGS="$new_CFLAGS $i"
180 ;;
181 esac
182 done
183 CFLAGS="$new_CFLAGS"
184 fi
185 ;;
186 esac
187
188 dnl We need to override the top-level CFLAGS. This is how we do it.
189 MY_CFLAGS="$CFLAGS"
190 AC_SUBST(MY_CFLAGS)
191
192 dnl Define a few things to retarget the library towards
193 dnl embedded Java.
194 AC_DEFINE(SILENT)
195 AC_DEFINE(NO_SIGNALS)
196 AC_DEFINE(NO_DEBUGGING)
197 AC_DEFINE(JAVA_FINALIZATION)
198
199 dnl This is something of a hack. When cross-compiling we turn off
200 dnl some functionality. We also enable the "small" configuration.
201 dnl These is only correct when targetting an embedded system. FIXME.
202 if test -n "${with_cross_host}"; then
203 AC_DEFINE(NO_SIGSET)
204 AC_DEFINE(NO_CLOCK)
205 AC_DEFINE(SMALL_CONFIG)
206 fi
207
208 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
209
210 if test "${multilib}" = "yes"; then
211 multilib_arg="--enable-multilib"
212 else
213 multilib_arg=
214 fi
215
216 AC_OUTPUT(Makefile,
217 [
218 dnl Put all the -D options in a file. These are required before
219 dnl boehm-config.h can be included. This is a huge hack brought
220 dnl about by overall poor structuring of this entire library.
221 echo "$DEFS" > boehm-cflags
222
223 if test -n "$CONFIG_FILES"; then
224 ac_file=Makefile . ${boehm_gc_basedir}/../config-ml.in
225 fi],
226 srcdir=${srcdir}
227 host=${host}
228 target=${target}
229 with_multisubdir=${with_multisubdir}
230 ac_configure_args="${multilib_arg} ${ac_configure_args}"
231 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
232 boehm_gc_basedir=${boehm_gc_basedir}
233 CC="${CC}"
234 DEFS="$DEFS"
235 )