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