Am I using --extra-cflags and --extra-ldflags wrong in the configure call?
I'd like to source build several pre-reqs specific to supporting the qemu source
build. I'd specifically not like to install neither the qemu or re-req builds
at the system level. Normally I'd expect the --extra-cflags and --extra-ldflags
configure options to do this but they do not appear to propagate to meson. There
was an approved meson patch back in 2018 for extra-cflags / extra-ldflags and qemu
is currently using meson >5.8(?) but it doesn't look like configure is adding the
args anywhere in the build tree. There are a number of ways to do this, what's
appropriate / future-proof wrt building qemu from source? And why is configure
supporting --extra-[c,ld]args but not doing anything with the values?
---------
As an example assume I've installed lzfse from source with a homedir prefix, no
other copies elsewhere, no ldconfig reference, no associated env vars, and force
the qemu build to require it. Yeah, but this is just an dumb example.
$ ls -l ~/include/* ~/lib/*
/home/olagarde/include/lzfse.h
/home/olagarde/lib/liblzfse.so
$ env |grep -i flags
$ set |grep -i flags
local flags_color="$c_lblue";
s="$flags_color$s";
$ git clone
https://gitlab.com/qemu-project/qemu.git <...snipsnip...>
$ mkdir qemu/build && cd qemu/build
$ ../configure --prefix=/home/olagarde \
--extra-cflags="-I /home/olagarde/include" \
--extra-ldflags="-L /home/olagarde/lib" \
--enable-lzfse
<...snipsnip...>
../meson.build:898:2: ERROR: C header 'lzfse.h' not found
A full log can be found at {a_really_long_path}meson-log.txt
ERROR: meson setup failed
Per the meson logs the command was
cc -m64 -mcx16 {a_really_long_path}testfile.c -E -P \
-D_FILE_OFFSET_BITS=64 -P -O0 -std=gnu11
and the testfile.c was
#ifdef __has_include
#if !__has_include("lzfse.h")
#error "Header 'lzfse.h' could not be found"
#endif
#else
#include <lzfse.h>
#endif
which obviously should fail exactly as it did, but should and does succeed
if the --extra-cflags value is added to the cc call.
All four args arrays in the config-meson.cross are empty so configure
didn't pass the cli extra-args in? Also 'find' doesn't report any files
in the tree containing /home/olagarde/include or /home/olagarde/lib, so
the option values passed to configure never made it into mesa (or anything
else)?