By default, the "vendor" area is not used, so Perl's installation
procedure forgot to create its top-level paths, too. In OpenPKG we use
the "vendor" area, so make sure it is created the same way the "site"
area is.

Index: installperl
--- installperl.orig	2015-05-13 22:19:29.000000000 +0200
+++ installperl	2015-06-02 23:37:36.418328694 +0200
@@ -191,6 +191,8 @@
 my $installarchlib = "$opts{destdir}$Config{installarchlib}";
 my $installsitelib = "$opts{destdir}$Config{installsitelib}";
 my $installsitearch = "$opts{destdir}$Config{installsitearch}";
+my $installvendorlib = "$opts{destdir}$Config{installvendorlib}";
+my $installvendorarch = "$opts{destdir}$Config{installvendorarch}";
 my $installman1dir = "$opts{destdir}$Config{installman1dir}";
 my $man1ext = $Config{man1ext};
 my $libperl = $Config{libperl};
@@ -328,6 +330,8 @@
 mkpath($installarchlib);
 mkpath($installsitelib, $opts{verbose}, 0777) if ($installsitelib);
 mkpath($installsitearch, $opts{verbose}, 0777) if ($installsitearch);
+mkpath($installvendorlib, $opts{verbose}, 0777) if ($installvendorlib);
+mkpath($installvendorarch, $opts{verbose}, 0777) if ($installvendorarch);
 
 if (-d 'lib') {
     find({no_chdir => 1, wanted => \&installlib}, 'lib')

-----------------------------------------------------------------------------

Port to [Open]Darwin 6.6.2:

1. In OpenPKG, Perl does not use the vendor GCC and our GCC does not
   understand "-no-cpp-precomp", so remove this build option.

2. The <sys/mman.h> indirectly includes system specific headers
   which in turn have fields named "environ" while Perl uses
   a define of "environ" internally. So wrap the inclusion.

3. Darwin 6 no longer accepts the non-standard "#import" statements,
   so replace with "#include" and circumvent some header problem
   related to the non-standard "__private_extern__" attribute.

Index: hints/darwin.sh
--- hints/darwin.sh.orig	2015-05-13 22:19:29.000000000 +0200
+++ hints/darwin.sh	2015-06-02 23:37:36.418328694 +0200
@@ -200,6 +200,20 @@
    ldflags="${ldflags} -flat_namespace"
    lddlflags="${ldflags} -bundle -undefined suppress"
    ;;
+9.*)
+   lddlflags="${ldflags} -bundle -undefined dynamic_lookup"
+   case "$ld" in
+       *MACOSX_DEVELOPMENT_TARGET*) ;;
+       *) ld="env MACOSX_DEPLOYMENT_TARGET=10.5 ${ld}" ;;
+   esac
+   ;;
+10.*)
+   lddlflags="${ldflags} -bundle -undefined dynamic_lookup"
+   case "$ld" in
+       *MACOSX_DEVELOPMENT_TARGET*) ;;
+       *) ld="env MACOSX_DEPLOYMENT_TARGET=10.6 ${ld}" ;;
+   esac
+   ;;
 *) 
    # MACOSX_DEPLOYMENT_TARGET selects the minimum OS level we want to support
    # https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/cross_development/Configuring/configuring.html
@@ -212,8 +226,7 @@
 esac
 ldlibpthname='DYLD_LIBRARY_PATH';
 
-# useshrplib=true results in much slower startup times.
-# 'false' is the default value.  Use Configure -Duseshrplib to override.
+useshrplib='true'
 
 cat > UU/archname.cbu <<'EOCBU'
 # This script UU/archname.cbu will get 'called-back' by Configure 
Index: ext/DynaLoader/dl_dyld.xs
--- ext/DynaLoader/dl_dyld.xs.orig	2015-05-13 22:19:29.000000000 +0200
+++ ext/DynaLoader/dl_dyld.xs	2015-06-02 23:37:36.418328694 +0200
@@ -48,7 +48,13 @@
 
 #undef environ
 #undef bool
+#ifdef PERL_DARWIN
+#define __private_extern__ extern
+#include <mach-o/dyld.h>
+#undef __private_extern__
+#else
 #import <mach-o/dyld.h>
+#endif
 
 static char *dlerror()
 {

-----------------------------------------------------------------------------

Port to Tru64 5.1:

Under Tru64 our gcc has to be built without binutils and the system
ld(1) does not accept a "-O" option, so remove the whole passing of
optimization flags to ld(1). Under a brain-dead platform like Tru64 we
really don't need any more optimization because we are already happy if
it works at all.

Index: hints/dec_osf.sh
--- hints/dec_osf.sh.orig	2015-05-13 22:19:29.000000000 +0200
+++ hints/dec_osf.sh	2015-06-02 23:37:36.418328694 +0200
@@ -73,15 +73,6 @@
 *)            if $test "X$optimize" = "X$undef"; then
                       lddlflags="$lddlflags -msym"
               else
