Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: introduce meson subprojects option
On Gentoo Linux, downloading external dependencies via subprojects concept is forbidden (meson setup --wrap-mode nodownload). Then, when trying to package TRX, meson is failing with the following error on libtrx configuration while it tries to download/unpack the uthash library : > Executing subproject libtrx > > libtrx| Project name: libtrx > libtrx| Project version: undefined > libtrx| C compiler for the host machine: x86_64-pc-linux-gnu-gcc (gcc 13.3.1 "x86_64-pc-linux-gnu-gcc (Gentoo 13.3.1_p20241025 p1) 13.3.1 20241024") > libtrx| C linker for the host machine: x86_64-pc-linux-gnu-gcc ld.bfd 2.42 > libtrx| Using subprojects/libtrx/subprojects/uthash.wrap > > src/tr1/subprojects/libtrx/meson.build:35:9: ERROR: Automatic wrap-based subproject downloading is disabled On Gentoo, the uthash library is distributed by the package manager and installed in /usr/include. This commit introduces a new boolean meson option (subprojects), defaulting to true. With subprojects == true, meson is using the bundled uthash subproject library as usual. With subprojects == false, meson is trying to find the uthash.h header on the system (in /usr/include). It also checks for the right library version (currently 2.3.0). Partial meson output with -Dsubprojects=false when the header was found : > Executing subproject libtrx > > libtrx| Project name: libtrx > libtrx| Project version: undefined > libtrx| C compiler for the host machine: ccache cc (gcc 13.3.1 "cc > (Gentoo 13.3.1_p20241025 p1) 13.3.1 20241024") > libtrx| C linker for the host machine: cc ld.bfd 2.42 > libtrx| Fetching value of define "UTHASH_VERSION" : 2.3.0 > libtrx| Message: Found uthash library header version: 2.3.0 Same output with -Dsubprojects=false while the header was not found : > Executing subproject libtrx > > libtrx| Project name: libtrx > libtrx| Project version: undefined > libtrx| C compiler for the host machine: ccache cc (gcc 13.3.1 "cc > (Gentoo 13.3.1_p20241025 p1) 13.3.1 20241024") > libtrx| C linker for the host machine: cc ld.bfd 2.42 > [...]/TRX/src/tr1/subprojects/libtrx/meson.build:46:30: ERROR: Could not get define 'UTHASH_VERSION' Same output with -Dsubprojects=false while the header version mismatches : > Executing subproject libtrx > > libtrx| Project name: libtrx > libtrx| Project version: undefined > libtrx| C compiler for the host machine: ccache cc (gcc 13.3.1 "cc > (Gentoo 13.3.1_p20241025 p1) 13.3.1 20241024") > libtrx| C linker for the host machine: cc ld.bfd 2.42 > [..]TRX/src/tr1/subprojects/libtrx/meson.build:54:4: ERROR: Problem encountered: Found wrong uthash library header version: 2.2.0 Signed-off-by: Fabrice Delliaux <[email protected]>
- Loading branch information