I'm using a $CONFIG_SITE
set to $ZPFX/share/config.site
file containing:
CPPFLAGS="-I$ZPFX/include $CPPFLAGS"
LDFLAGS="-L$ZPFX/lib $LDFLAGS"
where $ZPFX
variable is my custom user prefix, similar to ~/.local
.
Now, the problem is that the system iconv.h
(under path /usr/include
) isn't found because of this, as only the above pre-set (with use of config.site
) -I$ZPFX…/-L$ZPFX…
are being passed to the test program, as the following lines from config.log
are showing:
configure:21831: gcc -o conftest -g -O2 \
-I/home/q/.local/share/zinit/polaris/include \
-L/home/q/.local/share/zinit/polaris/lib \
conftest.c -lxml2 -liconv >&5
/usr/bin/ld: cannot find -liconv
collect2: error: ld returned 1 exit status
($ZPFX
is expanded to its value, which is: /home/q/.local/share/zinit/polaris
)
The Question: how to append (prepend) any custom ($ZPFX/…
in my case) directories to CPPFLAGS/LDFLAGS
, preserving their default values? So that my custom libraries are only given higher precedence, and not exclusivity?
What I've tried
As it can be seen, I've tried to prepend to the flags by appending any occurred values at the time of sourcing the config.site
file, by "…$CPP…/$LDFLAGS"
:
CPPFLAGS="-I$ZPFX/include $CPPFLAGS"
LDFLAGS="-L$ZPFX/lib $LDFLAGS"
However this has no effect.
I'm also waving between not-appending and appending any typically used system-libraries paths: /usr/include
and /usr/lib{,64}
, however I don't like the idea, because some system might use e.g.: /opt/…
for main prefix, making such hack not working at all.