| @@ -1,135 +1,137 @@ | | | @@ -1,135 +1,137 @@ |
1 | $NetBSD: patch-ab,v 1.5 2013/10/27 20:41:49 joerg Exp $ | | 1 | $NetBSD: patch-ab,v 1.6 2015/01/06 17:45:46 wiz Exp $ |
2 | | | 2 | |
3 | Caution: the extra cpp checking (the three hunks containing "Should be | | 3 | Caution: the extra cpp checking (the three hunks containing "Should be |
4 | one line") is manually hacked and not reflected in configure.in; do | | 4 | one line") is manually hacked and not reflected in configure.in; do |
5 | not regenerate configure with autoconf without merging it. This | | 5 | not regenerate configure with autoconf without merging it. This |
6 | checking is required because somewhere between gcc 4.1 and 4.5 cpp | | 6 | checking is required because somewhere between gcc 4.1 and 4.5 cpp |
7 | started doing regrettable things with backslash-escaped newlines. | | 7 | started doing regrettable things with backslash-escaped newlines. |
8 | | | 8 | |
9 | * Fix build on NetBSD 6.99.23, gcc -E -traditional-cpp with native X | | 9 | * Fix build on NetBSD 6.99.23, gcc -E -traditional-cpp with native X |
10 | results syntax error. Use -traditional-cpp for Makefile generation only. | | 10 | results syntax error. Use -traditional-cpp for Makefile generation only. |
11 | | | 11 | |
12 | --- configure.orig 2003-03-18 14:19:12.000000000 +0000 | | 12 | --- configure.orig 2003-03-18 09:19:12.000000000 -0500 |
13 | +++ configure | | 13 | +++ configure 2015-01-05 04:09:09.000000000 -0500 |
14 | @@ -822,9 +824,17 @@ case "${canonical}" in | | 14 | @@ -821,10 +821,18 @@ case "${canonical}" in |
| | | 15 | powerpc-*-netbsd*) machine=macppc ;; |
15 | sparc*-*-netbsd*) machine=sparc ;; | | 16 | sparc*-*-netbsd*) machine=sparc ;; |
16 | vax-*-netbsd*) machine=vax ;; | | 17 | vax-*-netbsd*) machine=vax ;; |
17 | arm-*-netbsd*) machine=arm ;; | | 18 | - arm-*-netbsd*) machine=arm ;; |
| | | 19 | + arm*-*-netbsd*) machine=arm ;; |
18 | + x86_64-*-netbsd*) machine=amd64 ;; | | 20 | + x86_64-*-netbsd*) machine=amd64 ;; |
19 | + hppa-*-netbsd*) machine=hp800 ;; | | 21 | + hppa-*-netbsd*) machine=hp800 ;; |
20 | + shle-*-netbsd*) machine=sh3el ;; | | 22 | + shle-*-netbsd*) machine=sh3el ;; |
21 | esac | | 23 | esac |
22 | ;; | | 24 | ;; |
23 | | | 25 | |
24 | + ## Darwin / Mac OS X | | 26 | + ## Darwin / Mac OS X |
25 | + powerpc-apple-darwin* ) | | 27 | + powerpc-apple-darwin* ) |
26 | + machine=powermac opsys=darwin ;; | | 28 | + machine=powermac opsys=darwin ;; |
27 | + i386-apple-darwin* ) | | 29 | + i386-apple-darwin* ) |
28 | + machine=intel386 opsys=darwin ;; | | 30 | + machine=intel386 opsys=darwin ;; |
29 | ## OpenBSD ports | | 31 | ## OpenBSD ports |
30 | *-*-openbsd* ) | | 32 | *-*-openbsd* ) |
31 | opsys=openbsd | | 33 | opsys=openbsd |
32 | @@ -909,6 +919,10 @@ case "${canonical}" in | | 34 | @@ -909,6 +917,10 @@ case "${canonical}" in |
33 | machine=macppc opsys=gnu-linux | | 35 | machine=macppc opsys=gnu-linux |
34 | ;; | | 36 | ;; |
35 | | | 37 | |
36 | + x86_64-*-linux* ) | | 38 | + x86_64-*-linux* ) |
37 | + machine=amd64 opsys=gnu-linux | | 39 | + machine=amd64 opsys=gnu-linux |
38 | + ;; | | 40 | + ;; |
39 | + | | 41 | + |
40 | ## Altos 3068 | | 42 | ## Altos 3068 |
41 | m68*-altos-sysv* ) | | 43 | m68*-altos-sysv* ) |
42 | machine=altos opsys=usg5-2 | | 44 | machine=altos opsys=usg5-2 |
43 | @@ -1659,6 +1673,7 @@ case "${canonical}" in | | 45 | @@ -1659,6 +1671,7 @@ case "${canonical}" in |
44 | *-sysv4.2uw* ) opsys=unixware; NON_GNU_CPP=/lib/cpp ;; | | 46 | *-sysv4.2uw* ) opsys=unixware; NON_GNU_CPP=/lib/cpp ;; |
45 | *-386bsd* ) opsys=386bsd ;; | | 47 | *-386bsd* ) opsys=386bsd ;; |
46 | *-freebsd* ) opsys=freebsd ;; | | 48 | *-freebsd* ) opsys=freebsd ;; |
47 | + *-dragonfly* ) opsys=dragonfly ;; | | 49 | + *-dragonfly* ) opsys=dragonfly ;; |
48 | *-nextstep* ) opsys=nextstep ;; | | 50 | *-nextstep* ) opsys=nextstep ;; |
49 | ## Otherwise, we'll fall through to the generic opsys code at the bottom. | | 51 | ## Otherwise, we'll fall through to the generic opsys code at the bottom. |
50 | esac | | 52 | esac |
51 | @@ -2052,15 +2067,20 @@ else | | 53 | @@ -2052,15 +2065,20 @@ else |
52 | CPP="${CC-cc} -E" | | 54 | CPP="${CC-cc} -E" |
53 | # On the NeXT, cc -E runs the code through the compiler's parser, | | 55 | # On the NeXT, cc -E runs the code through the compiler's parser, |
54 | # not just through cpp. | | 56 | # not just through cpp. |
55 | + # And, gcc 4.5? and up does not preserve escaped newlines, which is | | 57 | + # And, gcc 4.5? and up does not preserve escaped newlines, which is |
56 | + # fatal for preprocessing makefiles. | | 58 | + # fatal for preprocessing makefiles. |
57 | cat > conftest.$ac_ext <<EOF | | 59 | cat > conftest.$ac_ext <<EOF |
58 | #line 2057 "configure" | | 60 | #line 2057 "configure" |
59 | #include "confdefs.h" | | 61 | #include "confdefs.h" |
60 | #include <assert.h> | | 62 | #include <assert.h> |
61 | Syntax Error | | 63 | Syntax Error |
62 | +Should be one line. | | 64 | +Should be one line. |
63 | EOF | | 65 | EOF |
64 | -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | | 66 | -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" |
65 | +ac_try="$ac_cpp conftest.$ac_ext >conftest2.out 2>conftest.out" | | 67 | +ac_try="$ac_cpp conftest.$ac_ext >conftest2.out 2>conftest.out" |
66 | { (eval echo configure:2063: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | | 68 | { (eval echo configure:2063: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } |
67 | -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | | 69 | -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` |
68 | +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"; \ | | 70 | +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"; \ |
69 | + grep -L "Should *be one line" conftest2.out \ | | 71 | + grep -L "Should *be one line" conftest2.out \ |
70 | + ` | | 72 | + ` |
71 | if test -z "$ac_err"; then | | 73 | if test -z "$ac_err"; then |
72 | : | | 74 | : |
73 | else | | 75 | else |
74 | @@ -2068,16 +2088,19 @@ else | | 76 | @@ -2068,16 +2086,19 @@ else |
75 | echo "configure: failed program was:" >&5 | | 77 | echo "configure: failed program was:" >&5 |
76 | cat conftest.$ac_ext >&5 | | 78 | cat conftest.$ac_ext >&5 |
77 | rm -rf conftest* | | 79 | rm -rf conftest* |
78 | - CPP="${CC-cc} -E -traditional-cpp" | | 80 | - CPP="${CC-cc} -E -traditional-cpp" |
79 | + CPP="${CC-cc} -E" | | 81 | + CPP="${CC-cc} -E" |
80 | cat > conftest.$ac_ext <<EOF | | 82 | cat > conftest.$ac_ext <<EOF |
81 | #line 2074 "configure" | | 83 | #line 2074 "configure" |
82 | #include "confdefs.h" | | 84 | #include "confdefs.h" |
83 | #include <assert.h> | | 85 | #include <assert.h> |
84 | Syntax Error | | 86 | Syntax Error |
85 | +Should be one line. | | 87 | +Should be one line. |
86 | EOF | | 88 | EOF |
87 | -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | | 89 | -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" |
88 | +ac_try="$ac_cpp conftest.$ac_ext >conftest2.out 2>conftest.out" | | 90 | +ac_try="$ac_cpp conftest.$ac_ext >conftest2.out 2>conftest.out" |
89 | { (eval echo configure:2080: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | | 91 | { (eval echo configure:2080: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } |
90 | -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | | 92 | -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` |
91 | +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"; \ | | 93 | +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"; \ |
92 | + grep -L "Should *be one line" conftest2.out \ | | 94 | + grep -L "Should *be one line" conftest2.out \ |
93 | + ` | | 95 | + ` |
94 | if test -z "$ac_err"; then | | 96 | if test -z "$ac_err"; then |
95 | : | | 97 | : |
96 | else | | 98 | else |
97 | @@ -2091,10 +2114,13 @@ else | | 99 | @@ -2091,10 +2112,13 @@ else |
98 | #include "confdefs.h" | | 100 | #include "confdefs.h" |
99 | #include <assert.h> | | 101 | #include <assert.h> |
100 | Syntax Error | | 102 | Syntax Error |
101 | +Should be one line. | | 103 | +Should be one line. |
102 | EOF | | 104 | EOF |
103 | -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | | 105 | -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" |
104 | +ac_try="$ac_cpp conftest.$ac_ext >conftest2.out 2>conftest.out" | | 106 | +ac_try="$ac_cpp conftest.$ac_ext >conftest2.out 2>conftest.out" |
105 | { (eval echo configure:2097: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | | 107 | { (eval echo configure:2097: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } |
106 | -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | | 108 | -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` |
107 | +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"; \ | | 109 | +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"; \ |
108 | + grep -L "Should *be one line" conftest2.out \ | | 110 | + grep -L "Should *be one line" conftest2.out \ |
109 | + ` | | 111 | + ` |
110 | if test -z "$ac_err"; then | | 112 | if test -z "$ac_err"; then |
111 | : | | 113 | : |
112 | else | | 114 | else |
113 | @@ -2416,7 +2442,7 @@ ac_link="$ac_link $ld_switch_machine $ld | | 115 | @@ -2416,7 +2440,7 @@ ac_link="$ac_link $ld_switch_machine $ld |
114 | if test x"${OVERRIDE_CPPFLAGS}" != x; then | | 116 | if test x"${OVERRIDE_CPPFLAGS}" != x; then |
115 | CPPFLAGS="${OVERRIDE_CPPFLAGS}" | | 117 | CPPFLAGS="${OVERRIDE_CPPFLAGS}" |
116 | else | | 118 | else |
117 | - CPPFLAGS="$c_switch_system $c_switch_machine $CPPFLAGS" | | 119 | - CPPFLAGS="$c_switch_system $c_switch_machine $CPPFLAGS" |
118 | + CPPFLAGS="`echo $c_switch_system $c_switch_machine $CPPFLAGS | sed 's,-L[^ ]*,,g'`" | | 120 | + CPPFLAGS="`echo $c_switch_system $c_switch_machine $CPPFLAGS | sed 's,-L[^ ]*,,g'`" |
119 | fi | | 121 | fi |
120 | | | 122 | |
121 | | | 123 | |
122 | @@ -5583,24 +5619,24 @@ if eval "test \"`echo '$ac_cv_header_'$a | | 124 | @@ -5583,24 +5607,24 @@ if eval "test \"`echo '$ac_cv_header_'$a |
123 | echo "$ac_t""yes" 1>&6 | | 125 | echo "$ac_t""yes" 1>&6 |
124 | # EGifPutExtensionLast only exists from version libungif-4.1.0b1. | | 126 | # EGifPutExtensionLast only exists from version libungif-4.1.0b1. |
125 | # Earlier versions can crash Emacs. | | 127 | # Earlier versions can crash Emacs. |
126 | - echo $ac_n "checking for EGifPutExtensionLast in -lungif""... $ac_c" 1>&6 | | 128 | - echo $ac_n "checking for EGifPutExtensionLast in -lungif""... $ac_c" 1>&6 |
127 | -echo "configure:5588: checking for EGifPutExtensionLast in -lungif" >&5 | | 129 | -echo "configure:5588: checking for EGifPutExtensionLast in -lungif" >&5 |
128 | -ac_lib_var=`echo ungif'_'EGifPutExtensionLast | sed 'y%./+-%__p_%'` | | 130 | -ac_lib_var=`echo ungif'_'EGifPutExtensionLast | sed 'y%./+-%__p_%'` |
129 | + echo $ac_n "checking for EGifPutExtensionTrailer in -lgif""... $ac_c" 1>&6 | | 131 | + echo $ac_n "checking for EGifPutExtensionTrailer in -lgif""... $ac_c" 1>&6 |
130 | +echo "configure:5588: checking for EGifPutExtensionTrailer in -lgif" >&5 | | 132 | +echo "configure:5588: checking for EGifPutExtensionTrailer in -lgif" >&5 |
131 | +ac_lib_var=`echo ungif'_'EGifPutExtensionTrailer | sed 'y%./+-%__p_%'` | | 133 | +ac_lib_var=`echo ungif'_'EGifPutExtensionTrailer | sed 'y%./+-%__p_%'` |
132 | if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then | | 134 | if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then |
133 | echo $ac_n "(cached) $ac_c" 1>&6 | | 135 | echo $ac_n "(cached) $ac_c" 1>&6 |
134 | else | | 136 | else |
135 | ac_save_LIBS="$LIBS" | | 137 | ac_save_LIBS="$LIBS" |
| @@ -140,54 +142,54 @@ started doing regrettable things with ba | | | @@ -140,54 +142,54 @@ started doing regrettable things with ba |
140 | #include "confdefs.h" | | 142 | #include "confdefs.h" |
141 | /* Override any gcc2 internal prototype to avoid an error. */ | | 143 | /* Override any gcc2 internal prototype to avoid an error. */ |
142 | /* We use char because int might match the return type of a gcc2 | | 144 | /* We use char because int might match the return type of a gcc2 |
143 | builtin and then its argument prototype would still apply. */ | | 145 | builtin and then its argument prototype would still apply. */ |
144 | -char EGifPutExtensionLast(); | | 146 | -char EGifPutExtensionLast(); |
145 | +char EGifPutExtensionTrailer(); | | 147 | +char EGifPutExtensionTrailer(); |
146 | | | 148 | |
147 | int main() { | | 149 | int main() { |
148 | -EGifPutExtensionLast() | | 150 | -EGifPutExtensionLast() |
149 | +EGifPutExtensionTrailer() | | 151 | +EGifPutExtensionTrailer() |
150 | ; return 0; } | | 152 | ; return 0; } |
151 | EOF | | 153 | EOF |
152 | if { (eval echo configure:5607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then | | 154 | if { (eval echo configure:5607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then |
153 | @@ -9124,6 +9160,22 @@ EOF | | 155 | @@ -9124,6 +9148,22 @@ EOF |
154 | fi | | 156 | fi |
155 | | | 157 | |
156 | | | 158 | |
157 | +# NETBSD: NetBSD's newer run-time linker fix. | | 159 | +# NETBSD: NetBSD's newer run-time linker fix. |
158 | +if test $opsys = netbsd; then | | 160 | +if test $opsys = netbsd; then |
159 | + if test -f /usr/lib/crti.o; then | | 161 | + if test -f /usr/lib/crti.o; then |
160 | + cat >> confdefs.h <<\EOF | | 162 | + cat >> confdefs.h <<\EOF |
161 | +#define HAVE_NETBSD_CRTI 1 | | 163 | +#define HAVE_NETBSD_CRTI 1 |
162 | +EOF | | 164 | +EOF |
163 | + | | 165 | + |
164 | + fi | | 166 | + fi |
165 | + if test -f /usr/lib/crtn.o; then | | 167 | + if test -f /usr/lib/crtn.o; then |
166 | + cat >> confdefs.h <<\EOF | | 168 | + cat >> confdefs.h <<\EOF |
167 | +#define HAVE_NETBSD_CRTN 1 | | 169 | +#define HAVE_NETBSD_CRTN 1 |
168 | +EOF | | 170 | +EOF |
169 | + | | 171 | + |
170 | + fi | | 172 | + fi |
171 | +fi | | 173 | +fi |
172 | + | | 174 | + |
173 | # Set up the CFLAGS for real compilation, so we can substitute it. | | 175 | # Set up the CFLAGS for real compilation, so we can substitute it. |
174 | CFLAGS="$REAL_CFLAGS" | | 176 | CFLAGS="$REAL_CFLAGS" |
175 | CPPFLAGS="$REAL_CPPFLAGS" | | 177 | CPPFLAGS="$REAL_CPPFLAGS" |
176 | @@ -9735,7 +9793,7 @@ echo creating lib-src/Makefile | | 178 | @@ -9735,7 +9777,7 @@ echo creating lib-src/Makefile |
177 | sed -e '1,/start of cpp stuff/d'\ | | 179 | sed -e '1,/start of cpp stuff/d'\ |
178 | -e 's,/\*\*/#\(.*\)$,/* \1 */,' \ | | 180 | -e 's,/\*\*/#\(.*\)$,/* \1 */,' \ |
179 | < Makefile.c > junk.c | | 181 | < Makefile.c > junk.c |
180 | - $CPP $undefs -I. -I$top_srcdir/src $CPPFLAGS junk.c | \ | | 182 | - $CPP $undefs -I. -I$top_srcdir/src $CPPFLAGS junk.c | \ |
181 | + $TRADCPP $undefs -I. -I$top_srcdir/src $CPPFLAGS junk.c | \ | | 183 | + $TRADCPP $undefs -I. -I$top_srcdir/src $CPPFLAGS junk.c | \ |
182 | sed -e 's/^ / /' -e '/^#/d' -e '/^[ ]*$/d' > junk2.c | | 184 | sed -e 's/^ / /' -e '/^#/d' -e '/^[ ]*$/d' > junk2.c |
183 | cat junk1.c junk2.c > Makefile.new | | 185 | cat junk1.c junk2.c > Makefile.new |
184 | rm -f junk.c junk1.c junk2.c | | 186 | rm -f junk.c junk1.c junk2.c |
185 | @@ -9751,7 +9809,7 @@ echo creating src/Makefile | | 187 | @@ -9751,7 +9793,7 @@ echo creating src/Makefile |
186 | sed -e '1,/start of cpp stuff/d'\ | | 188 | sed -e '1,/start of cpp stuff/d'\ |
187 | -e 's,/\*\*/#\(.*\)$,/* \1 */,' \ | | 189 | -e 's,/\*\*/#\(.*\)$,/* \1 */,' \ |
188 | < Makefile.c > junk.c | | 190 | < Makefile.c > junk.c |
189 | - $CPP $undefs -I. -I$top_srcdir/src $CPPFLAGS junk.c | \ | | 191 | - $CPP $undefs -I. -I$top_srcdir/src $CPPFLAGS junk.c | \ |
190 | + $TRADCPP $undefs -I. -I$top_srcdir/src $CPPFLAGS junk.c | \ | | 192 | + $TRADCPP $undefs -I. -I$top_srcdir/src $CPPFLAGS junk.c | \ |
191 | sed -e 's/^ / /' -e '/^#/d' -e '/^[ ]*$/d' > junk2.c | | 193 | sed -e 's/^ / /' -e '/^#/d' -e '/^[ ]*$/d' > junk2.c |
192 | cat junk1.c junk2.c > Makefile.new | | 194 | cat junk1.c junk2.c > Makefile.new |
193 | rm -f junk.c junk1.c junk2.c | | 195 | rm -f junk.c junk1.c junk2.c |