=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/pkg-config/pkg-config,v retrieving revision 1.94 retrieving revision 1.95 diff -c -r1.94 -r1.95 *** src/usr.bin/pkg-config/pkg-config 2020/09/12 12:53:41 1.94 --- src/usr.bin/pkg-config/pkg-config 2020/09/15 07:18:45 1.95 *************** *** 1,9 **** #!/usr/bin/perl ! # $OpenBSD: pkg-config,v 1.94 2020/09/12 12:53:41 jasper Exp $ ! # $CSK: pkgconfig.pl,v 1.39 2006/11/27 16:26:20 ckuethe Exp $ # Copyright (c) 2006 Chris Kuethe ! # Copyright (c) 2011,2019 Jasper Lievisse Adriaanse # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above --- 1,8 ---- #!/usr/bin/perl ! # $OpenBSD: pkg-config,v 1.95 2020/09/15 07:18:45 jasper Exp $ # Copyright (c) 2006 Chris Kuethe ! # Copyright (c) 2011-2020 Jasper Lievisse Adriaanse # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above *************** *** 46,52 **** defined $ENV{PKG_CONFIG_DISABLE_UNINSTALLED} ? 0 : 1; my $found_uninstalled = 0; ! my $version = '0.29.1'; # pretend to be this version of pkgconfig my %configs = (); setup_self(); --- 45,51 ---- defined $ENV{PKG_CONFIG_DISABLE_UNINSTALLED} ? 0 : 1; my $found_uninstalled = 0; ! my $version = '0.29.2'; # pretend to be this version of pkgconfig my %configs = (); setup_self(); *************** *** 60,65 **** --- 59,71 ---- $variables->{pc_sysrootdir} //= $ENV{PKG_CONFIG_SYSROOT_DIR}; # The default '/' is implied. + my @sys_includes = ('/usr/include'); + foreach my $path ($ENV{PKG_CONFIG_SYSTEM_INCLUDE_PATH}, $ENV{C_PATH}, $ENV{C_INCLUDE_PATH}, + $ENV{CPLUS_INCLUDE_PATH}) { + next if !defined($path); + unshift(@sys_includes, split(/:/, $path)); + } + defined $ENV{PKG_CONFIG_DEBUG_SPEW} ? $mode{debug} = 1 : $mode{debug} = 0; if ($logfile) { *************** *** 496,505 **** for my $pkg (@$list) { my $l = $configs{$pkg}->get_property('Cflags', $variables); ! for my $path (@$l) { ! unless ($path =~ /-I\/usr\/include\/*$/) { ! push(@$cflags, $path); } } } my $a = OpenBSD::PkgConfig->compress($cflags, --- 502,512 ---- for my $pkg (@$list) { my $l = $configs{$pkg}->get_property('Cflags', $variables); ! PATH: for my $path (@$l) { ! for my $sys_path (@sys_includes) { ! next PATH if ($path =~ /${sys_path}\/*$/); } + push(@$cflags, $path); } } my $a = OpenBSD::PkgConfig->compress($cflags,