From acd0968448420bf685736a97b2e7d48e57fe03ec Mon Sep 17 00:00:00 2001 From: afresh1 Date: Wed, 24 Dec 2014 03:53:04 +0000 Subject: [PATCH] Avoid /usr/local while building perl, but allow it for ports commit it deraadt@ --- gnu/usr.bin/perl/hints/openbsd.sh | 4 ++-- gnu/usr.bin/perl/installperl | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) 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. -- 2.20.1