summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/perl')
-rw-r--r--gnu/usr.bin/perl/Makefile.bsd-wrapper14
-rw-r--r--gnu/usr.bin/perl/installperl33
-rw-r--r--gnu/usr.bin/perl/utils/h2ph.PL13
3 files changed, 42 insertions, 18 deletions
diff --git a/gnu/usr.bin/perl/Makefile.bsd-wrapper b/gnu/usr.bin/perl/Makefile.bsd-wrapper
index a375c4a9b4c..92065cb8f54 100644
--- a/gnu/usr.bin/perl/Makefile.bsd-wrapper
+++ b/gnu/usr.bin/perl/Makefile.bsd-wrapper
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.bsd-wrapper,v 1.4 1996/08/25 15:37:46 downsj Exp $
+# $OpenBSD: Makefile.bsd-wrapper,v 1.5 1996/08/26 05:31:51 downsj Exp $
#
# Build wrapper for Perl 5.003.
#
@@ -7,7 +7,7 @@
# with the one installed with X11.
LNDIR= /usr/bin/lndir
-#H2PH= /usr/bin/h2ph
+H2PH= /usr/bin/h2ph
MAN= x2p/a2p.man x2p/s2p.man pod/perl.man pod/perlbook.man \
pod/perlbot.man pod/perlcall.man pod/perldata.man \
@@ -78,13 +78,9 @@ x2p/cflags:
install: ${MANALL} maninstall
(cd ${.OBJDIR}; ${MAKE} install)
-#.ifndef DESTDIR
-# (cd /usr/include; ${H2PH} *.h arpa/*.h machine/*.h net/*.h \
-# protocols/*.h sys/*.h)
-#.else
-# @echo Perl headers must be installed by hand when DESTDIR is set.
-#.endif
-# -chmod -R a+rX ${DESTDIR}/usr/lib/perl5
+ (cd /usr/include; ${H2PH} *.h arpa/*.h machine/*.h net/*.h \
+ protocols/*.h sys/*.h)
+ -chmod -R a+rX ${DESTDIR}/usr/lib/perl5
clean:
-@if [ -e Makefile ]; then ${MAKE} realclean; fi
diff --git a/gnu/usr.bin/perl/installperl b/gnu/usr.bin/perl/installperl
index bf8e6927eab..0ca0b5c4e4c 100644
--- a/gnu/usr.bin/perl/installperl
+++ b/gnu/usr.bin/perl/installperl
@@ -1,4 +1,9 @@
#!./perl
+# $OpenBSD$
+#
+# This is hacked up, in order to support DESTDIR.
+#
+
BEGIN { @INC=('./lib', '../lib') }
use File::Find;
use File::Path qw(mkpath);
@@ -35,14 +40,26 @@ die "Patchlevel of perl ($patchlevel)",
"and patchlevel of config.sh ($Config{'PATCHLEVEL'}) don't match\n"
if $patchlevel != $Config{'PATCHLEVEL'};
-# Fetch some frequently-used items from %Config
-$installbin = $Config{installbin};
-$installscript = $Config{installscript};
-$installprivlib = $Config{installprivlib};
-$installarchlib = $Config{installarchlib};
-$installsitelib = $Config{installsitelib};
-$installsitearch = $Config{installsitearch};
-$installman1dir = $Config{installman1dir};
+$installdest = $ENV{"DESTDIR"};
+if ($installdest ne '') {
+ # Fetch some frequently-used items from %Config, prefixing them with
+ # DESTDIR.
+ $installbin = "$installdest/$Config{installbin}";
+ $installscript = "$installdest/$Config{installscript}";
+ $installprivlib = "$installdest/$Config{installprivlib}";
+ $installarchlib = "$installdest/$Config{installarchlib}";
+ $installsitelib = "$installdest/$Config{installsitelib}";
+ $installsitearch = "$installdest/$Config{installsitearch}";
+ $installman1dir = "$installdest/$Config{installman1dir}";
+} else {
+ # Fetch some frequently-used items from %Config.
+ $installbin = $Config{installbin};
+ $installscript = $Config{installscript};
+ $installprivlib = $Config{installprivlib};
+ $installarchlib = $Config{installarchlib};
+ $installsitelib = $Config{installsitelib};
+ $installsitearch = $Config{installsitearch};
+}
$man1ext = $Config{man1ext};
# Did we build libperl as a shared library?
$d_shrplib = $Config{d_shrplib};
diff --git a/gnu/usr.bin/perl/utils/h2ph.PL b/gnu/usr.bin/perl/utils/h2ph.PL
index 370aa872134..80d8375c9da 100644
--- a/gnu/usr.bin/perl/utils/h2ph.PL
+++ b/gnu/usr.bin/perl/utils/h2ph.PL
@@ -1,4 +1,8 @@
#!/usr/local/bin/perl
+# $OpenBSD$
+#
+# This is slightly hacked up in order to support DESTDIR.
+#
use Config;
use File::Basename qw(&basename &dirname);
@@ -42,7 +46,14 @@ $Config{'startperl'}
print OUT <<'!NO!SUBS!';
-chdir '/usr/include' || die "Can't cd /usr/include";
+$destdir = $ENV{"DESTDIR"};
+if ($destdir ne '') {
+ chdir "$destdir/usr/include" || die "Can't cd $destdir/usr/include";
+ # whack $perlincl
+ $perlincl = "$destdir/$perlincl";
+} else {
+ chdir '/usr/include' || die "Can't cd /usr/include";
+}
@isatype = split(' ',<<END);
char uchar u_char