main: use support for munging by $(pc_sysrootdir) and remove the old sysroot hack

feature/tap-sh
William Pitcock 2013-02-24 08:59:07 -06:00
parent 01c2d1d44c
commit 77c5b82aad
1 changed files with 4 additions and 18 deletions

22
main.c
View File

@ -74,23 +74,6 @@ fragment_has_system_dir(pkg_fragment_t *frag)
return false; return false;
} }
static inline const char *
print_sysroot_dir(pkg_fragment_t *frag)
{
if (sysroot_dir == NULL)
return "";
else switch (frag->type)
{
case 'L':
case 'I':
return sysroot_dir;
default:
break;
}
return "";
}
static void static void
print_fragment(pkg_fragment_t *frag) print_fragment(pkg_fragment_t *frag)
{ {
@ -98,7 +81,7 @@ print_fragment(pkg_fragment_t *frag)
return; return;
if (frag->type) if (frag->type)
printf("-%c%s%s ", frag->type, print_sysroot_dir(frag), frag->data); printf("-%c%s ", frag->type, frag->data);
else else
printf("%s ", frag->data); printf("%s ", frag->data);
} }
@ -656,7 +639,10 @@ main(int argc, char *argv[])
pkg_tuple_add_global("pc_top_builddir", "$(top_builddir)"); pkg_tuple_add_global("pc_top_builddir", "$(top_builddir)");
if ((sysroot_dir = getenv("PKG_CONFIG_SYSROOT_DIR")) != NULL) if ((sysroot_dir = getenv("PKG_CONFIG_SYSROOT_DIR")) != NULL)
{
pkg_tuple_add_global("pc_sysrootdir", sysroot_dir); pkg_tuple_add_global("pc_sysrootdir", sysroot_dir);
global_traverse_flags |= PKGF_MUNGE_SYSROOT_PREFIX;
}
else else
pkg_tuple_add_global("pc_sysrootdir", "/"); pkg_tuple_add_global("pc_sysrootdir", "/");