From 232a32d832f9754b81dde348e8fd8ded37ad404b Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 9 Jun 2022 22:24:46 +0200 Subject: [PATCH] (#11091) mingw: externalize deps * mingw: externalize deps * Update conanfile.py * don't propagate libs to gcc * fixup yml formatting --- recipes/mingw-w64/config.yml | 3 +- recipes/mingw-w64/linux/conandata.yml | 10 ------ recipes/mingw-w64/linux/conanfile.py | 51 ++++----------------------- 3 files changed, 8 insertions(+), 56 deletions(-) diff --git a/recipes/mingw-w64/config.yml b/recipes/mingw-w64/config.yml index 8bd9d1c5980b8..ccd4069ab51d6 100644 --- a/recipes/mingw-w64/config.yml +++ b/recipes/mingw-w64/config.yml @@ -1,4 +1,3 @@ versions: "8.0.2": - folder: "linux" - + folder: "linux" diff --git a/recipes/mingw-w64/linux/conandata.yml b/recipes/mingw-w64/linux/conandata.yml index ece2d6599b4fa..4c165fd2e4f36 100644 --- a/recipes/mingw-w64/linux/conandata.yml +++ b/recipes/mingw-w64/linux/conandata.yml @@ -6,17 +6,7 @@ sources: binutils: url: "http://ftp.gnu.org/gnu/binutils/binutils-2.35.2.tar.bz2" sha256: "cfa7644dbecf4591e136eb407c1c1da16578bd2b03f0c2e8acdceba194bb9d61" - gmp: - url: "https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz" - sha256: "fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2" - mpfr: - url: "https://ftp.gnu.org/gnu/mpfr/mpfr-4.1.0.tar.xz" - sha256: "0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f" - mpc: - url: "https://ftp.gnu.org/gnu/mpc/mpc-1.2.1.tar.gz" - sha256: "17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459" gcc: "10.3.0": url: "http://ftp.gnu.org/gnu/gcc/gcc-10.3.0/gcc-10.3.0.tar.xz" sha256: "64f404c1a650f27fc33da242e1f2df54952e3963a49e06e73f6940f3223ac344" - diff --git a/recipes/mingw-w64/linux/conanfile.py b/recipes/mingw-w64/linux/conanfile.py index ebd55e7c0a3d1..0aac88eb400c0 100644 --- a/recipes/mingw-w64/linux/conanfile.py +++ b/recipes/mingw-w64/linux/conanfile.py @@ -37,6 +37,9 @@ def validate(self): def build_requirements(self): self.build_requires("m4/1.4.19") + self.build_requires("gmp/6.2.1") + self.build_requires("mpfr/4.1.0") + self.build_requires("mpc/1.2.0") def _download_source(self): arch_data = self.conan_data["sources"][self.version] @@ -77,51 +80,10 @@ def build(self): env = {"PATH": os.environ["PATH"] + ":" + os.path.join(self.package_folder, "bin")} with tools.environment_append(env): - self.output.info("Building gmp ...") - os.mkdir(os.path.join(self.build_folder, "gmp")) - with tools.chdir(os.path.join(self.build_folder, "gmp")): - autotools = AutoToolsBuildEnvironment(self) - conf_args = [ - "--enable-silent-rules", - "--disable-shared" - ] - autotools.configure(configure_dir=os.path.join(self.build_folder, "sources", "gmp"), - args=conf_args, target=False, host=False, build=False) - autotools.make() - autotools.install() - - self.output.info("Building mpfr ...") - os.mkdir(os.path.join(self.build_folder, "mpfr")) - with tools.chdir(os.path.join(self.build_folder, "mpfr")): - autotools = AutoToolsBuildEnvironment(self) - conf_args = [ - "--enable-silent-rules", - "--disable-shared", - "--with-gmp={}".format(self.package_folder) - ] - autotools.configure(configure_dir=os.path.join(self.build_folder, "sources", "mpfr"), - args=conf_args, target=False, host=False, build=False) - autotools.make() - autotools.install() - - self.output.info("Building mpc ...") - os.mkdir(os.path.join(self.build_folder, "mpc")) - with tools.chdir(os.path.join(self.build_folder, "mpc")): - autotools = AutoToolsBuildEnvironment(self) - conf_args = [ - "--enable-silent-rules", - "--disable-shared", - "--with-gmp={}".format(self.package_folder), - "--with-mpfr={}".format(self.package_folder) - ] - autotools.configure(configure_dir=os.path.join(self.build_folder, "sources", "mpc"), - args=conf_args, target=False, host=False, build=False) - autotools.make() - autotools.install() with_gmp_mpfc_mpc = [ - "--with-gmp={}".format(self.package_folder), - "--with-mpfr={}".format(self.package_folder), - "--with-mpc={}".format(self.package_folder) + "--with-gmp={}".format(self.deps_cpp_info["gmp"].rootpath.replace("\\", "/")), + "--with-mpfr={}".format(self.deps_cpp_info["mpfr"].rootpath.replace("\\", "/")), + "--with-mpc={}".format(self.deps_cpp_info["mpc"].rootpath.replace("\\", "/")) ] self.output.info("Building binutils ...") @@ -207,6 +169,7 @@ def build(self): # Not 100% sure why, but the following options are required, otherwise # gcc fails to build with posix threads ]) + autotools_gcc.libs = [] autotools_gcc.configure(configure_dir=os.path.join(self.build_folder, "sources", "gcc"), args=conf_args, target=target_tag, host=False, build=False) autotools_gcc.make(target="all-gcc")