From: afresh1 Date: Wed, 24 Dec 2014 03:53:04 +0000 (+0000) Subject: Avoid /usr/local while building perl, but allow it for ports X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=acd0968448420bf685736a97b2e7d48e57fe03ec;p=openbsd Avoid /usr/local while building perl, but allow it for ports commit it deraadt@ --- diff --git a/gnu/usr.bin/perl/hints/openbsd.sh b/gnu/usr.bin/perl/hints/openbsd.sh index f4b6def5241..a81b82a26e9 100644 --- a/gnu/usr.bin/perl/hints/openbsd.sh +++ b/gnu/usr.bin/perl/hints/openbsd.sh @@ -147,8 +147,8 @@ case "$openbsd_distribution" in siteprefix='/usr/local' siteprefixexp='/usr/local' # Ports installs non-std libs in /usr/local/lib so look there too - locincpth='/usr/local/include' - loclibpth='/usr/local/lib' + locincpth='' + loclibpth='' # Link perl with shared libperl if [ "$usedl" = "$define" -a -r $src/shlib_version ]; then useshrplib=true diff --git a/gnu/usr.bin/perl/installperl b/gnu/usr.bin/perl/installperl index e0335b7a63c..56bc9a74ba9 100644 --- a/gnu/usr.bin/perl/installperl +++ b/gnu/usr.bin/perl/installperl @@ -751,6 +751,19 @@ sub installlib { return unless $do_installprivlib; } + if ($name eq 'Config_heavy.pl') { + open my $ifh, '<', $_ or die $!; + $_ = "$_.local"; + open my $ofh, '>', $_ or die $!; + while (my $l = <$ifh>) { + $l =~ s,^(ccflags|cppflags)[^=]*='[^']+,$& -I/usr/local/include,; + $l =~ s,^(ldflags|lddlflags)[^=]*='[^']+,$& -L/usr/local/lib,; + print $ofh $l; + } + close $ifh; + close $ofh; + } + if ($Is_NetWare && !$opts{netware} && /\.(?:nlp|nlm|bs)$/) { # Don't copy .nlp,.nlm files, doesn't make sense on Windows and also # if copied will give problems when building new extensions.