]>
Commit | Line | Data |
---|---|---|
729e4ab9 | 1 | # aclocal.m4 for ICU |
4388f060 | 2 | # Copyright (c) 1999-2011, International Business Machines Corporation and |
729e4ab9 A |
3 | # others. All Rights Reserved. |
4 | # Stephen F. Booth | |
b75a7d8f | 5 | |
729e4ab9 | 6 | # @TOP@ |
b75a7d8f | 7 | |
729e4ab9 | 8 | # ICU_CHECK_MH_FRAG |
b75a7d8f A |
9 | AC_DEFUN(ICU_CHECK_MH_FRAG, [ |
10 | AC_CACHE_CHECK( | |
729e4ab9 | 11 | [which Makefile fragment to use for ${host}], |
b75a7d8f A |
12 | [icu_cv_host_frag], |
13 | [ | |
14 | case "${host}" in | |
15 | *-*-solaris*) | |
374ca955 | 16 | if test "$GCC" = yes; then |
46f4442e | 17 | icu_cv_host_frag=mh-solaris-gcc |
b75a7d8f A |
18 | else |
19 | icu_cv_host_frag=mh-solaris | |
20 | fi ;; | |
21 | alpha*-*-linux-gnu) | |
374ca955 | 22 | if test "$GCC" = yes; then |
b75a7d8f | 23 | icu_cv_host_frag=mh-alpha-linux-gcc |
46f4442e | 24 | else |
b75a7d8f A |
25 | icu_cv_host_frag=mh-alpha-linux-cc |
26 | fi ;; | |
374ca955 A |
27 | powerpc*-*-linux*) |
28 | if test "$GCC" = yes; then | |
46f4442e | 29 | icu_cv_host_frag=mh-linux |
374ca955 | 30 | else |
46f4442e | 31 | icu_cv_host_frag=mh-linux-va |
374ca955 | 32 | fi ;; |
729e4ab9 | 33 | *-*-linux*|*-*-gnu|*-*-k*bsd*-gnu|*-*-kopensolaris*-gnu) icu_cv_host_frag=mh-linux ;; |
46f4442e | 34 | *-*-cygwin|*-*-mingw32) |
374ca955 | 35 | if test "$GCC" = yes; then |
46f4442e A |
36 | AC_TRY_COMPILE([ |
37 | #ifndef __MINGW32__ | |
38 | #error This is not MinGW | |
39 | #endif], [], icu_cv_host_frag=mh-mingw, icu_cv_host_frag=mh-cygwin) | |
b75a7d8f | 40 | else |
46f4442e | 41 | icu_cv_host_frag=mh-cygwin-msvc |
374ca955 | 42 | fi ;; |
73c04bcf | 43 | *-*-*bsd*|*-*-dragonfly*) icu_cv_host_frag=mh-bsd-gcc ;; |
b75a7d8f | 44 | *-*-aix*) |
374ca955 A |
45 | if test "$GCC" = yes; then |
46 | icu_cv_host_frag=mh-aix-gcc | |
b75a7d8f | 47 | else |
46f4442e | 48 | icu_cv_host_frag=mh-aix-va |
b75a7d8f A |
49 | fi ;; |
50 | *-*-hpux*) | |
374ca955 | 51 | if test "$GCC" = yes; then |
b75a7d8f A |
52 | icu_cv_host_frag=mh-hpux-gcc |
53 | else | |
54 | case "$CXX" in | |
55 | *aCC) icu_cv_host_frag=mh-hpux-acc ;; | |
b75a7d8f A |
56 | esac |
57 | fi ;; | |
58 | *-*ibm-openedition*|*-*-os390*) icu_cv_host_frag=mh-os390 ;; | |
59 | *-*-os400*) icu_cv_host_frag=mh-os400 ;; | |
60 | *-apple-rhapsody*) icu_cv_host_frag=mh-darwin ;; | |
61 | *-apple-darwin*) icu_cv_host_frag=mh-darwin ;; | |
729e4ab9 A |
62 | *-*-beos) icu_cv_host_frag=mh-beos ;; |
63 | *-*-haiku) icu_cv_host_frag=mh-haiku ;; | |
b75a7d8f A |
64 | *-*-irix*) icu_cv_host_frag=mh-irix ;; |
65 | *-dec-osf*) icu_cv_host_frag=mh-alpha-osf ;; | |
66 | *-*-nto*) icu_cv_host_frag=mh-qnx ;; | |
374ca955 | 67 | *-ncr-*) icu_cv_host_frag=mh-mpras ;; |
b75a7d8f A |
68 | *) icu_cv_host_frag=mh-unknown ;; |
69 | esac | |
70 | ] | |
71 | ) | |
72 | ]) | |
73 | ||
729e4ab9 | 74 | # ICU_CONDITIONAL - similar example taken from Automake 1.4 |
b75a7d8f A |
75 | AC_DEFUN(ICU_CONDITIONAL, |
76 | [AC_SUBST($1_TRUE) | |
b75a7d8f A |
77 | if $2; then |
78 | $1_TRUE= | |
b75a7d8f A |
79 | else |
80 | $1_TRUE='#' | |
b75a7d8f A |
81 | fi]) |
82 | ||
729e4ab9 | 83 | # ICU_PROG_LINK - Make sure that the linker is usable |
73c04bcf A |
84 | AC_DEFUN(ICU_PROG_LINK, |
85 | [ | |
86 | case "${host}" in | |
87 | *-*-cygwin*|*-*-mingw*) | |
88 | if test "$GCC" != yes && test -n "`link --version 2>&1 | grep 'GNU coreutils'`"; then | |
89 | AC_MSG_ERROR([link.exe is not a valid linker. Your PATH is incorrect. | |
90 | Please follow the directions in ICU's readme.]) | |
91 | fi;; | |
92 | *);; | |
93 | esac]) | |
94 | ||
729e4ab9 A |
95 | # AC_SEARCH_LIBS_FIRST(FUNCTION, SEARCH-LIBS [, ACTION-IF-FOUND |
96 | # [, ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]]) | |
97 | # Search for a library defining FUNC, then see if it's not already available. | |
46f4442e | 98 | |
b75a7d8f A |
99 | AC_DEFUN(AC_SEARCH_LIBS_FIRST, |
100 | [AC_PREREQ([2.13]) | |
101 | AC_CACHE_CHECK([for library containing $1], [ac_cv_search_$1], | |
102 | [ac_func_search_save_LIBS="$LIBS" | |
103 | ac_cv_search_$1="no" | |
104 | for i in $2; do | |
105 | LIBS="-l$i $5 $ac_func_search_save_LIBS" | |
106 | AC_TRY_LINK_FUNC([$1], | |
107 | [ac_cv_search_$1="-l$i" | |
108 | break]) | |
109 | done | |
110 | if test "$ac_cv_search_$1" = "no"; then | |
111 | AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1="none required"]) | |
112 | fi | |
113 | LIBS="$ac_func_search_save_LIBS"]) | |
114 | if test "$ac_cv_search_$1" != "no"; then | |
115 | test "$ac_cv_search_$1" = "none required" || LIBS="$ac_cv_search_$1 $LIBS" | |
116 | $3 | |
117 | else : | |
118 | $4 | |
119 | fi]) | |
120 | ||
729e4ab9 A |
121 | |
122 | ||
123 | # Check if we can build and use 64-bit libraries | |
b75a7d8f A |
124 | AC_DEFUN(AC_CHECK_64BIT_LIBS, |
125 | [ | |
729e4ab9 A |
126 | BITS_REQ=nochange |
127 | ENABLE_64BIT_LIBS=unknown | |
128 | ## revisit this for cross-compile. | |
129 | ||
b75a7d8f | 130 | AC_ARG_ENABLE(64bit-libs, |
729e4ab9 A |
131 | [ --enable-64bit-libs (deprecated, use --with-library-bits) build 64-bit libraries [default= platform default]], |
132 | [echo "note, use --with-library-bits instead of --*-64bit-libs" | |
133 | case "${enableval}" in | |
134 | no|false|32) with_library_bits=32; ;; | |
135 | yes|true|64) with_library_bits=64else32 ;; | |
136 | nochange) with_library_bits=nochange; ;; | |
137 | *) AC_MSG_ERROR(bad value ${enableval} for '--*-64bit-libs') ;; | |
138 | esac] ) | |
139 | ||
140 | ||
141 | AC_ARG_WITH(library-bits, | |
142 | [ --with-library-bits=bits specify how many bits to use for the library (32, 64, 64else32, nochange) [default=nochange]], | |
143 | [case "${withval}" in | |
144 | ""|nochange) BITS_REQ=$withval ;; | |
145 | 32|64|64else32) BITS_REQ=$withval ;; | |
146 | *) AC_MSG_ERROR(bad value ${withval} for --with-library-bits) ;; | |
147 | esac]) | |
148 | ||
149 | # don't use these for cross compiling | |
150 | if test "$cross_compiling" = "yes" -a "${BITS_REQ}" != "nochange"; then | |
151 | AC_MSG_ERROR([Don't specify bitness when cross compiling. See readme.html for help with cross compilation., and set compiler options manually.]) | |
152 | fi | |
153 | AC_CHECK_SIZEOF([void *]) | |
154 | AC_MSG_CHECKING([whether runnable 64 bit binaries are built by default]) | |
155 | case $ac_cv_sizeof_void_p in | |
156 | 8) DEFAULT_64BIT=yes ;; | |
157 | 4) DEFAULT_64BIT=no ;; | |
158 | *) DEFAULT_64BIT=unknown | |
159 | esac | |
160 | BITS_GOT=unknown | |
161 | ||
162 | # 'OK' here means, we can exit any further checking, everything's copa | |
163 | BITS_OK=yes | |
164 | ||
165 | # do we need to check for buildable/runnable 32 or 64 bit? | |
166 | BITS_CHECK_32=no | |
167 | BITS_CHECK_64=no | |
168 | ||
169 | # later, can we run the 32/64 bit binaries so made? | |
170 | BITS_RUN_32=no | |
171 | BITS_RUN_64=no | |
172 | ||
173 | if test "$DEFAULT_64BIT" = "yes"; then | |
174 | # we get 64 bits by default. | |
175 | BITS_GOT=64 | |
176 | case "$BITS_REQ" in | |
177 | 32) | |
178 | # need to look for 32 bit support. | |
179 | BITS_CHECK_32=yes | |
180 | # not copa. | |
181 | BITS_OK=no;; | |
182 | # everyone else is happy. | |
183 | nochange) ;; | |
184 | *) ;; | |
185 | esac | |
186 | elif test "$DEFAULT_64BIT" = "no"; then | |
187 | # not 64 bit by default. | |
188 | BITS_GOT=32 | |
189 | case "$BITS_REQ" in | |
190 | 64|64else32) | |
191 | BITS_CHECK_64=yes | |
192 | #BITS_CHECK_32=yes | |
193 | BITS_OK=no;; | |
194 | nochange) ;; | |
195 | *) ;; | |
196 | esac | |
197 | elif test "$DEFAULT_64BIT" = "unknown"; then | |
198 | # cross compiling. | |
199 | BITS_GOT=unknown | |
200 | case "$BITS_REQ" in | |
201 | 64|64else32) BITS_OK=no | |
202 | BITS_CHECK_32=yes | |
203 | BITS_CHECK_64=yes ;; | |
204 | 32) BITS_OK=no;; | |
205 | nochange) ;; | |
206 | *) ;; | |
207 | esac | |
208 | fi | |
209 | ||
210 | AC_MSG_RESULT($DEFAULT_64BIT); | |
211 | ||
212 | if test "$BITS_OK" != "yes"; then | |
213 | # not copa. back these up. | |
214 | CFLAGS_OLD="${CFLAGS}" | |
215 | CXXFLAGS_OLD="${CXXFLAGS}" | |
216 | LDFLAGS_OLD="${LDFLAGS}" | |
217 | ARFLAGS_OLD="${ARFLAGS}" | |
218 | ||
219 | CFLAGS_32="${CFLAGS}" | |
220 | CXXFLAGS_32="${CXXFLAGS}" | |
221 | LDFLAGS_32="${LDFLAGS}" | |
222 | ARFLAGS_32="${ARFLAGS}" | |
223 | ||
224 | CFLAGS_64="${CFLAGS}" | |
225 | CXXFLAGS_64="${CXXFLAGS}" | |
226 | LDFLAGS_64="${LDFLAGS}" | |
227 | ARFLAGS_64="${ARFLAGS}" | |
228 | ||
229 | CAN_BUILD_64=unknown | |
230 | CAN_BUILD_32=unknown | |
231 | # These results can't be cached because is sets compiler flags. | |
232 | if test "$BITS_CHECK_64" = "yes"; then | |
233 | AC_MSG_CHECKING([how to build 64-bit executables]) | |
234 | CAN_BUILD_64=no | |
235 | #### | |
236 | # Find out if we think we can *build* for 64 bit. Doesn't check whether we can run it. | |
237 | # Note, we don't have to actually check if the options work- we'll try them before using them. | |
238 | # So, only try actually testing the options, if you are trying to decide between multiple options. | |
239 | # On exit from the following clauses: | |
240 | # if CAN_BUILD_64=yes: | |
241 | # *FLAGS are assumed to contain the right settings for 64bit | |
242 | # else if CAN_BUILD_64=no: (default) | |
243 | # *FLAGS are assumed to be trashed, and will be reset from *FLAGS_OLD | |
244 | ||
245 | if test "$GCC" = yes; then | |
46f4442e A |
246 | CFLAGS="${CFLAGS} -m64" |
247 | CXXFLAGS="${CXXFLAGS} -m64" | |
4388f060 | 248 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main(void) {return (sizeof(void*)*8==64)?0:1;}])], |
729e4ab9 A |
249 | CAN_BUILD_64=yes, CAN_BUILD_64=no) |
250 | else | |
251 | case "${host}" in | |
252 | sparc*-*-solaris*) | |
253 | # 1. try -m64 | |
46f4442e A |
254 | CFLAGS="${CFLAGS} -m64" |
255 | CXXFLAGS="${CXXFLAGS} -m64" | |
4388f060 A |
256 | AC_RUN_IFELSE([AC_LANG_SOURCE([int main(void) {return (sizeof(void*)*8==64)?0:1;}])], |
257 | CAN_BUILD_64=yes, CAN_BUILD_64=no, CAN_BUILD_64=unknown) | |
729e4ab9 A |
258 | if test "$CAN_BUILD_64" != yes; then |
259 | # Nope. back out changes. | |
260 | CFLAGS="${CFLAGS_OLD}" | |
261 | CXXFLAGS="${CFLAGS_OLD}" | |
262 | # 2. try xarch=v9 [deprecated] | |
263 | ## TODO: cross compile: the following won't work. | |
264 | SPARCV9=`isainfo -n 2>&1 | grep sparcv9` | |
265 | SOL64=`$CXX -xarch=v9 2>&1 && $CC -xarch=v9 2>&1 | grep -v usage:` | |
266 | # "Warning: -xarch=v9 is deprecated, use -m64 to create 64-bit programs" | |
267 | if test -z "$SOL64" && test -n "$SPARCV9"; then | |
268 | CFLAGS="${CFLAGS} -xtarget=ultra -xarch=v9" | |
269 | CXXFLAGS="${CXXFLAGS} -xtarget=ultra -xarch=v9" | |
270 | LDFLAGS="${LDFLAGS} -xtarget=ultra -xarch=v9" | |
271 | CAN_BUILD_64=yes | |
272 | fi | |
46f4442e | 273 | fi |
729e4ab9 A |
274 | ;; |
275 | i386-*-solaris*) | |
276 | # 1. try -m64 | |
277 | CFLAGS="${CFLAGS} -m64" | |
278 | CXXFLAGS="${CXXFLAGS} -m64" | |
4388f060 A |
279 | AC_RUN_IFELSE([AC_LANG_SOURCE([int main(void) {return (sizeof(void*)*8==64)?0:1;}])], |
280 | CAN_BUILD_64=yes, CAN_BUILD_64=no, CAN_BUILD_64=unknown) | |
729e4ab9 A |
281 | if test "$CAN_BUILD_64" != yes; then |
282 | # Nope. back out changes. | |
283 | CFLAGS="${CFLAGS_OLD}" | |
284 | CXXFLAGS="${CXXFLAGS_OLD}" | |
285 | # 2. try the older compiler option | |
286 | ## TODO: cross compile problem | |
4388f060 | 287 | AMD64=`isainfo -n 2>&1 | grep amd64` |
729e4ab9 A |
288 | SOL64=`$CXX -xtarget=generic64 2>&1 && $CC -xtarget=generic64 2>&1 | grep -v usage:` |
289 | if test -z "$SOL64" && test -n "$AMD64"; then | |
290 | CFLAGS="${CFLAGS} -xtarget=generic64" | |
291 | CXXFLAGS="${CXXFLAGS} -xtarget=generic64" | |
292 | CAN_BUILD_64=yes | |
293 | fi | |
374ca955 | 294 | fi |
729e4ab9 A |
295 | ;; |
296 | ia64-*-linux*) | |
297 | # check for ecc/ecpc compiler support | |
298 | ## TODO: cross compiler problem | |
299 | if test -n "`$CXX --help 2>&1 && $CC --help 2>&1 | grep -v Intel`"; then | |
300 | if test -n "`$CXX --help 2>&1 && $CC --help 2>&1 | grep -v Itanium`"; then | |
301 | CAN_BUILD_64=yes | |
302 | fi | |
303 | fi | |
304 | ;; | |
305 | *-*-cygwin) | |
306 | # vcvarsamd64.bat should have been used to enable 64-bit builds. | |
307 | # We only do this check to display the correct answer. | |
308 | ## TODO: cross compiler problem | |
309 | if test -n "`$CXX -help 2>&1 | grep 'for x64'`"; then | |
310 | CAN_BUILD_64=yes | |
311 | fi | |
312 | ;; | |
313 | *-*-aix*|powerpc64-*-linux*) | |
314 | CFLAGS="${CFLAGS} -q64" | |
315 | CXXFLAGS="${CXXFLAGS} -q64" | |
316 | LDFLAGS="${LDFLAGS} -q64" | |
4388f060 | 317 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main(void) {return (sizeof(void*)*8==64)?0:1;}])], |
729e4ab9 A |
318 | CAN_BUILD_64=yes, CAN_BUILD_64=no) |
319 | if test "$CAN_BUILD_64" = yes; then | |
320 | # worked- set other options. | |
321 | case "${host}" in | |
322 | *-*-aix*) | |
323 | # tell AIX what executable mode to use. | |
324 | ARFLAGS="${ARFLAGS} -X64" | |
325 | esac | |
326 | fi | |
327 | ;; | |
328 | *-*-hpux*) | |
329 | # First we try the newer +DD64, if that doesn't work, | |
330 | # try other options. | |
374ca955 | 331 | |
729e4ab9 A |
332 | CFLAGS="${CFLAGS} +DD64" |
333 | CXXFLAGS="${CXXFLAGS} +DD64" | |
4388f060 | 334 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main(void) {return (sizeof(void*)*8==64)?0:1;}])], |
729e4ab9 A |
335 | CAN_BUILD_64=yes, CAN_BUILD_64=no) |
336 | if test "$CAN_BUILD_64" != yes; then | |
337 | # reset | |
338 | CFLAGS="${CFLAGS_OLD}" | |
339 | CXXFLAGS="${CXXFLAGS_OLD}" | |
340 | # append | |
341 | CFLAGS="${CFLAGS} +DA2.0W" | |
342 | CXXFLAGS="${CXXFLAGS} +DA2.0W" | |
4388f060 | 343 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main(void) {return (sizeof(void*)*8==64)?0:1;}])], |
729e4ab9 | 344 | CAN_BUILD_64=yes, CAN_BUILD_64=no) |
46f4442e | 345 | fi |
729e4ab9 A |
346 | ;; |
347 | *-*ibm-openedition*|*-*-os390*) | |
348 | CFLAGS="${CFLAGS} -Wc,lp64" | |
349 | CXXFLAGS="${CXXFLAGS} -Wc,lp64" | |
350 | LDFLAGS="${LDFLAGS} -Wl,lp64" | |
4388f060 | 351 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main(void) {return (sizeof(void*)*8==64)?0:1;}])], |
729e4ab9 A |
352 | CAN_BUILD_64=yes, CAN_BUILD_64=no) |
353 | ;; | |
354 | *) | |
355 | # unknown platform. | |
356 | ;; | |
357 | esac | |
358 | fi | |
359 | AC_MSG_RESULT($CAN_BUILD_64) | |
360 | if test "$CAN_BUILD_64" = yes; then | |
361 | AC_MSG_CHECKING([whether runnable 64-bit binaries are being built ]) | |
4388f060 | 362 | AC_RUN_IFELSE([AC_LANG_SOURCE([int main(void) {return (sizeof(void*)*8==64)?0:1;}])], |
729e4ab9 A |
363 | BITS_RUN_64=yes, BITS_RUN_64=no, BITS_RUN_64=unknown) |
364 | AC_MSG_RESULT($BITS_RUN_64); | |
365 | ||
366 | CFLAGS_64="${CFLAGS}" | |
367 | CXXFLAGS_64="${CXXFLAGS}" | |
368 | LDFLAGS_64="${LDFLAGS}" | |
369 | ARFLAGS_64="${ARFLAGS}" | |
370 | fi | |
371 | # put it back. | |
372 | CFLAGS="${CFLAGS_OLD}" | |
373 | CXXFLAGS="${CXXFLAGS_OLD}" | |
374 | LDFLAGS="${LDFLAGS_OLD}" | |
375 | ARFLAGS="${ARFLAGS_OLD}" | |
46f4442e | 376 | fi |
729e4ab9 A |
377 | if test "$BITS_CHECK_32" = "yes"; then |
378 | # see comment under 'if BITS_CHECK_64', above. | |
379 | AC_MSG_CHECKING([how to build 32-bit executables]) | |
380 | if test "$GCC" = yes; then | |
381 | CFLAGS="${CFLAGS} -m32" | |
382 | CXXFLAGS="${CXXFLAGS} -m32" | |
4388f060 | 383 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main(void) {return (sizeof(void*)*8==32)?0:1;}])], |
729e4ab9 | 384 | CAN_BUILD_32=yes, CAN_BUILD_32=no) |
73c04bcf | 385 | fi |
729e4ab9 A |
386 | AC_MSG_RESULT($CAN_BUILD_32) |
387 | if test "$CAN_BUILD_32" = yes; then | |
388 | AC_MSG_CHECKING([whether runnable 32-bit binaries are being built ]) | |
4388f060 | 389 | AC_RUN_IFELSE([AC_LANG_SOURCE([int main(void) {return (sizeof(void*)*8==32)?0:1;}])], |
729e4ab9 A |
390 | BITS_RUN_32=yes, BITS_RUN_32=no, BITS_RUN_32=unknown) |
391 | AC_MSG_RESULT($BITS_RUN_32); | |
392 | CFLAGS_32="${CFLAGS}" | |
393 | CXXFLAGS_32="${CXXFLAGS}" | |
394 | LDFLAGS_32="${LDFLAGS}" | |
395 | ARFLAGS_32="${ARFLAGS}" | |
396 | fi | |
397 | # put it back. | |
398 | CFLAGS="${CFLAGS_OLD}" | |
399 | CXXFLAGS="${CXXFLAGS_OLD}" | |
400 | LDFLAGS="${LDFLAGS_OLD}" | |
401 | ARFLAGS="${ARFLAGS_OLD}" | |
73c04bcf | 402 | fi |
729e4ab9 A |
403 | |
404 | ## | |
405 | # OK. Now, we've tested for 32 and 64 bitness. Let's see what we'll do. | |
406 | # | |
407 | ||
408 | # First, implement 64else32 | |
409 | if test "$BITS_REQ" = "64else32"; then | |
410 | if test "$BITS_RUN_64" = "yes"; then | |
411 | BITS_REQ=64 | |
412 | else | |
413 | # no changes. | |
414 | BITS_OK=yes | |
415 | fi | |
416 | fi | |
417 | ||
418 | # implement. | |
419 | if test "$BITS_REQ" = "32" -a "$BITS_RUN_32" = "yes"; then | |
420 | CFLAGS="${CFLAGS_32}" | |
421 | CXXFLAGS="${CXXFLAGS_32}" | |
422 | LDFLAGS="${LDFLAGS_32}" | |
423 | ARFLAGS="${ARFLAGS_32}" | |
424 | BITS_OK=yes | |
425 | elif test "$BITS_REQ" = "64" -a "$BITS_RUN_64" = "yes"; then | |
426 | CFLAGS="${CFLAGS_64}" | |
427 | CXXFLAGS="${CXXFLAGS_64}" | |
428 | LDFLAGS="${LDFLAGS_64}" | |
429 | ARFLAGS="${ARFLAGS_64}" | |
430 | BITS_OK=yes | |
431 | elif test "$BITS_OK" != "yes"; then | |
432 | AC_MSG_ERROR([Requested $BITS_REQ bit binaries but could not compile and execute them. See readme.html for help with cross compilation., and set compiler options manually.]) | |
433 | fi | |
434 | fi | |
b75a7d8f A |
435 | ]) |
436 | ||
729e4ab9 | 437 | # Strict compilation options. |
b75a7d8f A |
438 | AC_DEFUN(AC_CHECK_STRICT_COMPILE, |
439 | [ | |
440 | AC_MSG_CHECKING([whether strict compiling is on]) | |
729e4ab9 | 441 | AC_ARG_ENABLE(strict,[ --enable-strict compile with strict compiler options [default=yes]], [ |
374ca955 A |
442 | if test "$enableval" = no |
443 | then | |
444 | ac_use_strict_options=no | |
b75a7d8f | 445 | else |
374ca955 | 446 | ac_use_strict_options=yes |
b75a7d8f | 447 | fi |
729e4ab9 | 448 | ], [ac_use_strict_options=yes]) |
b75a7d8f A |
449 | AC_MSG_RESULT($ac_use_strict_options) |
450 | ||
451 | if test "$ac_use_strict_options" = yes | |
452 | then | |
453 | if test "$GCC" = yes | |
454 | then | |
b75a7d8f A |
455 | case "${host}" in |
456 | *-*-solaris*) | |
4388f060 | 457 | CFLAGS="$CFLAGS -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long" |
b75a7d8f | 458 | CFLAGS="$CFLAGS -D__STDC__=0";; |
4388f060 A |
459 | *-*-hpux*) |
460 | echo "# Note: We are not using '-ansi' with HP/UX GCC because int64_t broke, see <http://bugs.icu-project.org/trac/ticket/8493>" | |
461 | CFLAGS="$CFLAGS -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long";; | |
462 | *) | |
463 | CFLAGS="$CFLAGS -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long";; | |
b75a7d8f | 464 | esac |
374ca955 A |
465 | else |
466 | case "${host}" in | |
467 | *-*-cygwin) | |
468 | if test "`$CC /help 2>&1 | head -c9`" = "Microsoft" | |
469 | then | |
470 | CFLAGS="$CFLAGS /W4" | |
471 | fi | |
472 | esac | |
b75a7d8f A |
473 | fi |
474 | if test "$GXX" = yes | |
475 | then | |
73c04bcf | 476 | CXXFLAGS="$CXXFLAGS -W -Wall -ansi -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long" |
b75a7d8f A |
477 | case "${host}" in |
478 | *-*-solaris*) | |
479 | CXXFLAGS="$CXXFLAGS -D__STDC__=0";; | |
480 | esac | |
374ca955 A |
481 | else |
482 | case "${host}" in | |
483 | *-*-cygwin) | |
484 | if test "`$CXX /help 2>&1 | head -c9`" = "Microsoft" | |
485 | then | |
486 | CXXFLAGS="$CXXFLAGS /W4" | |
487 | fi | |
488 | esac | |
b75a7d8f A |
489 | fi |
490 | fi | |
491 | ]) | |
492 | ||
374ca955 | 493 |