bug 1399877 - Globally define DLL_PREFIX/DLL_SUFFIX. r=gps
☠☠ backed out by c28d790ecc91 ☠ ☠
authorTed Mielczarek <ted@mielczarek.org>
Thu, 14 Sep 2017 06:30:50 -0400
changeset 423832 d9bc6c96c492eb23bb08716607f276d1e5ea2f20
parent 423831 305e742634e5076bcfd0e98940879082b6f6db3a
child 423833 6cde1d8f17ad40e50bdfaec0c7ec19fe2e6022d0
push id85
push userfmarier@mozilla.com
push dateSat, 23 Sep 2017 00:09:53 +0000
reviewersgps
bugs1399877
milestone57.0a1
bug 1399877 - Globally define DLL_PREFIX/DLL_SUFFIX. r=gps Several source files use DLL_PREFIX/DLL_SUFFIX defines, and they all set them in moz.build using `DEFINES`. This is problematic for the WSL build because the quoting gets lost somewhere between bash and cl.exe. This patch makes them set globally in moz.configure with `set_define`. There was an existing global `MOZ_DLL_SUFFIX` define that was only used in one place, so that has been removed in favor of simply `DLL_SUFFIX`. MozReview-Commit-ID: 4ZQiqMK8Dgu
dom/system/moz.build
ipc/glue/moz.build
js/src/moz.build
moz.configure
security/apps/moz.build
security/certverifier/moz.build
security/manager/ssl/moz.build
xpcom/build/nsXPCOMPrivate.h
--- a/dom/system/moz.build
+++ b/dom/system/moz.build
@@ -79,13 +79,10 @@ FINAL_LIBRARY = 'xul'
 # We fire the nsDOMDeviceAcceleration
 LOCAL_INCLUDES += [
     '/dom/base',
     '/dom/bindings',
     '/js/xpconnect/loader',
     '/xpcom/base',
 ]
 
-DEFINES['DLL_PREFIX'] = '"%s"' % CONFIG['DLL_PREFIX']
-DEFINES['DLL_SUFFIX'] = '"%s"' % CONFIG['DLL_SUFFIX']
-
 MOCHITEST_CHROME_MANIFESTS += ['tests/chrome.ini']
 MOCHITEST_MANIFESTS += ['tests/mochitest.ini']
