Bug 1292066 - Move GNU make detection to python configure. r?chmanchester draft
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 04 Aug 2016 17:27:05 +0900
changeset 396711 3353a3f3bf92194d6068305e8a51ec5929b5925d
parent 396709 072d332ac513f12a51eef245c7be6726c3768cde
child 396712 edfa689c9050fc15b4cc2e150c219958587ca139
push id25077
push userbmo:mh+mozilla@glandium.org
push dateThu, 04 Aug 2016 08:29:01 +0000
reviewerschmanchester
bugs1292066
milestone51.0a1
Bug 1292066 - Move GNU make detection to python configure. r?chmanchester Nothing is using MAKE in old-configure, and it was not AC_SUBST'ed, so we don't need to set it when it's not set in the environment already.
js/src/old-configure.in
moz.configure
old-configure.in
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -372,43 +372,16 @@ tools are selected during the Xcode/Deve
   AC_LANG_RESTORE
   AC_MSG_RESULT($result)
 
   if test "$result" = "no" ; then
     AC_MSG_ERROR([The selected compiler and Mac OS X SDK are incompatible.])
   fi
 fi
 
-fi # COMPILE_ENVIRONMENT
-
-if test -n "$MAKE"; then
-  if test `echo $MAKE | grep -c make.py` != 1; then
-     NOT_PYMAKE=$MAKE
-  fi
-fi
-
-case "$host_os" in
-mingw*)
-    MOZ_PATH_PROGS(GMAKE, $GMAKE mingw32-make $NOT_PYMAKE make gmake, :)
-    ;;
-*)
-    MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE gmake make, :)
-    ;;
-esac
-if test "$GMAKE" = ":"; then
-   AC_MSG_ERROR([GNU make not found])
-fi
-
-# MAKE will be set by client.mk, but still need this for standalone js builds
-if test -z "$MAKE"; then
-  MAKE=$GMAKE
-fi
-
-if test "$COMPILE_ENVIRONMENT"; then
-
 AC_PATH_XTRA
 
 XCFLAGS="$X_CFLAGS"
 
 fi # COMPILE_ENVIRONMENT
 
 dnl ==============================================================
 dnl Get mozilla version from central milestone file
--- a/moz.configure
+++ b/moz.configure
@@ -189,16 +189,35 @@ def perl_version_check(min_version):
     def require_full_perl_installation(has_full_perl_installation):
         if not has_full_perl_installation:
             die('Cannot find Config.pm or $Config{archlib}. '
                 'A full perl installation is required.')
 
 perl_version_check('5.006')
 
 
+# GNU make detection
+# ==============================================================
+option(env='MAKE', nargs=1, help='Path to GNU make')
+
+@depends('MAKE', host)
+def possible_makes(make, host):
+    candidates = []
+    if host.kernel == 'WINNT':
+        candidates.append('mingw32-make')
+    if make:
+        candidates.append(make[0])
+    if host.kernel == 'WINNT':
+        candidates.extend(('make', 'gmake'))
+    else:
+        candidates.extend(('gmake', 'make'))
+    return candidates
+
+check_prog('GMAKE', possible_makes)
+
 # Miscellaneous programs
 # ==============================================================
 check_prog('DOXYGEN', ('doxygen',), allow_missing=True)
 check_prog('XARGS', ('xargs',))
 
 @depends(target)
 def extra_programs(target):
     if target.kernel == 'Darwin':
--- a/old-configure.in
+++ b/old-configure.in
@@ -562,43 +562,16 @@ tools are selected during the Xcode/Deve
   AC_LANG_RESTORE
   AC_MSG_RESULT($result)
 
   if test "$result" = "no" ; then
     AC_MSG_ERROR([The selected compiler and Mac OS X SDK are incompatible.])
   fi
 fi
 
-fi # COMPILE_ENVIRONMENT
-
-if test -n "$MAKE"; then
-  if test `echo $MAKE | grep -c make.py` != 1; then
-     NOT_PYMAKE=$MAKE
-  fi
-fi
-
-case "$host_os" in
-mingw*)
-    MOZ_PATH_PROGS(GMAKE, $GMAKE mingw32-make $NOT_PYMAKE make gmake, :)
-    ;;
-*)
-    MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE gmake make, :)
-    ;;
-esac
-if test "$GMAKE" = ":"; then
-   AC_MSG_ERROR([GNU make not found])
-fi
-AC_SUBST(GMAKE)
-
-if test -z "$MAKE"; then
-  MAKE=$GMAKE
-fi
-
-if test "$COMPILE_ENVIRONMENT"; then
-
 AC_PATH_XTRA
 
 XCFLAGS="$X_CFLAGS"
 
 fi # COMPILE_ENVIRONMENT
 
 dnl ========================================================
 dnl set the defaults first