acinclude.m4 19 KB

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