Bug 1290040 - Find link.exe from python configure. r?gps draft
authorMike Hommey <mh+mozilla@glandium.org>
Sat, 30 Jul 2016 07:51:20 +0900
changeset 394634 066b6a8d096b806d61b4267b7432f7598ae030ed
parent 394633 e6d4e3c4573ee715715b33701ebf4a04b043af0f
child 526849 15643aff729dabd52491380e8e53bd4cf83d4157
push id24612
push userbmo:mh+mozilla@glandium.org
push dateSat, 30 Jul 2016 04:51:39 +0000
reviewersgps
bugs1290040
milestone50.0a1
Bug 1290040 - Find link.exe from python configure. r?gps This ensures we have a full path to link.exe from MSVC in LD, avoiding to use /usr/bin/link on msys2.
build/autoconf/compiler-opts.m4
build/moz.configure/windows.configure
--- a/build/autoconf/compiler-opts.m4
+++ b/build/autoconf/compiler-opts.m4
@@ -20,17 +20,16 @@ dnl Default to MSVC for win32 and gcc-4.
 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 "$LD"; then LD=link; fi
     if test -z "$AS"; then
         case "${target_cpu}" in
         i*86)
             AS=ml;
             ;;
         x86_64)
             AS=ml64;
             ;;
--- a/build/moz.configure/windows.configure
+++ b/build/moz.configure/windows.configure
@@ -374,16 +374,26 @@ def valid_mt(path):
     except subprocess.CalledProcessError:
         pass
     raise FatalCheckError('%s is not Microsoft Manifest Tool')
 
 
 set_config('MSMANIFEST_TOOL', depends(valid_mt)(lambda x: bool(x)))
 
 
+# Ultimately, this will move to toolchain.configure and be turned into a
+# cross-platform check.
+option(env='LD', nargs=1, help='Path to the linker')
+
+link = check_prog('LINK', depends_win()(lambda: ('link.exe',)), input='LD',
+                  paths=vc_compiler_path)
+
+add_old_configure_assignment('LD', depends_win(link)(lambda x: x))
+
+
 # Normally, we'd just have CC, etc. set to absolute paths, but the build system
 # doesn't currently handle properly the case where the paths contain spaces.
 # Additionally, there's the issue described in toolchain.configure, in
 # valid_compiler().
 @depends_win(sdk_bin_path)
 @imports('os')
 def alter_path(sdk_bin_path):
     path = os.pathsep.join(sdk_bin_path)