text
stringlengths
0
834k
@DEFAULT_SEARCH_PATH = qw(
/usr/pkg/lib/pkgconfig
/usr/pkg/share/pkgconfig
/usr/X11R7/lib/pkgconfig
/usr/lib/pkgconfig
);
} elsif($^O eq 'openbsd') {
@DEFAULT_SEARCH_PATH = qw(
/usr/lib/pkgconfig
/usr/local/lib/pkgconfig
/usr/local/share/pkgconfig
/usr/X11R6/lib/pkgconfig
/usr/X11R6/share/pkgconfig
);
} elsif($^O eq 'MSWin32') {
# Caveats:
# 1. This pulls in Config,
# which we don't load on non MSWin32
# but it is in the core.
# 2. Slight semantic difference in that we are treating
# Strawberry as the ""system"" rather than Windows, but
# since pkg-config is rarely used in MSWin32, it is
# better to have something that is useful rather than
# worry about if it is exactly the same as other
# platforms.
# 3. It is a little brittle in that Strawberry might
# one day change its layouts. If it has and you are
# reading this, please send a pull request or simply
# let me know -plicease
require Config;
if($Config::Config{myuname} =~ /strawberry-perl/)
{
# handle PAR::Packer executables which have $^X eq ""perl.exe""
if ($ENV{PAR_0})
{
my $path = $ENV{PAR_TEMP};
$path =~ s{\\}{/}g;
@DEFAULT_SEARCH_PATH = ($path);
}
else {
my($vol, $dir, $file) = File::Spec->splitpath($^X);
my @dirs = File::Spec->splitdir($dir);
splice @dirs, -3;
my $path = (File::Spec->catdir($vol, @dirs, qw( c lib pkgconfig )));
$path =~ s{\\}{/}g;
@DEFAULT_SEARCH_PATH = $path;
}
}
my @reg_paths;
eval q{
package
PkgConfig::WinReg;
use Win32API::Registry 0.21 qw( :ALL );
foreach my $top (HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER) {
my $key;
RegOpenKeyEx( $top, ""Software\\\\pkgconfig\\\\PKG_CONFIG_PATH"", 0, KEY_READ, $key) || next;
my $nlen = 1024;
my $pos = 0;
my $name = '';
while(RegEnumValue($key, $pos++, $name, $nlen, [], [], [], [])) {
my $type;
my $data;
RegQueryValueEx($key, $name, [], $type, $data, []);
push @reg_paths, $data;
}
RegCloseKey( $key );
}
};
unless($@) {
unshift @DEFAULT_SEARCH_PATH, @reg_paths;
}
if($Config::Config{cc} =~ /cl(\.exe)?$/i)
{
@DEFAULT_EXCLUDE_LFLAGS = ();
@DEFAULT_EXCLUDE_CFLAGS = ();
}
else
{
@DEFAULT_EXCLUDE_LFLAGS = (
""-L/mingw/lib"",
""-R/mingw/lib"",
""-L/mingw/lib/pkgconfig/../../lib"",
""-R/mingw/lib/pkgconfig/../../lib"",
);
@DEFAULT_EXCLUDE_CFLAGS = (
""-I/mingw/include"",
""-I/mingw/lib/pkgconfig/../../include"",
);