diff --git a/pylib/gyp/common.py b/pylib/gyp/common.py index 223ce47b..deb7cc1b 100644 --- a/pylib/gyp/common.py +++ b/pylib/gyp/common.py @@ -506,6 +506,8 @@ def GetFlavorByPlatform(): return "zos" if sys.platform == "os400": return "os400" + if re.fullmatch("gnu\\d+", sys.platform): + return "hurd" return "linux" diff --git a/pylib/gyp/common_test.py b/pylib/gyp/common_test.py index b5988816..5de7bcf6 100755 --- a/pylib/gyp/common_test.py +++ b/pylib/gyp/common_test.py @@ -76,6 +76,7 @@ def test_platform_default(self): self.assertFlavor("linux", "linux2", {}) self.assertFlavor("linux", "linux3", {}) self.assertFlavor("linux", "linux", {}) + self.assertFlavor("hurd", "gnu0", {}) def test_param(self): self.assertFlavor("foobar", "linux2", {"flavor": "foobar"}) diff --git a/pylib/gyp/generator/make.py b/pylib/gyp/generator/make.py index 16b6f4e8..96fbbd1f 100644 --- a/pylib/gyp/generator/make.py +++ b/pylib/gyp/generator/make.py @@ -1888,7 +1888,7 @@ def WriteTarget( self.flavor not in ("mac", "openbsd", "netbsd", "win") and not self.is_standalone_static_library ): - if self.flavor in ("linux", "android", "openharmony"): + if self.flavor in ("linux", "android", "openharmony", "hurd"): self.WriteMakeRule( [self.output_binary], link_deps, @@ -1902,7 +1902,7 @@ def WriteTarget( part_of_all, postbuilds=postbuilds, ) - elif self.flavor in ("linux", "android", "openharmony"): + elif self.flavor in ("linux", "android", "openharmony", "hurd"): self.WriteMakeRule( [self.output_binary], link_deps, diff --git a/test_gyp.py b/test_gyp.py index 70c81ae8..810dfbed 100755 --- a/test_gyp.py +++ b/test_gyp.py @@ -128,6 +128,7 @@ def main(argv=None): # https://bugs.chromium.org/p/gyp/issues/detail?id=530 # 'darwin': ['make', 'ninja', 'xcode', 'xcode-ninja'], "darwin": ["make", "ninja", "xcode"], + "gnu0": ["make", "ninja"], }[sys.platform] gyp_options = []