* arm.h (ASM_OUTPUT_REG_PUSH, ASM_OUTPUT_REG_POP): Wrap in
[official-gcc.git] / libjava / configure.host
blobd6935c38e55ed1a4c246fe028698022197d3490c
1 # configure.host
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
9 #   . configure.host
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
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.
32 libgcj_flags=
33 libgcj_cflags=
34 libgcj_cxxflags=
35 libgcj_javaflags=
36 libgcj_interpreter=
37 enable_java_net_default=yes
38 enable_hash_synchronization_default=no
39 sysdeps_dir=generic
40 slow_pthread_self=
41 can_unwind_signal=no
43 case "${target_optspace}:${host}" in
44   yes:*)
45     libgcj_flags="${libgcj_flags} -Os"
46     ;;
47   :m32r-* | :d10v-* | :d30v-*)
48     libgcj_flags="${libgcj_flags} -Os"
49     ;;
50   no:* | :*)
51     # Nothing.
52     ;;
53 esac
55 AM_RUNTESTFLAGS= 
57 # Set any host dependent compiler flags.
58 # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
60 echo "$target"
62 DIVIDESPEC=-fuse-divide-subroutine
63 EXCEPTIONSPEC=-fnon-call-exceptions
64 CHECKREFSPEC=
66 # This case statement supports per-CPU defaults.
67 case "${host}" in
68   arm*-elf | strongarm*-elf | xscale*-elf)
69         with_libffi_default=no
70         PROCESS=Ecos
71         FILE=Posix
72         CHECKREFSPEC=-fcheck-references
73         EXCEPTIONSPEC=
74         enable_java_net_default=no
75         enable_getenv_properties_default=no
76         enable_main_args_default=no
77         ;;
78   mips-tx39-*|mipstx39-unknown-*)
79         libgcj_flags="${libgcj_flags} -G 0"
80         LDFLAGS="$LDFLAGS -Tjmr3904dram.ld"
81         AM_RUNTESTFLAGS="--target_board=jmr3904-sim"    
82         # Use "Ecos" processes since they are a no-op.
83         PROCESS=Ecos
84         FILE=Posix
85         enable_java_net_default=no
86         enable_getenv_properties_default=no
87         ;;
88   i686-*|i586-*|i486-*|i386-*)
89         sysdeps_dir=i386
90         libgcj_flags="${libgcj_flags} -ffloat-store"
91         libgcj_interpreter=yes
92         libgcj_cxxflags=
93         libgcj_cflags=
94         DIVIDESPEC=-fno-use-divide-subroutine
95         enable_hash_synchronization_default=yes
96         slow_pthread_self=yes
97         ;;
98   x86_64-*)
99         CHECKREFSPEC="%{m32:-fcheck-references}"
100         sysdeps_dir=x86-64
101         libgcj_flags="${libgcj_flags} -ffloat-store -fno-omit-frame-pointer"
102         libgcj_cxxflags=
103         libgcj_cflags=
104         enable_hash_synchronization_default=yes
105         slow_pthread_self=yes
106         libgcj_interpreter=yes
107         ;;
108   alpha*-*)
109         sysdeps_dir=alpha
110         libgcj_flags="${libgcj_flags} -mieee"
111         libgcj_interpreter=yes
112         enable_hash_synchronization_default=yes
113         IEEESPEC=-mieee
114         ;;
115   powerpc64*-*)
116         with_libffi_default=yes
117         libgcj_interpreter=yes
118         libgcj_flags="${libgcj_flags} -mminimal-toc"
119         # this may not be correct
120         sysdeps_dir=powerpc
121         enable_hash_synchronization_default=yes
122         slow_pthread_self=yes
123         ;;
124   powerpc*-*)
125         sysdeps_dir=powerpc
126         libgcj_interpreter=yes
127         enable_hash_synchronization_default=yes
128         slow_pthread_self=yes
129         ;;
130   s390*-*)
131         sysdeps_dir=s390
132         libgcj_interpreter=yes
133         enable_hash_synchronization_default=yes
134         ;;
135   sparc*-*)
136         libgcj_interpreter=yes
137         ;;
138   ia64-*)
139         sysdeps_dir=ia64
140         libgcj_flags="${libgcj_flags} -funwind-tables"
141         libgcj_interpreter=yes
142         enable_hash_synchronization_default=yes
143         ;;
144   sh-* | sh[34]*-*)
145         sysdeps_dir=sh
146         libgcj_flags="${libgcj_flags} -mieee"
147         libgcj_interpreter=yes
148         enable_hash_synchronization_default=yes
149         ;;
150 esac
152 # This case statement supports generic port properties and may refine
153 # the above per-CPU defaults.  Note: If your OS implements
154 # MD_FALLBACK_FRAME_STATE_FOR, then you want to set can_unwind_signal
155 # here.
156 case "${host}" in
157   i[34567]86*-linux* | \
158   powerpc*-linux* | \
159   alpha*-linux* | \
160   s390*-linux* | \
161   sparc*-linux* | \
162   ia64-* | \
163   x86_64*-linux* | \
164   sh-linux* | sh[34]*-linux*)
165         can_unwind_signal=yes
166         if test x$slow_pthread_self = xyes \
167            && test x$cross_compiling != xyes; then
168           cat > conftest.c <<EOF
169 #define _GNU_SOURCE 1
170 #include <pthread.h>
171 #include <stdlib.h>
172 #include <sys/resource.h>
173 #include <limits.h>
175 void *
176 tf (void *arg __attribute__ ((unused)))
178   pthread_attr_t a;
179   size_t s;
181   if (pthread_getattr_np (pthread_self (), &a)
182       || pthread_attr_getstacksize (&a, &s)
183       || s > 2 * PTHREAD_STACK_MIN)
184     exit (1);
185   exit (0);
189 main (int argc, char **argv)
191   pthread_t p;
192   void *ret;
193   struct rlimit r;
195   if (argc == 2)
196     {
197       r.rlim_cur = 2 * PTHREAD_STACK_MIN;
198       r.rlim_max = 2 * PTHREAD_STACK_MIN;
199       if (setrlimit (RLIMIT_STACK, &r))
200         exit (1);
201       execl (argv[1], argv[0], NULL);
202       exit (1);
203     }
205   if (pthread_create (&p, NULL, tf, NULL)
206       || pthread_join (p, &ret))
207     exit (1);
208   exit (1);
211           $CC -o conftest conftest.c -lpthread > /dev/null 2>&1 && \
212           ./conftest ./conftest && slow_pthread_self=
213           rm -f conftest conftest.c
214         fi
215         ;;
216   *-*-darwin*)
217         enable_hash_synchronization_default=no
218         slow_pthread_self=
219         can_unwind_signal=no
220         ;;
221   *-*-freebsd*)
222         slow_pthread_self=
223         ;;
224   *-mingw*)
225         # FIXME: win32_exception_handler( ) in win32.cc does not do the
226         # right stuff yet w.r.t. SEH. Live with the following for now.
227         can_unwind_signal=no
228         CHECKREFSPEC=-fcheck-references
229         DIVIDESPEC=-fuse-divide-subroutine
230         ;;
231   *-cygwin*)
232         # The cygwin linker doesn't do 8-byte alignment by default, so
233         # disable hash synchronization for now.
234         enable_hash_synchronization_default=no
235         slow_pthread_self=
236         ;;
237 esac
239 libgcj_cflags="${libgcj_cflags} ${libgcj_flags}"
240 libgcj_cxxflags="${libgcj_cxxflags} ${libgcj_flags}"
241 libgcj_javaflags="${libgcj_javaflags} ${libgcj_flags}"