Avoid /usr/local while building perl, but allow it for ports
authorafresh1 <afresh1@openbsd.org>
Wed, 24 Dec 2014 03:53:04 +0000 (03:53 +0000)
committerafresh1 <afresh1@openbsd.org>
Wed, 24 Dec 2014 03:53:04 +0000 (03:53 +0000)
commit it deraadt@

gnu/usr.bin/perl/hints/openbsd.sh
gnu/usr.bin/perl/installperl

index f4b6def..a81b82a 100644 (file)
@@ -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
index e0335b7..56bc9a7 100644 (file)
@@ -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.