Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perl 5.005_3 patch: Rudimentary cross build support #214

Closed
p5pRT opened this issue Jul 20, 1999 · 1 comment
Closed

Perl 5.005_3 patch: Rudimentary cross build support #214

p5pRT opened this issue Jul 20, 1999 · 1 comment

Comments

@p5pRT
Copy link

@p5pRT p5pRT commented Jul 20, 1999

Migrated from rt.perl.org#1020 (status was 'resolved')

Searchable as RT1020$

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jul 20, 1999

From seans@ncube.com

Inline Patch
--- ./Makefile.SH	Wed Mar  3 18:35:25 1999
+++ /vobs/ncube3/web/perl5.005_03/Makefile.SH	Fri Jun  4 10:46:52 1999
@@ -185,6 +185,9 @@
 # how to tr(anslate) newlines
 TRNL = '$trnl'
 
+# location of existing perl/miniperl for crossbuilds
+localperl = $localperl
+
 !GROK!THIS!
 
 ## In the following dollars and backticks do not need the extra backslash.
@@ -336,7 +339,13 @@
 # The Module used here must not depend on Config or any extensions.
 
 miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL)
-	$(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) $(LLIBPERL) $(libs)
+	if [ -z "$(localperl)" ]; \
+	then \
+		$(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) $(LLIBPERL) $(libs); \
+	else \
+		$(RMS) miniperl; \
+		$(LNS) $(localperl) miniperl; \
+	fi
 	$(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e 0 || $(MAKE) minitest
 
 perl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs
@@ -408,10 +417,20 @@
 		cd ../pod; $(MAKE) compile; \
 	else :; \
 	fi
-	$(LDLIBPTH) ./perl installperl
+	if [ -z "$(localperl)" ]; \
+	then \
+		$(LDLIBPTH) ./perl installperl; \
+	else \
+		$(LDLIBPTH) $(localperl) -I./lib installperl; \
+	fi
 
 install.man:	all installman
-	$(LDLIBPTH) ./perl installman
+	if [ -z "$(localperl)" ]; \
+	then \
+		$(LDLIBPTH) ./perl installman; \
+	else \
+		$(LDLIBPTH) $(localperl) installman; \
+	fi
 
 # XXX Experimental. Hardwired values, but useful for testing.
 # Eventually Configure could ask for some of these values.
--- ./installman	Mon Nov 23 16:18:57 1998
+++ /vobs/ncube3/web/perl5.005_03/installman	Mon Jun  7 16:42:00 1999
@@ -92,6 +92,15 @@
     $downdir =~ s:[^/]+:..:g;
     my($builddir) = Cwd::getcwd();
 
+    # We want to be sure to use the current perl.  We can't rely on
+    # the installed perl because it might not be actually installed
+    # yet. (The user may have set the $install* Configure variables 
+    # to point to some temporary home, from which the executable gets
+    # installed by occult means.)
+    my($perl) = $�;
+    $perl =~ s:^\./:../:;
+    $perl =~ s:^([^./]):../\1:;
+
     if ($mandir eq ' ' or $mandir eq '') {
 	print STDERR "Skipping installation of ",
 	    ($script ? "$poddir/$script man page" : "$poddir man pages"), ".\n";
@@ -107,12 +116,7 @@
     # won't be aware that we've chdir to $poddir.
     -r  "$downdir/pod/pod2man" || die "Executable pod/pod2man not found.\n";
 
-    # We want to be sure to use the current perl.  We can't rely on
-    # the installed perl because it might not be actually installed
-    # yet. (The user may have set the $install* Configure variables 
-    # to point to some temporary home, from which the executable gets
-    # installed by occult means.)
-    $pod2man = "$downdir/perl -I $downdir/lib $downdir/pod/pod2man --section=$manext --official";
+    $pod2man = "$perl -I $downdir/lib $downdir/pod/pod2man --section=$manext --official";
 
     mkpath($mandir, 1, 0777) unless $notify;  # In File::Path
     # Make a list of all the .pm and .pod files in the directory.  We will
--- ./installperl	Sat Jan 16 08:31:26 1999
+++ /vobs/ncube3/web/perl5.005_03/installperl	Fri Jun  4 10:44:40 1999
@@ -10,10 +10,13 @@
 use strict;
 use vars qw($Is_VMS $Is_W32 $Is_OS2 $nonono $versiononly $depth);
 
+use Config;
+my $osname = $Config{osname};
+
 BEGIN {
-    $Is_VMS = $^O eq 'VMS';
-    $Is_W32 = $^O eq 'MSWin32';
-    $Is_OS2 = $^O eq 'os2';
+    $Is_VMS = $osname eq 'VMS';
+    $Is_W32 = $osname eq 'MSWin32';
+    $Is_OS2 = $osname eq 'os2';
     if ($Is_VMS) { eval 'use VMS::Filespec;' }
 }
 
@@ -24,7 +27,6 @@
 use File::Copy ();
 use File::Path ();
 use ExtUtils::Packlist;
-use Config;
 use subs qw(unlink link chmod);
 use vars qw($packlist);
 
@@ -66,7 +68,7 @@
     Config => 1, 
 );
 
-if ($^O eq 'dos') {
+if ($osname eq 'dos') {
     push(@scripts,'djgpp/fixpmain');
     $archpms{config} = $archpms{filehand} = 1;
 }
@@ -159,7 +161,7 @@
     copy("perlshr$exe_ext", "$installbin/${perl}shr$exe_ext");
     chmod(0755, "$installbin/${perl}shr$exe_ext");
 }
-elsif ($^O eq 'mpeix') {
+elsif ($osname eq 'mpeix') {
     # MPE lacks hard links and requires that executables with special
     # capabilities reside in the MPE namespace.
     safe_unlink("$installbin/perl$ver$exe_ext", $Config{perlpath});
@@ -169,7 +171,7 @@
     # Create a backup copy with the version number.
     link($Config{perlpath}, "$installbin/perl$ver$exe_ext");
 }
-elsif ($^O ne 'dos') {
+elsif ($osname ne 'dos') {
     safe_unlink("$installbin/$perl$ver$exe_ext");
     copy("perl$exe_ext", "$installbin/$perl$ver$exe_ext");
     chmod(0755, "$installbin/$perl$ver$exe_ext");
@@ -219,8 +221,8 @@
 else {
     @corefiles = <*.h libperl*.*>;
     # AIX needs perl.exp installed as well.
-    push(@corefiles,'perl.exp') if $^O eq 'aix';
-    if ($^O eq 'mpeix') {
+    push(@corefiles,'perl.exp') if $osname eq 'aix';
+    if ($osname eq 'mpeix') {
         # MPE needs mpeixish.h installed as well.
         mkpath("$installarchlib/CORE/mpeix", 1, 0777);
         push(@corefiles,'mpeix/mpeixish.h');
@@ -239,13 +241,18 @@
 # Install main perl executables
 # Make links to ordinary names if installbin directory isn't current directory.
 
-if (! $versiononly && ! samepath($installbin, '.') && ($^O ne 'dos') && ! $Is_VMS) {
+if (! $versiononly && ! samepath($installbin, '.') && ($osname ne 'dos') && ! $Is_VMS) {
     safe_unlink("$installbin/$perl$exe_ext", "$installbin/suid$perl$exe_ext");
-    if ($^O eq 'mpeix') {
+    if ($osname eq 'mpeix') {
 	# MPE doesn't support hard links, so use a symlink.
 	# We don't want another cloned copy.
         symlink($Config{perlpath}, "$installbin/perl$exe_ext");
-    } else {
+    }
+    elsif ($osname eq 'transit') {
+	copy("$installbin/$perl$ver$exe_ext", "$installbin/$perl$exe_ext");
+	chmod(0755, "$installbin/$perl$exe_ext");
+    }
+    else {
 	link("$installbin/$perl$ver$exe_ext", "$installbin/$perl$exe_ext");
     }
     link("$installbin/s$perl$ver$exe_ext", "$installbin/suid$perl$exe_ext") 
@@ -324,8 +331,9 @@
 
 if (! $versiononly) {
     safe_unlink("$installscript/pstruct$scr_ext");
-    if ($^O eq 'dos' or $Is_VMS) {
+    if ($osname eq 'dos' or $Is_VMS or $osname eq 'transit') {
         copy("$installscript/c2ph$scr_ext", "$installscript/pstruct$scr_ext"); 
+	chmod(0755, "$installscript/pstruct$scr_ext");
     } else {
         link("$installscript/c2ph$scr_ext", "$installscript/pstruct$scr_ext");
     }
@@ -489,7 +497,7 @@
 sub chmod {
     my($mode,$name) = @_;
 
-    return if ($^O eq 'dos');
+    return if ($osname eq 'dos');
     printf STDERR "  chmod %o %s\n", $mode, $name;
     CORE::chmod($mode,$name)
 	|| warn sprintf("Couldn't chmod %o %s: $!\n", $mode, $name)
@@ -585,7 +593,7 @@
 
 sub copy_if_diff {
     my($from,$to)=@_;
-    return 1 if (($^O eq 'VMS') && (-d $from));
+    return 1 if (($osname eq 'VMS') && (-d $from));
     -f $from || die "$0: $from not found";
     $packlist->{$to} = { type => 'file' };
     if (compare($from, $to) || $nonono) {
--- ./pod/pod2man.PL	Sat Jan  2 07:43:49 1999
+++ /vobs/ncube3/web/perl5.005_03/pod/pod2man.PL	Mon Jun  7 16:30:53 1999
@@ -318,11 +318,7 @@
 # running an installed version of Perl to produce documentation from an
 # uninstalled newer version's pod files.
 if ($^O ne 'plan9' and $^O ne 'dos' and $^O ne 'os2' and $^O ne 'MSWin32') {
-  my $perl = (-x './perl' && -f './perl' ) ?
-                 './perl' :
-                 ((-x '../perl' && -f '../perl') ?
-                      '../perl' :
-                      '');
+  my $perl = $�;
   ($version,$patch) = `$perl -e 'print $]'` =~ /^(\d\.\d{3})(\d{2})?/ if $perl;
 }
 # No luck; we'll just go with the running Perl's version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant