Skip to content

Commit

Permalink
(#11091) mingw: externalize deps
Browse files Browse the repository at this point in the history
* mingw: externalize deps

* Update conanfile.py

* don't propagate libs to gcc

* fixup yml formatting
  • Loading branch information
ericLemanissier authored Jun 9, 2022
1 parent 3ae16f4 commit 232a32d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 56 deletions.
3 changes: 1 addition & 2 deletions recipes/mingw-w64/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
versions:
"8.0.2":
folder: "linux"

folder: "linux"
10 changes: 0 additions & 10 deletions recipes/mingw-w64/linux/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

51 changes: 7 additions & 44 deletions recipes/mingw-w64/linux/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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 ...")
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 232a32d

Please sign in to comment.