Bug 1319959 - Set _topsrcdir, _objdir, MOZ_BUILD_ROOT and DIST from python configure. r?gps draft
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 24 Nov 2016 09:47:15 +0900
changeset 443223 13293bec80add0cbddc683f6d2046e57fbb58d08
parent 442700 e1f1391a4b703a00490341fd2a0b447fa64225b1
child 537985 99c87757bbfd85f6a00f011c5942b738f1fda004
push id36920
push userbmo:mh+mozilla@glandium.org
push dateThu, 24 Nov 2016 00:52:28 +0000
reviewersgps
bugs1319959
milestone53.0a1
Bug 1319959 - Set _topsrcdir, _objdir, MOZ_BUILD_ROOT and DIST from python configure. r?gps In some cases, on OSX, python's `os.path.realpath` and shell's `pwd -P` don't agree on the case of paths on case-insensitive filesystems. So make everyone agree by using the value from python configure.
build/moz.configure/init.configure
js/src/old-configure.in
old-configure.in
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -66,16 +66,24 @@ def check_build_environment(help, dist):
     return result
 
 set_config('TOPSRCDIR', delayed_getattr(check_build_environment, 'topsrcdir'))
 set_config('TOPOBJDIR', delayed_getattr(check_build_environment, 'topobjdir'))
 set_config('MOZ_BUILD_ROOT', delayed_getattr(check_build_environment,
                                              'topobjdir'))
 set_config('DIST', delayed_getattr(check_build_environment, 'dist'))
 
+add_old_configure_assignment(
+    '_topsrcdir', delayed_getattr(check_build_environment, 'topsrcdir'))
+add_old_configure_assignment(
+    '_objdir', delayed_getattr(check_build_environment, 'topobjdir'))
+add_old_configure_assignment(
+    'MOZ_BUILD_ROOT', delayed_getattr(check_build_environment, 'topobjdir'))
+add_old_configure_assignment(
+    'DIST', delayed_getattr(check_build_environment, 'dist'))
 
 option(env='MOZ_AUTOMATION', help='Enable options for automated builds')
 set_config('MOZ_AUTOMATION', depends_if('MOZ_AUTOMATION')(lambda x: True))
 
 
 option(env='OLD_CONFIGURE', nargs=1, help='Path to the old configure script')
 
 option(env='MOZ_CURRENT_PROJECT', nargs=1, help='Current build project')
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -58,30 +58,20 @@ dnl ====================================
 MISSING_X=
 
 dnl Initialize the Pthread test variables early so they can be
 dnl  overridden by each platform.
 dnl ========================================================
 USE_PTHREADS=
 _PTHREAD_LDFLAGS=""
 
-dnl Do not allow objdir == srcdir builds
-dnl ==============================================================
-_topsrcdir=`cd $srcdir; pwd -W 2>/dev/null || pwd -P`
-_objdir=`pwd -P`
-
-MOZ_BUILD_ROOT=`pwd -W 2>/dev/null || pwd -P`
-
 MOZ_DEFAULT_COMPILER
 
 if test -z "$JS_STANDALONE"; then
   autoconfmk=autoconf-js.mk
-  #DIST is exported from top-level configure
-else
-  DIST="$MOZ_BUILD_ROOT/dist"
 fi
 AC_SUBST(autoconfmk)
 
 MOZ_ANDROID_NDK
 
 if test -n "$gonkdir" ; then
     LDFLAGS="-L$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib -Wl,-rpath-link=$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib --sysroot=$gonkdir/out/target/product/$GONK_PRODUCT/obj/ -llog $LDFLAGS"
 fi
--- a/old-configure.in
+++ b/old-configure.in
@@ -75,24 +75,16 @@ dnl ====================================
 MISSING_X=
 
 dnl Initialize the Pthread test variables early so they can be
 dnl  overridden by each platform.
 dnl ========================================================
 MOZ_USE_PTHREADS=
 _PTHREAD_LDFLAGS=""
 
-dnl Do not allow objdir == srcdir builds.
-dnl ==============================================================
-_topsrcdir=`cd \`dirname $0\`; pwd -W 2>/dev/null || pwd -P`
-_objdir=`pwd -P`
-
-MOZ_BUILD_ROOT=`pwd -W 2>/dev/null || pwd -P`
-DIST="$MOZ_BUILD_ROOT/dist"
-
 MOZ_DEFAULT_COMPILER
 
 if test "$COMPILE_ENVIRONMENT"; then
     MOZ_ANDROID_NDK
 fi # COMPILE_ENVIRONMENT
 
 if test -n "$gonkdir"; then
     dnl export for js/src/configure. We can't pass the option down normally,