|
| 1 | +diff --git a/deps/openssl/openssl.gyp b/deps/openssl/openssl.gyp |
| 2 | +index f6b157f8d608..ea3a2dc09ef2 100644 |
| 3 | +--- a/deps/openssl/openssl.gyp |
| 4 | ++++ b/deps/openssl/openssl.gyp |
| 5 | +@@ -5,19 +5,13 @@ |
| 6 | + 'nasm_version%': '0.0', |
| 7 | + 'openssl-cli': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)openssl-cli<(EXECUTABLE_SUFFIX)', |
| 8 | + 'conditions': [ |
| 9 | +- ['OS == "win"', { |
| 10 | +- 'obj_dir_abs': '<(PRODUCT_DIR_ABS)/obj', |
| 11 | +- }], |
| 12 | + ['GENERATOR == "ninja"', { |
| 13 | +- 'obj_dir_abs': '<(PRODUCT_DIR_ABS)/obj', |
| 14 | +- 'modules_dir': '<(PRODUCT_DIR_ABS)/obj/lib/openssl-modules', |
| 15 | ++ 'modules_dir': '<(PRODUCT_DIR_ABS_CSTR)/obj/lib/openssl-modules', |
| 16 | + }, { |
| 17 | +- 'obj_dir_abs%': '<(PRODUCT_DIR_ABS)/obj.target', |
| 18 | +- 'modules_dir': '<(PRODUCT_DIR_ABS)/obj.target/deps/openssl/lib/openssl-modules', |
| 19 | ++ 'modules_dir': '<(PRODUCT_DIR_ABS_CSTR)/obj.target/deps/openssl/lib/openssl-modules', |
| 20 | + }], |
| 21 | + ['OS=="mac"', { |
| 22 | +- 'obj_dir_abs%': '<(PRODUCT_DIR_ABS)/obj.target', |
| 23 | +- 'modules_dir': '<(PRODUCT_DIR_ABS)/obj.target/deps/openssl/lib/openssl-modules', |
| 24 | ++ 'modules_dir': '<(PRODUCT_DIR_ABS_CSTR)/obj.target/deps/openssl/lib/openssl-modules', |
| 25 | + }], |
| 26 | + ], |
| 27 | + }, |
| 28 | +diff --git a/tools/gyp/pylib/gyp/__init__.py b/tools/gyp/pylib/gyp/__init__.py |
| 29 | +index d6cc01307d99..59333e588459 100755 |
| 30 | +--- a/tools/gyp/pylib/gyp/__init__.py |
| 31 | ++++ b/tools/gyp/pylib/gyp/__init__.py |
| 32 | +@@ -24,6 +24,17 @@ DEBUG_GENERAL = "general" |
| 33 | + DEBUG_VARIABLES = "variables" |
| 34 | + DEBUG_INCLUDES = "includes" |
| 35 | + |
| 36 | ++def EscapeForCString(string): |
| 37 | ++ if isinstance(string, str): |
| 38 | ++ string = string.encode(encoding='utf8') |
| 39 | ++ |
| 40 | ++ result = '' |
| 41 | ++ for char in string: |
| 42 | ++ if not (32 <= char < 127) or char in (ord('\\'), ord('"')): |
| 43 | ++ result += '\\%03o' % char |
| 44 | ++ else: |
| 45 | ++ result += chr(char) |
| 46 | ++ return result |
| 47 | + |
| 48 | + def DebugOutput(mode, message, *args): |
| 49 | + if "all" in gyp.debug or mode in gyp.debug: |
| 50 | +@@ -106,18 +117,19 @@ def Load( |
| 51 | + |
| 52 | + output_dir = params["options"].generator_output or params["options"].toplevel_dir |
| 53 | + if default_variables["GENERATOR"] == "ninja": |
| 54 | +- default_variables.setdefault( |
| 55 | +- "PRODUCT_DIR_ABS", |
| 56 | +- os.path.join( |
| 57 | +- output_dir, "out", default_variables.get("build_type", "default") |
| 58 | +- ), |
| 59 | ++ product_dir_abs = os.path.join( |
| 60 | ++ output_dir, "out", default_variables.get("build_type", "default") |
| 61 | + ) |
| 62 | + else: |
| 63 | +- default_variables.setdefault( |
| 64 | +- "PRODUCT_DIR_ABS", |
| 65 | +- os.path.join(output_dir, default_variables["CONFIGURATION_NAME"]), |
| 66 | ++ product_dir_abs = os.path.join( |
| 67 | ++ output_dir, default_variables["CONFIGURATION_NAME"] |
| 68 | + ) |
| 69 | + |
| 70 | ++ default_variables.setdefault("PRODUCT_DIR_ABS", product_dir_abs) |
| 71 | ++ default_variables.setdefault( |
| 72 | ++ "PRODUCT_DIR_ABS_CSTR", EscapeForCString(product_dir_abs) |
| 73 | ++ ) |
| 74 | ++ |
| 75 | + # Give the generator the opportunity to set additional variables based on |
| 76 | + # the params it will receive in the output phase. |
| 77 | + if getattr(generator, "CalculateVariables", None): |
0 commit comments