From 3faa6ebe0068b432ee5a9390c47ceca068ea7fe9 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 21 Mar 2024 07:00:13 +0000 Subject: gentoo auto-resync : 21:03:2024 - 07:00:13 --- dev-libs/libsecp256k1/Manifest | 13 +-- .../files/0.2.0-fix-cross-compile.patch | 87 ------------------- .../files/0.3.0-fix-cross-compile.patch | 99 ++++++++++++++++++++++ .../files/0.4.0-fix-cross-compile.patch | 99 ++++++++++++++++++++++ dev-libs/libsecp256k1/libsecp256k1-0.3.0.ebuild | 2 +- dev-libs/libsecp256k1/libsecp256k1-0.3.1.ebuild | 2 +- dev-libs/libsecp256k1/libsecp256k1-0.3.2.ebuild | 2 +- dev-libs/libsecp256k1/libsecp256k1-0.4.0.ebuild | 2 +- dev-libs/libsecp256k1/libsecp256k1-0.4.1.ebuild | 2 +- 9 files changed, 210 insertions(+), 98 deletions(-) delete mode 100644 dev-libs/libsecp256k1/files/0.2.0-fix-cross-compile.patch create mode 100644 dev-libs/libsecp256k1/files/0.3.0-fix-cross-compile.patch create mode 100644 dev-libs/libsecp256k1/files/0.4.0-fix-cross-compile.patch (limited to 'dev-libs/libsecp256k1') diff --git a/dev-libs/libsecp256k1/Manifest b/dev-libs/libsecp256k1/Manifest index d25a8d5b7fa5..deaf741e5034 100644 --- a/dev-libs/libsecp256k1/Manifest +++ b/dev-libs/libsecp256k1/Manifest @@ -1,4 +1,5 @@ -AUX 0.2.0-fix-cross-compile.patch 3941 BLAKE2B ec2272250dd4cde7dcae4eb2bf0ac73649330a70fce4108b086d1e834bf9f132fc513fbb9ae4d2f5f87ceeb033e9ab3d4ff39025b9c537dd4ad982020faa5092 SHA512 c6fcb9dba23d00955174fef94323bd37250e1019aa1b68c0b4393292b505e6ff17670ea1121837f50f4b22356dd637ea53f4e43623c2cf32691d435f0278805a +AUX 0.3.0-fix-cross-compile.patch 4416 BLAKE2B e68d46d85af6d0bf56f5423219ad5412230de6808bd79e154316e8918df056353f336063e07810c7b40cfe41edd099986e3591e9caa918e01a99a1406a48bee4 SHA512 2865dd0d751b629258bc7283d9a7cca6f07ff304f29e0e020b87ffbcce85225ef2e72914b668ef2c4317ed8c11e093c5f2efa1604fa37f495a3f370404f9eff5 +AUX 0.4.0-fix-cross-compile.patch 4361 BLAKE2B a42a42404477cb69ffef4f6d2fb92efb1f7c09153c65dcbf467a9c756ef1e0e4df8bfbc06068aaff9e1e494d1d280a6f3f836c655c23b5d4fe4162add2bf4596 SHA512 28ae55f9b0ca02173bbb159b5232b4531fa6149d7888e5ff860f4a0e85e4c64e9544a8007452382e6615d1c922dc6d42cdaebebe0b82a2cad93b0c3ccb279839 DIST libsecp256k1-0.3.0.tar.gz 2475682 BLAKE2B a531a87da63abc67a55e756852cde41cdc56d388963871beb23233623721f583ade4ce6b273ffa1c319a3875541e18c549512034d7b6a9eb926e8e916513d14d SHA512 77251b37990b0e73442aa1ec1ff51c5c7e293755ace9abc92ce6c3d21c7ed7f3b1666b939b4410bf1f637e3a69b16a7d33069caf071327f05177420a10f15eda DIST libsecp256k1-0.3.1.tar.gz 2560292 BLAKE2B 70ff57e222dd47d0e63a40653d4e7b4e727f6bcb5abf005f15c94cf70e7d11843281d7406d2640b06a0f6a2c2f79cc66ea544cca761d1587973d57006ca39daf SHA512 58ec679625ef4663c94c7198ee953283106c1e027623c3de341277fa757265b822ad3c0e98019f9e425f0e9e414b03e6b62853a1581611813cce753e81845d0f DIST libsecp256k1-0.3.2.tar.gz 2566680 BLAKE2B bf0a5ac1edbc115247148912822a2cefe798651f6c6a480422eee90eba96ebbfba772d561e321ac2bf7a0f8261f8ccd9f3af0e66e196f1e861aa550ee1303f27 SHA512 18104b72dd5d1f5e776d72c31c36247e450736437b453b59cf6ec86f84fedeafcf231e266c1ddad727befd9864c65a779000d01e6cef4b9a6485850afebc8a81 @@ -8,9 +9,9 @@ DIST libsecp256k1-v0.1_pre20190401.tgz 166663 BLAKE2B 68c9fc3fda6af56452f32edeae DIST libsecp256k1-v0.1_pre20201028.tgz 200051 BLAKE2B 90d636049b411e02703feb2661006900a55f952f60e76e2b7147a5afe8e391a06a80d6ae1489b1e7f2382176c7ea831526465a85bca09156dc6d37b417fcb33b SHA512 54a0fa21b64dd6836e4227de51f3539afe06e0e2f352683397d6adb5dd0508af443d2e25f91e90e1ae366b261965fe7d438292314705baee799cf37421644958 EBUILD libsecp256k1-0.1_pre20190401.ebuild 1577 BLAKE2B f1472ea251a7f43a7c6a96aabcfcf34481d55b1f43afaca01293326c1d19cb0debf9d9a258250b6f045060d4827ada3b6f0644f2029e1d37ef7349833136dbc1 SHA512 ac2c63c0db252ca605ce4d2f99de32a66ffd24d6658eb23692d5380f02507e754b2135c5de562dcc98c689c32eea8edb85b6976ab3cb5c9814088f3e9cf5e8ac EBUILD libsecp256k1-0.1_pre20201028-r1.ebuild 1772 BLAKE2B 66747f4082defa6ddbc452762e359c4407dab613367d22c82de0c3a7b210374eca430f3f979064b294dfb7e0b5e349e8c3f89de2705bccaaab011ef64088d77f SHA512 276868582dfb71d5ca39880c647717a8c5051aa96714df0eeddf8fdf307a962ecfcf9da98837d8603a5cdbedbd24c9b3a478e9cb0c8eedcb7c4ec23a5b00c59e -EBUILD libsecp256k1-0.3.0.ebuild 1717 BLAKE2B 463ea5f1cbc676db7f8d4e4f761af32502a79aba66e7e4aedc58997dd3f57d6c403456131ba6ef6c62fadbc83d27ea076b0434696080436d975036627f8ff67c SHA512 627467a49da0da0194b5f170864887ec35adb4020b0fe5b01b4d8bff7bde7e9ad43ef56197c077349740f75cf773f8dc8194d2bd72d562e2bb834e110b0c0d75 -EBUILD libsecp256k1-0.3.1.ebuild 1717 BLAKE2B 463ea5f1cbc676db7f8d4e4f761af32502a79aba66e7e4aedc58997dd3f57d6c403456131ba6ef6c62fadbc83d27ea076b0434696080436d975036627f8ff67c SHA512 627467a49da0da0194b5f170864887ec35adb4020b0fe5b01b4d8bff7bde7e9ad43ef56197c077349740f75cf773f8dc8194d2bd72d562e2bb834e110b0c0d75 -EBUILD libsecp256k1-0.3.2.ebuild 1719 BLAKE2B 4d834ae4d90508090a14cdec378a44aca80e1b16ff5daa8fe94ca783fab6e42fe2d24906858c6706dc39c251e706728827e4b77520e883973e202a08b1619b9c SHA512 0784c04d16ad8cf1e1ef723ea8883758faad505a337d2826b4e9076ef93ff065bdf497b9e728ea0f08dbb3cbfe03aeacd448ea68b971e912332584702b91cb48 -EBUILD libsecp256k1-0.4.0.ebuild 1762 BLAKE2B fd99f3a2520e0f7e0029fa464b5792c89578408ac121f578882890b312cc7d156ce5225ea1e687dc3682f28b574741f1b11b3ddf921cc7e8ec5b9dd98c94ad32 SHA512 e38870746ae809cf18e8a63b358275006306da3249db74417269701900ddefe88c0c8e744576cd012e36bc879022bcc4dbb60eb81dcbe3759808512b18bb34c7 -EBUILD libsecp256k1-0.4.1.ebuild 1645 BLAKE2B 76f7c6aa6f1fc86a15d4cd90b3f77f3e7ae265beaace2a00a75f354f0149de780c1845091d64ffcd1a55dc76040be5049679a64247b5eeddf016dbc92cdd894c SHA512 1d8a6f060e64b8c7c055ce84b38269138ae2dc9b71a0584c68ad01366ba90f30066690fc72ca3ce5f635f0796d6908ef14ecf3d8c4af1ed9ee49c833709ff304 +EBUILD libsecp256k1-0.3.0.ebuild 1717 BLAKE2B 2d58ce27e1d6d2d40f0d78d0aaf134a21a5fbabfab5832a089710cb4c0ab8dc97aa46fb5e4485b3d4b03d6b6469f13452a5ac2ae34def65d946afd2e552457d3 SHA512 f7690ccc0cd48cc2af018b4d884c11c13dd9029d9658b9187170ec649a9a22391d951904d678a68a94fd75058d544ee4bed7d3a962291f039ebfaec54ffdcbcd +EBUILD libsecp256k1-0.3.1.ebuild 1717 BLAKE2B 2d58ce27e1d6d2d40f0d78d0aaf134a21a5fbabfab5832a089710cb4c0ab8dc97aa46fb5e4485b3d4b03d6b6469f13452a5ac2ae34def65d946afd2e552457d3 SHA512 f7690ccc0cd48cc2af018b4d884c11c13dd9029d9658b9187170ec649a9a22391d951904d678a68a94fd75058d544ee4bed7d3a962291f039ebfaec54ffdcbcd +EBUILD libsecp256k1-0.3.2.ebuild 1719 BLAKE2B 0f177e6e84f100eb1430019fdc11fde9ceb40e2e9043c80317cfcc1a8e8d650366e3ffe7e9147aa3b88de904e1664f1f33e5cbc93f8823fcc0e9b9a00ebc10c5 SHA512 3485c09d6765345d95abf93ce17bd6e825ac599e9468a64dd6d9072e66bc738df1f3f9417d33b55edb6e75cc1d900b439d43275de9f74354889bc4a4a391e12a +EBUILD libsecp256k1-0.4.0.ebuild 1762 BLAKE2B ea0cd297838bb6dc8a4ce5d9579b34f2c7db3a1d1a132f558f9aad444d20b6ca79a15ba106903c11a146a07b485084110ca4a4ffc52fd0f337da572949ee16dd SHA512 3b3d0ef5c6b2935057a19c630e7f488bae5afb792cdb56bcbab48c5e0c43a5760e1cd6c9628abe072963d8719c0ca896a953d5af0fe69f1ea1fc0ab22b088c70 +EBUILD libsecp256k1-0.4.1.ebuild 1645 BLAKE2B 81e612be118cd8e5dda952ec9328f77c4a30bc432ff181a54186cfe2358d4f2e3e0b9a4ee6a982e4cde5f571d7ca259c57d9a8214a44b8ade923dbfe80676163 SHA512 597f0045f8458159d82b87539af759fdeeae5bd3cd62093acae2526713738497fba5aab337d20ed78e5afc97fb8208cd96c6cfeb1a406179ac8c38ef02285e5b MISC metadata.xml 1179 BLAKE2B ec5305666568df781002de407712305ab58b474bfb982d708816ac375cae3474918c539a5d652dabf864edf6557bd92df5b182756293929784b2fccbbf943dec SHA512 950a0e56c67a3dedb6d38bc5e2c30b9fda03124a17e8e30b2c1eeb28a4cd5fd1414a223c1c85882e623c5945fbb2a0a05706c9ae15dfc8ea07b9698e9990345b diff --git a/dev-libs/libsecp256k1/files/0.2.0-fix-cross-compile.patch b/dev-libs/libsecp256k1/files/0.2.0-fix-cross-compile.patch deleted file mode 100644 index a1db0826ebe2..000000000000 --- a/dev-libs/libsecp256k1/files/0.2.0-fix-cross-compile.patch +++ /dev/null @@ -1,87 +0,0 @@ -https://github.com/bitcoin-core/secp256k1/pull/1159 - -From 772e747bd9104d80fe531bed61f23f75342d7d63 Mon Sep 17 00:00:00 2001 -From: Matt Whitlock -Date: Sun, 20 Nov 2022 01:46:07 -0500 -Subject: [PATCH] Makefile: build precomp generators using build-system - toolchain - -When cross-compiling libsecp256k1, if the `precomputed_ecmult*.c` source -files need to be regenerated, then the generators need to be built for -the *build* system, not for the *host* system. Autoconf supports this -fairly cleanly via the `AX_PROG_CC_FOR_BUILD` macro (from Autoconf -Archive), but Automake requires some hackery. When building the -generators, we override the `CC`, `CFLAGS`, `CPPFLAGS`, and `LDFLAGS` -variables to their build-system counterparts, whose names are suffixed -with `_FOR_BUILD` and whose values are populated by the aforementioned -Autoconf macro and may be overridden on the `make` command line. Since -Automake lacks support for overriding `EXEEXT` on a per-program basis, -we define a recipe that builds the generator binaries with names -suffixed with `$(EXEEXT)` and then renames them suffixed with -`$(BUILD_EXEEXT)`. ---- - Makefile.am | 30 ++++++++++++++++++++++++------ - configure.ac | 1 + - 2 files changed, 25 insertions(+), 6 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index 30b6a794d0..e929300298 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -180,8 +180,26 @@ endif - endif - - ### Precomputed tables --EXTRA_PROGRAMS = precompute_ecmult precompute_ecmult_gen --CLEANFILES = $(EXTRA_PROGRAMS) -+PROGRAMS_FOR_BUILD = precompute_ecmult precompute_ecmult_gen -+$(addsuffix $(BUILD_EXEEXT),$(PROGRAMS_FOR_BUILD)) : override CC = $(CC_FOR_BUILD) -+$(addsuffix $(BUILD_EXEEXT),$(PROGRAMS_FOR_BUILD)) : override CFLAGS = $(CFLAGS_FOR_BUILD) -+$(addsuffix $(BUILD_EXEEXT),$(PROGRAMS_FOR_BUILD)) : override CPPFLAGS = $(CPPFLAGS_FOR_BUILD) -+$(addsuffix $(BUILD_EXEEXT),$(PROGRAMS_FOR_BUILD)) : override LDFLAGS = $(LDFLAGS_FOR_BUILD) -+# Automake has no support for PROGRAMS suffixed with BUILD_EXEEXT -+# instead of EXEEXT, so if those extensions differ, then we define a -+# recipe that builds the latter and renames it to the former. Since -+# Cygwin toolchains always append '.exe' to the output file name given -+# by '-o', we ignore rename failures since the toolchain will have -+# already created the right output file. (Note: The leading spaces -+# before ifneq and endif here are a hack so Automake won't try to -+# interpret them as an Automake conditional.) -+ ifneq ($(BUILD_EXEEXT),$(EXEEXT)) -+%$(BUILD_EXEEXT) : %$(EXEEXT) -+ mv -- '$<' '$@' || : -+ endif -+ -+EXTRA_PROGRAMS = $(PROGRAMS_FOR_BUILD) -+CLEANFILES = $(addsuffix $(BUILD_EXEEXT),$(PROGRAMS_FOR_BUILD)) - - precompute_ecmult_SOURCES = src/precompute_ecmult.c - precompute_ecmult_CPPFLAGS = $(SECP_INCLUDES) -@@ -198,11 +216,11 @@ precompute_ecmult_gen_LDADD = $(SECP_LIBS) $(COMMON_LIB) - # This means that rebuilds of the prebuilt files always need to be - # forced by deleting them, e.g., by invoking `make clean-precomp`. - src/precomputed_ecmult.c: -- $(MAKE) $(AM_MAKEFLAGS) precompute_ecmult$(EXEEXT) -- ./precompute_ecmult$(EXEEXT) -+ $(MAKE) $(AM_MAKEFLAGS) precompute_ecmult$(BUILD_EXEEXT) -+ ./precompute_ecmult$(BUILD_EXEEXT) - src/precomputed_ecmult_gen.c: -- $(MAKE) $(AM_MAKEFLAGS) precompute_ecmult_gen$(EXEEXT) -- ./precompute_ecmult_gen$(EXEEXT) -+ $(MAKE) $(AM_MAKEFLAGS) precompute_ecmult_gen$(BUILD_EXEEXT) -+ ./precompute_ecmult_gen$(BUILD_EXEEXT) - - PRECOMP = src/precomputed_ecmult_gen.c src/precomputed_ecmult.c - precomp: $(PRECOMP) -diff --git a/configure.ac b/configure.ac -index a2a15d2b82..013964f5ff 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -35,6 +35,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) - AC_PROG_CC - AM_PROG_AS - AM_PROG_AR -+AX_PROG_CC_FOR_BUILD - - # Clear some cache variables as a workaround for a bug that appears due to a bad - # interaction between AM_PROG_AR and LT_INIT when combining MSVC's archiver lib.exe. diff --git a/dev-libs/libsecp256k1/files/0.3.0-fix-cross-compile.patch b/dev-libs/libsecp256k1/files/0.3.0-fix-cross-compile.patch new file mode 100644 index 000000000000..1aec78d36589 --- /dev/null +++ b/dev-libs/libsecp256k1/files/0.3.0-fix-cross-compile.patch @@ -0,0 +1,99 @@ +https://github.com/bitcoin-core/secp256k1/pull/1159 + +From dc87b08eea757aae95b1efc25fe543e91510df0a Mon Sep 17 00:00:00 2001 +From: Matt Whitlock +Date: Sun, 20 Nov 2022 01:46:07 -0500 +Subject: [PATCH] Makefile: build precomp generators using build-system + toolchain + +When cross-compiling libsecp256k1, if the `precomputed_ecmult*.c` source +files need to be regenerated, then the generators need to be built for +the *build* system, not for the *host* system. Autoconf supports this +fairly cleanly via the `AX_PROG_CC_FOR_BUILD` macro (from Autoconf +Archive), but Automake requires some hackery. When building the +generators, we override the `CC` variable to its build-system +counterpart, `CC_FOR_BUILD`, and we specify Automake per-program +overrides for `CFLAGS`, `CPPFLAGS`, and `LDFLAGS`, setting their values +respectively from the `CFLAGS_FOR_BUILD`, `CPPFLAGS_FOR_BUILD`, and +`LDFLAGS_FOR_BUILD` variables, whose values in turn are populated by the +aforementioned Autoconf macro and may be overridden on the `make` +command line. Since Automake lacks support for overriding `EXEEXT` on a +per-program basis, we define a recipe that builds the generator binaries +with names suffixed with `$(EXEEXT)` and then renames them suffixed with +`$(BUILD_EXEEXT)`. +--- + Makefile.am | 35 +++++++++++++++++++++++++++-------- + configure.ac | 1 + + 2 files changed, 28 insertions(+), 8 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index e3fdf4da..5e859c91 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -186,15 +186,34 @@ endif + endif + + ### Precomputed tables +-EXTRA_PROGRAMS = precompute_ecmult precompute_ecmult_gen +-CLEANFILES = $(EXTRA_PROGRAMS) ++PROGRAMS_FOR_BUILD = precompute_ecmult precompute_ecmult_gen ++$(addsuffix $(BUILD_EXEEXT),$(PROGRAMS_FOR_BUILD)) : override CC = $(CC_FOR_BUILD) ++# Automake has no support for PROGRAMS suffixed with BUILD_EXEEXT ++# instead of EXEEXT, so if those extensions differ, then we define a ++# recipe that builds the latter and renames it to the former. Since ++# Cygwin toolchains always append '.exe' to the output file name given ++# by '-o', we ignore rename failures since the toolchain will have ++# already created the right output file. (Note: The leading spaces ++# before ifneq and endif here are a hack so Automake won't try to ++# interpret them as an Automake conditional.) ++ ifneq ($(BUILD_EXEEXT),$(EXEEXT)) ++%$(BUILD_EXEEXT) : %$(EXEEXT) ++ mv -- '$<' '$@' || : ++ endif ++ ++EXTRA_PROGRAMS = $(PROGRAMS_FOR_BUILD) ++CLEANFILES = $(addsuffix $(BUILD_EXEEXT),$(PROGRAMS_FOR_BUILD)) + + precompute_ecmult_SOURCES = src/precompute_ecmult.c +-precompute_ecmult_CPPFLAGS = $(SECP_CONFIG_DEFINES) ++precompute_ecmult_CFLAGS = $(CFLAGS_FOR_BUILD) ++precompute_ecmult_CPPFLAGS = $(CPPFLAGS_FOR_BUILD) $(SECP_CONFIG_DEFINES) ++precompute_ecmult_LDFLAGS = $(LDFLAGS_FOR_BUILD) + precompute_ecmult_LDADD = $(COMMON_LIB) + + precompute_ecmult_gen_SOURCES = src/precompute_ecmult_gen.c +-precompute_ecmult_gen_CPPFLAGS = $(SECP_CONFIG_DEFINES) ++precompute_ecmult_gen_CFLAGS = $(CFLAGS_FOR_BUILD) ++precompute_ecmult_gen_CPPFLAGS = $(CPPFLAGS_FOR_BUILD) $(SECP_CONFIG_DEFINES) ++precompute_ecmult_gen_LDFLAGS = $(LDFLAGS_FOR_BUILD) + precompute_ecmult_gen_LDADD = $(COMMON_LIB) + + # See Automake manual, Section "Errors with distclean". +@@ -204,11 +223,11 @@ precompute_ecmult_gen_LDADD = $(COMMON_LIB) + # This means that rebuilds of the prebuilt files always need to be + # forced by deleting them, e.g., by invoking `make clean-precomp`. + src/precomputed_ecmult.c: +- $(MAKE) $(AM_MAKEFLAGS) precompute_ecmult$(EXEEXT) +- ./precompute_ecmult$(EXEEXT) ++ $(MAKE) $(AM_MAKEFLAGS) precompute_ecmult$(BUILD_EXEEXT) ++ ./precompute_ecmult$(BUILD_EXEEXT) + src/precomputed_ecmult_gen.c: +- $(MAKE) $(AM_MAKEFLAGS) precompute_ecmult_gen$(EXEEXT) +- ./precompute_ecmult_gen$(EXEEXT) ++ $(MAKE) $(AM_MAKEFLAGS) precompute_ecmult_gen$(BUILD_EXEEXT) ++ ./precompute_ecmult_gen$(BUILD_EXEEXT) + + PRECOMP = src/precomputed_ecmult_gen.c src/precomputed_ecmult.c + precomp: $(PRECOMP) +diff --git a/configure.ac b/configure.ac +index a46a0a7b..3b88d0d0 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -32,6 +32,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + AC_PROG_CC + AM_PROG_AS + AM_PROG_AR ++AX_PROG_CC_FOR_BUILD + + # Clear some cache variables as a workaround for a bug that appears due to a bad + # interaction between AM_PROG_AR and LT_INIT when combining MSVC's archiver lib.exe. diff --git a/dev-libs/libsecp256k1/files/0.4.0-fix-cross-compile.patch b/dev-libs/libsecp256k1/files/0.4.0-fix-cross-compile.patch new file mode 100644 index 000000000000..e77b59f15204 --- /dev/null +++ b/dev-libs/libsecp256k1/files/0.4.0-fix-cross-compile.patch @@ -0,0 +1,99 @@ +https://github.com/bitcoin-core/secp256k1/pull/1159 + +From 4764fb33a47e93769ee8b9353a270989227bc2f0 Mon Sep 17 00:00:00 2001 +From: Matt Whitlock +Date: Sun, 20 Nov 2022 01:46:07 -0500 +Subject: [PATCH] Makefile: build precomp generators using build-system + toolchain + +When cross-compiling libsecp256k1, if the `precomputed_ecmult*.c` source +files need to be regenerated, then the generators need to be built for +the *build* system, not for the *host* system. Autoconf supports this +fairly cleanly via the `AX_PROG_CC_FOR_BUILD` macro (from Autoconf +Archive), but Automake requires some hackery. When building the +generators, we override the `CC` variable to its build-system +counterpart, `CC_FOR_BUILD`, and we specify Automake per-program +overrides for `CFLAGS`, `CPPFLAGS`, and `LDFLAGS`, setting their values +respectively from the `CFLAGS_FOR_BUILD`, `CPPFLAGS_FOR_BUILD`, and +`LDFLAGS_FOR_BUILD` variables, whose values in turn are populated by the +aforementioned Autoconf macro and may be overridden on the `make` +command line. Since Automake lacks support for overriding `EXEEXT` on a +per-program basis, we define a recipe that builds the generator binaries +with names suffixed with `$(EXEEXT)` and then renames them suffixed with +`$(BUILD_EXEEXT)`. +--- + Makefile.am | 35 +++++++++++++++++++++++++++-------- + configure.ac | 1 + + 2 files changed, 28 insertions(+), 8 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 32bc729a..de43723f 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -185,15 +185,34 @@ endif + endif + + ### Precomputed tables +-EXTRA_PROGRAMS = precompute_ecmult precompute_ecmult_gen +-CLEANFILES = $(EXTRA_PROGRAMS) ++PROGRAMS_FOR_BUILD = precompute_ecmult precompute_ecmult_gen ++$(addsuffix $(BUILD_EXEEXT),$(PROGRAMS_FOR_BUILD)) : override CC = $(CC_FOR_BUILD) ++# Automake has no support for PROGRAMS suffixed with BUILD_EXEEXT ++# instead of EXEEXT, so if those extensions differ, then we define a ++# recipe that builds the latter and renames it to the former. Since ++# Cygwin toolchains always append '.exe' to the output file name given ++# by '-o', we ignore rename failures since the toolchain will have ++# already created the right output file. (Note: The leading spaces ++# before ifneq and endif here are a hack so Automake won't try to ++# interpret them as an Automake conditional.) ++ ifneq ($(BUILD_EXEEXT),$(EXEEXT)) ++%$(BUILD_EXEEXT) : %$(EXEEXT) ++ mv -- '$<' '$@' || : ++ endif ++ ++EXTRA_PROGRAMS = $(PROGRAMS_FOR_BUILD) ++CLEANFILES = $(addsuffix $(BUILD_EXEEXT),$(PROGRAMS_FOR_BUILD)) + + precompute_ecmult_SOURCES = src/precompute_ecmult.c +-precompute_ecmult_CPPFLAGS = $(SECP_CONFIG_DEFINES) -DVERIFY ++precompute_ecmult_CFLAGS = $(CFLAGS_FOR_BUILD) ++precompute_ecmult_CPPFLAGS = $(CPPFLAGS_FOR_BUILD) $(SECP_CONFIG_DEFINES) -DVERIFY ++precompute_ecmult_LDFLAGS = $(LDFLAGS_FOR_BUILD) + precompute_ecmult_LDADD = $(COMMON_LIB) + + precompute_ecmult_gen_SOURCES = src/precompute_ecmult_gen.c +-precompute_ecmult_gen_CPPFLAGS = $(SECP_CONFIG_DEFINES) -DVERIFY ++precompute_ecmult_gen_CFLAGS = $(CFLAGS_FOR_BUILD) ++precompute_ecmult_gen_CPPFLAGS = $(CPPFLAGS_FOR_BUILD) $(SECP_CONFIG_DEFINES) -DVERIFY ++precompute_ecmult_gen_LDFLAGS = $(LDFLAGS_FOR_BUILD) + precompute_ecmult_gen_LDADD = $(COMMON_LIB) + + # See Automake manual, Section "Errors with distclean". +@@ -203,11 +222,11 @@ precompute_ecmult_gen_LDADD = $(COMMON_LIB) + # This means that rebuilds of the prebuilt files always need to be + # forced by deleting them. + src/precomputed_ecmult.c: +- $(MAKE) $(AM_MAKEFLAGS) precompute_ecmult$(EXEEXT) +- ./precompute_ecmult$(EXEEXT) ++ $(MAKE) $(AM_MAKEFLAGS) precompute_ecmult$(BUILD_EXEEXT) ++ ./precompute_ecmult$(BUILD_EXEEXT) + src/precomputed_ecmult_gen.c: +- $(MAKE) $(AM_MAKEFLAGS) precompute_ecmult_gen$(EXEEXT) +- ./precompute_ecmult_gen$(EXEEXT) ++ $(MAKE) $(AM_MAKEFLAGS) precompute_ecmult_gen$(BUILD_EXEEXT) ++ ./precompute_ecmult_gen$(BUILD_EXEEXT) + + PRECOMP = src/precomputed_ecmult_gen.c src/precomputed_ecmult.c + precomp: $(PRECOMP) +diff --git a/configure.ac b/configure.ac +index e3877850..48072cb3 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -37,6 +37,7 @@ fi + AC_PROG_CC + AM_PROG_AS + AM_PROG_AR ++AX_PROG_CC_FOR_BUILD + + # Clear some cache variables as a workaround for a bug that appears due to a bad + # interaction between AM_PROG_AR and LT_INIT when combining MSVC's archiver lib.exe. diff --git a/dev-libs/libsecp256k1/libsecp256k1-0.3.0.ebuild b/dev-libs/libsecp256k1/libsecp256k1-0.3.0.ebuild index 4ed054a8e8e7..61e3902587f1 100644 --- a/dev-libs/libsecp256k1/libsecp256k1-0.3.0.ebuild +++ b/dev-libs/libsecp256k1/libsecp256k1-0.3.0.ebuild @@ -27,7 +27,7 @@ BDEPEND=" " PATCHES=( - "${FILESDIR}/0.2.0-fix-cross-compile.patch" + "${FILESDIR}/0.3.0-fix-cross-compile.patch" ) S="${WORKDIR}/${MyPN}-${PV}" diff --git a/dev-libs/libsecp256k1/libsecp256k1-0.3.1.ebuild b/dev-libs/libsecp256k1/libsecp256k1-0.3.1.ebuild index 4ed054a8e8e7..61e3902587f1 100644 --- a/dev-libs/libsecp256k1/libsecp256k1-0.3.1.ebuild +++ b/dev-libs/libsecp256k1/libsecp256k1-0.3.1.ebuild @@ -27,7 +27,7 @@ BDEPEND=" " PATCHES=( - "${FILESDIR}/0.2.0-fix-cross-compile.patch" + "${FILESDIR}/0.3.0-fix-cross-compile.patch" ) S="${WORKDIR}/${MyPN}-${PV}" diff --git a/dev-libs/libsecp256k1/libsecp256k1-0.3.2.ebuild b/dev-libs/libsecp256k1/libsecp256k1-0.3.2.ebuild index 4f6e4550437e..8a347f00c909 100644 --- a/dev-libs/libsecp256k1/libsecp256k1-0.3.2.ebuild +++ b/dev-libs/libsecp256k1/libsecp256k1-0.3.2.ebuild @@ -27,7 +27,7 @@ BDEPEND=" " PATCHES=( - "${FILESDIR}/0.2.0-fix-cross-compile.patch" + "${FILESDIR}/0.3.0-fix-cross-compile.patch" ) S="${WORKDIR}/${MyPN}-${PV}" diff --git a/dev-libs/libsecp256k1/libsecp256k1-0.4.0.ebuild b/dev-libs/libsecp256k1/libsecp256k1-0.4.0.ebuild index 81afa059b2b3..a5459332d0dc 100644 --- a/dev-libs/libsecp256k1/libsecp256k1-0.4.0.ebuild +++ b/dev-libs/libsecp256k1/libsecp256k1-0.4.0.ebuild @@ -27,7 +27,7 @@ BDEPEND=" " PATCHES=( - "${FILESDIR}/0.2.0-fix-cross-compile.patch" + "${FILESDIR}/0.4.0-fix-cross-compile.patch" ) S="${WORKDIR}/${MyPN}-${PV}" diff --git a/dev-libs/libsecp256k1/libsecp256k1-0.4.1.ebuild b/dev-libs/libsecp256k1/libsecp256k1-0.4.1.ebuild index c75b3b63a13c..fcf78c907148 100644 --- a/dev-libs/libsecp256k1/libsecp256k1-0.4.1.ebuild +++ b/dev-libs/libsecp256k1/libsecp256k1-0.4.1.ebuild @@ -27,7 +27,7 @@ BDEPEND=" " PATCHES=( - "${FILESDIR}/0.2.0-fix-cross-compile.patch" + "${FILESDIR}/0.4.0-fix-cross-compile.patch" ) S="${WORKDIR}/${MyPN}-${PV}" -- cgit v1.2.3