Bug 1292059 - Remove now useless compiler checks in compiler-opts.m4. r?chmanchester draft
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 04 Aug 2016 17:11:52 +0900
changeset 396718 b760d1f25eed9f75713fd5fb936c2063e2c46016
parent 396701 9929ecad98f9f3ed60bf7f8e0302283996a3dd84
child 527269 cb9ab096e32e813ca255163a7b6f00454f1fbd51
push id25082
push userbmo:mh+mozilla@glandium.org
push dateThu, 04 Aug 2016 09:01:46 +0000
reviewerschmanchester
bugs1292059, 1259382, 1288313
milestone51.0a1
Bug 1292059 - Remove now useless compiler checks in compiler-opts.m4. r?chmanchester Since bug 1259382, CC and CXX are always set, so we can stop falling back to cl on Windows, and clang on OSX in compiler-opts.m4. Also, we were actively rejecting GCC on OSX because it was based on GCC 4.2 and known to be broken, but that test predates our requirement for more recent versions of GCC, which would fail configure anyways. So just remove that GCC test. Building with a modern GCC from macports or wherever might actually work anyways. Finally, remove target bit-width mismatch with the compiler as it's handled in python configure since bug 1288313.
build/autoconf/compiler-opts.m4
js/src/old-configure.in
old-configure.in
--- a/build/autoconf/compiler-opts.m4
+++ b/build/autoconf/compiler-opts.m4
@@ -16,18 +16,16 @@ dnl set DEVELOPER_OPTIONS early; MOZ_DEF
       DEVELOPER_OPTIONS=,
       DEVELOPER_OPTIONS=1)
 
 dnl Default to MSVC for win32 and gcc-4.2 for darwin
 dnl ==============================================================
 if test -z "$CROSS_COMPILE"; then
 case "$target" in
 *-mingw*)
-    if test -z "$CC"; then CC=cl; fi
-    if test -z "$CXX"; then CXX=cl; fi
     if test -z "$CPP"; then CPP="$CC -E -nologo"; fi
     if test -z "$CXXCPP"; then CXXCPP="$CXX -TP -E -nologo"; ac_cv_prog_CXXCPP="$CXXCPP"; fi
     if test -z "$AS"; then
         case "${target_cpu}" in
         i*86)
             AS=ml;
             ;;
         x86_64)
@@ -37,33 +35,16 @@ case "$target" in
     fi
     if test -z "$MIDL"; then MIDL=midl; fi
 
     # need override this flag since we don't use $(LDFLAGS) for this.
     if test -z "$HOST_LDFLAGS" ; then
         HOST_LDFLAGS=" "
     fi
     ;;
-*-darwin*)
-    # GCC on darwin is based on gcc 4.2 and we don't support it anymore.
-    if test -z "$CC"; then
-        MOZ_PATH_PROGS(CC, clang)
-    fi
-    if test -z "$CXX"; then
-        MOZ_PATH_PROGS(CXX, clang++)
-    fi
-    IS_GCC=$($CC -v 2>&1 | grep gcc)
-    if test -n "$IS_GCC"
-    then
-      echo gcc is known to be broken on OS X, please use clang.
-      echo see http://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions/Mac_OS_X_Prerequisites
-      echo for more information.
-      exit 1
-    fi
-    ;;
 esac
 fi
 ])
 
 dnl ============================================================================
 dnl C++ rtti
 dnl We don't use it in the code, but it can be usefull for debugging, so give
 dnl the user the option of enabling it.
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -976,20 +976,16 @@ case "$target" in
     case "$host_os" in
     cygwin*|msvc*|mks*)
         AC_MSG_ERROR([Using a Cygwin build environment is unsupported. Configure cannot check for presence of necessary headers. Please upgrade to MozillaBuild; see https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
         ;;
     esac
 
     case "$target" in
     i*86-*)
-        if test "$HAVE_64BIT_BUILD"; then
-            AC_MSG_ERROR([You are targeting i386 but using the 64-bit compiler.])
-        fi
-
         if test -n "$GNU_CC"; then
             CFLAGS="$CFLAGS -mstackrealign -fno-keep-inline-dllexport"
             CXXFLAGS="$CXXFLAGS -mstackrealign -fno-keep-inline-dllexport"
             LDFLAGS="$LDFLAGS -Wl,--large-address-aware"
         else
             DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X86"
             LDFLAGS="$LDFLAGS -SAFESEH"
         fi
--- a/old-configure.in
+++ b/old-configure.in
@@ -1337,35 +1337,28 @@ case "$target" in
     case "$host_os" in
     cygwin*|msvc*|mks*)
         AC_MSG_ERROR([Using a Cygwin build environment is unsupported. Configure cannot check for presence of necessary headers. Please upgrade to MozillaBuild; see https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
         ;;
     esac
 
     case "$target" in
     i*86-*)
-        if test "$HAVE_64BIT_BUILD" -a -n "$COMPILE_ENVIRONMENT"; then
-            AC_MSG_ERROR([You are targeting i386 but using the 64-bit compiler.])
-        fi
-
         if test -n "$GNU_CC"; then
             CFLAGS="$CFLAGS -mstackrealign -fno-keep-inline-dllexport"
             CXXFLAGS="$CXXFLAGS -mstackrealign -fno-keep-inline-dllexport"
             LDFLAGS="$LDFLAGS -Wl,--enable-stdcall-fixup -Wl,--large-address-aware"
         else
             DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X86"
             LDFLAGS="$LDFLAGS -SAFESEH"
         fi
 
         AC_DEFINE(_X86_)
         ;;
     x86_64-*)
-        if test -z "$HAVE_64BIT_BUILD" -a -n "$COMPILE_ENVIRONMENT"; then
-            AC_MSG_ERROR([You are targeting 64-bit but using the 32-bit compiler.])
-        fi
         if test -n "$_WIN32_MSVC"; then
             DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X64"
         fi
         AC_DEFINE(_AMD64_)
         ;;
     *)
         AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
         ;;