Skip to content

Commit a12be2a

Browse files
committed
Backport of Configure patch for 5.16.3
This is necessary for h2ph to work. The patch comes directly from the main perl branch without any modifications.
1 parent 94595e6 commit a12be2a

File tree

4 files changed

+106
-0
lines changed

4 files changed

+106
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
From 6f87f404fa51739971a4068da1f11443024f3fc4 Mon Sep 17 00:00:00 2001
2+
From: Andy Dougherty <[email protected]>
3+
Date: Wed, 6 Jun 2012 11:12:58 -0400
4+
Subject: [perl #113024] Configure: Avoid Cppsym warnings for extra tokens
5+
[perl #113024]
6+
7+
The cppsymbols can include macros such as __INT16_C(c), which can't
8+
be tested with a simple #ifdef. This patch strips off the opening
9+
parenthesis and everything following it. These macros were generated
10+
by cpp -dM.
11+
12+
Also ensure Cppsym.true list is sorted for later input to comm.
13+
(I noticed this while testing this change on Solaris.)
14+
---
15+
Configure | 5 +++--
16+
1 file changed, 3 insertions(+), 2 deletions(-)
17+
18+
diff --git a/Configure b/Configure
19+
index a780b81..3ae16ca 100755
20+
--- a/Configure
21+
+++ b/Configure
22+
@@ -21936,15 +21936,16 @@ $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $r
23+
EOSH
24+
chmod +x Cppsym.try
25+
$eunicefix Cppsym.try
26+
-./Cppsym < Cppsym.know > Cppsym.true
27+
+./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
28+
: Add in any linux cpp "predefined macros":
29+
case "$osname::$gccversion" in
30+
*linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
31+
tHdrH=_tmpHdr
32+
rm -f $tHdrH'.h' $tHdrH
33+
touch $tHdrH'.h'
34+
+ # Filter out macro arguments, such as Linux's __INT8_C(c)
35+
if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
36+
- sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
37+
+ sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
38+
if [ -s $tHdrH'_cppsym.real' ]; then
39+
cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
40+
fi
41+
--
42+
2.1.4
43+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This should be auto-generated; for now, it's not,
2+
# simply because it should be generated before the build,
3+
# which means having the appropriate version's patchlevel.h
4+
# available, which I don't want to bake into the fetch just
5+
# yet.
6+
7+
--- a/patchlevel.h
8+
+++ b/patchlevel.h
9+
@@ -135,0 +136 @@
10+
+ ,"Backport of perl5 git 6f87f404fa51739971a4068da1f11443024f3fc4"
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
From 6f87f404fa51739971a4068da1f11443024f3fc4 Mon Sep 17 00:00:00 2001
2+
From: Andy Dougherty <[email protected]>
3+
Date: Wed, 6 Jun 2012 11:12:58 -0400
4+
Subject: [perl #113024] Configure: Avoid Cppsym warnings for extra tokens
5+
[perl #113024]
6+
7+
The cppsymbols can include macros such as __INT16_C(c), which can't
8+
be tested with a simple #ifdef. This patch strips off the opening
9+
parenthesis and everything following it. These macros were generated
10+
by cpp -dM.
11+
12+
Also ensure Cppsym.true list is sorted for later input to comm.
13+
(I noticed this while testing this change on Solaris.)
14+
---
15+
Configure | 5 +++--
16+
1 file changed, 3 insertions(+), 2 deletions(-)
17+
18+
diff --git a/Configure b/Configure
19+
index a780b81..3ae16ca 100755
20+
--- a/Configure
21+
+++ b/Configure
22+
@@ -21936,15 +21936,16 @@ $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $r
23+
EOSH
24+
chmod +x Cppsym.try
25+
$eunicefix Cppsym.try
26+
-./Cppsym < Cppsym.know > Cppsym.true
27+
+./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
28+
: Add in any linux cpp "predefined macros":
29+
case "$osname::$gccversion" in
30+
*linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
31+
tHdrH=_tmpHdr
32+
rm -f $tHdrH'.h' $tHdrH
33+
touch $tHdrH'.h'
34+
+ # Filter out macro arguments, such as Linux's __INT8_C(c)
35+
if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
36+
- sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
37+
+ sed -e 's/#define[\ \ ]*//;s/[\ \ ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
38+
if [ -s $tHdrH'_cppsym.real' ]; then
39+
cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
40+
fi
41+
--
42+
2.1.4
43+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This should be auto-generated; for now, it's not,
2+
# simply because it should be generated before the build,
3+
# which means having the appropriate version's patchlevel.h
4+
# available, which I don't want to bake into the fetch just
5+
# yet.
6+
7+
--- a/patchlevel.h
8+
+++ b/patchlevel.h
9+
@@ -135,0 +136 @@
10+
+ ,"Backport of perl5 git 6f87f404fa51739971a4068da1f11443024f3fc4"

0 commit comments

Comments
 (0)