Bug 1515595 - Move AR to python configure. r=froydnj
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 21 Dec 2018 22:53:53 +0000
changeset 508886 eb4b6440b878912f26e2b1235a069a7f130541c4
parent 508885 d517c2d33a6090f8815d2377adb6dda55d49a57d
child 508887 ca959629000bf8b631ddc17c9a94d3c6d75138b8
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1515595
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1515595 - Move AR to python configure. r=froydnj Depends on D15179 Differential Revision: https://phabricator.services.mozilla.com/D15180
build/autoconf/toolchain.m4
build/moz.configure/toolchain.configure
js/src/old-configure.in
old-configure.in
--- a/build/autoconf/toolchain.m4
+++ b/build/autoconf/toolchain.m4
@@ -52,17 +52,16 @@ case "${TOOLCHAIN_PREFIX}" in
 /*)
     PATH="/:$PATH"
     ;;
 esac
 AC_PROG_CC
 AC_PROG_CXX
 
 AC_CHECK_PROGS(RANLIB, "${TOOLCHAIN_PREFIX}ranlib", :)
-AC_CHECK_PROGS(AR, "${TOOLCHAIN_PREFIX}ar", :)
 AC_CHECK_PROGS(AS, "${TOOLCHAIN_PREFIX}as", :)
 AC_CHECK_PROGS(LIPO, "${TOOLCHAIN_PREFIX}lipo", :)
 AC_CHECK_PROGS(STRIP, "${TOOLCHAIN_PREFIX}strip", :)
 AC_CHECK_PROGS(OTOOL, "${TOOLCHAIN_PREFIX}otool", :)
 AC_CHECK_PROGS(INSTALL_NAME_TOOL, "${TOOLCHAIN_PREFIX}install_name_tool", :)
 AC_CHECK_PROGS(OBJCOPY, "${TOOLCHAIN_PREFIX}objcopy", :)
 PATH=$_SAVE_PATH
 ])
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -2152,8 +2152,34 @@ set_config('MKCSHLIB', make_shared_libra
 def rc_names(c_compiler, toolchain_prefix):
     if c_compiler.type in ('gcc', 'clang'):
         return tuple('%s%s' % (p, 'windres')
                      for p in ('',) + (toolchain_prefix or ()))
     return ('rc',)
 
 
 check_prog('RC', rc_names, paths=sdk_bin_path)
+
+
+@depends(link, toolchain_prefix)
+def ar_config(link, toolchain_prefix):
+    if link:  # if LINKER is set, it's either for lld-link or link
+        if 'lld-link' in link:
+            return namespace(
+                names=('llvm-lib',),
+                flags=('-llvmlibthin', '-out:$@'),
+            )
+        else:
+            return namespace(
+                names=('lib',),
+                flags=('-NOLOGO', '-OUT:$@'),
+            )
+    return namespace(
+        names=tuple('%s%s' % (p, 'ar')
+                   for p in (toolchain_prefix or ()) + ('',)),
+        flags=('crs', '$@'),
+    )
+
+
+check_prog('AR', ar_config.names, paths=toolchain_search_path)
+
+
+set_config('AR_FLAGS', ar_config.flags)
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -82,18 +82,16 @@ case "$target" in
     MOZ_IOS_SDK
     ;;
 esac
 
 dnl ========================================================
 dnl Checks for compilers.
 dnl ========================================================
 
-AR_FLAGS='crs $@'
-
 if test "$COMPILE_ENVIRONMENT"; then
 
 # Note:
 #   In Mozilla, we use the names $target, $host and $build incorrectly, but are
 #   too far gone to back out now. See Bug 475488:
 #     - When we say $target, we mean $host, that is, the system on which
 #       Mozilla will be run.
 #     - When we say $host, we mean $build, that is, the system on which Mozilla
@@ -102,17 +100,16 @@ if test "$COMPILE_ENVIRONMENT"; then
 #       different platform than $host, so it would not be used by Mozilla.
 if test "$target" != "$host"; then
     MOZ_CROSS_COMPILER
 else
     AC_PROG_CC
     AC_PROG_CXX
     AC_PROG_RANLIB
     MOZ_PATH_PROGS(AS, $AS as, $CC)
-    AC_CHECK_PROGS(AR, ar, :)
     AC_CHECK_PROGS(STRIP, strip, :)
     if test -z "$HOST_CC"; then
         HOST_CC='$(CC)'
     fi
     if test -z "$HOST_CXX"; then
         HOST_CXX='$(CXX)'
     fi
 fi
@@ -587,26 +584,16 @@ case "$target" in
         MOZ_OPTIMIZE_FLAGS="-O2"
 
         WIN32_CONSOLE_EXE_LDFLAGS=-mconsole
         WIN32_GUI_EXE_LDFLAGS=-mwindows
     else
         TARGET_COMPILER_ABI=msvc
         HOST_CC='$(CC)'
         HOST_CXX='$(CXX)'
-        case "$LINKER" in
-        *lld*)
-            AR='llvm-lib'
-            AR_FLAGS='-llvmlibthin -out:$@'
-            ;;
-        *)
-            AR='lib'
-            AR_FLAGS='-NOLOGO -OUT:$@'
-            ;;
-        esac
         RANLIB='echo not_ranlib'
         STRIP='echo not_strip'
         PKG_SKIP_STRIP=1
         # aarch64 doesn't support subsystems below 6.02
         if test "$CPU_ARCH" = "aarch64"; then
             WIN32_SUBSYSTEM_VERSION=6.02
         else
             WIN32_SUBSYSTEM_VERSION=6.01
@@ -1589,18 +1576,16 @@ MOZ_ARG_WITH_STRING(cross-lib,
     CROSS_LIB=/usr/$target)
 AC_SUBST(CROSS_LIB)
 dnl ========================================================
 dnl =
 dnl = Maintainer debug option (no --enable equivalent)
 dnl =
 dnl ========================================================
 
-AC_SUBST(AR)
-AC_SUBST(AR_FLAGS)
 AC_SUBST(NM)
 AC_SUBST_LIST(ASFLAGS)
 AC_SUBST(RCFLAGS)
 AC_SUBST(WINDRES)
 AC_SUBST(IMPLIB)
 AC_SUBST(FILTER)
 AC_SUBST_LIST(MOZ_DEBUG_LDFLAGS)
 AC_SUBST(WARNINGS_AS_ERRORS)
--- a/old-configure.in
+++ b/old-configure.in
@@ -101,33 +101,30 @@ esac
 AC_SUBST(ANDROID_SOURCE)
 AC_SUBST(ANDROID_PACKAGE_NAME)
 AC_SUBST(OBJCOPY)
 
 dnl ========================================================
 dnl Checks for compilers.
 dnl ========================================================
 
-AR_FLAGS='crs $@'
-
 if test "$COMPILE_ENVIRONMENT"; then
 
 if test "$target" != "$host"; then
     MOZ_CROSS_COMPILER
 else
     AC_PROG_CC
     case "$target" in
     *-mingw*)
       # Work around the conftest.exe access problem on Windows
       sleep 2
     esac
     AC_PROG_CXX
     AC_PROG_RANLIB
     MOZ_PATH_PROGS(AS, $AS as, $CC)
-    AC_CHECK_PROGS(AR, ar, :)
     AC_CHECK_PROGS(STRIP, strip, :)
     AC_CHECK_PROGS(OTOOL, otool, :)
 fi
 
 if test -n "$MOZ_WINCONSOLE"; then
     AC_DEFINE(MOZ_WINCONSOLE)
 fi
 
@@ -725,26 +722,16 @@ case "$target" in
             # function thunks need to be generated for cross-DLL calls.
             MOZ_FOLD_LIBS_FLAGS="-mnop-fun-dllimport"
         else
             # Silence problematic clang warnings
             CXXFLAGS="$CXXFLAGS -Wno-incompatible-ms-struct"
         fi
     else
         TARGET_COMPILER_ABI=msvc
-        case "$LINKER" in
-        *lld*)
-            AR='llvm-lib'
-            AR_FLAGS='-llvmlibthin -out:$@'
-            ;;
-        *)
-            AR='lib'
-            AR_FLAGS='-NOLOGO -OUT:$@'
-            ;;
-        esac
         RANLIB='echo not_ranlib'
         STRIP='echo not_strip'
         PKG_SKIP_STRIP=1
         # aarch64 doesn't support subsystems below 6.02
         if test "$CPU_ARCH" = "aarch64"; then
             WIN32_SUBSYSTEM_VERSION=6.02
         else
             WIN32_SUBSYSTEM_VERSION=6.01
@@ -3604,18 +3591,16 @@ if test "$NECKO_COOKIES"; then
 fi
 
 dnl ========================================================
 dnl =
 dnl = Maintainer debug option (no --enable equivalent)
 dnl =
 dnl ========================================================
 
-AC_SUBST(AR)
-AC_SUBST(AR_FLAGS)
 AC_SUBST(NM)
 AC_SUBST_LIST(ASFLAGS)
 AC_SUBST(RCFLAGS)
 AC_SUBST(IMPLIB)
 AC_SUBST(FILTER)
 AC_SUBST(MOZ_AUTH_EXTENSION)
 AC_SUBST(MOZ_PREF_EXTENSIONS)
 AC_SUBST_LIST(MOZ_DEBUG_LDFLAGS)
@@ -4162,22 +4147,20 @@ export RUSTC
 export CARGO
 export MOZILLA_CENTRAL_PATH=$_topsrcdir
 export STLPORT_CPPFLAGS
 export STLPORT_LIBS
 unset MOZ_BUILD_APP
 export DIST
 export MOZ_LINKER
 export ZLIB_IN_MOZGLUE
-export AR
 export RANLIB
 export CPP
 export CC
 export CXX
-export ARFLAGS
 export CPPFLAGS
 export CFLAGS
 export CXXFLAGS
 export LDFLAGS
 export HOST_CC
 export HOST_CXX
 export HOST_CFLAGS
 export HOST_CPPFLAGS