* linux_threads.c: Don't reference __pthread_initial_thread_bos.
[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 Configuring with a cross compiler])
17 AC_ARG_WITH(cross-host,
18 [ --with-cross-host=HOST Configuring with a cross compiler])
19
20 AM_MAINTAINER_MODE
21 # automake wants to see AC_EXEEXT. But we don't need it. And having
22 # it is actually a problem, because the compiler we're passed can't
23 # necessarily do a full link. So we fool automake here.
24 if test "x" = "y"; then
25 AC_EXEEXT
26 fi
27
28 AC_MSG_CHECKING([for threads package to use])
29 AC_ARG_ENABLE(threads, [ --enable-threads=TYPE choose threading package],
30 THREADS=$enableval,
31 dnl FIXME: figure out native threads to use here.
32 THREADS=no)
33
34 if test "$THREADS" = yes; then
35 case "$host" in
36 *-*-vxworks*)
37 THREADS=vxworks
38 ;;
39 *-*-linux*)
40 # FIXME: this isn't correct in all cases.
41 THREADS=posix
42 ;;
43 *-*-win*)
44 THREADS=win32
45 ;;
46 *-*-irix*)
47 THREADS=irix
48 ;;
49 *-*-solaris*)
50 # FIXME: for now, choose POSIX, because we implement that.
51 # Later, choose solaris threads.
52 THREADS=posix
53 ;;
54 *)
55 # For now.
56 THREADS=none
57 ;;
58 esac
59 fi
60
61 INCLUDES=
62 case "$THREADS" in
63 no | none | single)
64 THREADS=none
65 ;;
66 posix | pthreads)
67 THREADS=posix
68 case "$host" in
69 *-*-linux*)
70 AC_DEFINE(LINUX_THREADS)
71 AC_DEFINE(_REENTRANT)
72 ;;
73 *-*-solaris*)
74 AC_DEFINE(SOLARIS_THREADS)
75 AC_DEFINE(_SOLARIS_PTHREADS)
76 ;;
77 esac
78 ;;
79 qt)
80 AC_DEFINE(QUICK_THREADS)
81 INCLUDES="-I${boehm_gc_basedir}/../qthreads"
82 ;;
83 decosf1 | irix | mach | os2 | solaris | win32 | dce | vxworks)
84 AC_MSG_ERROR(thread package $THREADS not yet supported)
85 ;;
86 *)
87 AC_MSG_ERROR($THREADS is an unknown thread package)
88 ;;
89 esac
90 AC_MSG_RESULT($THREADS)
91
92 AC_ARG_ENABLE(java-gc,
93 changequote(<<,>>)dnl
94 << --enable-java-gc=TYPE choose garbage collector [boehm]>>,
95 changequote([,])
96 GC=$enableval,
97 GC=boehm)
98 target_all=
99 if test "$GC" = "boehm"; then
100 target_all=libgcjgc.la
101 fi
102 AC_SUBST(target_all)
103
104 dnl If the target is an eCos system, use the appropriate eCos
105 dnl I/O routines.
106 dnl FIXME: this should not be a local option but a global target
107 dnl system; at present there is no eCos target.
108 TARGET_ECOS="no"
109 AC_ARG_WITH(ecos,
110 [ --with-ecos Enable runtime eCos target support.],
111 TARGET_ECOS="$with_ecos"
112 )
113
114 addobjs=
115 CXXINCLUDES=
116 case "$TARGET_ECOS" in
117 no)
118 ;;
119 *)
120 AC_DEFINE(ECOS)
121 CXXINCLUDES="-I${TARGET_ECOS}/include"
122 addobjs="$addobjs ecos.lo"
123 ;;
124 esac
125 AC_SUBST(CXX)
126
127 AC_SUBST(INCLUDES)
128 AC_SUBST(CXXINCLUDES)
129
130 machdep=
131 case "$host" in
132 alpha-*-*)
133 machdep="alpha_mach_dep.lo"
134 ;;
135 mipstx39-*-elf*)
136 machdep="mips_ultrix_mach_dep.lo"
137 AC_DEFINE(STACKBASE, __stackbase)
138 AC_DEFINE(DATASTART_IS_ETEXT)
139 ;;
140 sparc-sun-solaris2.3*)
141 AC_DEFINE(SUNOS53_SHARED_LIB)
142 ;;
143 esac
144 if test x"$machdep" = x; then
145 machdep="mach_dep.lo"
146 fi
147 addobjs="$addobjs $machdep"
148 AC_SUBST(addobjs)
149
150 dnl As of 4.13a2, the collector will not properly work on Solaris when
151 dnl built with gcc and -O. So we remove -O in the appropriate case.
152 case "$host" in
153 sparc-sun-solaris2*)
154 if test "$GCC" = yes; then
155 new_CFLAGS=
156 for i in $CFLAGS; do
157 case "$i" in
158 -O*)
159 ;;
160 *)
161 new_CFLAGS="$new_CFLAGS $i"
162 ;;
163 esac
164 done
165 CFLAGS="$new_CFLAGS"
166 fi
167 ;;
168 esac
169
170 dnl We need to override the top-level CFLAGS. This is how we do it.
171 MY_CFLAGS="$CFLAGS"
172 AC_SUBST(MY_CFLAGS)
173
174 dnl Define a few things to retarget the library towards
175 dnl embedded Java.
176 AC_DEFINE(SILENT)
177 AC_DEFINE(NO_SIGNALS)
178 AC_DEFINE(NO_DEBUGGING)
179 AC_DEFINE(JAVA_FINALIZATION)
180
181 dnl Create boehm-config.h so that libjava can find it.
182 dnl It is required to use gc_priv.h, which is required to write
183 dnl a new marking function. So config.h in this package is
184 dnl poorly named.
185 AC_LINK_FILES(config.h, boehm-config.h)
186
187 dnl This is something of a hack. When cross-compiling we turn off
188 dnl some functionality. We also enable the "small" configuration.
189 dnl These is only correct when targetting an embedded system. FIXME.
190 if test -n "${with_cross_host}"; then
191 AC_DEFINE(NO_SIGSET)
192 AC_DEFINE(NO_CLOCK)
193 AC_DEFINE(SMALL_CONFIG)
194 fi
195
196 if test "${multilib}" = "yes"; then
197 multilib_arg="--enable-multilib"
198 else
199 multilib_arg=
200 fi
201
202 AC_OUTPUT(Makefile,
203 [
204 dnl Put all the -D options in a file. These are required before
205 dnl boehm-config.h can be included. This is a huge hack brought
206 dnl about by overall poor structuring of this entire library.
207 echo "$DEFS" > boehm-cflags
208
209 if test -n "$CONFIG_FILES"; then
210 ac_file=Makefile . ${boehm_gc_basedir}/../config-ml.in
211 fi],
212 srcdir=${srcdir}
213 host=${host}
214 target=${target}
215 with_multisubdir=${with_multisubdir}
216 ac_configure_args="${multilib_arg} ${ac_configure_args}"
217 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
218 boehm_gc_basedir=${boehm_gc_basedir}
219 CC="${CC}"
220 DEFS="$DEFS"
221 )