summaryrefslogtreecommitdiff
path: root/os2/diff.configure
blob: 0e062f811d4c8d67798f789aec0b8932a2c95a91 (plain)
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
--- Configure.dist	Tue Feb 11 09:45:57 1997
+++ Configure	Tue Feb 11 09:46:04 1997
@@ -1467,7 +1467,7 @@
 	*)
 		echo "I don't know where '$file' is, and my life depends on it." >&4
 		echo "Go find a public domain implementation or fix your PATH setting!" >&4
-		exit 1
+		#exit 1
 		;;
 	esac
 done
@@ -1476,7 +1476,9 @@
 say=offhand
 for file in $trylist; do
 	xxx=`./loc $file $file $pth`
-	eval $file=$xxx
+	if test "X$file" != "X$xxx" ; then
+		eval $file=$xxx
+	fi
 	eval _$file=$xxx
 	case "$xxx" in
 	/*)
@@ -3164,7 +3166,7 @@
 	exit(0);
 }
 EOM
-if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
+if $cc -o gccvers gccvers.c $ldflags  >/dev/null 2>&1; then
 	gccversion=`./gccvers`
 	case "$gccversion" in
 	'') echo "You are not using GNU cc." ;;
@@ -3367,6 +3369,12 @@
 		*"-l$thislib "*);;
 		*) dflt="$dflt -l$thislib";;
 		esac
+	elif xxx=`./loc $thislib.lib X $libpth`; $test -f "$xxx"; then
+		echo "Found -l$thislib."
+		case " $dflt " in
+		*"-l$thislib "*);;
+		*) dflt="$dflt -l$thislib";;
+		esac
 	else
 		echo "No -l$thislib."
 	fi
@@ -3914,7 +3922,7 @@
 	esac
 	;;
 esac
-libnames='';
+#libnames='';
 case "$libs" in
 '') ;;
 *)  for thislib in $libs; do
@@ -4116,6 +4124,10 @@
 	eval $xscan;\
 	$contains '^fprintf$' libc.list >/dev/null 2>&1; then
 		eval $xrun
+elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
+	eval $xscan;\
+	$contains '^fprintf$' libc.list >/dev/null 2>&1; then
+		eval $xrun
 else
 	nm -p $* 2>/dev/null >libc.tmp
 	$grep fprintf libc.tmp > libc.ptf
@@ -4126,23 +4138,33 @@
 		eval $xrun
 	else
 		echo " "
-		echo "nm didn't seem to work right. Trying ar instead..." >&4
+		echo "nm didn't seem to work right. Trying $ar instead..." >&4
 		com=''
-		if ar t $libc > libc.tmp; then
-			for thisname in $libnames; do
-				ar t $thisname >>libc.tmp
+		if test "X$osname" = "Xos2"; then ar_opt=tv ; else ar_opt=t ;fi
+		if $ar $ar_opt $libc > libc.tmp; then
+			echo \; > libc.tmp
+			for thisname in $libnames $libc; do
+  				$ar $ar_opt $thisname >>libc.tmp
+				if test "X$osname" = "Xos2"; then
+				    # Revision 50 of EMX has bug in $ar:
+				    emximp -o tmp.imp $thisname \
+					2>/dev/null && \
+					$sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
+					< tmp.imp >>libc.tmp
+				    $rm tmp.imp
+				fi
 			done
-			$sed -e 's/\.o$//' < libc.tmp > libc.list
+			$sed -e 's/\.o$//' -e 's/^ \+//' < libc.tmp | grep -v "^IMPORT#" > libc.list
 			echo "Ok." >&4
 		else
-			echo "ar didn't seem to work right." >&4
+			echo "$ar didn't seem to work right." >&4
 			echo "Maybe this is a Cray...trying bld instead..." >&4
 			if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list
 			then
 				for thisname in $libnames; do
 					bld t $libnames | \
 					$sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list
-					ar t $thisname >>libc.tmp
+					$ar t $thisname >>libc.tmp
 				done
 				echo "Ok." >&4
 			else
@@ -5845,7 +5867,7 @@
 	exit(result);
 }
 EOCP
-if $cc -o try $ccflags try.c >/dev/null 2>&1; then
+if $cc -o try $ccflags try.c $ldflags >/dev/null 2>&1; then
 	./try
 	yyy=$?
 else
@@ -5926,7 +5948,7 @@
 
 }
 EOCP
-if $cc -o try $ccflags try.c >/dev/null 2>&1; then
+if $cc -o try $ccflags try.c $ldflags >/dev/null 2>&1; then
 	./try
 	castflags=$?
 else
@@ -5965,7 +5987,7 @@
 	exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
 }
 EOF
-	if $cc $ccflags vprintf.c -o vprintf >/dev/null 2>&1 && ./vprintf; then
+	if $cc $ccflags vprintf.c $ldflags -o vprintf >/dev/null 2>&1 && ./vprintf; then
 		echo "Your vsprintf() returns (int)." >&4
 		val2="$undef"
 	else
@@ -6310,7 +6332,7 @@
 EOCP
 : check sys/file.h first to get FREAD on Sun
 if $test `./findhdr sys/file.h` && \
-		$cc $cppflags "-DI_SYS_FILE" open3.c -o open3 >/dev/null 2>&1 ; then
+		$cc $cppflags $ldflags "-DI_SYS_FILE" open3.c -o open3 >/dev/null 2>&1 ; then
 	h_sysfile=true;
 	echo "<sys/file.h> defines the O_* constants..." >&4
 	if ./open3; then
@@ -6321,7 +6343,7 @@
 		val="$undef"
 	fi
 elif $test `./findhdr fcntl.h` && \
-		$cc "-DI_FCNTL" open3.c -o open3 >/dev/null 2>&1 ; then
+		$cc "-DI_FCNTL" $ldflags open3.c -o open3 >/dev/null 2>&1 ; then
 	h_fcntl=true;
 	echo "<fcntl.h> defines the O_* constants..." >&4
 	if ./open3; then
@@ -6827,7 +6849,7 @@
 y*|true)
 	usemymalloc='y'
 	mallocsrc='malloc.c'
-	mallocobj='malloc.o'
+	mallocobj="malloc$obj_ext"
 	d_mymalloc="$define"
 	case "$libs" in
 	*-lmalloc*)
@@ -8080,7 +8102,7 @@
 	printf("%d\n", (char *)&try.bar - (char *)&try.foo);
 }
 EOCP
-	if $cc $ccflags try.c -o try >/dev/null 2>&1; then
+	if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1; then
 		dflt=`./try`
 	else
 		dflt='8'
@@ -8128,7 +8150,7 @@
 }
 EOCP
 	xxx_prompt=y
-	if $cc $ccflags try.c -o try >/dev/null 2>&1 && ./try > /dev/null; then
+	if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1 && ./try > /dev/null; then
 		dflt=`./try`
 		case "$dflt" in
 		[1-4][1-4][1-4][1-4]|12345678|87654321)
@@ -8550,7 +8572,7 @@
 	printf("%d\n",i);
 }
 EOCP
-	if $cc try.c -o try >/dev/null 2>&1 ; then
+	if $cc $ldflags try.c -o try >/dev/null 2>&1 ; then
 		dflt=`try`
 	else
 		dflt='?'
@@ -8660,7 +8682,7 @@
 	'') $echo $n ".$c"
 		if $cc $ccflags \
 		$i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone \
-		try.c -o try >/dev/null 2>&1 ; then
+		try.c -o try $ldflags >/dev/null 2>&1 ; then
 			set X $i_time $i_systime $i_systimek $sysselect $s_timeval
 			shift
 			flags="$*"
@@ -8729,7 +8751,7 @@
 #endif
 }
 EOCP
-if $cc $ccflags -DTRYBITS fd_set.c -o fd_set >fd_set.out 2>&1 ; then
+if $cc $ccflags $ldflags -DTRYBITS fd_set.c -o fd_set >fd_set.out 2>&1 ; then
 	d_fds_bits="$define"
 	d_fd_set="$define"
 	echo "Well, your system knows about the normal fd_set typedef..." >&4
@@ -8746,7 +8768,7 @@
 	$cat <<'EOM'
 Hmm, your compiler has some difficulty with fd_set.  Checking further...
 EOM
-	if $cc $ccflags fd_set.c -o fd_set >fd_set.out 2>&1 ; then
+	if $cc $ccflags $ldflags fd_set.c -o fd_set >fd_set.out 2>&1 ; then
 		d_fds_bits="$undef"
 		d_fd_set="$define"
 		echo "Well, your system has some sort of fd_set available..." >&4
@@ -9493,7 +9515,7 @@
 else
 	echo "false"
 fi
-$rm -f varargs.o
+$rm -f varargs$obj_ext
 EOP
 chmod +x varargs
 
@@ -9820,7 +9842,7 @@
 	echo " "
 	echo "Stripping down executable paths..." >&4
 	for file in $loclist $trylist; do
-		eval $file="\$file"
+		if test X$file != Xln -o X$osname != Xos2; then eval $file="\$file"; fi
 	done
 	;;
 esac