-		  case "$myosvers" in
-		  *4.0D*)
-		      # QAR 56761: -O4 + .so may produce broken code,
-		      # fixed in 4.0E or better.
-		      ;;
-		  *)
-                      lddlflags="$lddlflags $optimize"
-		      ;;
-		  esac
 		  # -msym: If using a sufficiently recent /sbin/loader,
 		  # keep the module symbols with the modules.
                   lddlflags="$lddlflags -msym $_lddlflags_strict_ansi"

-----------------------------------------------------------------------------

Linker flag change for Solaris.

Index: Configure
--- Configure.orig	2014-09-14 13:30:59.000000000 +0200
+++ Configure	2014-10-02 23:57:28.814228661 +0200
@@ -8256,7 +8236,7 @@
 			    esac
 			    ;;
 		    sunos) dflt='-assert nodefinitions' ;;
-		    svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
+		    svr4*|esix*|nonstopux) dflt="-shared $ldflags" ;;
 		    *)     dflt='none' ;;
 		esac
 		;;

-----------------------------------------------------------------------------

Do not use -fstack-protector as it causes too much portability issues.

Index: Configure
--- Configure.orig	2015-06-02 23:37:36.458336000 +0200
+++ Configure	2015-06-02 23:39:18.748316375 +0200
@@ -5439,24 +5439,6 @@
 		;;
 	esac
 
-	# on x86_64 (at least) we require an extra library (libssp) in the
-	# link command line. This library is not named, so I infer that it is
-	# an implementation detail that may change. Hence the safest approach
-	# is to add the flag to the flags passed to the compiler at link time,
-	# as that way the compiler can do the right implementation dependant
-	# thing. (NWC)
-	case "$gccversion" in
-	?*)	set stack-protector-strong -fstack-protector-strong
-		eval $checkccflag
-		case "$dflt" in
-		*-fstack-protector-strong*) ;; # It got added.
-		*) # Try the plain/older -fstack-protector.
-		   set stack-protector -fstack-protector
-		   eval $checkccflag
-		   ;;
-		esac
-		;;
-	esac
 	;;
 esac
 
@@ -5595,21 +5577,6 @@
 	;;
 *) dflt="$ldflags";;
 esac
-# See note above about -fstack-protector
-case "$ccflags" in
-*-fstack-protector-strong*)
-	case "$dflt" in
-	*-fstack-protector-strong*) ;; # Don't add it again
-	*) dflt="$dflt -fstack-protector-strong" ;;
-	esac
-	;;
-*-fstack-protector*)
-	case "$dflt" in
-	*-fstack-protector*) ;; # Don't add it again
-	*) dflt="$dflt -fstack-protector" ;;
-	esac
-	;;
-esac
 
 : Try to guess additional flags to pick up local libraries.
 for thislibdir in $libpth; do
@@ -8495,21 +8462,6 @@
 	    ''|' ') dflt='none' ;;
 	esac
 
-	case "$ldflags" in
-	    *-fstack-protector-strong*)
-		case "$dflt" in
-		    *-fstack-protector-strong*) ;; # Don't add it again
-		    *) dflt="$dflt -fstack-protector-strong" ;;
-		esac
-		;;
-	    *-fstack-protector*)
-		case "$dflt" in
-		    *-fstack-protector*) ;; # Don't add it again
-		    *) dflt="$dflt -fstack-protector" ;;
-		esac
-		;;
-	esac
-
 	rp="Any special flags to pass to $ld to create a dynamically loaded library?"
 	. ./myread
 	case "$ans" in

-----------------------------------------------------------------------------

Make sure we install into <prefix>/lib/perl/ and not <prefix>/lib/perl5/

Index: Configure
--- Configure.orig	2015-06-02 23:37:36.458336000 +0200
+++ Configure	2015-06-02 23:39:18.748316375 +0200
@@ -1860,7 +1860,7 @@
 touch posthint.sh
 
 : set package name
-package='perl5'
+package='perl'
 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in

-----------------------------------------------------------------------------

Linking against just libgdbm_compat under at least SUSE fails
because it also needs libgdbm (which Perl doesn't pick up, too)

Index: hints/linux.sh
--- hints/linux.sh.orig	2015-05-13 22:19:29.000000000 +0200
+++ hints/linux.sh	2015-06-02 23:37:40.338319434 +0200
@@ -61,7 +61,9 @@
 echo $libs
 if echo " $libswanted " | grep -q ' gdbm '; then
     # Only add if gdbm is in libswanted.
+    if [ -f /etc/debian_version -o -f /etc/ubuntu_version ]; then
     libswanted="$libswanted gdbm_compat"
+    fi
 fi
 
 # Configure may fail to find lstat() since it's a static/inline

