author | Sam Lantinga <slouken@libsdl.org> |
Tue, 31 Jul 2001 06:08:11 +0000 | |
changeset 132 | 2604a7be65af |
parent 1 | cf2af46e9e2a |
child 387 | 469d5c0da01d |
permissions | -rw-r--r-- |
0 | 1 |
# ltmain.sh - Provide generalized library-building support services. |
2 |
# NOTE: Changing this file will not affect anything until you rerun ltconfig. |
|
3 |
# |
|
4 |
# Copyright (C) 1996-1999 Free Software Foundation, Inc. |
|
5 |
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 |
|
6 |
# |
|
7 |
# This program is free software; you can redistribute it and/or modify |
|
8 |
# it under the terms of the GNU General Public License as published by |
|
9 |
# the Free Software Foundation; either version 2 of the License, or |
|
10 |
# (at your option) any later version. |
|
11 |
# |
|
12 |
# This program is distributed in the hope that it will be useful, but |
|
13 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
15 |
# General Public License for more details. |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License |
|
18 |
# along with this program; if not, write to the Free Software |
|
19 |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
# |
|
21 |
# As a special exception to the GNU General Public License, if you |
|
22 |
# distribute this file as part of a program that contains a |
|
23 |
# configuration script generated by Autoconf, you may include it under |
|
24 |
# the same distribution terms that you use for the rest of that program. |
|
25 |
||
26 |
# Check that we have a working $echo. |
|
27 |
if test "X$1" = X--no-reexec; then |
|
28 |
# Discard the --no-reexec flag, and continue. |
|
29 |
shift |
|
30 |
elif test "X$1" = X--fallback-echo; then |
|
31 |
# Avoid inline document here, it may be left over |
|
32 |
: |
|
33 |
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then |
|
34 |
# Yippee, $echo works! |
|
35 |
: |
|
36 |
else |
|
37 |
# Restart under the correct shell, and then maybe $echo will work. |
|
38 |
exec $SHELL "$0" --no-reexec ${1+"$@"} |
|
39 |
fi |
|
40 |
||
41 |
if test "X$1" = X--fallback-echo; then |
|
42 |
# used as fallback echo |
|
43 |
shift |
|
44 |
cat <<EOF |
|
45 |
$* |
|
46 |
EOF |
|
47 |
exit 0 |
|
48 |
fi |
|
49 |
||
50 |
# The name of this program. |
|
51 |
progname=`$echo "$0" | sed 's%^.*/%%'` |
|
52 |
modename="$progname" |
|
53 |
||
54 |
# Constants. |
|
55 |
PROGRAM=ltmain.sh |
|
56 |
PACKAGE=libtool |
|
57 |
VERSION=1.3.5 |
|
58 |
TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)" |
|
59 |
||
60 |
default_mode= |
|
61 |
help="Try \`$progname --help' for more information." |
|
62 |
magic="%%%MAGIC variable%%%" |
|
63 |
mkdir="mkdir" |
|
64 |
mv="mv -f" |
|
65 |
rm="rm -f" |
|
66 |
||
67 |
# Sed substitution that helps us do robust quoting. It backslashifies |
|
68 |
# metacharacters that are still active within double-quoted strings. |
|
69 |
Xsed='sed -e 1s/^X//' |
|
70 |
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' |
|
71 |
SP2NL='tr \040 \012' |
|
72 |
NL2SP='tr \015\012 \040\040' |
|
73 |
||
74 |
# NLS nuisances. |
|
75 |
# Only set LANG and LC_ALL to C if already set. |
|
76 |
# These must not be set unconditionally because not all systems understand |
|
77 |
# e.g. LANG=C (notably SCO). |
|
78 |
# We save the old values to restore during execute mode. |
|
79 |
if test "${LC_ALL+set}" = set; then |
|
80 |
save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL |
|
81 |
fi |
|
82 |
if test "${LANG+set}" = set; then |
|
83 |
save_LANG="$LANG"; LANG=C; export LANG |
|
84 |
fi |
|
85 |
||
86 |
if test "$LTCONFIG_VERSION" != "$VERSION"; then |
|
87 |
echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2 |
|
88 |
echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 |
|
89 |
exit 1 |
|
90 |
fi |
|
91 |
||
92 |
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then |
|
93 |
echo "$modename: not configured to build any kind of library" 1>&2 |
|
94 |
echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 |
|
95 |
exit 1 |
|
96 |
fi |
|
97 |
||
98 |
# Global variables. |
|
99 |
mode=$default_mode |
|
100 |
nonopt= |
|
101 |
prev= |
|
102 |
prevopt= |
|
103 |
run= |
|
104 |
show="$echo" |
|
105 |
show_help= |
|
106 |
execute_dlfiles= |
|
107 |
lo2o="s/\\.lo\$/.${objext}/" |
|
108 |
o2lo="s/\\.${objext}\$/.lo/" |
|
109 |
||
110 |
# Parse our command line options once, thoroughly. |
|
111 |
while test $# -gt 0 |
|
112 |
do |
|
113 |
arg="$1" |
|
114 |
shift |
|
115 |
||
116 |
case "$arg" in |
|
117 |
-*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; |
|
118 |
*) optarg= ;; |
|
119 |
esac |
|
120 |
||
121 |
# If the previous option needs an argument, assign it. |
|
122 |
if test -n "$prev"; then |
|
123 |
case "$prev" in |
|
124 |
execute_dlfiles) |
|
125 |
eval "$prev=\"\$$prev \$arg\"" |
|
126 |
;; |
|
127 |
*) |
|
128 |
eval "$prev=\$arg" |
|
129 |
;; |
|
130 |
esac |
|
131 |
||
132 |
prev= |
|
133 |
prevopt= |
|
134 |
continue |
|
135 |
fi |
|
136 |
||
137 |
# Have we seen a non-optional argument yet? |
|
138 |
case "$arg" in |
|
139 |
--help) |
|
140 |
show_help=yes |
|
141 |
;; |
|
142 |
||
143 |
--version) |
|
144 |
echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" |
|
145 |
exit 0 |
|
146 |
;; |
|
147 |
||
148 |
--config) |
|
149 |
sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0 |
|
150 |
exit 0 |
|
151 |
;; |
|
152 |
||
153 |
--debug) |
|
154 |
echo "$progname: enabling shell trace mode" |
|
155 |
set -x |
|
156 |
;; |
|
157 |
||
158 |
--dry-run | -n) |
|
159 |
run=: |
|
160 |
;; |
|
161 |
||
162 |
--features) |
|
163 |
echo "host: $host" |
|
164 |
if test "$build_libtool_libs" = yes; then |
|
165 |
echo "enable shared libraries" |
|
166 |
else |
|
167 |
echo "disable shared libraries" |
|
168 |
fi |
|
169 |
if test "$build_old_libs" = yes; then |
|
170 |
echo "enable static libraries" |
|
171 |
else |
|
172 |
echo "disable static libraries" |
|
173 |
fi |
|
174 |
exit 0 |
|
175 |
;; |
|
176 |
||
177 |
--finish) mode="finish" ;; |
|
178 |
||
179 |
--mode) prevopt="--mode" prev=mode ;; |
|
180 |
--mode=*) mode="$optarg" ;; |
|
181 |
||
182 |
--quiet | --silent) |
|
183 |
show=: |
|
184 |
;; |
|
185 |
||
186 |
-dlopen) |
|
187 |
prevopt="-dlopen" |
|
188 |
prev=execute_dlfiles |
|
189 |
;; |
|
190 |
||
191 |
-*) |
|
192 |
$echo "$modename: unrecognized option \`$arg'" 1>&2 |
|
193 |
$echo "$help" 1>&2 |
|
194 |
exit 1 |
|
195 |
;; |
|
196 |
||
197 |
*) |
|
198 |
nonopt="$arg" |
|
199 |
break |
|
200 |
;; |
|
201 |
esac |
|
202 |
done |
|
203 |
||
204 |
if test -n "$prevopt"; then |
|
205 |
$echo "$modename: option \`$prevopt' requires an argument" 1>&2 |
|
206 |
$echo "$help" 1>&2 |
|
207 |
exit 1 |
|
208 |
fi |
|
209 |
||
210 |
if test -z "$show_help"; then |
|
211 |
||
212 |
# Infer the operation mode. |
|
213 |
if test -z "$mode"; then |
|
214 |
case "$nonopt" in |
|
215 |
*cc | *++ | gcc* | *-gcc*) |
|
216 |
mode=link |
|
217 |
for arg |
|
218 |
do |
|
219 |
case "$arg" in |
|
220 |
-c) |
|
221 |
mode=compile |
|
222 |
break |
|
223 |
;; |
|
224 |
esac |
|
225 |
done |
|
226 |
;; |
|
227 |
*db | *dbx | *strace | *truss) |
|
228 |
mode=execute |
|
229 |
;; |
|
230 |
*install*|cp|mv) |
|
231 |
mode=install |
|
232 |
;; |
|
233 |
*rm) |
|
234 |
mode=uninstall |
|
235 |
;; |
|
236 |
*) |
|
237 |
# If we have no mode, but dlfiles were specified, then do execute mode. |
|
238 |
test -n "$execute_dlfiles" && mode=execute |
|
239 |
||
240 |
# Just use the default operation mode. |
|
241 |
if test -z "$mode"; then |
|
242 |
if test -n "$nonopt"; then |
|
243 |
$echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 |
|
244 |
else |
|
245 |
$echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 |
|
246 |
fi |
|
247 |
fi |
|
248 |
;; |
|
249 |
esac |
|
250 |
fi |
|
251 |
||
252 |
# Only execute mode is allowed to have -dlopen flags. |
|
253 |
if test -n "$execute_dlfiles" && test "$mode" != execute; then |
|
254 |
$echo "$modename: unrecognized option \`-dlopen'" 1>&2 |
|
255 |
$echo "$help" 1>&2 |
|
256 |
exit 1 |
|
257 |
fi |
|
258 |
||
259 |
# Change the help message to a mode-specific one. |
|
260 |
generic_help="$help" |
|
261 |
help="Try \`$modename --help --mode=$mode' for more information." |
|
262 |
||
263 |
# These modes are in order of execution frequency so that they run quickly. |
|
264 |
case "$mode" in |
|
265 |
# libtool compile mode |
|
266 |
compile) |
|
267 |
modename="$modename: compile" |
|
268 |
# Get the compilation command and the source file. |
|
269 |
base_compile= |
|
270 |
lastarg= |
|
271 |
srcfile="$nonopt" |
|
272 |
suppress_output= |
|
273 |
||
274 |
user_target=no |
|
275 |
for arg |
|
276 |
do |
|
277 |
# Accept any command-line options. |
|
278 |
case "$arg" in |
|
279 |
-o) |
|
280 |
if test "$user_target" != "no"; then |
|
281 |
$echo "$modename: you cannot specify \`-o' more than once" 1>&2 |
|
282 |
exit 1 |
|
283 |
fi |
|
284 |
user_target=next |
|
285 |
;; |
|
286 |
||
287 |
-static) |
|
288 |
build_old_libs=yes |
|
289 |
continue |
|
290 |
;; |
|
291 |
esac |
|
292 |
||
293 |
case "$user_target" in |
|
294 |
next) |
|
295 |
# The next one is the -o target name |
|
296 |
user_target=yes |
|
297 |
continue |
|
298 |
;; |
|
299 |
yes) |
|
300 |
# We got the output file |
|
301 |
user_target=set |
|
302 |
libobj="$arg" |
|
303 |
continue |
|
304 |
;; |
|
305 |
esac |
|
306 |
||
307 |
# Accept the current argument as the source file. |
|
308 |
lastarg="$srcfile" |
|
309 |
srcfile="$arg" |
|
310 |
||
311 |
# Aesthetically quote the previous argument. |
|
312 |
||
313 |
# Backslashify any backslashes, double quotes, and dollar signs. |
|
314 |
# These are the only characters that are still specially |
|
315 |
# interpreted inside of double-quoted scrings. |
|
316 |
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` |
|
317 |
||
318 |
# Double-quote args containing other shell metacharacters. |
|
319 |
# Many Bourne shells cannot handle close brackets correctly in scan |
|
320 |
# sets, so we specify it separately. |
|
321 |
case "$lastarg" in |
|
322 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
|
323 |
lastarg="\"$lastarg\"" |
|
324 |
;; |
|
325 |
esac |
|
326 |
||
327 |
# Add the previous argument to base_compile. |
|
328 |
if test -z "$base_compile"; then |
|
329 |
base_compile="$lastarg" |
|
330 |
else |
|
331 |
base_compile="$base_compile $lastarg" |
|
332 |
fi |
|
333 |
done |
|
334 |
||
335 |
case "$user_target" in |
|
336 |
set) |
|
337 |
;; |
|
338 |
no) |
|
339 |
# Get the name of the library object. |
|
340 |
libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` |
|
341 |
;; |
|
342 |
*) |
|
343 |
$echo "$modename: you must specify a target with \`-o'" 1>&2 |
|
344 |
exit 1 |
|
345 |
;; |
|
346 |
esac |
|
347 |
||
348 |
# Recognize several different file suffixes. |
|
349 |
# If the user specifies -o file.o, it is replaced with file.lo |
|
350 |
xform='[cCFSfmso]' |
|
351 |
case "$libobj" in |
|
352 |
*.ada) xform=ada ;; |
|
353 |
*.adb) xform=adb ;; |
|
354 |
*.ads) xform=ads ;; |
|
355 |
*.asm) xform=asm ;; |
|
356 |
*.c++) xform=c++ ;; |
|
357 |
*.cc) xform=cc ;; |
|
358 |
*.cpp) xform=cpp ;; |
|
359 |
*.cxx) xform=cxx ;; |
|
360 |
*.f90) xform=f90 ;; |
|
361 |
*.for) xform=for ;; |
|
362 |
esac |
|
363 |
||
364 |
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` |
|
365 |
||
366 |
case "$libobj" in |
|
367 |
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; |
|
368 |
*) |
|
369 |
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 |
|
370 |
exit 1 |
|
371 |
;; |
|
372 |
esac |
|
373 |
||
374 |
if test -z "$base_compile"; then |
|
375 |
$echo "$modename: you must specify a compilation command" 1>&2 |
|
376 |
$echo "$help" 1>&2 |
|
377 |
exit 1 |
|
378 |
fi |
|
379 |
||
380 |
# Delete any leftover library objects. |
|
381 |
if test "$build_old_libs" = yes; then |
|
382 |
removelist="$obj $libobj" |
|
383 |
else |
|
384 |
removelist="$libobj" |
|
385 |
fi |
|
386 |
||
387 |
$run $rm $removelist |
|
388 |
trap "$run $rm $removelist; exit 1" 1 2 15 |
|
389 |
||
390 |
# Calculate the filename of the output object if compiler does |
|
391 |
# not support -o with -c |
|
392 |
if test "$compiler_c_o" = no; then |
|
393 |
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext} |
|
394 |
lockfile="$output_obj.lock" |
|
395 |
removelist="$removelist $output_obj $lockfile" |
|
396 |
trap "$run $rm $removelist; exit 1" 1 2 15 |
|
397 |
else |
|
398 |
need_locks=no |
|
399 |
lockfile= |
|
400 |
fi |
|
401 |
||
402 |
# Lock this critical section if it is needed |
|
403 |
# We use this script file to make the link, it avoids creating a new file |
|
404 |
if test "$need_locks" = yes; then |
|
405 |
until ln "$0" "$lockfile" 2>/dev/null; do |
|
406 |
$show "Waiting for $lockfile to be removed" |
|
407 |
sleep 2 |
|
408 |
done |
|
409 |
elif test "$need_locks" = warn; then |
|
410 |
if test -f "$lockfile"; then |
|
411 |
echo "\ |
|
412 |
*** ERROR, $lockfile exists and contains: |
|
413 |
`cat $lockfile 2>/dev/null` |
|
414 |
||
415 |
This indicates that another process is trying to use the same |
|
416 |
temporary object file, and libtool could not work around it because |
|
417 |
your compiler does not support \`-c' and \`-o' together. If you |
|
418 |
repeat this compilation, it may succeed, by chance, but you had better |
|
419 |
avoid parallel builds (make -j) in this platform, or get a better |
|
420 |
compiler." |
|
421 |
||
422 |
$run $rm $removelist |
|
423 |
exit 1 |
|
424 |
fi |
|
425 |
echo $srcfile > "$lockfile" |
|
426 |
fi |
|
427 |
||
428 |
if test -n "$fix_srcfile_path"; then |
|
429 |
eval srcfile=\"$fix_srcfile_path\" |
|
430 |
fi |
|
431 |
||
432 |
# Only build a PIC object if we are building libtool libraries. |
|
433 |
if test "$build_libtool_libs" = yes; then |
|
434 |
# Without this assignment, base_compile gets emptied. |
|
435 |
fbsd_hideous_sh_bug=$base_compile |
|
436 |
||
437 |
# All platforms use -DPIC, to notify preprocessed assembler code. |
|
438 |
command="$base_compile $srcfile $pic_flag -DPIC" |
|
439 |
if test "$build_old_libs" = yes; then |
|
440 |
lo_libobj="$libobj" |
|
441 |
dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` |
|
442 |
if test "X$dir" = "X$libobj"; then |
|
443 |
dir="$objdir" |
|
444 |
else |
|
445 |
dir="$dir/$objdir" |
|
446 |
fi |
|
447 |
libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` |
|
448 |
||
449 |
if test -d "$dir"; then |
|
450 |
$show "$rm $libobj" |
|
451 |
$run $rm $libobj |
|
452 |
else |
|
453 |
$show "$mkdir $dir" |
|
454 |
$run $mkdir $dir |
|
455 |
status=$? |
|
456 |
if test $status -ne 0 && test ! -d $dir; then |
|
457 |
exit $status |
|
458 |
fi |
|
459 |
fi |
|
460 |
fi |
|
461 |
if test "$compiler_o_lo" = yes; then |
|
462 |
output_obj="$libobj" |
|
463 |
command="$command -o $output_obj" |
|
464 |
elif test "$compiler_c_o" = yes; then |
|
465 |
output_obj="$obj" |
|
466 |
command="$command -o $output_obj" |
|
467 |
fi |
|
468 |
||
469 |
$run $rm "$output_obj" |
|
470 |
$show "$command" |
|
471 |
if $run eval "$command"; then : |
|
472 |
else |
|
473 |
test -n "$output_obj" && $run $rm $removelist |
|
474 |
exit 1 |
|
475 |
fi |
|
476 |
||
477 |
if test "$need_locks" = warn && |
|
478 |
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then |
|
479 |
echo "\ |
|
480 |
*** ERROR, $lockfile contains: |
|
481 |
`cat $lockfile 2>/dev/null` |
|
482 |
||
483 |
but it should contain: |
|
484 |
$srcfile |
|
485 |
||
486 |
This indicates that another process is trying to use the same |
|
487 |
temporary object file, and libtool could not work around it because |
|
488 |
your compiler does not support \`-c' and \`-o' together. If you |
|
489 |
repeat this compilation, it may succeed, by chance, but you had better |
|
490 |
avoid parallel builds (make -j) in this platform, or get a better |
|
491 |
compiler." |
|
492 |
||
493 |
$run $rm $removelist |
|
494 |
exit 1 |
|
495 |
fi |
|
496 |
||
497 |
# Just move the object if needed, then go on to compile the next one |
|
498 |
if test x"$output_obj" != x"$libobj"; then |
|
499 |
$show "$mv $output_obj $libobj" |
|
500 |
if $run $mv $output_obj $libobj; then : |
|
501 |
else |
|
502 |
error=$? |
|
503 |
$run $rm $removelist |
|
504 |
exit $error |
|
505 |
fi |
|
506 |
fi |
|
507 |
||
508 |
# If we have no pic_flag, then copy the object into place and finish. |
|
509 |
if test -z "$pic_flag" && test "$build_old_libs" = yes; then |
|
510 |
# Rename the .lo from within objdir to obj |
|
511 |
if test -f $obj; then |
|
512 |
$show $rm $obj |
|
513 |
$run $rm $obj |
|
514 |
fi |
|
515 |
||
516 |
$show "$mv $libobj $obj" |
|
517 |
if $run $mv $libobj $obj; then : |
|
518 |
else |
|
519 |
error=$? |
|
520 |
$run $rm $removelist |
|
521 |
exit $error |
|
522 |
fi |
|
523 |
||
524 |
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` |
|
525 |
if test "X$xdir" = "X$obj"; then |
|
526 |
xdir="." |
|
527 |
else |
|
528 |
xdir="$xdir" |
|
529 |
fi |
|
530 |
baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"` |
|
531 |
libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` |
|
532 |
# Now arrange that obj and lo_libobj become the same file |
|
533 |
$show "(cd $xdir && $LN_S $baseobj $libobj)" |
|
534 |
if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then |
|
535 |
exit 0 |
|
536 |
else |
|
537 |
error=$? |
|
538 |
$run $rm $removelist |
|
539 |
exit $error |
|
540 |
fi |
|
541 |
fi |
|
542 |
||
543 |
# Allow error messages only from the first compilation. |
|
544 |
suppress_output=' >/dev/null 2>&1' |
|
545 |
fi |
|
546 |
||
547 |
# Only build a position-dependent object if we build old libraries. |
|
548 |
if test "$build_old_libs" = yes; then |
|
549 |
command="$base_compile $srcfile" |
|
550 |
if test "$compiler_c_o" = yes; then |
|
551 |
command="$command -o $obj" |
|
552 |
output_obj="$obj" |
|
553 |
fi |
|
554 |
||
555 |
# Suppress compiler output if we already did a PIC compilation. |
|
556 |
command="$command$suppress_output" |
|
557 |
$run $rm "$output_obj" |
|
558 |
$show "$command" |
|
559 |
if $run eval "$command"; then : |
|
560 |
else |
|
561 |
$run $rm $removelist |
|
562 |
exit 1 |
|
563 |
fi |
|
564 |
||
565 |
if test "$need_locks" = warn && |
|
566 |
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then |
|
567 |
echo "\ |
|
568 |
*** ERROR, $lockfile contains: |
|
569 |
`cat $lockfile 2>/dev/null` |
|
570 |
||
571 |
but it should contain: |
|
572 |
$srcfile |
|
573 |
||
574 |
This indicates that another process is trying to use the same |
|
575 |
temporary object file, and libtool could not work around it because |
|
576 |
your compiler does not support \`-c' and \`-o' together. If you |
|
577 |
repeat this compilation, it may succeed, by chance, but you had better |
|
578 |
avoid parallel builds (make -j) in this platform, or get a better |
|
579 |
compiler." |
|
580 |
||
581 |
$run $rm $removelist |
|
582 |
exit 1 |
|
583 |
fi |
|
584 |
||
585 |
# Just move the object if needed |
|
586 |
if test x"$output_obj" != x"$obj"; then |
|
587 |
$show "$mv $output_obj $obj" |
|
588 |
if $run $mv $output_obj $obj; then : |
|
589 |
else |
|
590 |
error=$? |
|
591 |
$run $rm $removelist |
|
592 |
exit $error |
|
593 |
fi |
|
594 |
fi |
|
595 |
||
596 |
# Create an invalid libtool object if no PIC, so that we do not |
|
597 |
# accidentally link it into a program. |
|
598 |
if test "$build_libtool_libs" != yes; then |
|
599 |
$show "echo timestamp > $libobj" |
|
600 |
$run eval "echo timestamp > \$libobj" || exit $? |
|
601 |
else |
|
602 |
# Move the .lo from within objdir |
|
603 |
$show "$mv $libobj $lo_libobj" |
|
604 |
if $run $mv $libobj $lo_libobj; then : |
|
605 |
else |
|
606 |
error=$? |
|
607 |
$run $rm $removelist |
|
608 |
exit $error |
|
609 |
fi |
|
610 |
fi |
|
611 |
fi |
|
612 |
||
613 |
# Unlock the critical section if it was locked |
|
614 |
if test "$need_locks" != no; then |
|
615 |
$rm "$lockfile" |
|
616 |
fi |
|
617 |
||
618 |
exit 0 |
|
619 |
;; |
|
620 |
||
621 |
# libtool link mode |
|
622 |
link) |
|
623 |
modename="$modename: link" |
|
624 |
case "$host" in |
|
625 |
*-*-cygwin* | *-*-mingw* | *-*-os2*) |
|
626 |
# It is impossible to link a dll without this setting, and |
|
627 |
# we shouldn't force the makefile maintainer to figure out |
|
628 |
# which system we are compiling for in order to pass an extra |
|
629 |
# flag for every libtool invokation. |
|
630 |
# allow_undefined=no |
|
631 |
||
632 |
# FIXME: Unfortunately, there are problems with the above when trying |
|
633 |
# to make a dll which has undefined symbols, in which case not |
|
634 |
# even a static library is built. For now, we need to specify |
|
635 |
# -no-undefined on the libtool link line when we can be certain |
|
636 |
# that all symbols are satisfied, otherwise we get a static library. |
|
637 |
allow_undefined=yes |
|
638 |
||
639 |
# This is a source program that is used to create dlls on Windows |
|
640 |
# Don't remove nor modify the starting and closing comments |
|
641 |
# /* ltdll.c starts here */ |
|
642 |
# #define WIN32_LEAN_AND_MEAN |
|
643 |
# #include <windows.h> |
|
644 |
# #undef WIN32_LEAN_AND_MEAN |
|
645 |
# #include <stdio.h> |
|
646 |
# |
|
647 |
# #ifndef __CYGWIN__ |
|
648 |
# # ifdef __CYGWIN32__ |
|
649 |
# # define __CYGWIN__ __CYGWIN32__ |
|
650 |
# # endif |
|
651 |
# #endif |
|
652 |
# |
|
653 |
# #ifdef __cplusplus |
|
654 |
# extern "C" { |
|
655 |
# #endif |
|
656 |
# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); |
|
657 |
# #ifdef __cplusplus |
|
658 |
# } |
|
659 |
# #endif |
|
660 |
# |
|
661 |
# #ifdef __CYGWIN__ |
|
662 |
# #include <cygwin/cygwin_dll.h> |
|
663 |
# DECLARE_CYGWIN_DLL( DllMain ); |
|
664 |
# #endif |
|
665 |
# HINSTANCE __hDllInstance_base; |
|
666 |
# |
|
667 |
# BOOL APIENTRY |
|
668 |
# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) |
|
669 |
# { |
|
670 |
# __hDllInstance_base = hInst; |
|
671 |
# return TRUE; |
|
672 |
# } |
|
673 |
# /* ltdll.c ends here */ |
|
674 |
# This is a source program that is used to create import libraries |
|
675 |
# on Windows for dlls which lack them. Don't remove nor modify the |
|
676 |
# starting and closing comments |
|
677 |
# /* impgen.c starts here */ |
|
678 |
# /* Copyright (C) 1999 Free Software Foundation, Inc. |
|
679 |
# |
|
680 |
# This file is part of GNU libtool. |
|
681 |
# |
|
682 |
# This program is free software; you can redistribute it and/or modify |
|
683 |
# it under the terms of the GNU General Public License as published by |
|
684 |
# the Free Software Foundation; either version 2 of the License, or |
|
685 |
# (at your option) any later version. |
|
686 |
# |
|
687 |
# This program is distributed in the hope that it will be useful, |
|
688 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
689 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
690 |
# GNU General Public License for more details. |
|
691 |
# |
|
692 |
# You should have received a copy of the GNU General Public License |
|
693 |
# along with this program; if not, write to the Free Software |
|
694 |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
695 |
# */ |
|
696 |
# |
|
697 |
# #include <stdio.h> /* for printf() */ |
|
698 |
# #include <unistd.h> /* for open(), lseek(), read() */ |
|
699 |
# #include <fcntl.h> /* for O_RDONLY, O_BINARY */ |
|
700 |
# #include <string.h> /* for strdup() */ |
|
701 |
# |
|
702 |
# static unsigned int |
|
703 |
# pe_get16 (fd, offset) |
|
704 |
# int fd; |
|
705 |
# int offset; |
|
706 |
# { |
|
707 |
# unsigned char b[2]; |
|
708 |
# lseek (fd, offset, SEEK_SET); |
|
709 |
# read (fd, b, 2); |
|
710 |
# return b[0] + (b[1]<<8); |
|
711 |
# } |
|
712 |
# |
|
713 |
# static unsigned int |
|
714 |
# pe_get32 (fd, offset) |
|
715 |
# int fd; |
|
716 |
# int offset; |
|
717 |
# { |
|
718 |
# unsigned char b[4]; |
|
719 |
# lseek (fd, offset, SEEK_SET); |
|
720 |
# read (fd, b, 4); |
|
721 |
# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); |
|
722 |
# } |
|
723 |
# |
|
724 |
# static unsigned int |
|
725 |
# pe_as32 (ptr) |
|
726 |
# void *ptr; |
|
727 |
# { |
|
728 |
# unsigned char *b = ptr; |
|
729 |
# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); |
|
730 |
# } |
|
731 |
# |
|
732 |
# int |
|
733 |
# main (argc, argv) |
|
734 |
# int argc; |
|
735 |
# char *argv[]; |
|
736 |
# { |
|
737 |
# int dll; |
|
738 |
# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; |
|
739 |
# unsigned long export_rva, export_size, nsections, secptr, expptr; |
|
740 |
# unsigned long name_rvas, nexp; |
|
741 |
# unsigned char *expdata, *erva; |
|
742 |
# char *filename, *dll_name; |
|
743 |
# |
|
744 |
# filename = argv[1]; |
|
745 |
# |
|
746 |
# dll = open(filename, O_RDONLY|O_BINARY); |
|
747 |
# if (!dll) |
|
748 |
# return 1; |
|
749 |
# |
|
750 |
# dll_name = filename; |
|
751 |
# |
|
752 |
# for (i=0; filename[i]; i++) |
|
753 |
# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') |
|
754 |
# dll_name = filename + i +1; |
|
755 |
# |
|
756 |
# pe_header_offset = pe_get32 (dll, 0x3c); |
|
757 |
# opthdr_ofs = pe_header_offset + 4 + 20; |
|
758 |
# num_entries = pe_get32 (dll, opthdr_ofs + 92); |
|
759 |
# |
|
760 |
# if (num_entries < 1) /* no exports */ |
|
761 |
# return 1; |
|
762 |
# |
|
763 |
# export_rva = pe_get32 (dll, opthdr_ofs + 96); |
|
764 |
# export_size = pe_get32 (dll, opthdr_ofs + 100); |
|
765 |
# nsections = pe_get16 (dll, pe_header_offset + 4 +2); |
|
766 |
# secptr = (pe_header_offset + 4 + 20 + |
|
767 |
# pe_get16 (dll, pe_header_offset + 4 + 16)); |
|
768 |
# |
|
769 |
# expptr = 0; |
|
770 |
# for (i = 0; i < nsections; i++) |
|
771 |
# { |
|
772 |
# char sname[8]; |
|
773 |
# unsigned long secptr1 = secptr + 40 * i; |
|
774 |
# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); |
|
775 |
# unsigned long vsize = pe_get32 (dll, secptr1 + 16); |
|
776 |
# unsigned long fptr = pe_get32 (dll, secptr1 + 20); |
|
777 |
# lseek(dll, secptr1, SEEK_SET); |
|
778 |
# read(dll, sname, 8); |
|
779 |
# if (vaddr <= export_rva && vaddr+vsize > export_rva) |
|
780 |
# { |
|
781 |
# expptr = fptr + (export_rva - vaddr); |
|
782 |
# if (export_rva + export_size > vaddr + vsize) |
|
783 |
# export_size = vsize - (export_rva - vaddr); |
|
784 |
# break; |
|
785 |
# } |
|
786 |
# } |
|
787 |
# |
|
788 |
# expdata = (unsigned char*)malloc(export_size); |
|
789 |
# lseek (dll, expptr, SEEK_SET); |
|
790 |
# read (dll, expdata, export_size); |
|
791 |
# erva = expdata - export_rva; |
|
792 |
# |
|
793 |
# nexp = pe_as32 (expdata+24); |
|
794 |
# name_rvas = pe_as32 (expdata+32); |
|
795 |
# |
|
796 |
# printf ("EXPORTS\n"); |
|
797 |
# for (i = 0; i<nexp; i++) |
|
798 |
# { |
|
799 |
# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4); |
|
800 |
# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i); |
|
801 |
# } |
|
802 |
# |
|
803 |
# return 0; |
|
804 |
# } |
|
805 |
# /* impgen.c ends here */ |
|
806 |
;; |
|
807 |
*) |
|
808 |
allow_undefined=yes |
|
809 |
;; |
|
810 |
esac |
|
811 |
compile_command="$nonopt" |
|
812 |
finalize_command="$nonopt" |
|
813 |
||
814 |
compile_rpath= |
|
815 |
finalize_rpath= |
|
816 |
compile_shlibpath= |
|
817 |
finalize_shlibpath= |
|
818 |
convenience= |
|
819 |
old_convenience= |
|
820 |
deplibs= |
|
821 |
linkopts= |
|
822 |
||
823 |
if test -n "$shlibpath_var"; then |
|
824 |
# get the directories listed in $shlibpath_var |
|
825 |
eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` |
|
826 |
else |
|
827 |
lib_search_path= |
|
828 |
fi |
|
829 |
# now prepend the system-specific ones |
|
830 |
eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\" |
|
831 |
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" |
|
832 |
||
833 |
avoid_version=no |
|
834 |
dlfiles= |
|
835 |
dlprefiles= |
|
836 |
dlself=no |
|
837 |
export_dynamic=no |
|
838 |
export_symbols= |
|
839 |
export_symbols_regex= |
|
840 |
generated= |
|
841 |
libobjs= |
|
842 |
link_against_libtool_libs= |
|
843 |
ltlibs= |
|
844 |
module=no |
|
845 |
objs= |
|
846 |
prefer_static_libs=no |
|
847 |
preload=no |
|
848 |
prev= |
|
849 |
prevarg= |
|
850 |
release= |
|
851 |
rpath= |
|
852 |
xrpath= |
|
853 |
perm_rpath= |
|
854 |
temp_rpath= |
|
855 |
thread_safe=no |
|
856 |
vinfo= |
|
857 |
||
858 |
# We need to know -static, to get the right output filenames. |
|
859 |
for arg |
|
860 |
do |
|
861 |
case "$arg" in |
|
862 |
-all-static | -static) |
|
863 |
if test "X$arg" = "X-all-static"; then |
|
864 |
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then |
|
865 |
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 |
|
866 |
fi |
|
867 |
if test -n "$link_static_flag"; then |
|
868 |
dlopen_self=$dlopen_self_static |
|
869 |
fi |
|
870 |
else |
|
871 |
if test -z "$pic_flag" && test -n "$link_static_flag"; then |
|
872 |
dlopen_self=$dlopen_self_static |
|
873 |
fi |
|
874 |
fi |
|
875 |
build_libtool_libs=no |
|
876 |
build_old_libs=yes |
|
877 |
prefer_static_libs=yes |
|
878 |
break |
|
879 |
;; |
|
880 |
esac |
|
881 |
done |
|
882 |
||
883 |
# See if our shared archives depend on static archives. |
|
884 |
test -n "$old_archive_from_new_cmds" && build_old_libs=yes |
|
885 |
||
886 |
# Go through the arguments, transforming them on the way. |
|
887 |
while test $# -gt 0; do |
|
888 |
arg="$1" |
|
889 |
shift |
|
890 |
||
891 |
# If the previous option needs an argument, assign it. |
|
892 |
if test -n "$prev"; then |
|
893 |
case "$prev" in |
|
894 |
output) |
|
895 |
compile_command="$compile_command @OUTPUT@" |
|
896 |
finalize_command="$finalize_command @OUTPUT@" |
|
897 |
;; |
|
898 |
esac |
|
899 |
||
900 |
case "$prev" in |
|
901 |
dlfiles|dlprefiles) |
|
902 |
if test "$preload" = no; then |
|
903 |
# Add the symbol object into the linking commands. |
|
904 |
compile_command="$compile_command @SYMFILE@" |
|
905 |
finalize_command="$finalize_command @SYMFILE@" |
|
906 |
preload=yes |
|
907 |
fi |
|
908 |
case "$arg" in |
|
909 |
*.la | *.lo) ;; # We handle these cases below. |
|
910 |
force) |
|
911 |
if test "$dlself" = no; then |
|
912 |
dlself=needless |
|
913 |
export_dynamic=yes |
|
914 |
fi |
|
915 |
prev= |
|
916 |
continue |
|
917 |
;; |
|
918 |
self) |
|
919 |
if test "$prev" = dlprefiles; then |
|
920 |
dlself=yes |
|
921 |
elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then |
|
922 |
dlself=yes |
|
923 |
else |
|
924 |
dlself=needless |
|
925 |
export_dynamic=yes |
|
926 |
fi |
|
927 |
prev= |
|
928 |
continue |
|
929 |
;; |
|
930 |
*) |
|
931 |
if test "$prev" = dlfiles; then |
|
932 |
dlfiles="$dlfiles $arg" |
|
933 |
else |
|
934 |
dlprefiles="$dlprefiles $arg" |
|
935 |
fi |
|
936 |
prev= |
|
937 |
;; |
|
938 |
esac |
|
939 |
;; |
|
940 |
expsyms) |
|
941 |
export_symbols="$arg" |
|
942 |
if test ! -f "$arg"; then |
|
943 |
$echo "$modename: symbol file \`$arg' does not exist" |
|
944 |
exit 1 |
|
945 |
fi |
|
946 |
prev= |
|
947 |
continue |
|
948 |
;; |
|
949 |
expsyms_regex) |
|
950 |
export_symbols_regex="$arg" |
|
951 |
prev= |
|
952 |
continue |
|
953 |
;; |
|
954 |
release) |
|
955 |
release="-$arg" |
|
956 |
prev= |
|
957 |
continue |
|
958 |
;; |
|
959 |
rpath | xrpath) |
|
960 |
# We need an absolute path. |
|
961 |
case "$arg" in |
|
962 |
[\\/]* | [A-Za-z]:[\\/]*) ;; |
|
963 |
*) |
|
964 |
$echo "$modename: only absolute run-paths are allowed" 1>&2 |
|
965 |
exit 1 |
|
966 |
;; |
|
967 |
esac |
|
968 |
if test "$prev" = rpath; then |
|
969 |
case "$rpath " in |
|
970 |
*" $arg "*) ;; |
|
971 |
*) rpath="$rpath $arg" ;; |
|
972 |
esac |
|
973 |
else |
|
974 |
case "$xrpath " in |
|
975 |
*" $arg "*) ;; |
|
976 |
*) xrpath="$xrpath $arg" ;; |
|
977 |
esac |
|
978 |
fi |
|
979 |
prev= |
|
980 |
continue |
|
981 |
;; |
|
982 |
*) |
|
983 |
eval "$prev=\"\$arg\"" |
|
984 |
prev= |
|
985 |
continue |
|
986 |
;; |
|
987 |
esac |
|
988 |
fi |
|
989 |
||
990 |
prevarg="$arg" |
|
991 |
||
992 |
case "$arg" in |
|
993 |
-all-static) |
|
994 |
if test -n "$link_static_flag"; then |
|
995 |
compile_command="$compile_command $link_static_flag" |
|
996 |
finalize_command="$finalize_command $link_static_flag" |
|
997 |
fi |
|
998 |
continue |
|
999 |
;; |
|
1000 |
||
1001 |
-allow-undefined) |
|
1002 |
# FIXME: remove this flag sometime in the future. |
|
1003 |
$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 |
|
1004 |
continue |
|
1005 |
;; |
|
1006 |
||
1007 |
-avoid-version) |
|
1008 |
avoid_version=yes |
|
1009 |
continue |
|
1010 |
;; |
|
1011 |
||
1012 |
-dlopen) |
|
1013 |
prev=dlfiles |
|
1014 |
continue |
|
1015 |
;; |
|
1016 |
||
1017 |
-dlpreopen) |
|
1018 |
prev=dlprefiles |
|
1019 |
continue |
|
1020 |
;; |
|
1021 |
||
1022 |
-export-dynamic) |
|
1023 |
export_dynamic=yes |
|
1024 |
continue |
|
1025 |
;; |
|
1026 |
||
1027 |
-export-symbols | -export-symbols-regex) |
|
1028 |
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then |
|
1029 |
$echo "$modename: not more than one -exported-symbols argument allowed" |
|
1030 |
exit 1 |
|
1031 |
fi |
|
1032 |
if test "X$arg" = "X-export-symbols"; then |
|
1033 |
prev=expsyms |
|
1034 |
else |
|
1035 |
prev=expsyms_regex |
|
1036 |
fi |
|
1037 |
continue |
|
1038 |
;; |
|
1039 |
||
1040 |
-L*) |
|
1041 |
dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` |
|
1042 |
# We need an absolute path. |
|
1043 |
case "$dir" in |
|
1044 |
[\\/]* | [A-Za-z]:[\\/]*) ;; |
|
1045 |
*) |
|
1046 |
absdir=`cd "$dir" && pwd` |
|
1047 |
if test -z "$absdir"; then |
|
1048 |
$echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 |
|
1049 |
$echo "$modename: passing it literally to the linker, although it might fail" 1>&2 |
|
1050 |
absdir="$dir" |
|
1051 |
fi |
|
1052 |
dir="$absdir" |
|
1053 |
;; |
|
1054 |
esac |
|
1055 |
case " $deplibs " in |
|
1056 |
*" $arg "*) ;; |
|
1057 |
*) deplibs="$deplibs $arg";; |
|
1058 |
esac |
|
1059 |
case " $lib_search_path " in |
|
1060 |
*" $dir "*) ;; |
|
1061 |
*) lib_search_path="$lib_search_path $dir";; |
|
1062 |
esac |
|
1063 |
case "$host" in |
|
1064 |
*-*-cygwin* | *-*-mingw* | *-*-os2*) |
|
1065 |
dllsearchdir=`cd "$dir" && pwd || echo "$dir"` |
|
1066 |
case ":$dllsearchpath:" in |
|
1067 |
::) dllsearchpath="$dllsearchdir";; |
|
1068 |
*":$dllsearchdir:"*) ;; |
|
1069 |
*) dllsearchpath="$dllsearchpath:$dllsearchdir";; |
|
1070 |
esac |
|
1071 |
;; |
|
1072 |
esac |
|
1073 |
;; |
|
1074 |
||
1075 |
-l*) |
|
1076 |
if test "$arg" = "-lc"; then |
|
1077 |
case "$host" in |
|
1078 |
*-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos* |*-*-freebsd* ) |
|
1079 |
# These systems don't actually have c library (as such) |
|
1080 |
continue |
|
1081 |
;; |
|
1
cf2af46e9e2a
Changes since SDL 1.2.0 release
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
1082 |
*-*-openbsd*) |
cf2af46e9e2a
Changes since SDL 1.2.0 release
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
1083 |
# Do not include libc due to us having libc/libc_r. |
cf2af46e9e2a
Changes since SDL 1.2.0 release
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
1084 |
continue |
cf2af46e9e2a
Changes since SDL 1.2.0 release
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
1085 |
;; |
0 | 1086 |
esac |
1
cf2af46e9e2a
Changes since SDL 1.2.0 release
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
1087 |
elif test "$arg" = "-lc_r"; then |
cf2af46e9e2a
Changes since SDL 1.2.0 release
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
1088 |
case "$host" in |
cf2af46e9e2a
Changes since SDL 1.2.0 release
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
1089 |
*-*-openbsd*) |
cf2af46e9e2a
Changes since SDL 1.2.0 release
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
1090 |
# Do not include libc_r directly, use -pthread flag. |
cf2af46e9e2a
Changes since SDL 1.2.0 release
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
1091 |
continue |
cf2af46e9e2a
Changes since SDL 1.2.0 release
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
1092 |
;; |
cf2af46e9e2a
Changes since SDL 1.2.0 release
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
1093 |
esac |
0 | 1094 |
elif test "$arg" = "-lm"; then |
1095 |
case "$host" in |
|
1096 |
*-*-cygwin* | *-*-beos*) |
|
1097 |
# These systems don't actually have math library (as such) |
|
1098 |
continue |
|
1099 |
;; |
|
1100 |
esac |
|
1101 |
fi |
|
1102 |
deplibs="$deplibs $arg" |
|
1103 |
;; |
|
1104 |
||
1
cf2af46e9e2a
Changes since SDL 1.2.0 release
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
1105 |
-?thread) |
cf2af46e9e2a
Changes since SDL 1.2.0 release
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
1106 |
deplibs="$deplibs $arg" |
cf2af46e9e2a
Changes since SDL 1.2.0 release
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
1107 |
;; |
cf2af46e9e2a
Changes since SDL 1.2.0 release
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
1108 |
|
0 | 1109 |
-module) |
1110 |
module=yes |
|
1111 |
continue |
|
1112 |
;; |
|
1113 |
||
1114 |
-no-undefined) |
|
1115 |
allow_undefined=no |
|
1116 |
continue |
|
1117 |
;; |
|
1118 |
||
1119 |
-o) prev=output ;; |
|
1120 |
||
1121 |
-release) |
|
1122 |
prev=release |
|
1123 |
continue |
|
1124 |
;; |
|
1125 |
||
1126 |
-rpath) |
|
1127 |
prev=rpath |
|
1128 |
continue |
|
1129 |
;; |
|
1130 |
||
1131 |
-R) |
|
1132 |
prev=xrpath |
|
1133 |
continue |
|
1134 |
;; |
|
1135 |
||
1136 |
-R*) |
|
1137 |
dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` |
|
1138 |
# We need an absolute path. |
|
1139 |
case "$dir" in |
|
1140 |
[\\/]* | [A-Za-z]:[\\/]*) ;; |
|
1141 |
*) |
|
1142 |
$echo "$modename: only absolute run-paths are allowed" 1>&2 |
|
1143 |
exit 1 |
|
1144 |
;; |
|
1145 |
esac |
|
1146 |
case "$xrpath " in |
|
1147 |
*" $dir "*) ;; |
|
1148 |
*) xrpath="$xrpath $dir" ;; |
|
1149 |
esac |
|
1150 |
continue |
|
1151 |
;; |
|
1152 |
||
1153 |
-static) |
|
1154 |
# If we have no pic_flag, then this is the same as -all-static. |
|
1155 |
if test -z "$pic_flag" && test -n "$link_static_flag"; then |
|
1156 |
compile_command="$compile_command $link_static_flag" |
|
1157 |
finalize_command="$finalize_command $link_static_flag" |
|
1158 |
fi |
|
1159 |
continue |
|
1160 |
;; |
|
1161 |
||
1162 |
-thread-safe) |
|
1163 |
thread_safe=yes |
|
1164 |
continue |
|
1165 |
;; |
|
1166 |
||
1167 |
-version-info) |
|
1168 |
prev=vinfo |
|
1169 |
continue |
|
1170 |
;; |
|
1171 |
||
1172 |
# Some other compiler flag. |
|
1173 |
-* | +*) |
|
1174 |
# Unknown arguments in both finalize_command and compile_command need |
|
1175 |
# to be aesthetically quoted because they are evaled later. |
|
1176 |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
|
1177 |
case "$arg" in |
|
1178 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
|
1179 |
arg="\"$arg\"" |
|
1180 |
;; |
|
1181 |
esac |
|
1182 |
;; |
|
1183 |
||
1184 |
*.o | *.obj | *.a | *.lib) |
|
1185 |
# A standard object. |
|
1186 |
objs="$objs $arg" |
|
1187 |
;; |
|
1188 |
||
1189 |
*.lo) |
|
1190 |
# A library object. |
|
1191 |
if test "$prev" = dlfiles; then |
|
1192 |
dlfiles="$dlfiles $arg" |
|
1193 |
if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then |
|
1194 |
prev= |
|
1195 |
continue |
|
1196 |
else |
|
1197 |
# If libtool objects are unsupported, then we need to preload. |
|
1198 |
prev=dlprefiles |
|
1199 |
fi |
|
1200 |
fi |
|
1201 |
||
1202 |
if test "$prev" = dlprefiles; then |
|
1203 |
# Preload the old-style object. |
|
1204 |
dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` |
|
1205 |
prev= |
|
1206 |
fi |
|
1207 |
libobjs="$libobjs $arg" |
|
1208 |
;; |
|
1209 |
||
1210 |
*.la) |
|
1211 |
# A libtool-controlled library. |
|
1212 |
||
1213 |
dlname= |
|
1214 |
libdir= |
|
1215 |
library_names= |
|
1216 |
old_library= |
|
1217 |
||
1218 |
# Check to see that this really is a libtool archive. |
|
1219 |
if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : |
|
1220 |
else |
|
1221 |
$echo "$modename: \`$arg' is not a valid libtool archive" 1>&2 |
|
1222 |
exit 1 |
|
1223 |
fi |
|
1224 |
||
1225 |
# If the library was installed with an old release of libtool, |
|
1226 |
# it will not redefine variable installed. |
|
1227 |
installed=yes |
|
1228 |
||
1229 |
# Read the .la file |
|
1230 |
# If there is no directory component, then add one. |
|
1231 |
case "$arg" in |
|
1232 |
*/* | *\\*) . $arg ;; |
|
1233 |
*) . ./$arg ;; |
|
1234 |
esac |
|
1235 |
||
1236 |
# Get the name of the library we link against. |
|
1237 |
linklib= |
|
1238 |
for l in $old_library $library_names; do |
|
1239 |
linklib="$l" |
|
1240 |
done |
|
1241 |
||
1242 |
if test -z "$linklib"; then |
|
1243 |
$echo "$modename: cannot find name of link library for \`$arg'" 1>&2 |
|
1244 |
exit 1 |
|
1245 |
fi |
|
1246 |
||
1247 |
# Find the relevant object directory and library name. |
|
1248 |
name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'` |
|
1249 |
||
1250 |
if test "X$installed" = Xyes; then |
|
1251 |
dir="$libdir" |
|
1252 |
else |
|
1253 |
dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` |
|
1254 |
if test "X$dir" = "X$arg"; then |
|
1255 |
dir="$objdir" |
|
1256 |
else |
|
1257 |
dir="$dir/$objdir" |
|
1258 |
fi |
|
1259 |
fi |
|
1260 |
||
1261 |
if test -n "$dependency_libs"; then |
|
1262 |
# Extract -R and -L from dependency_libs |
|
1263 |
temp_deplibs= |
|
1264 |
for deplib in $dependency_libs; do |
|
1265 |
case "$deplib" in |
|