]>
Commit | Line | Data |
---|---|---|
ee9dd372 TT |
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 | |
45597167 BM |
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 | |
605dc89b BM |
29 | # can_unwind_signal Set to "yes" if the EH unwinder supports throwing |
30 | # from a signal handler. | |
ee9dd372 TT |
31 | |
32 | libgcj_flags= | |
33 | libgcj_cflags= | |
34 | libgcj_cxxflags= | |
35 | libgcj_javaflags= | |
b11f6430 | 36 | libgcj_interpreter= |
3610e0d5 TT |
37 | enable_java_net_default=yes |
38 | enable_hash_synchronization_default=no | |
45597167 BM |
39 | sysdeps_dir=generic |
40 | slow_pthread_self= | |
605dc89b | 41 | can_unwind_signal=no |
ee9dd372 TT |
42 | |
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 | |
54 | ||
55 | AM_RUNTESTFLAGS= | |
56 | ||
57 | # Set any host dependent compiler flags. | |
58 | # THIS TABLE IS SORTED. KEEP IT THAT WAY. | |
59 | ||
60 | echo "$target" | |
61 | ||
d342a2e1 | 62 | DIVIDESPEC=-fuse-divide-subroutine |
e529c2c1 | 63 | EXCEPTIONSPEC=-fnon-call-exceptions |
5cb27a46 | 64 | CHECKREFSPEC= |
d342a2e1 | 65 | |
c0904887 | 66 | # This case statement supports per-CPU defaults. |
ee9dd372 | 67 | case "${host}" in |
841b8360 RE |
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 | ;; | |
ee9dd372 TT |
78 | mips-tx39-*|mipstx39-unknown-*) |
79 | libgcj_flags="${libgcj_flags} -G 0" | |
80 | LDFLAGS="$LDFLAGS -Tjmr3904dram.ld" | |
d342a2e1 | 81 | AM_RUNTESTFLAGS="--target_board=jmr3904-sim" |
ab31268c TT |
82 | # Use "Ecos" processes since they are a no-op. |
83 | PROCESS=Ecos | |
2d933a0b | 84 | FILE=Posix |
4b68fe8a | 85 | enable_java_net_default=no |
ffccc6be | 86 | enable_getenv_properties_default=no |
ee9dd372 | 87 | ;; |
97ce4a51 | 88 | i686-*|i586-*|i486-*|i386-*) |
45597167 | 89 | sysdeps_dir=i386 |
6cc96432 | 90 | libgcj_flags="${libgcj_flags} -ffloat-store" |
b11f6430 | 91 | libgcj_interpreter=yes |
6cc96432 AG |
92 | libgcj_cxxflags="-D__NO_MATH_INLINES" |
93 | libgcj_cflags="-D__NO_MATH_INLINES" | |
c677cd7f | 94 | DIVIDESPEC=-fno-use-divide-subroutine |
3610e0d5 | 95 | enable_hash_synchronization_default=yes |
45597167 | 96 | slow_pthread_self=yes |
ee9dd372 | 97 | ;; |
7b204712 | 98 | x86_64-*) |
fb13499f | 99 | CHECKREFSPEC="%{m32:-fcheck-references}" |
7b204712 | 100 | sysdeps_dir=x86-64 |
4b445d7c | 101 | libgcj_flags="${libgcj_flags} -ffloat-store -fno-omit-frame-pointer" |
7b204712 BT |
102 | libgcj_cxxflags="-D__NO_MATH_INLINES" |
103 | libgcj_cflags="-D__NO_MATH_INLINES" | |
7b204712 BT |
104 | enable_hash_synchronization_default=yes |
105 | slow_pthread_self=yes | |
7b22f8b0 | 106 | libgcj_interpreter=yes |
7b204712 | 107 | ;; |
48a9aced | 108 | alpha*-*) |
45597167 | 109 | sysdeps_dir=alpha |
0be25992 | 110 | libgcj_flags="${libgcj_flags} -mieee" |
bc38c787 | 111 | libgcj_interpreter=yes |
092a1f5a | 112 | enable_hash_synchronization_default=yes |
c4ebd83d | 113 | IEEESPEC=-mieee |
bc38c787 | 114 | ;; |
1d49f58a AM |
115 | powerpc64*-*) |
116 | # libffi not ported. | |
117 | with_libffi_default=no | |
118 | libgcj_interpreter=no | |
119 | libgcj_flags="${libgcj_flags} -mminimal-toc" | |
120 | # this may not be correct | |
121 | sysdeps_dir=powerpc | |
122 | enable_hash_synchronization_default=yes | |
123 | slow_pthread_self=yes | |
124 | ;; | |
c0904887 | 125 | powerpc*-*) |
45597167 | 126 | sysdeps_dir=powerpc |
23ab86e4 | 127 | libgcj_interpreter=yes |
45597167 BM |
128 | enable_hash_synchronization_default=yes |
129 | slow_pthread_self=yes | |
23ab86e4 | 130 | ;; |
5404cddb UW |
131 | s390*-*) |
132 | sysdeps_dir=s390 | |
133 | libgcj_interpreter=yes | |
134 | enable_hash_synchronization_default=yes | |
135 | ;; | |
2eb1ea83 JS |
136 | sparc*-*) |
137 | libgcj_interpreter=yes | |
3cf88fb4 | 138 | ;; |
6c80c45e | 139 | ia64-*) |
45597167 | 140 | sysdeps_dir=ia64 |
6c80c45e | 141 | libgcj_flags="${libgcj_flags} -funwind-tables" |
6c80c45e | 142 | libgcj_interpreter=yes |
3610e0d5 | 143 | enable_hash_synchronization_default=yes |
6c80c45e | 144 | ;; |
d8278e27 KK |
145 | sh-* | sh[34]*-*) |
146 | sysdeps_dir=sh | |
147 | libgcj_flags="${libgcj_flags} -mieee" | |
148 | libgcj_interpreter=yes | |
d8278e27 KK |
149 | enable_hash_synchronization_default=yes |
150 | ;; | |
ee9dd372 TT |
151 | esac |
152 | ||
c0904887 | 153 | # This case statement supports generic port properties and may refine |
605dc89b BM |
154 | # the above per-CPU defaults. Note: If your OS implements |
155 | # MD_FALLBACK_FRAME_STATE_FOR, then you want to set can_unwind_signal | |
156 | # here. | |
c0904887 | 157 | case "${host}" in |
605dc89b BM |
158 | i[34567]86*-linux* | \ |
159 | powerpc*-linux* | \ | |
160 | alpha*-linux* | \ | |
e793a714 | 161 | s390*-linux* | \ |
714708c8 | 162 | sparc*-linux* | \ |
7b204712 | 163 | ia64-* | \ |
4977bab6 ZW |
164 | x86_64*-linux* | \ |
165 | sh-linux* | sh[34]*-linux*) | |
605dc89b | 166 | can_unwind_signal=yes |
ba39351e JJ |
167 | if test x$slow_pthread_self = xyes \ |
168 | && test x$cross_compiling != xyes; then | |
169 | cat > conftest.c <<EOF | |
170 | #define _GNU_SOURCE 1 | |
171 | #include <pthread.h> | |
172 | #include <stdlib.h> | |
173 | #include <sys/resource.h> | |
174 | #include <limits.h> | |
175 | ||
176 | void * | |
177 | tf (void *arg __attribute__ ((unused))) | |
178 | { | |
179 | pthread_attr_t a; | |
180 | size_t s; | |
181 | ||
182 | if (pthread_getattr_np (pthread_self (), &a) | |
183 | || pthread_attr_getstacksize (&a, &s) | |
184 | || s > 2 * PTHREAD_STACK_MIN) | |
185 | exit (1); | |
186 | exit (0); | |
187 | } | |
188 | ||
189 | int | |
190 | main (int argc, char **argv) | |
191 | { | |
192 | pthread_t p; | |
193 | void *ret; | |
194 | struct rlimit r; | |
195 | ||
196 | if (argc == 2) | |
197 | { | |
198 | r.rlim_cur = 2 * PTHREAD_STACK_MIN; | |
199 | r.rlim_max = 2 * PTHREAD_STACK_MIN; | |
200 | if (setrlimit (RLIMIT_STACK, &r)) | |
201 | exit (1); | |
202 | execl (argv[1], argv[0], NULL); | |
203 | exit (1); | |
204 | } | |
205 | ||
206 | if (pthread_create (&p, NULL, tf, NULL) | |
207 | || pthread_join (p, &ret)) | |
208 | exit (1); | |
209 | exit (1); | |
210 | } | |
211 | EOF | |
212 | $CC -o conftest conftest.c -lpthread > /dev/null 2>&1 && \ | |
213 | ./conftest ./conftest && slow_pthread_self= | |
214 | rm -f conftest conftest.c | |
215 | fi | |
605dc89b | 216 | ;; |
c0904887 LR |
217 | *-*-darwin*) |
218 | enable_hash_synchronization_default=no | |
219 | slow_pthread_self= | |
e9e93c8b | 220 | can_unwind_signal=no |
c0904887 LR |
221 | ;; |
222 | *-*-freebsd*) | |
c0904887 LR |
223 | slow_pthread_self= |
224 | ;; | |
5f555088 BM |
225 | *-cygwin*) |
226 | # The cygwin linker doesn't do 8-byte alignment by default, so | |
227 | # disable hash synchronization for now. | |
228 | enable_hash_synchronization_default=no | |
229 | slow_pthread_self= | |
230 | ;; | |
c0904887 LR |
231 | esac |
232 | ||
ee9dd372 TT |
233 | libgcj_cflags="${libgcj_cflags} ${libgcj_flags}" |
234 | libgcj_cxxflags="${libgcj_cxxflags} ${libgcj_flags}" | |
235 | libgcj_javaflags="${libgcj_javaflags} ${libgcj_flags}" |