--- a/ipc/glue/moz.build
+++ b/ipc/glue/moz.build
@@ -215,17 +215,17 @@ LOCAL_INCLUDES += [
     '/xpcom/threads',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 for var in ('MOZ_CHILD_PROCESS_NAME', 'MOZ_CHILD_PROCESS_NAME_PIE',
-            'MOZ_CHILD_PROCESS_BUNDLE', 'DLL_PREFIX', 'DLL_SUFFIX'):
+            'MOZ_CHILD_PROCESS_BUNDLE'):
     DEFINES[var] = '"%s"' % CONFIG[var]
 
 if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_ARCH'] == 'WINNT':
     LOCAL_INCLUDES += [
         '/security/sandbox/chromium',
         '/security/sandbox/chromium-shim',
         '/security/sandbox/win/src/sandboxbroker',
     ]
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -651,18 +651,16 @@ if CONFIG['MOZ_DEBUG'] or CONFIG['NIGHTL
 
 # Also set in shell/moz.build
 DEFINES['ENABLE_SHARED_ARRAY_BUFFER'] = True
 
 DEFINES['EXPORT_JS_API'] = True
 
 if CONFIG['JS_HAS_CTYPES']:
     DEFINES['JS_HAS_CTYPES'] = True
-    for var in ('DLL_PREFIX', 'DLL_SUFFIX'):
-        DEFINES[var] = '"%s"' % CONFIG[var]
 
 if CONFIG['MOZ_LINKER']:
     DEFINES['MOZ_LINKER'] = True
 
 if CONFIG['_MSC_VER']:
     if CONFIG['CPU_ARCH'] == 'x86':
         SOURCES['builtin/RegExp.cpp'].no_pgo = True # Bug 772303
     elif CONFIG['CPU_ARCH'] == 'x86_64' and CONFIG['JS_HAS_CTYPES']:
--- a/moz.configure
+++ b/moz.configure
@@ -215,17 +215,18 @@ set_config('DLL_SUFFIX', library_name_in
 set_config('LIB_PREFIX', library_name_info.lib.prefix)
 set_config('LIB_SUFFIX', library_name_info.lib.suffix)
 set_config('RUST_LIB_PREFIX', library_name_info.rust_lib.prefix)
 set_config('RUST_LIB_SUFFIX', library_name_info.rust_lib.suffix)
 set_config('OBJ_SUFFIX', library_name_info.obj.suffix)
 # Lots of compilation tests depend on this variable being present.
 add_old_configure_assignment('OBJ_SUFFIX', library_name_info.obj.suffix)
 set_config('IMPORT_LIB_SUFFIX', library_name_info.import_lib.suffix)
-set_define('MOZ_DLL_SUFFIX', depends(library_name_info.dll.suffix)(lambda s: '"%s"' % s))
+set_define('DLL_PREFIX', depends(library_name_info.dll.prefix)(lambda s: '"%s"' % s))
+set_define('DLL_SUFFIX', depends(library_name_info.dll.suffix)(lambda s: '"%s"' % s))
 
 include(include_project_configure)
 
 @depends('--help')
 @imports(_from='mozbuild.backend', _import='backends')
 def build_backends_choices(_):
     return tuple(backends)
 
--- a/security/apps/moz.build
+++ b/security/apps/moz.build
@@ -16,18 +16,16 @@ FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '/security/certverifier',
     '/security/manager/ssl',
     '/security/pkix/include',
 ]
 
 DEFINES['NSS_ENABLE_ECC'] = 'True'
-for var in ('DLL_PREFIX', 'DLL_SUFFIX'):
-    DEFINES[var] = '"%s"' % CONFIG[var]
 
 if CONFIG['GNU_CXX']:
     CXXFLAGS += [
         '-Wextra',
     ]
 
     # Gecko headers aren't warning-free enough for us to enable these warnings.
     CXXFLAGS += [
--- a/security/certverifier/moz.build
+++ b/security/certverifier/moz.build
@@ -40,19 +40,16 @@ UNIFIED_SOURCES += [
     'SignedCertificateTimestamp.cpp',
 ]
 
 if not CONFIG['NSS_NO_EV_CERTS']:
     UNIFIED_SOURCES += [
         'ExtendedValidation.cpp',
     ]
 
-for var in ('DLL_PREFIX', 'DLL_SUFFIX'):
-    DEFINES[var] = '"%s"' % CONFIG[var]
-
 LOCAL_INCLUDES += [
     '/security/manager/ssl',
     '/security/pkix/include',
     '/security/pkix/lib',
 ]
 
 DIRS += [
     '../pkix',
--- a/security/manager/ssl/moz.build
+++ b/security/manager/ssl/moz.build
@@ -178,18 +178,16 @@ dafsa_data = GENERATED_FILES['nsSTSPrelo
 dafsa_data.script = '../../../xpcom/ds/make_dafsa.py'
 dafsa_data.inputs = ['nsSTSPreloadList.inc']
 
 if CONFIG['NSS_DISABLE_DBM']:
     DEFINES['NSS_DISABLE_DBM'] = '1'
 
 DEFINES['SSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES'] = 'True'
 DEFINES['NSS_ENABLE_ECC'] = 'True'
-for var in ('DLL_PREFIX', 'DLL_SUFFIX'):
-    DEFINES[var] = '"%s"' % CONFIG[var]
 
 if not CONFIG['MOZ_SYSTEM_NSS']:
     USE_LIBS += [
         'crmf',
     ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
--- a/xpcom/build/nsXPCOMPrivate.h
+++ b/xpcom/build/nsXPCOMPrivate.h
@@ -76,17 +76,17 @@ void LogTerm();
 
 // you have to love apple..
 #ifdef XP_MACOSX
 #define XPCOM_SEARCH_KEY  "DYLD_LIBRARY_PATH"
 #define GRE_FRAMEWORK_NAME "XUL.framework"
 #define XUL_DLL            "XUL"
 #else
 #define XPCOM_SEARCH_KEY  "LD_LIBRARY_PATH"
-#define XUL_DLL   "libxul" MOZ_DLL_SUFFIX
+#define XUL_DLL   "libxul" DLL_SUFFIX
 #endif
 
 #define GRE_CONF_NAME ".gre.config"
 #define GRE_CONF_PATH "/etc/gre.conf"
 #define GRE_CONF_DIR  "/etc/gre.d"
 #define GRE_USER_CONF_DIR ".gre.d"
 #endif