1 --- Configure.orig Fri Aug 1 23:12:26 1997
2 +++ Configure Fri Aug 1 23:20:24 1997
5 echo "I don't know where '$file' is, and my life depends on it." >&4
6 echo "Go find a public domain implementation or fix your PATH setting!" >&4
14 for file in $trylist; do
15 xxx=`./loc $file $file $pth`
17 + if test "X$file" != "X$xxx" ; then
27 -if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
28 +if $cc -o gccvers gccvers.c $ldflags >/dev/null 2>&1; then
29 gccversion=`./gccvers`
31 '') echo "You are not using GNU cc." ;;
32 @@ -3401,6 +3403,12 @@
34 *) dflt="$dflt -l$thislib";;
36 + elif xxx=`./loc $thislib.lib X $libpth`; $test -f "$xxx"; then
37 + echo "Found -l$thislib."
40 + *) dflt="$dflt -l$thislib";;
53 *) for thislib in $libs; do
56 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
58 + elif try=`./loc $thislib$lib_ext X $libpth`; $test -f "$try"; then
60 elif try=`./loc Slib$thislib$lib_ext X $xlibpth`; $test -f "$try"; then
63 @@ -4156,6 +4166,10 @@
65 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
67 +elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
69 + $contains '^fprintf$' libc.list >/dev/null 2>&1; then
72 nm -p $* 2>/dev/null >libc.tmp
73 $grep fprintf libc.tmp > libc.ptf
74 @@ -4166,23 +4180,33 @@
78 - echo "nm didn't seem to work right. Trying ar instead..." >&4
79 + echo "nm didn't seem to work right. Trying $ar instead..." >&4
81 - if ar t $libc > libc.tmp; then
82 - for thisname in $libnames; do
83 - ar t $thisname >>libc.tmp
84 + if test "X$osname" = "Xos2"; then ar_opt=tv ; else ar_opt=t ;fi
85 + if $ar $ar_opt $libc > libc.tmp; then
87 + for thisname in $libnames $libc; do
88 + $ar $ar_opt $thisname >>libc.tmp
89 + if test "X$osname" = "Xos2"; then
90 + # Revision 50 of EMX has bug in $ar:
91 + emximp -o tmp.imp $thisname \
93 + $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
94 + < tmp.imp >>libc.tmp
98 - $sed -e 's/\.o$//' < libc.tmp > libc.list
99 + $sed -e 's/\.o$//' -e 's/^ \+//' < libc.tmp | grep -v "^IMPORT#" > libc.list
102 - echo "ar didn't seem to work right." >&4
103 + echo "$ar didn't seem to work right." >&4
104 echo "Maybe this is a Cray...trying bld instead..." >&4
105 if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list
107 for thisname in $libnames; do
109 $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list
110 - ar t $thisname >>libc.tmp
111 + $ar t $thisname >>libc.tmp
115 @@ -5611,15 +5635,15 @@
117 : check sys/file.h first, no particular reason here
118 if $test `./findhdr sys/file.h` && \
119 - $cc $cppflags -DI_SYS_FILE access.c -o access >/dev/null 2>&1 ; then
120 + $cc $ldflags $cppflags -DI_SYS_FILE access.c -o access >/dev/null 2>&1 ; then
122 echo "<sys/file.h> defines the *_OK access constants." >&4
123 elif $test `./findhdr fcntl.h` && \
124 - $cc $cppflags -DI_FCNTL access.c -o access >/dev/null 2>&1 ; then
125 + $cc $ldflags $cppflags -DI_FCNTL access.c -o access >/dev/null 2>&1 ; then
127 echo "<fcntl.h> defines the *_OK access constants." >&4
128 elif $test `./findhdr unistd.h` && \
129 - $cc $cppflags -DI_UNISTD access.c -o access >/dev/null 2>&1 ; then
130 + $cc $ldflags $cppflags -DI_UNISTD access.c -o access >/dev/null 2>&1 ; then
131 echo "<unistd.h> defines the *_OK access constants." >&4
133 echo "I can't find the four *_OK access constants--I'll use mine." >&4
134 @@ -5913,7 +5937,7 @@
138 -if $cc -o try $ccflags try.c >/dev/null 2>&1; then
139 +if $cc -o try $ccflags try.c $ldflags >/dev/null 2>&1; then
143 @@ -5994,7 +6018,7 @@
147 -if $cc -o try $ccflags try.c >/dev/null 2>&1; then
148 +if $cc -o try $ccflags try.c $ldflags >/dev/null 2>&1; then
152 @@ -6033,7 +6057,7 @@
153 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
156 - if $cc $ccflags vprintf.c -o vprintf >/dev/null 2>&1 && ./vprintf; then
157 + if $cc $ccflags vprintf.c $ldflags -o vprintf >/dev/null 2>&1 && ./vprintf; then
158 echo "Your vsprintf() returns (int)." >&4
161 @@ -6381,7 +6405,7 @@
163 : check sys/file.h first to get FREAD on Sun
164 if $test `./findhdr sys/file.h` && \
165 - $cc $ccflags "-DI_SYS_FILE" -o open3 $ldflags open3.c $libs >/dev/null 2>&1 ; then
166 + $cc $ldflags $ccflags "-DI_SYS_FILE" -o open3 $ldflags open3.c $libs >/dev/null 2>&1 ; then
168 echo "<sys/file.h> defines the O_* constants..." >&4
170 @@ -6392,7 +6416,7 @@
173 elif $test `./findhdr fcntl.h` && \
174 - $cc $ccflags "-DI_FCNTL" -o open3 $ldflags open3.c $libs >/dev/null 2>&1 ; then
175 + $cc $ldflags $ccflags "-DI_FCNTL" -o open3 $ldflags open3.c $libs >/dev/null 2>&1 ; then
177 echo "<fcntl.h> defines the O_* constants..." >&4
179 @@ -6898,7 +6922,7 @@
183 - mallocobj='malloc.o'
184 + mallocobj="malloc$obj_ext"
188 @@ -8156,7 +8180,7 @@
189 printf("%d\n", (char *)&try.bar - (char *)&try.foo);
192 - if $cc $ccflags try.c -o try >/dev/null 2>&1; then
193 + if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1; then
197 @@ -8204,7 +8228,7 @@
201 - if $cc $ccflags try.c -o try >/dev/null 2>&1 && ./try > /dev/null; then
202 + if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1 && ./try > /dev/null; then
205 [1-4][1-4][1-4][1-4]|12345678|87654321)
206 @@ -8711,18 +8735,18 @@
207 $cc $ccflags -c bar1.c >/dev/null 2>&1
208 $cc $ccflags -c bar2.c >/dev/null 2>&1
209 $cc $ccflags -c foo.c >/dev/null 2>&1
210 -ar rc bar$lib_ext bar2.o bar1.o >/dev/null 2>&1
211 +$ar rc bar$lib_ext bar2.o bar1.o >/dev/null 2>&1
212 if $cc $ccflags $ldflags -o foobar foo.o bar$lib_ext $libs > /dev/null 2>&1 &&
213 ./foobar >/dev/null 2>&1; then
214 - echo "ar appears to generate random libraries itself."
215 + echo "$ar appears to generate random libraries itself."
218 -elif ar ts bar$lib_ext >/dev/null 2>&1 &&
219 +elif $ar ts bar$lib_ext >/dev/null 2>&1 &&
220 $cc $ccflags $ldflags -o foobar foo.o bar$lib_ext $libs > /dev/null 2>&1 &&
221 ./foobar >/dev/null 2>&1; then
222 - echo "a table of contents needs to be added with 'ar ts'."
223 + echo "a table of contents needs to be added with '$ar ts'."
230 @@ -8794,7 +8818,7 @@
233 $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone \
234 - try.c -o try >/dev/null 2>&1 ; then
235 + try.c -o try $ldflags >/dev/null 2>&1 ; then
236 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
239 @@ -8863,7 +8887,7 @@
243 -if $cc $ccflags -DTRYBITS fd_set.c -o fd_set >fd_set.out 2>&1 ; then
244 +if $cc $ccflags $ldflags -DTRYBITS fd_set.c -o fd_set >fd_set.out 2>&1 ; then
247 echo "Well, your system knows about the normal fd_set typedef..." >&4
248 @@ -8880,7 +8904,7 @@
250 Hmm, your compiler has some difficulty with fd_set. Checking further...
252 - if $cc $ccflags fd_set.c -o fd_set >fd_set.out 2>&1 ; then
253 + if $cc $ccflags $ldflags fd_set.c -o fd_set >fd_set.out 2>&1 ; then
256 echo "Well, your system has some sort of fd_set available..." >&4
257 @@ -9627,7 +9651,7 @@
262 +$rm -f varargs$obj_ext
266 @@ -9954,7 +9978,7 @@
268 echo "Stripping down executable paths..." >&4
269 for file in $loclist $trylist; do
270 - eval $file="\$file"
271 + if test X$file != Xln -o X$osname != Xos2; then eval $file="\$file"; fi