forked from ariadne/pkgconf
main: filter out system dirs
parent
3c380f9b63
commit
a290467261
21
main.c
21
main.c
|
@ -55,9 +55,30 @@ static char *required_pkgconfig_version = NULL;
|
||||||
static char *required_module_version = NULL;
|
static char *required_module_version = NULL;
|
||||||
static char *want_variable = NULL;
|
static char *want_variable = NULL;
|
||||||
|
|
||||||
|
static bool
|
||||||
|
fragment_has_system_dir(pkg_fragment_t *frag)
|
||||||
|
{
|
||||||
|
switch (frag->type)
|
||||||
|
{
|
||||||
|
case 'L':
|
||||||
|
if (!strcasecmp(LIBDIR, frag->data))
|
||||||
|
return true;
|
||||||
|
case 'I':
|
||||||
|
if (!strcasecmp(INCLUDEDIR, frag->data))
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_fragment(pkg_fragment_t *frag)
|
print_fragment(pkg_fragment_t *frag)
|
||||||
{
|
{
|
||||||
|
if (fragment_has_system_dir(frag))
|
||||||
|
return;
|
||||||
|
|
||||||
if (frag->type)
|
if (frag->type)
|
||||||
printf("-%c%s ", frag->type, frag->data);
|
printf("-%c%s ", frag->type, frag->data);
|
||||||
else
|
else
|
||||||
|
|
|
@ -60,7 +60,7 @@ run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} --libs bar" \
|
||||||
run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} --libs --cflags baz" \
|
run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} --libs --cflags baz" \
|
||||||
'-lbaz' '-fPIC' '-I/usr/include/foo'
|
'-lbaz' '-fPIC' '-I/usr/include/foo'
|
||||||
run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} --static --libs baz" \
|
run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} --static --libs baz" \
|
||||||
'-L/usr/lib -lfoo -L/usr/lib -lbaz -L/usr/lib -lzee'
|
'-lfoo' '-lbaz' '-lzee'
|
||||||
|
|
||||||
if [ ${failed} -gt 0 ]; then
|
if [ ${failed} -gt 0 ]; then
|
||||||
echo "${failed} of ${done} tests failed. See output for details." >&2
|
echo "${failed} of ${done} tests failed. See output for details." >&2
|
||||||
|
|
Loading…
Reference in New Issue