diff --git a/.travis.yml b/.travis.yml index 701a746..572ddf2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,10 +13,12 @@ perl: - "5.18" - "5.20" - "5.22" - + - "5.24" + - "5.26" + - "5.28" + script: - perl Makefile.PL - make - prove -bv t - - make install diff --git a/README b/README index 10cc56c..69c27de 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ PkgConfig -This module provides a pure perl version of pkg-config, a program +This module is a pure perl version of pkg-config, a program that provides compiler and linker flags for installed packages. See: diff --git a/lib/PkgConfig.pm b/lib/PkgConfig.pm index b65585d..b8b9383 100755 --- a/lib/PkgConfig.pm +++ b/lib/PkgConfig.pm @@ -400,12 +400,6 @@ sub GuessPaths { } #log_info(@cpp_output); my @include_paths; - while (my $path = shift @cpp_output) { - if($path =~ /\s*End of search list/) { - last; - } - push @include_paths, $path; - } @DEFAULT_EXCLUDE_CFLAGS = map { "-I$_" } @include_paths; log_debug("Determine exclude CFLAGS", @DEFAULT_EXCLUDE_CFLAGS); } @@ -890,6 +884,14 @@ sub get_cflags { filter_omit(\@cflags, $self->exclude_cflags); filter_dups(\@cflags); + my @new_flags; + if ( $ENV{PKG_CONFIG_SYSTEM_INCLUDE_PATH} ){ + for my $i (@cflags) { + my @path = split("/", $i); + push @new_flags, "-I$ENV{PKG_CONFIG_SYSTEM_INCLUDE_PATH}/".$path[$#path]; + } + } + push @cflags, @new_flags; _return_context @cflags; }