]> git.ipfire.org Git - thirdparty/gcc.git/blob - libjava/configure.host
Add missing docs for feature added by Richard Henderson.
[thirdparty/gcc.git] / libjava / configure.host
1 # configure.host
2
3 # This shell script handles all host based configuration for libgcj.
4 # It sets various shell variables based on the the host and the
5 # configuration options. You can modify this shell script without
6 # needing to rerun autoconf.
7
8 # This shell script should be invoked as
9 # . configure.host
10 # If it encounters an error, it will exit with a message.
11
12 # It uses the following shell variables:
13 # host The configuration host
14 # host_cpu The configuration host CPU
15 # target_optspace --enable-target-optspace ("yes", "no", "")
16
17 # It sets the following shell variables:
18 # libgcj_cflags Special CFLAGS to use when building
19 # libgcj_cxxflags Special CXXFLAGS to use when building
20 # libgcj_javaflags Special JAVAFLAGS to use when building
21 # libgcj_interpreter If the bytecode interpreter supports this platform.
22 # enable_java_net_default If java.net native code should be enabled by
23 # default.
24 # enable_hash_synchronization_default If hash synchronization should be
25 # enabled by default.
26 # sysdeps_dir Directory containing system-dependent headers
27 # slow_pthread_self The synchronization code should try to avoid
28 # pthread_self calls by caching thread IDs in a hashtable
29 # can_unwind_signal Set to "yes" if the EH unwinder supports throwing
30 # from a signal handler.
31 # disable_dladdr Set to "yes" if dladdr should not be used
32 # (i.e it is broken).
33 # fallback_backtrace_h Header to use for fallback backtrace implementation
34 # (only for targets that don't support DWARF2 unwind)
35 # descriptor_h Header to use for looking past function descriptors
36
37 libgcj_flags=
38 libgcj_cflags=
39 libgcj_cxxflags=
40 libgcj_javaflags=
41 libgcj_interpreter=
42 enable_java_net_default=yes
43 enable_hash_synchronization_default=no
44 sysdeps_dir=generic
45 slow_pthread_self=
46 can_unwind_signal=no
47 disable_dladdr=
48 fallback_backtrace_h=sysdep/generic/backtrace.h
49
50 case "${target_optspace}:${host}" in
51 yes:*)
52 libgcj_flags="${libgcj_flags} -Os"
53 ;;
54 :m32r-* | :d10v-* | :d30v-*)
55 libgcj_flags="${libgcj_flags} -Os"
56 ;;
57 no:* | :*)
58 # Nothing.
59 ;;
60 esac
61
62 AM_RUNTESTFLAGS=
63
64 # Set any host dependent compiler flags.
65 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
66
67 echo "$target"
68
69 DIVIDESPEC=-fuse-divide-subroutine
70 EXCEPTIONSPEC=-fnon-call-exceptions
71 CHECKREFSPEC=
72 BACKTRACESPEC=
73
74 # This case statement supports per-CPU defaults.
75 case "${host}" in
76 arm*-elf | strongarm*-elf | xscale*-elf)
77 with_libffi_default=no
78 PROCESS=Ecos
79 FILE=Posix
80 CHECKREFSPEC=-fcheck-references
81 EXCEPTIONSPEC=
82 enable_java_net_default=no
83 enable_getenv_properties_default=no
84 enable_main_args_default=no
85 ;;
86 mips-tx39-*|mipstx39-unknown-*)
87 libgcj_flags="${libgcj_flags} -G 0"
88 LDFLAGS="$LDFLAGS -Tjmr3904dram.ld"
89 AM_RUNTESTFLAGS="--target_board=jmr3904-sim"
90 # Use "Ecos" processes since they are a no-op.
91 PROCESS=Ecos
92 FILE=Posix
93 enable_java_net_default=no
94 enable_getenv_properties_default=no
95 ;;
96 i686-*|i586-*|i486-*|i386-*)
97 sysdeps_dir=i386
98 libgcj_flags="${libgcj_flags} -ffloat-store"
99 libgcj_interpreter=yes
100 libgcj_cxxflags=
101 libgcj_cflags=
102 DIVIDESPEC=-fno-use-divide-subroutine
103 BACKTRACESPEC=-fomit-frame-pointer
104 enable_hash_synchronization_default=yes
105 slow_pthread_self=yes
106 ;;
107 x86_64-*)
108 sysdeps_dir=x86-64
109 libgcj_flags="${libgcj_flags} -ffloat-store"
110 libgcj_cxxflags=
111 libgcj_cflags=
112 DIVIDESPEC=-f%{m32:no-}use-divide-subroutine
113 enable_hash_synchronization_default=yes
114 slow_pthread_self=yes
115 libgcj_interpreter=yes
116 ;;
117 alpha*-*)
118 sysdeps_dir=alpha
119 libgcj_flags="${libgcj_flags} -mieee"
120 libgcj_interpreter=yes
121 enable_hash_synchronization_default=yes
122 IEEESPEC=-mieee
123 ;;
124 hppa-*)
125 sysdeps_dir=pa
126 libgcj_interpreter=yes
127 enable_hash_synchronization_default=yes
128 ;;
129 powerpc64*-*)
130 sysdeps_dir=powerpc
131 libgcj_interpreter=yes
132 if [ x`$CC -print-multi-os-directory` = x../lib64 ]; then
133 libgcj_flags="${libgcj_flags} -mminimal-toc"
134 fi
135 enable_hash_synchronization_default=yes
136 slow_pthread_self=yes
137 ;;
138 powerpc*-*)
139 sysdeps_dir=powerpc
140 libgcj_interpreter=yes
141 enable_hash_synchronization_default=yes
142 slow_pthread_self=yes
143 ;;
144 s390*-*)
145 sysdeps_dir=s390
146 libgcj_interpreter=yes
147 DIVIDESPEC=-fno-use-divide-subroutine
148 enable_hash_synchronization_default=yes
149 ;;
150 sparc*-*)
151 libgcj_interpreter=yes
152 ;;
153 ia64-*)
154 sysdeps_dir=ia64
155 libgcj_flags="${libgcj_flags} -funwind-tables"
156 libgcj_interpreter=yes
157 enable_hash_synchronization_default=yes
158 ;;
159 sh-* | sh[34]*-*)
160 sysdeps_dir=sh
161 libgcj_flags="${libgcj_flags} -mieee"
162 libgcj_interpreter=yes
163 enable_hash_synchronization_default=yes
164 IEEESPEC=-mieee
165 ;;
166 esac
167
168 # This case statement supports generic port properties and may refine
169 # the above per-CPU defaults. Note: If your OS implements
170 # MD_FALLBACK_FRAME_STATE_FOR, then you want to set can_unwind_signal
171 # here.
172 case "${host}" in
173 i[34567]86*-linux* | \
174 powerpc*-linux* | \
175 alpha*-linux* | \
176 s390*-linux* | \
177 sparc*-linux* | \
178 ia64-* | \
179 x86_64*-linux* | \
180 hppa*-linux* | \
181 sh-linux* | sh[34]*-linux*)
182 can_unwind_signal=yes
183 libgcj_ld_symbolic='-Wl,-Bsymbolic'
184 if test x$slow_pthread_self = xyes \
185 && test x$cross_compiling != xyes; then
186 cat > conftest.c <<EOF
187 #define _GNU_SOURCE 1
188 #include <pthread.h>
189 #include <stdlib.h>
190 #include <sys/resource.h>
191 #include <limits.h>
192
193 void *
194 tf (void *arg __attribute__ ((unused)))
195 {
196 pthread_attr_t a;
197 size_t s;
198
199 if (pthread_getattr_np (pthread_self (), &a)
200 || pthread_attr_getstacksize (&a, &s)
201 || s > 2 * PTHREAD_STACK_MIN)
202 exit (1);
203 exit (0);
204 }
205
206 int
207 main (int argc, char **argv)
208 {
209 pthread_t p;
210 void *ret;
211 struct rlimit r;
212
213 if (argc == 2)
214 {
215 r.rlim_cur = 2 * PTHREAD_STACK_MIN;
216 r.rlim_max = 2 * PTHREAD_STACK_MIN;
217 if (setrlimit (RLIMIT_STACK, &r))
218 exit (1);
219 execl (argv[1], argv[0], NULL);
220 exit (1);
221 }
222
223 if (pthread_create (&p, NULL, tf, NULL)
224 || pthread_join (p, &ret))
225 exit (1);
226 exit (1);
227 }
228 EOF
229 $CC -o conftest conftest.c -lpthread > /dev/null 2>&1 && \
230 ./conftest ./conftest && slow_pthread_self=
231 rm -f conftest conftest.c
232 fi
233 ;;
234 i[34567]86-*-solaris2.1[0-9]* )
235 sysdeps_dir=x86-64
236 DIVIDESPEC=-f%{m32:no-}%{!m32:%{!m64:no-}}%{m64:}use-divide-subroutine
237 ;;
238 mips*-*-linux* )
239 sysdeps_dir=mips
240 can_unwind_signal=yes
241 DIVIDESPEC=-fno-use-divide-subroutine
242 case "${host}" in
243 mipsel*-linux* | mipsisa32el*-linux*)
244 enable_hash_synchronization_default=yes
245 disable_dladdr=yes
246 ;;
247 esac
248 ;;
249 powerpc*-*-darwin*)
250 enable_hash_synchronization_default=yes
251 slow_pthread_self=
252 can_unwind_signal=yes
253 ;;
254 *-*-freebsd*)
255 slow_pthread_self=
256 ;;
257 *-mingw*)
258 # FIXME: win32_exception_handler( ) in win32.cc does not do the
259 # right stuff yet w.r.t. SEH. Live with the following for now.
260 can_unwind_signal=no
261 CHECKREFSPEC=-fcheck-references
262 DIVIDESPEC=-fuse-divide-subroutine
263 ;;
264 *-cygwin*)
265 # The cygwin linker doesn't do 8-byte alignment by default, so
266 # disable hash synchronization for now.
267 enable_hash_synchronization_default=no
268 slow_pthread_self=
269 ;;
270 esac
271
272 case "${host}" in
273 *-cygwin* | *-mingw*)
274 fallback_backtrace_h=sysdep/i386/backtrace.h
275 # We need a frame pointer on Windows, so override BACKTRACESPEC
276 BACKTRACESPEC=
277 ;;
278 esac
279
280 case "${host}" in
281 ia64-* | hppa*-*)
282 descriptor_h=sysdep/descriptor-y.h
283 ;;
284
285 rs6000-* | powerpc*-*)
286 descriptor_h=sysdep/powerpc/descriptor.h
287 ;;
288
289 *)
290 descriptor_h=sysdep/descriptor-n.h
291 ;;
292 esac
293
294 libgcj_cflags="${libgcj_cflags} ${libgcj_flags}"
295 libgcj_cxxflags="${libgcj_cxxflags} ${libgcj_flags}"
296 libgcj_javaflags="${libgcj_javaflags} ${libgcj_flags}"