Integrate mainline (a while ago)
[p5sagit/p5-mst-13.2.git] / installperl
index c18fd6a..827e30a 100755 (executable)
@@ -234,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') {
@@ -242,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;
@@ -381,6 +395,10 @@ if (! $versiononly && ! samepath($installbin, '.') && ($^O ne 'dos') && ! $Is_VM
        # MPE doesn't support hard links, so use a symlink.
        # We don't want another cloned copy.
         symlink($Config{perlpath}, "$installbin/perl$exe_ext");
+    } elsif ($^O eq 'vos') {
+       # VOS doesn't support hard links, so use a symlink.
+        symlink("$installbin/$perl_verbase$ver$exe_ext",
+                "$installbin/$perl$exe_ext");
     } else {
        link("$installbin/$perl_verbase$ver$exe_ext",
                "$installbin/$perl$exe_ext");
@@ -395,8 +413,8 @@ if (! $versiononly && ! samepath($installbin, '.') && ($^O ne 'dos') && ! $Is_VM
 if ($archname && ! samepath($installbin, '.') && ($^O ne 'dos') && ! $Is_VMS) {
     my $archperl = "$perl_verbase$ver-$Config{archname}$exe_ext";
     safe_unlink("$installbin/$archperl");
-    if ($^O eq 'mpeix') {
-       # MPE doesn't support hard links, so use a symlink.
+    if ($^O eq 'mpeix' || $^O eq 'vos') {
+       # MPE and VOS don't support hard links, so use a symlink.
        # We don't want another cloned copy.
         symlink($Config{perlpath}, "$installbin/$archperl");
     } else {
@@ -466,6 +484,9 @@ sub script_alias {
     if ($^O eq 'dos' or $Is_VMS or $^O eq 'transit') {
        copy("$installscript/$orig$scr_ext",
             "$installscript/$alias$scr_ext");
+    } elsif ($^O eq 'vos') {
+       symlink("$installscript/$orig$scr_ext",
+               "$installscript/$alias$scr_ext");
     } else {
        link("$installscript/$orig$scr_ext",
             "$installscript/$alias$scr_ext");