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.
8 # This shell script should be invoked as
10 # If it encounters an error, it will exit with a message.
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", "")
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
24 # enable_hash_synchronization_default If hash synchronization should be
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
39 enable_java_net_default=yes
40 enable_hash_synchronization_default=no
46 case "${target_optspace}:${host}" in
48 libgcj_flags="${libgcj_flags} -Os"
50 :m32r-* | :d10v-* | :d30v-*)
51 libgcj_flags="${libgcj_flags} -Os"
60 # Set any host dependent compiler flags.
61 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
65 DIVIDESPEC=-fuse-divide-subroutine
66 EXCEPTIONSPEC=-fnon-call-exceptions
69 # This case statement supports per-CPU defaults.
71 arm*-elf | strongarm*-elf | xscale*-elf)
72 with_libffi_default=no
75 CHECKREFSPEC=-fcheck-references
77 enable_java_net_default=no
78 enable_getenv_properties_default=no
79 enable_main_args_default=no
81 mips-tx39-*|mipstx39-unknown-*)
82 libgcj_flags="${libgcj_flags} -G 0"
83 LDFLAGS="$LDFLAGS -Tjmr3904dram.ld"
84 AM_RUNTESTFLAGS="--target_board=jmr3904-sim"
85 # Use "Ecos" processes since they are a no-op.
88 enable_java_net_default=no
89 enable_getenv_properties_default=no
91 i686-*|i586-*|i486-*|i386-*)
93 libgcj_flags="${libgcj_flags} -ffloat-store -fno-omit-frame-pointer"
94 libgcj_interpreter=yes
97 DIVIDESPEC=-fno-use-divide-subroutine
98 enable_hash_synchronization_default=yes
103 libgcj_flags="${libgcj_flags} -ffloat-store -fno-omit-frame-pointer"
106 DIVIDESPEC=-f%{m32:no-}use-divide-subroutine
107 enable_hash_synchronization_default=yes
108 slow_pthread_self=yes
109 libgcj_interpreter=yes
113 libgcj_flags="${libgcj_flags} -mieee"
114 libgcj_interpreter=yes
115 enable_hash_synchronization_default=yes
120 libgcj_interpreter=yes
121 enable_hash_synchronization_default=yes
125 libgcj_interpreter=yes
126 if [ x`$CC -print-multi-os-directory` = x../lib64 ]; then
127 libgcj_flags="${libgcj_flags} -mminimal-toc"
129 enable_hash_synchronization_default=yes
130 slow_pthread_self=yes
134 libgcj_interpreter=yes
135 enable_hash_synchronization_default=yes
136 slow_pthread_self=yes
140 libgcj_interpreter=yes
141 DIVIDESPEC=-fno-use-divide-subroutine
142 enable_hash_synchronization_default=yes
145 libgcj_interpreter=yes
149 libgcj_flags="${libgcj_flags} -funwind-tables"
150 libgcj_interpreter=yes
151 enable_hash_synchronization_default=yes
155 libgcj_flags="${libgcj_flags} -mieee"
156 libgcj_interpreter=yes
157 enable_hash_synchronization_default=yes
161 # This case statement supports generic port properties and may refine
162 # the above per-CPU defaults. Note: If your OS implements
163 # MD_FALLBACK_FRAME_STATE_FOR, then you want to set can_unwind_signal
166 i[34567]86*-linux* | \
174 sh-linux* | sh[34]*-linux*)
175 can_unwind_signal=yes
176 if test x$slow_pthread_self = xyes \
177 && test x$cross_compiling != xyes; then
178 cat > conftest.c <<EOF
179 #define _GNU_SOURCE 1
182 #include <sys/resource.h>
186 tf (void *arg __attribute__ ((unused)))
191 if (pthread_getattr_np (pthread_self (), &a)
192 || pthread_attr_getstacksize (&a, &s)
193 || s > 2 * PTHREAD_STACK_MIN)
199 main (int argc, char **argv)
207 r.rlim_cur = 2 * PTHREAD_STACK_MIN;
208 r.rlim_max = 2 * PTHREAD_STACK_MIN;
209 if (setrlimit (RLIMIT_STACK, &r))
211 execl (argv[1], argv[0], NULL);
215 if (pthread_create (&p, NULL, tf, NULL)
216 || pthread_join (p, &ret))
221 $CC -o conftest conftest.c -lpthread > /dev/null 2>&1 && \
222 ./conftest ./conftest && slow_pthread_self=
223 rm -f conftest conftest.c
228 can_unwind_signal=yes
229 libgcj_flags="${libgcj_flags} -mxgot"
231 mipsel*-linux* | mipsisa32el*-linux*)
232 enable_hash_synchronization_default=yes
238 enable_hash_synchronization_default=yes
240 can_unwind_signal=yes
246 # FIXME: win32_exception_handler( ) in win32.cc does not do the
247 # right stuff yet w.r.t. SEH. Live with the following for now.
249 CHECKREFSPEC=-fcheck-references
250 DIVIDESPEC=-fuse-divide-subroutine
253 # The cygwin linker doesn't do 8-byte alignment by default, so
254 # disable hash synchronization for now.
255 enable_hash_synchronization_default=no
260 libgcj_cflags="${libgcj_cflags} ${libgcj_flags}"
261 libgcj_cxxflags="${libgcj_cxxflags} ${libgcj_flags}"
262 libgcj_javaflags="${libgcj_javaflags} ${libgcj_flags}"