main: filter out system dirs

feature/tap-sh
William Pitcock 2012-05-03 19:44:44 +00:00
parent 3c380f9b63
commit a290467261
2 changed files with 22 additions and 1 deletions

21
main.c
View File

@ -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

View File

@ -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