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