Additional patch is needed for os2/diff.configure
[p5sagit/p5-mst-13.2.git] / os2 / diff.configure
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 @@ -4136,6 +4144,10 @@
55         eval $xscan;\
56         $contains '^fprintf$' libc.list >/dev/null 2>&1; then
57                 eval $xrun
58 +elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
59 +       eval $xscan;\
60 +       $contains '^fprintf$' libc.list >/dev/null 2>&1; then
61 +               eval $xrun
62  else
63         nm -p $* 2>/dev/null >libc.tmp
64         $grep fprintf libc.tmp > libc.ptf
65 @@ -4166,23 +4180,33 @@
66                 eval $xrun
67         else
68                 echo " "
69 -               echo "nm didn't seem to work right. Trying ar instead..." >&4
70 +               echo "nm didn't seem to work right. Trying $ar instead..." >&4
71                 com=''
72 -               if ar t $libc > libc.tmp; then
73 -                       for thisname in $libnames; do
74 -                               ar t $thisname >>libc.tmp
75 +               if test "X$osname" = "Xos2"; then ar_opt=tv ; else ar_opt=t ;fi
76 +               if $ar $ar_opt $libc > libc.tmp; then
77 +                       echo \; > libc.tmp
78 +                       for thisname in $libnames $libc; do
79 +                               $ar $ar_opt $thisname >>libc.tmp
80 +                               if test "X$osname" = "Xos2"; then
81 +                                   # Revision 50 of EMX has bug in $ar:
82 +                                   emximp -o tmp.imp $thisname \
83 +                                       2>/dev/null && \
84 +                                       $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
85 +                                       < tmp.imp >>libc.tmp
86 +                                   $rm tmp.imp
87 +                               fi
88                         done
89 -                       $sed -e 's/\.o$//' < libc.tmp > libc.list
90 +                       $sed -e 's/\.o$//' -e 's/^ \+//' < libc.tmp | grep -v "^IMPORT#" > libc.list
91                         echo "Ok." >&4
92                 else
93 -                       echo "ar didn't seem to work right." >&4
94 +                       echo "$ar didn't seem to work right." >&4
95                         echo "Maybe this is a Cray...trying bld instead..." >&4
96                         if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list
97                         then
98                                 for thisname in $libnames; do
99                                         bld t $libnames | \
100                                         $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list
101 -                                       ar t $thisname >>libc.tmp
102 +                                       $ar t $thisname >>libc.tmp
103                                 done
104                                 echo "Ok." >&4
105                         else
106 @@ -5611,15 +5635,15 @@
107  EOCP
108         : check sys/file.h first, no particular reason here
109         if $test `./findhdr sys/file.h` && \
110 -               $cc $cppflags -DI_SYS_FILE access.c -o access >/dev/null 2>&1 ; then
111 +               $cc $ldflags $cppflags -DI_SYS_FILE access.c -o access >/dev/null 2>&1 ; then
112                 h_sysfile=true;
113                 echo "<sys/file.h> defines the *_OK access constants." >&4
114         elif $test `./findhdr fcntl.h` && \
115 -               $cc $cppflags -DI_FCNTL access.c -o access >/dev/null 2>&1 ; then
116 +               $cc $ldflags $cppflags -DI_FCNTL access.c -o access >/dev/null 2>&1 ; then
117                 h_fcntl=true;
118                 echo "<fcntl.h> defines the *_OK access constants." >&4
119         elif $test `./findhdr unistd.h` && \
120 -               $cc $cppflags -DI_UNISTD access.c -o access >/dev/null 2>&1 ; then
121 +               $cc $ldflags $cppflags -DI_UNISTD access.c -o access >/dev/null 2>&1 ; then
122                 echo "<unistd.h> defines the *_OK access constants." >&4
123         else
124                 echo "I can't find the four *_OK access constants--I'll use mine." >&4
125 @@ -5913,7 +5937,7 @@
126         exit(result);
127  }
128  EOCP
129 -if $cc -o try $ccflags try.c >/dev/null 2>&1; then
130 +if $cc -o try $ccflags try.c $ldflags >/dev/null 2>&1; then
131         ./try
132         yyy=$?
133  else
134 @@ -5994,7 +6018,7 @@
135  
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         castflags=$?
142  else
143 @@ -6033,7 +6057,7 @@
144         exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
145  }
146  EOF
147 -       if $cc $ccflags vprintf.c -o vprintf >/dev/null 2>&1 && ./vprintf; then
148 +       if $cc $ccflags vprintf.c $ldflags -o vprintf >/dev/null 2>&1 && ./vprintf; then
149                 echo "Your vsprintf() returns (int)." >&4
150                 val2="$undef"
151         else
152 @@ -6381,7 +6405,7 @@
153  EOCP
154  : check sys/file.h first to get FREAD on Sun
155  if $test `./findhdr sys/file.h` && \
156 -        $cc $ccflags "-DI_SYS_FILE" -o open3 $ldflags open3.c $libs ; then
157 +        $cc $ldflags $ccflags "-DI_SYS_FILE" -o open3 $ldflags open3.c $libs ; then
158         h_sysfile=true;
159         echo "<sys/file.h> defines the O_* constants..." >&4
160         if ./open3; then
161 @@ -6392,7 +6416,7 @@
162                 val="$undef"
163         fi
164  elif $test `./findhdr fcntl.h` && \
165 -        $cc $ccflags "-DI_FCNTL" -o open3 $ldflags open3.c $libs ; then
166 +        $cc $ldflags $ccflags "-DI_FCNTL" -o open3 $ldflags open3.c $libs ; then
167         h_fcntl=true;
168         echo "<fcntl.h> defines the O_* constants..." >&4
169         if ./open3; then
170 @@ -6898,7 +6922,7 @@
171  y*|true)
172         usemymalloc='y'
173         mallocsrc='malloc.c'
174 -       mallocobj='malloc.o'
175 +       mallocobj="malloc$obj_ext"
176         d_mymalloc="$define"
177         case "$libs" in
178         *-lmalloc*)
179 @@ -8156,7 +8180,7 @@
180         printf("%d\n", (char *)&try.bar - (char *)&try.foo);
181  }
182  EOCP
183 -       if $cc $ccflags try.c -o try >/dev/null 2>&1; then
184 +       if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1; then
185                 dflt=`./try`
186         else
187                 dflt='8'
188 @@ -8204,7 +8228,7 @@
189  }
190  EOCP
191         xxx_prompt=y
192 -       if $cc $ccflags try.c -o try >/dev/null 2>&1 && ./try > /dev/null; then
193 +       if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1 && ./try > /dev/null; then
194                 dflt=`./try`
195                 case "$dflt" in
196                 [1-4][1-4][1-4][1-4]|12345678|87654321)
197 @@ -8692,7 +8714,7 @@
198         '') $echo $n ".$c"
199                 if $cc $ccflags \
200                 $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone \
201 -               try.c -o try >/dev/null 2>&1 ; then
202 +               try.c -o try $ldflags >/dev/null 2>&1 ; then
203                         set X $i_time $i_systime $i_systimek $sysselect $s_timeval
204                         shift
205                         flags="$*"
206 @@ -8863,7 +8887,7 @@
207  #endif
208  }
209  EOCP
210 -if $cc $ccflags -DTRYBITS fd_set.c -o fd_set >fd_set.out 2>&1 ; then
211 +if $cc $ccflags $ldflags -DTRYBITS fd_set.c -o fd_set >fd_set.out 2>&1 ; then
212         d_fds_bits="$define"
213         d_fd_set="$define"
214         echo "Well, your system knows about the normal fd_set typedef..." >&4
215 @@ -8880,7 +8904,7 @@
216         $cat <<'EOM'
217  Hmm, your compiler has some difficulty with fd_set.  Checking further...
218  EOM
219 -       if $cc $ccflags fd_set.c -o fd_set >fd_set.out 2>&1 ; then
220 +       if $cc $ccflags $ldflags fd_set.c -o fd_set >fd_set.out 2>&1 ; then
221                 d_fds_bits="$undef"
222                 d_fd_set="$define"
223                 echo "Well, your system has some sort of fd_set available..." >&4
224 @@ -9627,7 +9651,7 @@
225  else
226         echo "false"
227  fi
228 -$rm -f varargs.o
229 +$rm -f varargs$obj_ext
230  EOP
231  chmod +x varargs
232  
233 @@ -9954,7 +9978,7 @@
234         echo " "
235         echo "Stripping down executable paths..." >&4
236         for file in $loclist $trylist; do
237 -               eval $file="\$file"
238 +               if test X$file != Xln -o X$osname != Xos2; then eval $file="\$file"; fi
239         done
240         ;;
241  esac