xref: /openbsd-src/gnu/usr.bin/perl/os2/diff.configure (revision ba47ec9da08b5e716a167fd61325b8edfcb66dd6)
1--- Configure.orig	Fri Aug  1 23:12:26 1997
2+++ Configure	Fri Aug  1 23:20:24 1997
3@@ -1489,7 +1489,7 @@
4 	*)
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
7-		exit 1
8+		#exit 1
9 		;;
10 	esac
11 done
12@@ -1498,7 +1498,9 @@
13 say=offhand
14 for file in $trylist; do
15 	xxx=`./loc $file $file $pth`
16-	eval $file=$xxx
17+	if test "X$file" != "X$xxx" ; then
18+		eval $file=$xxx
19+	fi
20 	eval _$file=$xxx
21 	case "$xxx" in
22 	/*)
23@@ -3198,7 +3200,7 @@
24 	exit(0);
25 }
26 EOM
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`
30 	case "$gccversion" in
31 	'') echo "You are not using GNU cc." ;;
32@@ -3401,6 +3403,12 @@
33 		*"-l$thislib "*);;
34 		*) dflt="$dflt -l$thislib";;
35 		esac
36+	elif xxx=`./loc $thislib.lib X $libpth`; $test -f "$xxx"; then
37+		echo "Found -l$thislib."
38+		case " $dflt " in
39+		*"-l$thislib "*);;
40+		*) dflt="$dflt -l$thislib";;
41+		esac
42 	else
43 		echo "No -l$thislib."
44 	fi
45@@ -3950,7 +3958,7 @@
46 	esac
47 	;;
48 esac
49-libnames='';
50+#libnames='';
51 case "$libs" in
52 '') ;;
53 *)  for thislib in $libs; do
54@@ -3972,6 +3980,8 @@
55 			:
56 		elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
57 			:
58+		elif try=`./loc $thislib$lib_ext X $libpth`; $test -f "$try"; then
59+			:
60 		elif try=`./loc Slib$thislib$lib_ext X $xlibpth`; $test -f "$try"; then
61 			:
62 		else
63@@ -4156,6 +4166,10 @@
64 	eval $xscan;\
65 	$contains '^fprintf$' libc.list >/dev/null 2>&1; then
66 		eval $xrun
67+elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
68+	eval $xscan;\
69+	$contains '^fprintf$' libc.list >/dev/null 2>&1; then
70+		eval $xrun
71 else
72 	nm -p $* 2>/dev/null >libc.tmp
73 	$grep fprintf libc.tmp > libc.ptf
74@@ -4166,23 +4180,33 @@
75 		eval $xrun
76 	else
77 		echo " "
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
80 		com=''
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
86+			echo \; > libc.tmp
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 \
92+					2>/dev/null && \
93+					$sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
94+					< tmp.imp >>libc.tmp
95+				    $rm tmp.imp
96+				fi
97 			done
98-			$sed -e 's/\.o$//' < libc.tmp > libc.list
99+			$sed -e 's/\.o$//' -e 's/^ \+//' < libc.tmp | grep -v "^IMPORT#" > libc.list
100 			echo "Ok." >&4
101 		else
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
106 			then
107 				for thisname in $libnames; do
108 					bld t $libnames | \
109 					$sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list
110-					ar t $thisname >>libc.tmp
111+					$ar t $thisname >>libc.tmp
112 				done
113 				echo "Ok." >&4
114 			else
115@@ -5611,15 +5635,15 @@
116 EOCP
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
121 		h_sysfile=true;
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
126 		h_fcntl=true;
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
132 	else
133 		echo "I can't find the four *_OK access constants--I'll use mine." >&4
134@@ -5913,7 +5937,7 @@
135 	exit(result);
136 }
137 EOCP
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
140 	./try
141 	yyy=$?
142 else
143@@ -5994,7 +6018,7 @@
144
145 }
146 EOCP
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
149 	./try
150 	castflags=$?
151 else
152@@ -6033,7 +6057,7 @@
153 	exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
154 }
155 EOF
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
159 		val2="$undef"
160 	else
161@@ -6381,7 +6405,7 @@
162 EOCP
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
167 	h_sysfile=true;
168 	echo "<sys/file.h> defines the O_* constants..." >&4
169 	if ./open3; then
170@@ -6392,7 +6416,7 @@
171 		val="$undef"
172 	fi
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
176 	h_fcntl=true;
177 	echo "<fcntl.h> defines the O_* constants..." >&4
178 	if ./open3; then
179@@ -6898,7 +6922,7 @@
180 y*|true)
181 	usemymalloc='y'
182 	mallocsrc='malloc.c'
183-	mallocobj='malloc.o'
184+	mallocobj="malloc$obj_ext"
185 	d_mymalloc="$define"
186 	case "$libs" in
187 	*-lmalloc*)
188@@ -8156,7 +8180,7 @@
189 	printf("%d\n", (char *)&try.bar - (char *)&try.foo);
190 }
191 EOCP
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
194 		dflt=`./try`
195 	else
196 		dflt='8'
197@@ -8204,7 +8228,7 @@
198 }
199 EOCP
200 	xxx_prompt=y
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
203 		dflt=`./try`
204 		case "$dflt" in
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."
216 	orderlib=false
217 	ranlib=":"
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'."
224 		orderlib=false
225-		ranlib="ar ts"
226+		ranlib="$ar ts"
227 else
228 	case "$ranlib" in
229 	:) ranlib='';;
230@@ -8794,7 +8818,7 @@
231 	'') $echo $n ".$c"
232 		if $cc $ccflags \
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
237 			shift
238 			flags="$*"
239@@ -8863,7 +8887,7 @@
240 #endif
241 }
242 EOCP
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
245 	d_fds_bits="$define"
246 	d_fd_set="$define"
247 	echo "Well, your system knows about the normal fd_set typedef..." >&4
248@@ -8880,7 +8904,7 @@
249 	$cat <<'EOM'
250 Hmm, your compiler has some difficulty with fd_set.  Checking further...
251 EOM
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
254 		d_fds_bits="$undef"
255 		d_fd_set="$define"
256 		echo "Well, your system has some sort of fd_set available..." >&4
257@@ -9627,7 +9651,7 @@
258 else
259 	echo "false"
260 fi
261-$rm -f varargs.o
262+$rm -f varargs$obj_ext
263 EOP
264 chmod +x varargs
265
266@@ -9954,7 +9978,7 @@
267 	echo " "
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
272 	done
273 	;;
274 esac
275