-# Cwd.xs added in commit 0d2079faa739aaa9. Cwd.pm moved to ext/ 8 years later
-# in commit 403f501d5b37ebf0
-if ($major > 0 && <*/Cwd/Cwd.xs>) {
- if ($major < 10 && !extract_from_file('Makefile.SH', qr/^extra_dep=''$/)) {
- # The Makefile.PL for Unicode::Normalize needs
- # lib/unicore/CombiningClass.pl. Even without a parallel build, we need
- # a dependency to ensure that it builds. This is a variant of commit
- # 9f3ef600c170f61e. Putting this for earlier versions gives us a spot
- # on which to hang the edits below
- apply_patch(<<'EOPATCH');
-diff --git a/Makefile.SH b/Makefile.SH
-index f61d0db..6097954 100644
---- a/Makefile.SH
-+++ b/Makefile.SH
-@@ -155,10 +155,20 @@ esac
-
- : Prepare dependency lists for Makefile.
- dynamic_list=' '
-+extra_dep=''
- for f in $dynamic_ext; do
- : the dependency named here will never exist
- base=`echo "$f" | sed 's/.*\///'`
-- dynamic_list="$dynamic_list lib/auto/$f/$base.$dlext"
-+ this_target="lib/auto/$f/$base.$dlext"
-+ dynamic_list="$dynamic_list $this_target"
-+
-+ : Parallel makes reveal that we have some interdependencies
-+ case $f in
-+ Math/BigInt/FastCalc) extra_dep="$extra_dep
-+$this_target: lib/auto/List/Util/Util.$dlext" ;;
-+ Unicode/Normalize) extra_dep="$extra_dep
-+$this_target: lib/unicore/CombiningClass.pl" ;;
-+ esac
- done
-
- static_list=' '
-@@ -987,2 +997,9 @@ n_dummy $(nonxs_ext): miniperl$(EXE_EXT) preplibrary $(DYNALOADER) FORCE
- @$(LDLIBPTH) sh ext/util/make_ext nonxs $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
-+!NO!SUBS!
-+
-+$spitshell >>Makefile <<EOF
-+$extra_dep
-+EOF
-+
-+$spitshell >>Makefile <<'!NO!SUBS!'
-
-EOPATCH
- }
- if ($major < 14) {
- # Commits dc0655f797469c47 and d11a62fe01f2ecb2
- edit_file('Makefile.SH', sub {
- my $code = shift;
- foreach my $ext (qw(Encode SDBM_File)) {
- next if $code =~ /\b$ext\) extra_dep=/s;
- $code =~ s!(\) extra_dep="\$extra_dep
-\$this_target: .*?" ;;)
-( esac
-)!$1
- $ext) extra_dep="\$extra_dep
-\$this_target: lib/auto/Cwd/Cwd.\$dlext" ;;
-$2!;
- }
- return $code;
- });
- }
-}
-if ($major == 7) {
- # Remove commits 9fec149bb652b6e9 and 5bab1179608f81d8, which add/amend
- # rules to automatically run regen scripts that rebuild C headers. These
- # cause problems because a git checkout doesn't preserve relative file
- # modification times, hence the regen scripts may fire. This will obscure
- # whether the repository had the correct generated headers checked in.
- # Also, the dependency rules for running the scripts were not correct,
- # which could cause spurious re-builds on re-running make, and can cause
- # complete build failures for a parallel make.
- if (extract_from_file('Makefile.SH',
- qr/Writing it this way gives make a big hint to always run opcode\.pl before/)) {
- system 'git show 70c6e6715e8fec53 | patch -p1'
- and die;
- } elsif (extract_from_file('Makefile.SH',
- qr/^opcode\.h opnames\.h pp_proto\.h pp\.sym: opcode\.pl$/)) {
- system 'git show 9fec149bb652b6e9 | patch -p1 -R'
- and die;
- }
-}
-
-# There was a bug in makedepend.SH which was fixed in version 96a8704c.
-# Symptom was './makedepend: 1: Syntax error: Unterminated quoted string'
-# Remove this if you're actually bisecting a problem related to makedepend.SH
-system 'git show blead:makedepend.SH > makedepend.SH </dev/null' and die;
-
-if ($^O eq 'freebsd') {
- # There are rather too many version-specific FreeBSD hints fixes to patch
- # individually. Also, more than once the FreeBSD hints file has been
- # written in what turned out to be a rather non-future-proof style,
- # with case statements treating the most recent version as the exception,
- # instead of treating previous versions' behaviour explicitly and changing
- # the default to cater for the current behaviour. (As strangely, future
- # versions inherit the current behaviour.)
- system 'git show blead:hints/freebsd.sh > hints/freebsd.sh </dev/null'
- and die;
-
- if ($major < 2) {
- # 5.002 Configure and later have code to
- #
- # : Try to guess additional flags to pick up local libraries.
- #
- # which will automatically add --L/usr/local/lib because libpth
- # contains /usr/local/lib
- #
- # Without it, if Configure finds libraries in /usr/local/lib (eg
- # libgdbm.so) and adds them to the compiler commandline (as -lgdbm),
- # then the link will fail. We can't fix this up in config.sh because
- # the link will *also* fail in the test compiles that Configure does
- # (eg $inlibc) which makes Configure get all sorts of things
- # wrong. :-( So bodge it here.
- #
- # Possibly other platforms will need something similar. (if they
- # have "wanted" libraries in /usr/local/lib, but the compiler
- # doesn't default to putting that directory in its link path)
- apply_patch(<<'EOPATCH');
---- perl2/hints/freebsd.sh.orig 2011-10-05 16:44:55.000000000 +0200
-+++ perl2/hints/freebsd.sh 2011-10-05 16:45:52.000000000 +0200
-@@ -125,7 +125,7 @@
- else
- libpth="/usr/lib /usr/local/lib"
- glibpth="/usr/lib /usr/local/lib"
-- ldflags="-Wl,-E "
-+ ldflags="-Wl,-E -L/usr/local/lib "
- lddlflags="-shared "
- fi
- cccdlflags='-DPIC -fPIC'
-@@ -133,7 +133,7 @@
- *)
- libpth="/usr/lib /usr/local/lib"
- glibpth="/usr/lib /usr/local/lib"
-- ldflags="-Wl,-E "
-+ ldflags="-Wl,-E -L/usr/local/lib "
- lddlflags="-shared "
- cccdlflags='-DPIC -fPIC'
- ;;
-EOPATCH
- }
-} elsif ($^O eq 'darwin') {
- if ($major < 8) {
- my $faking_it;
- # We can't build on darwin without some of the data in the hints file.
- foreach ('ext/DynaLoader/dl_dyld.xs', 'hints/darwin.sh') {
- next if -f $_;
- ++$faking_it;
- # Probably less surprising to use the earliest version of
- # hints/darwin.sh and then edit in place just below, than use
- # blead's version, as that would create a discontinuity at
- # f556e5b971932902 - before it, hints bugs would be "fixed", after
- # it they'd resurface. This way, we should give the illusion of
- # monotonic bug fixing.
- system "git show f556e5b971932902:$_ >$_"
- and die "while attempting to extract $_";
- }
- if ($faking_it) {
- apply_patch(<<'EOPATCH');
-diff -u a/ext/DynaLoader/dl_dyld.xs~ a/ext/DynaLoader/dl_dyld.xs
---- a/ext/DynaLoader/dl_dyld.xs~ 2011-10-11 21:41:27.000000000 +0100
-+++ b/ext/DynaLoader/dl_dyld.xs 2011-10-11 21:42:20.000000000 +0100
-@@ -41,6 +41,35 @@
- #include "perl.h"
- #include "XSUB.h"
-
-+#ifndef pTHX
-+# define pTHX void
-+# define pTHX_
-+#endif
-+#ifndef aTHX
-+# define aTHX
-+# define aTHX_
-+#endif
-+#ifndef dTHX
-+# define dTHXa(a) extern int Perl___notused(void)
-+# define dTHX extern int Perl___notused(void)
-+#endif
-+
-+#ifndef Perl_form_nocontext
-+# define Perl_form_nocontext form
-+#endif
-+
-+#ifndef Perl_warn_nocontext
-+# define Perl_warn_nocontext warn
-+#endif
-+
-+#ifndef PTR2IV
-+# define PTR2IV(p) (IV)(p)
-+#endif
-+
-+#ifndef get_av
-+# define get_av perl_get_av
-+#endif
-+
- #define DL_LOADONCEONLY
-
- #include "dlutils.c" /* SaveError() etc */
-@@ -185,7 +191,7 @@
- CODE:
- DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_load_file(%s,%x):\n", filename,flags));
- if (flags & 0x01)
-- Perl_warn(aTHX_ "Can't make loaded symbols global on this platform while loading %s",filename);
-+ Perl_warn_nocontext("Can't make loaded symbols global on this platform while loading %s",filename);
- RETVAL = dlopen(filename, mode) ;
- DLDEBUG(2,PerlIO_printf(Perl_debug_log, " libref=%x\n", RETVAL));
- ST(0) = sv_newmortal() ;
-EOPATCH
- if ($major < 4 && !extract_from_file('util.c', qr/^form/m)) {
- apply_patch(<<'EOPATCH');
-diff -u a/ext/DynaLoader/dl_dyld.xs~ a/ext/DynaLoader/dl_dyld.xs
---- a/ext/DynaLoader/dl_dyld.xs~ 2011-10-11 21:56:25.000000000 +0100
-+++ b/ext/DynaLoader/dl_dyld.xs 2011-10-11 22:00:00.000000000 +0100
-@@ -60,6 +60,18 @@
- # define get_av perl_get_av
- #endif
-
-+static char *
-+form(char *pat, ...)
-+{
-+ char *retval;
-+ va_list args;
-+ va_start(args, pat);
-+ vasprintf(&retval, pat, &args);
-+ va_end(args);
-+ SAVEFREEPV(retval);
-+ return retval;
-+}
-+
- #define DL_LOADONCEONLY
-
- #include "dlutils.c" /* SaveError() etc */
-EOPATCH
- }
- }
-
- edit_file('hints/darwin.sh', sub {
- my $code = shift;
- # Part of commit 8f4f83badb7d1ba9, which mostly undoes
- # commit 0511a818910f476c.
- $code =~ s/^cppflags='-traditional-cpp';$/cppflags="\${cppflags} -no-cpp-precomp"/m;
- # commit 14c11978e9b52e08/803bb6cc74d36a3f
- # Without this, code in libperl.bundle links against op.o
- # in preference to opmini.o on the linker command line,
- # and hence miniperl tries to use File::Glob instead of
- # csh
- $code =~ s/^(lddlflags=)/ldflags="\${ldflags} -flat_namespace"\n$1/m;
- # f556e5b971932902 also patches Makefile.SH with some
- # special case code to deal with useshrplib for darwin.
- # Given that post 5.8.0 the darwin hints default was
- # changed to false, and it would be very complex to splice
- # in that code in various versions of Makefile.SH back
- # to 5.002, lets just turn it off.
- $code =~ s/^useshrplib='true'/useshrplib='false'/m
- if $faking_it;
- return $code;
- });
- }
-} elsif ($^O eq 'netbsd') {
- if ($major < 6) {
- # These are part of commit 099685bc64c7dbce
- edit_file('hints/netbsd.sh', sub {
- my $code = shift;
- my $fixed = <<'EOC';
-case "$osvers" in
-0.9|0.8*)
- usedl="$undef"
- ;;
-*)
- if [ -f /usr/libexec/ld.elf_so ]; then
- d_dlopen=$define
- d_dlerror=$define
- ccdlflags="-Wl,-E -Wl,-R${PREFIX}/lib $ccdlflags"
- cccdlflags="-DPIC -fPIC $cccdlflags"
- lddlflags="--whole-archive -shared $lddlflags"
- elif [ "`uname -m`" = "pmax" ]; then
-# NetBSD 1.3 and 1.3.1 on pmax shipped an `old' ld.so, which will not work.
- d_dlopen=$undef
- elif [ -f /usr/libexec/ld.so ]; then
- d_dlopen=$define
- d_dlerror=$define
- ccdlflags="-Wl,-R${PREFIX}/lib $ccdlflags"
-# we use -fPIC here because -fpic is *NOT* enough for some of the
-# extensions like Tk on some netbsd platforms (the sparc is one)
- cccdlflags="-DPIC -fPIC $cccdlflags"
- lddlflags="-Bforcearchive -Bshareable $lddlflags"
- else
- d_dlopen=$undef
- fi
- ;;
-esac
-EOC
- $code =~ s/^case "\$osvers" in\n0\.9\|0\.8.*?^esac\n/$fixed/ms;
- return $code;
- });
- if (!extract_from_file('unixish.h',
- qr/defined\(NSIG\).*defined\(__NetBSD__\)/)) {
- apply_patch(<<'EOPATCH')
-diff --git a/unixish.h b/unixish.h
-index 2a6cbcd..eab2de1 100644
---- a/unixish.h
-+++ b/unixish.h
-@@ -89,7 +89,7 @@
- */
- /* #define ALTERNATE_SHEBANG "#!" / **/
-
--#if !defined(NSIG) || defined(M_UNIX) || defined(M_XENIX)
-+#if !defined(NSIG) || defined(M_UNIX) || defined(M_XENIX) || defined(__NetBSD__)
- # include <signal.h>
- #endif
-
-EOPATCH
- }
- }
-} elsif ($^O eq 'openbsd') {
- if (!-f 'hints/openbsd.sh') {
- system 'git show 43051805d53a3e4c:hints/openbsd.sh > hints/openbsd.sh'
- and die;
- }
-
- if ($major < 8) {
- my $which = extract_from_file('hints/openbsd.sh',
- qr/# from (2\.8|3\.1) onwards/,
- '');
- if ($which eq '') {
- my $was = extract_from_file('hints/openbsd.sh',
- qr/(lddlflags="(?:-Bforcearchive )?-Bshareable)/);
- # This is commit 154d43cbcf57271c and parts of 5c75dbfa77b0949c
- # and 29b5585702e5e025
- apply_patch(sprintf <<'EOPATCH', $was);
-diff --git a/hints/openbsd.sh b/hints/openbsd.sh
-index a7d8bf2..5b79709 100644
---- a/hints/openbsd.sh
-+++ b/hints/openbsd.sh
-@@ -37,7 +37,25 @@ OpenBSD.alpha|OpenBSD.mips|OpenBSD.powerpc|OpenBSD.vax)
- # we use -fPIC here because -fpic is *NOT* enough for some of the
- # extensions like Tk on some OpenBSD platforms (ie: sparc)
- cccdlflags="-DPIC -fPIC $cccdlflags"
-- %s $lddlflags"
-+ case "$osvers" in
-+ [01].*|2.[0-7]|2.[0-7].*)
-+ lddlflags="-Bshareable $lddlflags"
-+ ;;
-+ 2.[8-9]|3.0)
-+ ld=${cc:-cc}
-+ lddlflags="-shared -fPIC $lddlflags"
-+ ;;
-+ *) # from 3.1 onwards
-+ ld=${cc:-cc}
-+ lddlflags="-shared -fPIC $lddlflags"
-+ libswanted=`echo $libswanted | sed 's/ dl / /'`
-+ ;;
-+ esac
-+
-+ # We need to force ld to export symbols on ELF platforms.
-+ # Without this, dlopen() is crippled.
-+ ELF=`${cc:-cc} -dM -E - </dev/null | grep __ELF__`
-+ test -n "$ELF" && ldflags="-Wl,-E $ldflags"
- ;;
- esac
-
-EOPATCH
- } elsif ($which eq '2.8') {
- # This is parts of 5c75dbfa77b0949c and 29b5585702e5e025, and
- # possibly eb9cd59d45ad2908
- my $was = extract_from_file('hints/openbsd.sh',
- qr/lddlflags="(-shared(?: -fPIC)?) \$lddlflags"/);
-
- apply_patch(sprintf <<'EOPATCH', $was);
---- a/hints/openbsd.sh 2011-10-21 17:25:20.000000000 +0200
-+++ b/hints/openbsd.sh 2011-10-21 16:58:43.000000000 +0200
-@@ -44,11 +44,21 @@
- [01].*|2.[0-7]|2.[0-7].*)
- lddlflags="-Bshareable $lddlflags"
- ;;
-- *) # from 2.8 onwards
-+ 2.[8-9]|3.0)
- ld=${cc:-cc}
-- lddlflags="%s $lddlflags"
-+ lddlflags="-shared -fPIC $lddlflags"
-+ ;;
-+ *) # from 3.1 onwards
-+ ld=${cc:-cc}
-+ lddlflags="-shared -fPIC $lddlflags"
-+ libswanted=`echo $libswanted | sed 's/ dl / /'`
- ;;
- esac
-+
-+ # We need to force ld to export symbols on ELF platforms.
-+ # Without this, dlopen() is crippled.
-+ ELF=`${cc:-cc} -dM -E - </dev/null | grep __ELF__`
-+ test -n "$ELF" && ldflags="-Wl,-E $ldflags"
- ;;
- esac
-
-EOPATCH
- } elsif ($which eq '3.1'
- && !extract_from_file('hints/openbsd.sh',
- qr/We need to force ld to export symbols on ELF platforms/)) {
- # This is part of 29b5585702e5e025
- apply_patch(<<'EOPATCH');
-diff --git a/hints/openbsd.sh b/hints/openbsd.sh
-index c6b6bc9..4839d04 100644
---- a/hints/openbsd.sh
-+++ b/hints/openbsd.sh
-@@ -54,6 +54,11 @@ alpha-2.[0-8]|mips-*|vax-*|powerpc-2.[0-7]|m88k-*)
- libswanted=`echo $libswanted | sed 's/ dl / /'`
- ;;
- esac
-+
-+ # We need to force ld to export symbols on ELF platforms.
-+ # Without this, dlopen() is crippled.
-+ ELF=`${cc:-cc} -dM -E - </dev/null | grep __ELF__`
-+ test -n "$ELF" && ldflags="-Wl,-E $ldflags"
- ;;
- esac
-
-EOPATCH
- }
- }
- if ($major < 4) {
- my $bad;
- # Need changes from commit a6e633defa583ad5.
- # Commits c07a80fdfe3926b5 and f82b3d4130164d5f changed the same part
- # of perl.h
-
- if (extract_from_file('perl.h',
- qr/^#ifdef HAS_GETPGRP2$/)) {
- $bad = <<'EOBAD';
-***************
-*** 57,71 ****
- #define TAINT_PROPER(s) if (tainting) taint_proper(no_security, s)
- #define TAINT_ENV() if (tainting) taint_env()
-
-! #ifdef HAS_GETPGRP2
-! # ifndef HAS_GETPGRP
-! # define HAS_GETPGRP
-! # endif
-! #endif
-!
-! #ifdef HAS_SETPGRP2
-! # ifndef HAS_SETPGRP
-! # define HAS_SETPGRP
-! # endif
- #endif
-
-EOBAD
- } elsif (extract_from_file('perl.h',
- qr/Gack, you have one but not both of getpgrp2/)) {
- $bad = <<'EOBAD';
-***************
-*** 56,76 ****
- #define TAINT_PROPER(s) if (tainting) taint_proper(no_security, s)
- #define TAINT_ENV() if (tainting) taint_env()
-
-! #if defined(HAS_GETPGRP2) && defined(HAS_SETPGRP2)
-! # define getpgrp getpgrp2
-! # define setpgrp setpgrp2
-! # ifndef HAS_GETPGRP
-! # define HAS_GETPGRP
-! # endif
-! # ifndef HAS_SETPGRP
-! # define HAS_SETPGRP
-! # endif
-! # ifndef USE_BSDPGRP
-! # define USE_BSDPGRP
-! # endif
-! #else
-! # if defined(HAS_GETPGRP2) || defined(HAS_SETPGRP2)
-! #include "Gack, you have one but not both of getpgrp2() and setpgrp2()."
-! # endif
- #endif
-
-EOBAD
- } elsif (extract_from_file('perl.h',
- qr/^#ifdef USE_BSDPGRP$/)) {
- $bad = <<'EOBAD'
-***************
-*** 91,116 ****
- #define TAINT_PROPER(s) if (tainting) taint_proper(no_security, s)
- #define TAINT_ENV() if (tainting) taint_env()
-
-! #ifdef USE_BSDPGRP
-! # ifdef HAS_GETPGRP
-! # define BSD_GETPGRP(pid) getpgrp((pid))
-! # endif
-! # ifdef HAS_SETPGRP
-! # define BSD_SETPGRP(pid, pgrp) setpgrp((pid), (pgrp))
-! # endif
-! #else
-! # ifdef HAS_GETPGRP2
-! # define BSD_GETPGRP(pid) getpgrp2((pid))
-! # ifndef HAS_GETPGRP
-! # define HAS_GETPGRP
-! # endif
-! # endif
-! # ifdef HAS_SETPGRP2
-! # define BSD_SETPGRP(pid, pgrp) setpgrp2((pid), (pgrp))
-! # ifndef HAS_SETPGRP
-! # define HAS_SETPGRP
-! # endif
-! # endif
- #endif
-
- #ifndef _TYPES_ /* If types.h defines this it's easy. */
-EOBAD
- }
- if ($bad) {
- apply_patch(<<"EOPATCH");
-*** a/perl.h 2011-10-21 09:46:12.000000000 +0200
---- b/perl.h 2011-10-21 09:46:12.000000000 +0200
-$bad--- 91,144 ----
- #define TAINT_PROPER(s) if (tainting) taint_proper(no_security, s)
- #define TAINT_ENV() if (tainting) taint_env()
-
-! /* XXX All process group stuff is handled in pp_sys.c. Should these
-! defines move there? If so, I could simplify this a lot. --AD 9/96.
-! */
-! /* Process group stuff changed from traditional BSD to POSIX.
-! perlfunc.pod documents the traditional BSD-style syntax, so we'll
-! try to preserve that, if possible.
-! */
-! #ifdef HAS_SETPGID
-! # define BSD_SETPGRP(pid, pgrp) setpgid((pid), (pgrp))
-! #else
-! # if defined(HAS_SETPGRP) && defined(USE_BSD_SETPGRP)
-! # define BSD_SETPGRP(pid, pgrp) setpgrp((pid), (pgrp))
-! # else
-! # ifdef HAS_SETPGRP2 /* DG/UX */
-! # define BSD_SETPGRP(pid, pgrp) setpgrp2((pid), (pgrp))
-! # endif
-! # endif
-! #endif
-! #if defined(BSD_SETPGRP) && !defined(HAS_SETPGRP)
-! # define HAS_SETPGRP /* Well, effectively it does . . . */
-! #endif
-!
-! /* getpgid isn't POSIX, but at least Solaris and Linux have it, and it makes
-! our life easier :-) so we'll try it.
-! */
-! #ifdef HAS_GETPGID
-! # define BSD_GETPGRP(pid) getpgid((pid))
-! #else
-! # if defined(HAS_GETPGRP) && defined(USE_BSD_GETPGRP)
-! # define BSD_GETPGRP(pid) getpgrp((pid))
-! # else
-! # ifdef HAS_GETPGRP2 /* DG/UX */
-! # define BSD_GETPGRP(pid) getpgrp2((pid))
-! # endif
-! # endif
-! #endif
-! #if defined(BSD_GETPGRP) && !defined(HAS_GETPGRP)
-! # define HAS_GETPGRP /* Well, effectively it does . . . */
-! #endif
-!
-! /* These are not exact synonyms, since setpgrp() and getpgrp() may
-! have different behaviors, but perl.h used to define USE_BSDPGRP
-! (prior to 5.003_05) so some extension might depend on it.
-! */
-! #if defined(USE_BSD_SETPGRP) || defined(USE_BSD_GETPGRP)
-! # ifndef USE_BSDPGRP
-! # define USE_BSDPGRP
-! # endif
- #endif
-
- #ifndef _TYPES_ /* If types.h defines this it's easy. */
-EOPATCH
- }
- }
- if ($major < 3 && !extract_from_file('pp_sys.c', qr/BSD_GETPGRP/)) {
- # Part of commit c3293030fd1b7489
- apply_patch(<<'EOPATCH');
-diff --git a/pp_sys.c b/pp_sys.c
-index 4608a2a..f0c9d1d 100644
---- a/pp_sys.c
-+++ b/pp_sys.c
-@@ -2903,8 +2903,8 @@ PP(pp_getpgrp)
- pid = 0;
- else
- pid = SvIVx(POPs);
--#ifdef USE_BSDPGRP
-- value = (I32)getpgrp(pid);
-+#ifdef BSD_GETPGRP
-+ value = (I32)BSD_GETPGRP(pid);
- #else
- if (pid != 0)
- DIE("POSIX getpgrp can't take an argument");
-@@ -2933,8 +2933,8 @@ PP(pp_setpgrp)
- }
-
- TAINT_PROPER("setpgrp");
--#ifdef USE_BSDPGRP
-- SETi( setpgrp(pid, pgrp) >= 0 );
-+#ifdef BSD_SETPGRP
-+ SETi( BSD_SETPGRP(pid, pgrp) >= 0 );
- #else
- if ((pgrp != 0) || (pid != 0)) {
- DIE("POSIX setpgrp can't take an argument");
-EOPATCH
- }
-}
-
-if ($major < 10) {
- if (!extract_from_file('ext/DB_File/DB_File.xs',
- qr!^#else /\* Berkeley DB Version > 2 \*/$!)) {
- # This DB_File.xs is really too old to patch up.
- # Skip DB_File, unless we're invoked with an explicit -Unoextensions
- if (!exists $defines{noextensions}) {
- $defines{noextensions} = 'DB_File';
- } elsif (defined $defines{noextensions}) {
- $defines{noextensions} .= ' DB_File';
- }
- } elsif (!extract_from_file('ext/DB_File/DB_File.xs',
- qr/^#ifdef AT_LEAST_DB_4_1$/)) {
- # This line is changed by commit 3245f0580c13b3ab
- my $line = extract_from_file('ext/DB_File/DB_File.xs',
- qr/^( status = \(?RETVAL->dbp->open\)?\(RETVAL->dbp, name, NULL, RETVAL->type, $)/);
- apply_patch(<<"EOPATCH");
-diff --git a/ext/DB_File/DB_File.xs b/ext/DB_File/DB_File.xs
-index 489ba96..fba8ded 100644
---- a/ext/DB_File/DB_File.xs
-+++ b/ext/DB_File/DB_File.xs
-\@\@ -183,4 +187,8 \@\@
- #endif
-
-+#if DB_VERSION_MAJOR > 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1)
-+# define AT_LEAST_DB_4_1
-+#endif
-+
- /* map version 2 features & constants onto their version 1 equivalent */
-
-\@\@ -1334,7 +1419,12 \@\@ SV * sv ;
- #endif
-
-+#ifdef AT_LEAST_DB_4_1
-+ status = (RETVAL->dbp->open)(RETVAL->dbp, NULL, name, NULL, RETVAL->type,
-+ Flags, mode) ;
-+#else
- $line
- Flags, mode) ;
-+#endif
- /* printf("open returned %d %s\\n", status, db_strerror(status)) ; */
-
-EOPATCH
- }
-}
-
-# if Encode is not needed for the test, you can speed up the bisect by
-# excluding it from the runs with -Dnoextensions=Encode
-# ccache is an easy win. Remove it if it causes problems.
-# Commit 1cfa4ec74d4933da adds ignore_versioned_solibs to Configure, and sets it
-# to true in hints/linux.sh
-# On dromedary, from that point on, Configure (by default) fails to find any
-# libraries, because it scans /usr/local/lib /lib /usr/lib, which only contain
-# versioned libraries. Without -lm, the build fails.
-# Telling /usr/local/lib64 /lib64 /usr/lib64 works from that commit onwards,
-# until commit faae14e6e968e1c0 adds it to the hints.
-# However, prior to 1cfa4ec74d4933da telling Configure the truth doesn't work,
-# because it will spot versioned libraries, pass them to the compiler, and then
-# bail out pretty early on. Configure won't let us override libswanted, but it
-# will let us override the entire libs list.
-