[ID 20020220.002] Perl 5.7.2 porting patches for POSIX 1003.1-2001 hosts
[p5sagit/p5-mst-13.2.git] / installperl
index fc7ccb5..6b702bd 100755 (executable)
@@ -10,7 +10,7 @@ BEGIN {
 use strict;
 my ($Is_VMS, $Is_W32, $Is_OS2, $Is_Cygwin, $Is_Darwin,
     $nonono, $dostrip, $versiononly, $silent, $verbose,
-    $otherperls, $archname,$Is_NetWare, $nwinstall);
+    $otherperls, $archname,$Is_NetWare, $nwinstall, $nopods);
 use vars qw /$depth/;
 
 BEGIN {
@@ -72,6 +72,7 @@ while (@ARGV) {
     $verbose = 1 if $ARGV[0] eq '-V' || $ARGV [0] eq '-n';
     $archname = 1 if $ARGV[0] eq '-A';
        $nwinstall = 1 if $ARGV[0] eq '-netware';
+    $nopods = 1 if $ARGV[0] eq '-p';
     if ($ARGV[0] eq '-?' or $ARGV[0] =~ /^-?-h/) {
       print <<"EOT";
 Usage $0: [switches]
@@ -86,6 +87,7 @@ Usage $0: [switches]
   -V        Verbose mode.
   -A        Also install perl with the architecture's name in the perl binary's
             name.
+  -p        Don't install the pod files. [This will break use diagnostics;]
   -netware  Install correctly on a Netware server.
 EOT
       exit;
@@ -111,7 +113,7 @@ close SCRIPTS;
 
 if ($scr_ext) { @scripts = map { "$_$scr_ext" } @scripts; }
 
-my @pods = (<pod/*.pod>);
+my @pods = $nopods ? () : (<pod/*.pod>);
 
 # Specify here any .pm files that are actually architecture-dependent.
 # (Those included with XS extensions under ext/ are automatically
@@ -232,7 +234,9 @@ if (($Is_W32 and ! $Is_NetWare)  or $Is_Cygwin) {
 
   if ($Is_Cygwin) {
     $perldll = $libperl;
-    $perldll =~ s/(\..*)?$/.$dlext/;
+    my $v_e_r_s = $ver; $v_e_r_s =~ tr/./_/;
+    $perldll =~ s/(\..*)?$/$v_e_r_s.$dlext/;
+    $perldll =~ s/^lib/cyg/;
     if ($Config{useshrplib} eq 'true') {
       # install ld2 and perlld as well
       foreach ('ld2', 'perlld') {
@@ -240,6 +244,18 @@ if (($Is_W32 and ! $Is_NetWare)  or $Is_Cygwin) {
         copy("$_", "$installbin/$_");
         chmod(0755, "$installbin/$_");
       };
+      { 
+               open (LD2, ">$installbin/ld2");
+               print LD2 "#!/bin/sh\n#\n# ld wrapper, passes all args to perlld;\n#\n"
+                         . "for trythis in $installbin/perl\ndo\n  if [ -x \$trythis ]\n"
+                         . "  then\n    \$trythis $installbin/perlld \"\$\@\"\n"
+                         . "    exit \$?\n  fi\ndone\n# hard luck!\necho i see no perl"
+                         . " executable around there\necho perl is required to build "
+                         . "dynamic libraries\necho look if the path to perl in /bin/ld2"
+                         . " is correct\nexit 1\n";
+               close LD2;
+      };
+      chmod(0755, "$installbin/ld2");
     };
   } else {
     $perldll = 'perl57.' . $dlext;