]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/acinclude.m4
ICU-64243.0.1.tar.gz
[apple/icu.git] / icuSources / acinclude.m4
index 5b2c8444b428755393137b4d7624fd795252371b..507f41f521c52d3d2d71dcedc5366180316dcb79 100644 (file)
@@ -1,4 +1,6 @@
-# Copyright (c) 1999-2013, International Business Machines Corporation and
+# Copyright (C) 2016 and later: Unicode, Inc. and others.
+# License & terms of use: http://www.unicode.org/copyright.html
+# Copyright (c) 1999-2016, International Business Machines Corporation and
 # others. All Rights Reserved.
 # acinclude.m4 for ICU
 # Don't edit aclocal.m4, do edit acinclude.m4
@@ -32,17 +34,30 @@ powerpc*-*-linux*)
                icu_cv_host_frag=mh-linux-va
        fi ;;
 *-*-linux*|*-*-gnu|*-*-k*bsd*-gnu|*-*-kopensolaris*-gnu) icu_cv_host_frag=mh-linux ;;
-*-*-cygwin|*-*-mingw32|*-*-mingw64)
+i[[34567]]86-*-cygwin) 
        if test "$GCC" = yes; then
-               AC_TRY_COMPILE([
-#ifndef __MINGW32__
-#error This is not MinGW
-#endif], [], AC_TRY_COMPILE([
+               icu_cv_host_frag=mh-cygwin
+       else
+               icu_cv_host_frag=mh-cygwin-msvc
+       fi ;;
+x86_64-*-cygwin) 
+       if test "$GCC" = yes; then
+               icu_cv_host_frag=mh-cygwin64
+       else
+               icu_cv_host_frag=mh-cygwin-msvc
+       fi ;;
+*-*-mingw*)
+       if test "$GCC" = yes; then
+                AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #ifndef __MINGW64__
 #error This is not MinGW64
-#endif], [], icu_cv_host_frag=mh-mingw64, icu_cv_host_frag=mh-mingw), icu_cv_host_frag=mh-cygwin)
+#endif]])],                        [icu_cv_host_frag=mh-mingw64],
+                                   [icu_cv_host_frag=mh-mingw])
        else
-               icu_cv_host_frag=mh-cygwin-msvc
+               case "${host}" in
+               *-*-mingw*) icu_cv_host_frag=mh-msys-msvc ;;
+               *-*-cygwin) icu_cv_host_frag=mh-cygwin-msvc ;;
+               esac
        fi ;;
 *-*-*bsd*|*-*-dragonfly*)      icu_cv_host_frag=mh-bsd-gcc ;;
 *-*-aix*)
@@ -75,15 +90,6 @@ esac
        )
 ])
 
-# ICU_CONDITIONAL - similar example taken from Automake 1.4
-AC_DEFUN([ICU_CONDITIONAL],
-[AC_SUBST($1_TRUE)
-if $2; then
-  $1_TRUE=
-else
-  $1_TRUE='#'
-fi])
-
 # ICU_PROG_LINK - Make sure that the linker is usable
 AC_DEFUN([ICU_PROG_LINK],
 [
@@ -262,7 +268,7 @@ AC_DEFUN([AC_CHECK_64BIT_LIBS],
                     if test "$CAN_BUILD_64" != yes; then
                         # Nope. back out changes.
                         CFLAGS="${CFLAGS_OLD}"
-                        CXXFLAGS="${CFLAGS_OLD}"
+                        CXXFLAGS="${CXXFLAGS_OLD}"
                         # 2. try xarch=v9 [deprecated]
                         ## TODO: cross compile: the following won't work.
                         SPARCV9=`isainfo -n 2>&1 | grep sparcv9`
@@ -458,12 +464,12 @@ AC_DEFUN([AC_CHECK_STRICT_COMPILE],
         then
             case "${host}" in
             *-*-solaris*)
-                # Don't use -std=c99 option on Solaris/GCC
+                # Don't use -std=c11 on Solaris because of timezone check fails
                 ;;
             *)
                 # Do not use -ansi. It limits us to C90, and it breaks some platforms.
-                # We use -std=c99 to disable the gnu99 defaults and its associated warnings
-                CFLAGS="$CFLAGS -std=c99"
+                # We use -std=c11 to disable the gnu99 defaults and its associated warnings
+                CFLAGS="$CFLAGS -std=c11"
                 ;;
             esac
             
@@ -474,7 +480,9 @@ AC_DEFUN([AC_CHECK_STRICT_COMPILE],
                 if test "`$CC /help 2>&1 | head -c9`" = "Microsoft"
                 then
                     CFLAGS="$CFLAGS /W4"
-                fi
+                fi ;;
+            *-*-mingw*)
+                CFLAGS="$CFLAGS -W4" ;;
             esac
         fi
         if test "$GXX" = yes
@@ -486,7 +494,9 @@ AC_DEFUN([AC_CHECK_STRICT_COMPILE],
                 if test "`$CXX /help 2>&1 | head -c9`" = "Microsoft"
                 then
                     CXXFLAGS="$CXXFLAGS /W4"
-                fi
+                fi ;;
+            *-*-mingw*)
+                CFLAGS="$CFLAGS -W4" ;;
             esac
         fi
     fi