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