The old scheme didn't make any sense...not that there was a scheme really.
Signed-off-by: Marcel Denia <naoir@gmx.net>
--- /dev/null
+The patches in this package are loosely sorted into the following categories:
+
+0xx - Bugfixes
+1xx - Cross-compile fixes
+3xx - Workarounds
+7xx - Testsuite fixes
+
+Feel free to add another one if your new patch doesn't seem to fit into an
+existing category.
\ No newline at end of file
--- /dev/null
+--- a/pp.c
++++ b/pp.c
+@@ -43,7 +43,7 @@ extern Pid_t getpid (void);
+ * Some BSDs and Cygwin default to POSIX math instead of IEEE.
+ * This switches them over to IEEE.
+ */
+-#if defined(LIBM_LIB_VERSION)
++#if defined(LIBM_LIB_VERSION) && (defined(__GLIBC__) || defined(__UCLIBC__))
+ _LIB_VERSION_TYPE _LIB_VERSION = _IEEE_;
+ #endif
+
--- /dev/null
+--- a/hints/linux.sh
++++ b/hints/linux.sh
+@@ -204,6 +204,24 @@ case "$libc" in
+ ;;
+ esac
+
++# Ubuntu 11.04 (and later, presumably) doesn't keep most libraries
++# (such as -lm) in /lib or /usr/lib. So we have to ask gcc to tell us
++# where to look. We don't want gcc's own libraries, however, so we
++# filter those out.
++# This could be conditional on Unbuntu, but other distributions may
++# follow suit, and this scheme seems to work even on rather old gcc's.
++# This unconditionally uses gcc because even if the user is using another
++# compiler, we still need to find the math library and friends, and I don't
++# know how other compilers will cope with that situation.
++# Still, as an escape hatch, allow Configure command line overrides to
++# plibpth to bypass this check.
++case "$plibpth" in
++'') plibpth=`gcc -print-search-dirs | grep libraries |
++ cut -f2- -d= | tr ':' $trnl | grep -v 'gcc'`
++ plibpth="$plibpth" # Collapse all entries on one line
++ ;;
++esac
++
+ # Are we using ELF? Thanks to Kenneth Albanowski <kjahds@kjahds.com>
+ # for this test.
+ cat >try.c <<'EOM'
--- /dev/null
+--- a/config_h.SH
++++ b/config_h.SH
+@@ -52,6 +52,19 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#und
+ #ifndef _config_h_
+ #define _config_h_
+
++#if defined(USE_CROSS_COMPILE) && !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
++# include <endian.h>
++# if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN)
++# if (__BYTE_ORDER == __LITTLE_ENDIAN)
++# define __LITTLE_ENDIAN__
++# elif (__BYTE_ORDER == __BIG_ENDIAN)
++# define __BIG_ENDIAN__
++# else
++# error Unknown endianness
++# endif
++# endif
++#endif
++
+ /* LOC_SED:
+ * This symbol holds the complete pathname to the sed program.
+ */
+++ /dev/null
---- a/pp.c
-+++ b/pp.c
-@@ -43,7 +43,7 @@ extern Pid_t getpid (void);
- * Some BSDs and Cygwin default to POSIX math instead of IEEE.
- * This switches them over to IEEE.
- */
--#if defined(LIBM_LIB_VERSION)
-+#if defined(LIBM_LIB_VERSION) && (defined(__GLIBC__) || defined(__UCLIBC__))
- _LIB_VERSION_TYPE _LIB_VERSION = _IEEE_;
- #endif
-
+++ /dev/null
---- a/config_h.SH
-+++ b/config_h.SH
-@@ -52,6 +52,19 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#und
- #ifndef _config_h_
- #define _config_h_
-
-+#if defined(USE_CROSS_COMPILE) && !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
-+# include <endian.h>
-+# if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN)
-+# if (__BYTE_ORDER == __LITTLE_ENDIAN)
-+# define __LITTLE_ENDIAN__
-+# elif (__BYTE_ORDER == __BIG_ENDIAN)
-+# define __BIG_ENDIAN__
-+# else
-+# error Unknown endianness
-+# endif
-+# endif
-+#endif
-+
- /* LOC_SED:
- * This symbol holds the complete pathname to the sed program.
- */
--- /dev/null
+--- a/Makefile.SH
++++ b/Makefile.SH
+@@ -315,22 +315,11 @@ MINIPERL = \$(LDLIBPTH) ./miniperl\$(EXE
+
+ !GROK!THIS!
+
+-case "$usecrosscompile$perl" in
+-define?*)
+- $spitshell >>$Makefile <<!GROK!THIS!
+-# Macros to invoke a copy of our fully operational perl during the build.
+-PERL_EXE = perl\$(EXE_EXT)
+-RUN_PERL = \$(LDLIBPTH) \$(RUN) $perl\$(EXE_EXT)
+-!GROK!THIS!
+- ;;
+-*)
+- $spitshell >>$Makefile <<!GROK!THIS!
++$spitshell >>$Makefile <<!GROK!THIS!
+ # Macros to invoke a copy of our fully operational perl during the build.
+ PERL_EXE = perl\$(EXE_EXT)
+-RUN_PERL = \$(LDLIBPTH) \$(RUN) ./perl\$(EXE_EXT) -Ilib
++RUN_PERL = \$(LDLIBPTH) \$(RUN) ./miniperl\$(EXE_EXT) -Ilib
+ !GROK!THIS!
+- ;;
+-esac
+
+ $spitshell >>$Makefile <<!GROK!THIS!
+ # Macros to run our tests
+++ /dev/null
---- a/hints/linux.sh
-+++ b/hints/linux.sh
-@@ -204,6 +204,24 @@ case "$libc" in
- ;;
- esac
-
-+# Ubuntu 11.04 (and later, presumably) doesn't keep most libraries
-+# (such as -lm) in /lib or /usr/lib. So we have to ask gcc to tell us
-+# where to look. We don't want gcc's own libraries, however, so we
-+# filter those out.
-+# This could be conditional on Unbuntu, but other distributions may
-+# follow suit, and this scheme seems to work even on rather old gcc's.
-+# This unconditionally uses gcc because even if the user is using another
-+# compiler, we still need to find the math library and friends, and I don't
-+# know how other compilers will cope with that situation.
-+# Still, as an escape hatch, allow Configure command line overrides to
-+# plibpth to bypass this check.
-+case "$plibpth" in
-+'') plibpth=`gcc -print-search-dirs | grep libraries |
-+ cut -f2- -d= | tr ':' $trnl | grep -v 'gcc'`
-+ plibpth="$plibpth" # Collapse all entries on one line
-+ ;;
-+esac
-+
- # Are we using ELF? Thanks to Kenneth Albanowski <kjahds@kjahds.com>
- # for this test.
- cat >try.c <<'EOM'
--- /dev/null
+--- /dev/null
++++ b/relink/Makefile.PL
+@@ -0,0 +1,3 @@
++use ExtUtils::MakeMaker;
++
++WriteMakefile(NAME => "relink");
+++ /dev/null
---- a/Makefile.SH
-+++ b/Makefile.SH
-@@ -315,22 +315,11 @@ MINIPERL = \$(LDLIBPTH) ./miniperl\$(EXE
-
- !GROK!THIS!
-
--case "$usecrosscompile$perl" in
--define?*)
-- $spitshell >>$Makefile <<!GROK!THIS!
--# Macros to invoke a copy of our fully operational perl during the build.
--PERL_EXE = perl\$(EXE_EXT)
--RUN_PERL = \$(LDLIBPTH) \$(RUN) $perl\$(EXE_EXT)
--!GROK!THIS!
-- ;;
--*)
-- $spitshell >>$Makefile <<!GROK!THIS!
-+$spitshell >>$Makefile <<!GROK!THIS!
- # Macros to invoke a copy of our fully operational perl during the build.
- PERL_EXE = perl\$(EXE_EXT)
--RUN_PERL = \$(LDLIBPTH) \$(RUN) ./perl\$(EXE_EXT) -Ilib
-+RUN_PERL = \$(LDLIBPTH) \$(RUN) ./miniperl\$(EXE_EXT) -Ilib
- !GROK!THIS!
-- ;;
--esac
-
- $spitshell >>$Makefile <<!GROK!THIS!
- # Macros to run our tests
+++ /dev/null
---- /dev/null
-+++ b/relink/Makefile.PL
-@@ -0,0 +1,3 @@
-+use ExtUtils::MakeMaker;
-+
-+WriteMakefile(NAME => "relink");
+++ /dev/null
-Index: perl-5.22.0/t/op/tie_fetch_count.t
-===================================================================
---- perl-5.22.0.orig/t/op/tie_fetch_count.t
-+++ perl-5.22.0/t/op/tie_fetch_count.t
-@@ -250,12 +250,17 @@ for ([chdir=>''],[chmod=>'0,'],[chown=>'
- check_count "$op $args\\\$tied_glob$postargs";
- }
-
--$dummy = crypt $var,0; check_count 'crypt $tied, ...';
--$dummy = crypt 0,$var; check_count 'crypt ..., $tied';
--$var = substr(chr 256,0,0);
--$dummy = crypt $var,0; check_count 'crypt $tied_utf8, ...';
--$var = substr(chr 256,0,0);
--$dummy = crypt 0,$var; check_count 'crypt ..., $tied_utf8';
-+SKIP: {
-+ use Config;
-+ skip "crypt() is unavailable", 4, unless defined $Config{'d_crypt'};
-+
-+ $dummy = crypt $var,0; check_count 'crypt $tied, ...';
-+ $dummy = crypt 0,$var; check_count 'crypt ..., $tied';
-+ $var = substr(chr 256,0,0);
-+ $dummy = crypt $var,0; check_count 'crypt $tied_utf8, ...';
-+ $var = substr(chr 256,0,0);
-+ $dummy = crypt 0,$var; check_count 'crypt ..., $tied_utf8';
-+}
-
- SKIP:
- {
+++ /dev/null
-perl: Skip $0 test on busybox
-
-This test requires a ps which provides the -f option, as well as suitable output.
-We can't provide either with busybox. Just skip it for now.
-
-Signed-off-by: Marcel Denia <naoir@gmx.net>
-
-Index: perl-5.22.0/dist/threads/t/join.t
-===================================================================
---- perl-5.22.0.orig/dist/threads/t/join.t
-+++ perl-5.22.0/dist/threads/t/join.t
-@@ -110,36 +110,41 @@ sub skip {
-
- # We parse ps output so this is OS-dependent.
- if ($^O eq 'linux') {
-- # First modify $0 in a subthread.
-- #print "# mainthread: \$0 = $0\n";
-- threads->create(sub{ #print "# subthread: \$0 = $0\n";
-- $0 = "foobar";
-- #print "# subthread: \$0 = $0\n"
-- })->join;
-- #print "# mainthread: \$0 = $0\n";
-- #print "# pid = $$\n";
-- if (open PS, "ps -f |") { # Note: must work in (all) systems.
-- my ($sawpid, $sawexe);
-- while (<PS>) {
-- chomp;
-- #print "# [$_]\n";
-- if (/^\s*\S+\s+$$\s/) {
-- $sawpid++;
-- if (/\sfoobar\s*$/) { # Linux 2.2 leaves extra trailing spaces.
-- $sawexe++;
-- }
-- last;
-- }
-- }
-- close PS or die;
-- if ($sawpid) {
-- ok($sawpid && $sawexe, 'altering $0 is effective');
-- } else {
-- skip("\$0 check: did not see pid $$ in 'ps -f |'");
-- }
-- } else {
-- skip("\$0 check: opening 'ps -f |' failed: $!");
-- }
-+ if (readlink('/bin/ps') ne 'busybox') {
-+ # First modify $0 in a subthread.
-+ #print "# mainthread: \$0 = $0\n";
-+ threads->create(sub{ #print "# subthread: \$0 = $0\n";
-+ $0 = "foobar";
-+ #print "# subthread: \$0 = $0\n"
-+ })->join;
-+ #print "# mainthread: \$0 = $0\n";
-+ #print "# pid = $$\n";
-+ if (open PS, "ps -f |") { # Note: must work in (all) systems.
-+ my ($sawpid, $sawexe);
-+ while (<PS>) {
-+ chomp;
-+ #print "# [$_]\n";
-+ if (/^\s*\S+\s+$$\s/) {
-+ $sawpid++;
-+ if (/\sfoobar\s*$/) { # Linux 2.2 leaves extra trailing spaces.
-+ $sawexe++;
-+ }
-+ last;
-+ }
-+ }
-+ close PS or die;
-+ if ($sawpid) {
-+ ok($sawpid && $sawexe, 'altering $0 is effective');
-+ } else {
-+ skip("\$0 check: did not see pid $$ in 'ps -f |'");
-+ }
-+ } else {
-+ skip("\$0 check: opening 'ps -f |' failed: $!");
-+ }
-+ }
-+ else {
-+ skip("\$0 check: incompatible with busybox");
-+ }
- } else {
- skip("\$0 check: only on Linux");
- }
--- /dev/null
+Index: perl-5.22.0/t/op/tie_fetch_count.t
+===================================================================
+--- perl-5.22.0.orig/t/op/tie_fetch_count.t
++++ perl-5.22.0/t/op/tie_fetch_count.t
+@@ -250,12 +250,17 @@ for ([chdir=>''],[chmod=>'0,'],[chown=>'
+ check_count "$op $args\\\$tied_glob$postargs";
+ }
+
+-$dummy = crypt $var,0; check_count 'crypt $tied, ...';
+-$dummy = crypt 0,$var; check_count 'crypt ..., $tied';
+-$var = substr(chr 256,0,0);
+-$dummy = crypt $var,0; check_count 'crypt $tied_utf8, ...';
+-$var = substr(chr 256,0,0);
+-$dummy = crypt 0,$var; check_count 'crypt ..., $tied_utf8';
++SKIP: {
++ use Config;
++ skip "crypt() is unavailable", 4, unless defined $Config{'d_crypt'};
++
++ $dummy = crypt $var,0; check_count 'crypt $tied, ...';
++ $dummy = crypt 0,$var; check_count 'crypt ..., $tied';
++ $var = substr(chr 256,0,0);
++ $dummy = crypt $var,0; check_count 'crypt $tied_utf8, ...';
++ $var = substr(chr 256,0,0);
++ $dummy = crypt 0,$var; check_count 'crypt ..., $tied_utf8';
++}
+
+ SKIP:
+ {
--- /dev/null
+perl: Skip $0 test on busybox
+
+This test requires a ps which provides the -f option, as well as suitable output.
+We can't provide either with busybox. Just skip it for now.
+
+Signed-off-by: Marcel Denia <naoir@gmx.net>
+
+Index: perl-5.22.0/dist/threads/t/join.t
+===================================================================
+--- perl-5.22.0.orig/dist/threads/t/join.t
++++ perl-5.22.0/dist/threads/t/join.t
+@@ -110,36 +110,41 @@ sub skip {
+
+ # We parse ps output so this is OS-dependent.
+ if ($^O eq 'linux') {
+- # First modify $0 in a subthread.
+- #print "# mainthread: \$0 = $0\n";
+- threads->create(sub{ #print "# subthread: \$0 = $0\n";
+- $0 = "foobar";
+- #print "# subthread: \$0 = $0\n"
+- })->join;
+- #print "# mainthread: \$0 = $0\n";
+- #print "# pid = $$\n";
+- if (open PS, "ps -f |") { # Note: must work in (all) systems.
+- my ($sawpid, $sawexe);
+- while (<PS>) {
+- chomp;
+- #print "# [$_]\n";
+- if (/^\s*\S+\s+$$\s/) {
+- $sawpid++;
+- if (/\sfoobar\s*$/) { # Linux 2.2 leaves extra trailing spaces.
+- $sawexe++;
+- }
+- last;
+- }
+- }
+- close PS or die;
+- if ($sawpid) {
+- ok($sawpid && $sawexe, 'altering $0 is effective');
+- } else {
+- skip("\$0 check: did not see pid $$ in 'ps -f |'");
+- }
+- } else {
+- skip("\$0 check: opening 'ps -f |' failed: $!");
+- }
++ if (readlink('/bin/ps') ne 'busybox') {
++ # First modify $0 in a subthread.
++ #print "# mainthread: \$0 = $0\n";
++ threads->create(sub{ #print "# subthread: \$0 = $0\n";
++ $0 = "foobar";
++ #print "# subthread: \$0 = $0\n"
++ })->join;
++ #print "# mainthread: \$0 = $0\n";
++ #print "# pid = $$\n";
++ if (open PS, "ps -f |") { # Note: must work in (all) systems.
++ my ($sawpid, $sawexe);
++ while (<PS>) {
++ chomp;
++ #print "# [$_]\n";
++ if (/^\s*\S+\s+$$\s/) {
++ $sawpid++;
++ if (/\sfoobar\s*$/) { # Linux 2.2 leaves extra trailing spaces.
++ $sawexe++;
++ }
++ last;
++ }
++ }
++ close PS or die;
++ if ($sawpid) {
++ ok($sawpid && $sawexe, 'altering $0 is effective');
++ } else {
++ skip("\$0 check: did not see pid $$ in 'ps -f |'");
++ }
++ } else {
++ skip("\$0 check: opening 'ps -f |' failed: $!");
++ }
++ }
++ else {
++ skip("\$0 check: incompatible with busybox");
++ }
+ } else {
+ skip("\$0 check: only on Linux");
+ }