source: trunk/src/gcc/boehm-gc/configure.in@ 1330

Last change on this file since 1330 was 2, checked in by bird, 22 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 7.7 KB
Line 
1# Copyright (c) 1999, 2000, 2001, 2002, 2003 by Red Hat, Inc. All rights reserved.
2#
3# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
4# OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
5#
6# Permission is hereby granted to use or copy this program
7# for any purpose, provided the above notices are retained on all copies.
8# Permission to modify the code and to distribute modified code is granted,
9# provided the above notices are retained, and a notice that the code was
10# modified is included with the above copyright notice.
11#
12# Original author: Tom Tromey
13
14dnl Process this file with autoconf to produce configure.
15
16AC_INIT(gcj_mlc.c)
17
18# This works around the fact that libtool configuration may change LD
19# for this particular configuration, but some shells, instead of
20# keeping the changes in LD private, export them just because LD is
21# exported.
22ORIGINAL_LD_FOR_MULTILIBS=$LD
23
24dnl Can't be done in GC_CONFIGURE because that confuses automake.
25AC_CONFIG_AUX_DIR(.)
26
27GC_CONFIGURE(.)
28
29AM_PROG_LIBTOOL
30
31dnl We use these options to decide which functions to include.
32AC_ARG_WITH(target-subdir,
33[ --with-target-subdir=SUBDIR
34 configuring with a cross compiler])
35AC_ARG_WITH(cross-host,
36[ --with-cross-host=HOST configuring with a cross compiler])
37
38AM_MAINTAINER_MODE
39# automake wants to see AC_EXEEXT. But we don't need it. And having
40# it is actually a problem, because the compiler we're passed can't
41# necessarily do a full link. So we fool automake here.
42if false; then
43 # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
44 # to nothing, so nothing would remain between `then' and `fi' if it
45 # were not for the `:' below.
46 :
47 AC_EXEEXT
48fi
49
50AC_MSG_CHECKING([for thread model used by GCC])
51THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
52if test -z "$THREADS"; then
53 THREADS=no
54fi
55AC_MSG_RESULT([$THREADS])
56
57AC_ARG_ENABLE(parallel-mark,
58[ --enable-parallel-mark parallelize marking and free list construction],
59 [case "$THREADS" in
60 no | none | single)
61 AC_MSG_ERROR([Parallel mark requires --enable-threads=x spec])
62 ;;
63 esac]
64)
65
66INCLUDES=-I${srcdir}/include
67THREADLIBS=
68case "$THREADS" in
69 no | none | single)
70 THREADS=none
71 ;;
72 posix | pthreads)
73 THREADS=posix
74 THREADLIBS=-lpthread
75 case "$host" in
76 x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux*)
77 AC_DEFINE(GC_LINUX_THREADS)
78 AC_DEFINE(_REENTRANT)
79 if test "${enable_parallel_mark}"; then
80 AC_DEFINE(PARALLEL_MARK)
81 fi
82 AC_DEFINE(THREAD_LOCAL_ALLOC)
83 ;;
84 *-*-linux*)
85 AC_DEFINE(GC_LINUX_THREADS)
86 AC_DEFINE(_REENTRANT)
87 ;;
88 *-*-hpux*)
89 AC_MSG_WARN("Only HP/UX 11 threads are supported.")
90 AC_DEFINE(GC_HPUX_THREADS)
91 AC_DEFINE(_POSIX_C_SOURCE,199506L)
92 if test "${enable_parallel_mark}" = yes; then
93 AC_DEFINE(PARALLEL_MARK)
94 fi
95 AC_DEFINE(THREAD_LOCAL_ALLOC)
96 THREADLIBS="-lpthread -lrt"
97 ;;
98 *-*-freebsd*)
99 AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
100 AC_DEFINE(GC_FREEBSD_THREADS)
101 INCLUDES="$INCLUDES -pthread"
102 THREADLIBS=-pthread
103 ;;
104 *-*-solaris*)
105 AC_DEFINE(GC_SOLARIS_THREADS)
106 AC_DEFINE(GC_SOLARIS_PTHREADS)
107 ;;
108 *-*-irix*)
109 AC_DEFINE(GC_IRIX_THREADS)
110 ;;
111 *-*-cygwin*)
112 THREADLIBS=
113 ;;
114 esac
115 ;;
116 win32)
117 AC_DEFINE(GC_WIN32_THREADS)
118 AC_DEFINE(NO_GETENV)
119 ;;
120 decosf1 | irix | mach | os2 | solaris | dce | vxworks)
121 AC_MSG_ERROR(thread package $THREADS not yet supported)
122 ;;
123 *)
124 AC_MSG_ERROR($THREADS is an unknown thread package)
125 ;;
126esac
127AC_SUBST(THREADLIBS)
128
129AC_CHECK_LIB(dl, dlopen, EXTRA_TEST_LIBS="$EXTRA_TEST_LIBS -ldl")
130AC_SUBST(EXTRA_TEST_LIBS)
131
132target_all=libgcjgc.la
133AC_SUBST(target_all)
134AC_SUBST(target_alias)
135
136dnl If the target is an eCos system, use the appropriate eCos
137dnl I/O routines.
138dnl FIXME: this should not be a local option but a global target
139dnl system; at present there is no eCos target.
140TARGET_ECOS="no"
141AC_ARG_WITH(ecos,
142[ --with-ecos enable runtime eCos target support],
143TARGET_ECOS="$with_ecos"
144)
145
146addobjs=
147CXXINCLUDES=
148case "$TARGET_ECOS" in
149 no)
150 ;;
151 *)
152 AC_DEFINE(ECOS)
153 CXXINCLUDES="-I${TARGET_ECOS}/include"
154 addobjs="$addobjs ecos.lo"
155 ;;
156esac
157AC_SUBST(CXX)
158
159AC_SUBST(INCLUDES)
160AC_SUBST(CXXINCLUDES)
161
162machdep=
163case "$host" in
164 alpha*-*-openbsd*)
165 machdep="alpha_mach_dep.lo"
166 if test x"${ac_cv_lib_dl_dlopen}" != xyes ; then
167 AC_MSG_WARN(OpenBSD/Alpha without dlopen(). Shared library support is disabled)
168 AM_DISABLE_SHARED
169 fi
170 ;;
171 alpha*-*-*)
172 machdep="alpha_mach_dep.lo"
173 ;;
174 i?86-*-solaris2.[[89]]*)
175 AC_DEFINE(SOLARIS25_PROC_VDB_BUG_FIXED)
176 ;;
177 mipstx39-*-elf*)
178 machdep="mips_ultrix_mach_dep.lo"
179 AC_DEFINE(STACKBASE, __stackbase)
180 AC_DEFINE(DATASTART_IS_ETEXT)
181 ;;
182 mips-dec-ultrix*)
183 machdep="mips_ultrix_mach-dep.lo"
184 ;;
185 mips-*-*)
186 machdep="mips_sgi_mach_dep.lo"
187 AC_DEFINE(NO_EXECUTE_PERMISSION)
188 ;;
189 sparc-sun-solaris2.3*)
190 machdep="sparc_mach_dep.lo"
191 AC_DEFINE(SUNOS53_SHARED_LIB)
192 ;;
193 sparc-sun-solaris2.*)
194 machdep="sparc_mach_dep.lo"
195 ;;
196 ia64-*-*)
197 machdep="mach_dep.lo ia64_save_regs_in_stack.lo"
198 ;;
199esac
200if test x"$machdep" = x; then
201 machdep="mach_dep.lo"
202fi
203addobjs="$addobjs $machdep"
204AC_SUBST(addobjs)
205
206dnl As of 4.13a2, the collector will not properly work on Solaris when
207dnl built with gcc and -O. So we remove -O in the appropriate case.
208case "$host" in
209 sparc-sun-solaris2*)
210 if test "$GCC" = yes; then
211 new_CFLAGS=
212 for i in $CFLAGS; do
213 case "$i" in
214 -O*)
215 ;;
216 *)
217 new_CFLAGS="$new_CFLAGS $i"
218 ;;
219 esac
220 done
221 CFLAGS="$new_CFLAGS"
222 fi
223 ;;
224esac
225
226dnl We need to override the top-level CFLAGS. This is how we do it.
227MY_CFLAGS="$CFLAGS"
228AC_SUBST(MY_CFLAGS)
229
230dnl Include defines that have become de facto standard.
231dnl ALL_INTERIOR_POINTERS can be overridden in startup code.
232AC_DEFINE(SILENT)
233AC_DEFINE(NO_SIGNALS)
234AC_DEFINE(NO_EXECUTE_PERMISSION)
235AC_DEFINE(ALL_INTERIOR_POINTERS)
236
237dnl By default, make the library as general as possible.
238AC_DEFINE(JAVA_FINALIZATION)
239AC_DEFINE(GC_GCJ_SUPPORT)
240AC_DEFINE(ATOMIC_UNCOLLECTABLE)
241
242dnl This is something of a hack. When cross-compiling we turn off
243dnl some functionality. These is only correct when targetting an
244dnl embedded system. FIXME.
245if test -n "${with_cross_host}"; then
246 AC_DEFINE(NO_SIGSET)
247 AC_DEFINE(NO_DEBUGGING)
248fi
249
250AC_ARG_ENABLE(full-debug,
251[ --enable-full-debug include full support for pointer backtracing etc.],
252[ if test "$enable_full_debug" = "yes"; then
253 AC_MSG_WARN("Must define GC_DEBUG and use debug alloc. in clients.")
254 AC_DEFINE(KEEP_BACK_PTRS)
255 AC_DEFINE(DBG_HDRS_ALL)
256 case $host in
257 ia64-*-linux* )
258 AC_DEFINE(MAKE_BACK_GRAPH)
259 ;;
260 x86-*-linux* | i586-*-linux* | i686-*-linux* )
261 AC_DEFINE(MAKE_BACK_GRAPH)
262 AC_MSG_WARN("Client must not use -fomit-frame-pointer.")
263 AC_DEFINE(SAVE_CALL_COUNT, 8)
264 ;;
265 esac ]
266 fi)
267
268if test -n "$with_cross_host" &&
269 test x"$with_cross_host" != x"no"; then
270 toolexecdir='$(exec_prefix)/$(target_alias)'
271 toolexeclibdir='$(toolexecdir)/lib'
272else
273 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
274 toolexeclibdir='$(libdir)'
275fi
276toolexeclibdir=$toolexeclibdir/`$CC -print-multi-os-directory`
277AC_SUBST(toolexecdir)
278AC_SUBST(toolexeclibdir)
279
280if test "${multilib}" = "yes"; then
281 multilib_arg="--enable-multilib"
282else
283 multilib_arg=
284fi
285
286AC_OUTPUT(Makefile include/Makefile, [
287dnl Put all the -D options in a file.
288echo "$DEFS" > boehm-cflags
289
290if test -n "$CONFIG_FILES"; then
291 LD="${ORIGINAL_LD_FOR_MULTILIBS}"
292 ac_file=Makefile . ${gc_basedir}/../config-ml.in
293fi],
294srcdir=${srcdir}
295host=${host}
296target=${target}
297with_multisubdir=${with_multisubdir}
298ac_configure_args="${multilib_arg} ${ac_configure_args}"
299CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
300gc_basedir=${gc_basedir}
301CC="${CC}"
302DEFS="$DEFS"
303)
Note: See TracBrowser for help on using the repository browser.