blob: cb8174715ae6d80fe4d5bb2a23548826e285c616 [file] [log] [blame]
Daniel Veillard36169f81998-07-24 19:30:47 +00001# ltmain.sh - Provide generalized library-building support services.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002# NOTE: Changing this file will not affect anything until you rerun ltconfig.
3#
4# Copyright (C) 1996-1998 Free Software Foundation, Inc.
Daniel Veillard36169f81998-07-24 19:30:47 +00005# 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
Daniel Veillardda4d3c41998-11-04 20:07:05 +000026# Check that we have a working $echo.
27if test "X$1" = X--no-reexec; then
28 # Discard the --no-reexec flag, and continue.
29 shift
30elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
31 # Yippee, $echo works!
32 :
Miguel de Icaza442321c1998-11-04 18:13:38 +000033else
Daniel Veillardda4d3c41998-11-04 20:07:05 +000034 # Restart under the correct shell, and then maybe $echo will work.
35 exec $SHELL "$0" --no-reexec ${1+"$@"}
Miguel de Icaza442321c1998-11-04 18:13:38 +000036fi
37
Daniel Veillard36169f81998-07-24 19:30:47 +000038# The name of this program.
39progname=`$echo "$0" | sed 's%^.*/%%'`
Daniel Veillardda4d3c41998-11-04 20:07:05 +000040modename="$progname"
Daniel Veillard36169f81998-07-24 19:30:47 +000041
42# Constants.
43PROGRAM=ltmain.sh
44PACKAGE=libtool
Daniel Veillardda4d3c41998-11-04 20:07:05 +000045VERSION=1.2b
Daniel Veillard36169f81998-07-24 19:30:47 +000046
47default_mode=
48help="Try \`$progname --help' for more information."
49magic="%%%MAGIC variable%%%"
50mkdir="mkdir"
51mv="mv -f"
52rm="rm -f"
53
54# Sed substitution that helps us do robust quoting. It backslashifies
55# metacharacters that are still active within double-quoted strings.
Daniel Veillardda4d3c41998-11-04 20:07:05 +000056Xsed='sed -e s/^X//'
57sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
Daniel Veillard36169f81998-07-24 19:30:47 +000058
59# NLS nuisances.
60# Only set LANG and LC_ALL to C if already set.
61# These must not be set unconditionally because not all systems understand
62# e.g. LANG=C (notably SCO).
Daniel Veillardda4d3c41998-11-04 20:07:05 +000063# We save the old values to restore during execute mode.
64if test "${LC_ALL+set}" = set; then
65 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
66fi
67if test "${LANG+set}" = set; then
68 save_LANG="$LANG"; LANG=C; export LANG
69fi
Daniel Veillard36169f81998-07-24 19:30:47 +000070
71if test "$LTCONFIG_VERSION" != "$VERSION"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +000072 echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
73 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +000074 exit 1
75fi
76
77if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +000078 echo "$modename: not configured to build any kind of library" 1>&2
79 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +000080 exit 1
81fi
82
83# Global variables.
84mode=$default_mode
85nonopt=
86prev=
87prevopt=
88run=
89show="$echo"
90show_help=
91execute_dlfiles=
92
93# Parse our command line options once, thoroughly.
94while test $# -gt 0
95do
96 arg="$1"
97 shift
98
99 case "$arg" in
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000100 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
Daniel Veillard36169f81998-07-24 19:30:47 +0000101 *) optarg= ;;
102 esac
103
104 # If the previous option needs an argument, assign it.
105 if test -n "$prev"; then
106 case "$prev" in
107 execute_dlfiles)
108 eval "$prev=\"\$$prev \$arg\""
109 ;;
110 *)
111 eval "$prev=\$arg"
112 ;;
113 esac
114
115 prev=
116 prevopt=
117 continue
118 fi
119
120 # Have we seen a non-optional argument yet?
121 case "$arg" in
122 --help)
123 show_help=yes
124 ;;
125
126 --version)
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000127 echo "$PROGRAM (GNU $PACKAGE) $VERSION"
Daniel Veillard36169f81998-07-24 19:30:47 +0000128 exit 0
129 ;;
130
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000131 --config)
132 sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
133 exit 0
134 ;;
135
136 --debug)
137 echo "$progname: enabling shell trace mode"
138 set -x
139 ;;
140
Daniel Veillard36169f81998-07-24 19:30:47 +0000141 --dry-run | -n)
142 run=:
143 ;;
144
145 --features)
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000146 echo "host: $host"
Daniel Veillard36169f81998-07-24 19:30:47 +0000147 if test "$build_libtool_libs" = yes; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000148 echo "enable shared libraries"
Daniel Veillard36169f81998-07-24 19:30:47 +0000149 else
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000150 echo "disable shared libraries"
Daniel Veillard36169f81998-07-24 19:30:47 +0000151 fi
152 if test "$build_old_libs" = yes; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000153 echo "enable static libraries"
Daniel Veillard36169f81998-07-24 19:30:47 +0000154 else
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000155 echo "disable static libraries"
Daniel Veillard36169f81998-07-24 19:30:47 +0000156 fi
157 exit 0
158 ;;
159
160 --finish) mode="finish" ;;
161
162 --mode) prevopt="--mode" prev=mode ;;
163 --mode=*) mode="$optarg" ;;
164
165 --quiet | --silent)
166 show=:
167 ;;
168
169 -dlopen)
170 prevopt="-dlopen"
171 prev=execute_dlfiles
172 ;;
173
174 -*)
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000175 $echo "$modename: unrecognized option \`$arg'" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +0000176 $echo "$help" 1>&2
177 exit 1
178 ;;
179
180 *)
181 nonopt="$arg"
182 break
183 ;;
184 esac
185done
186
187if test -n "$prevopt"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000188 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +0000189 $echo "$help" 1>&2
190 exit 1
191fi
192
193if test -z "$show_help"; then
194
195 # Infer the operation mode.
196 if test -z "$mode"; then
197 case "$nonopt" in
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000198 *cc | *++ | gcc* | *-gcc*)
Daniel Veillard36169f81998-07-24 19:30:47 +0000199 mode=link
200 for arg
201 do
202 case "$arg" in
203 -c)
204 mode=compile
205 break
206 ;;
207 esac
208 done
209 ;;
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000210 *db | *dbx | *strace | *truss)
Daniel Veillard36169f81998-07-24 19:30:47 +0000211 mode=execute
212 ;;
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000213 *install*|cp|mv)
Daniel Veillard36169f81998-07-24 19:30:47 +0000214 mode=install
215 ;;
216 *rm)
217 mode=uninstall
218 ;;
219 *)
220 # If we have no mode, but dlfiles were specified, then do execute mode.
221 test -n "$execute_dlfiles" && mode=execute
222
223 # Just use the default operation mode.
224 if test -z "$mode"; then
225 if test -n "$nonopt"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000226 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +0000227 else
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000228 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +0000229 fi
230 fi
231 ;;
232 esac
233 fi
234
235 # Only execute mode is allowed to have -dlopen flags.
236 if test -n "$execute_dlfiles" && test "$mode" != execute; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000237 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +0000238 $echo "$help" 1>&2
239 exit 1
240 fi
241
242 # Change the help message to a mode-specific one.
243 generic_help="$help"
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000244 help="Try \`$modename --help --mode=$mode' for more information."
Daniel Veillard36169f81998-07-24 19:30:47 +0000245
246 # These modes are in order of execution frequency so that they run quickly.
247 case "$mode" in
248 # libtool compile mode
249 compile)
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000250 modename="$modename: compile"
Daniel Veillard36169f81998-07-24 19:30:47 +0000251 # Get the compilation command and the source file.
252 base_compile=
253 lastarg=
254 srcfile="$nonopt"
255 suppress_output=
256
257 for arg
258 do
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000259 # Accept any command-line options.
260 case "$arg" in
261 -o)
262 $echo "$modename: you cannot specify the output filename with \`-o'" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +0000263 $echo "$help" 1>&2
264 exit 1
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000265 ;;
266
267 -static)
268 build_old_libs=yes
269 continue
270 ;;
271 esac
Daniel Veillard36169f81998-07-24 19:30:47 +0000272
273 # Accept the current argument as the source file.
274 lastarg="$srcfile"
275 srcfile="$arg"
276
277 # Aesthetically quote the previous argument.
278
279 # Backslashify any backslashes, double quotes, and dollar signs.
280 # These are the only characters that are still specially
281 # interpreted inside of double-quoted scrings.
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000282 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
Daniel Veillard36169f81998-07-24 19:30:47 +0000283
284 # Double-quote args containing other shell metacharacters.
285 # Many Bourne shells cannot handle close brackets correctly in scan
286 # sets, so we specify it separately.
287 case "$lastarg" in
288 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
289 lastarg="\"$lastarg\""
290 ;;
291 esac
292
293 # Add the previous argument to base_compile.
294 if test -z "$base_compile"; then
295 base_compile="$lastarg"
296 else
297 base_compile="$base_compile $lastarg"
298 fi
299 done
300
301 # Get the name of the library object.
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000302 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
Daniel Veillard36169f81998-07-24 19:30:47 +0000303
304 # Recognize several different file suffixes.
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000305 xform='[cCFSfms]'
Daniel Veillard36169f81998-07-24 19:30:47 +0000306 case "$libobj" in
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000307 *.ada) xform=ada ;;
308 *.adb) xform=adb ;;
309 *.ads) xform=ads ;;
310 *.asm) xform=asm ;;
Daniel Veillard36169f81998-07-24 19:30:47 +0000311 *.c++) xform=c++ ;;
312 *.cc) xform=cc ;;
313 *.cpp) xform=cpp ;;
314 *.cxx) xform=cxx ;;
315 *.f90) xform=f90 ;;
316 *.for) xform=for ;;
317 esac
318
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000319 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
Daniel Veillard36169f81998-07-24 19:30:47 +0000320
321 case "$libobj" in
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000322 *.lo) obj=`$echo "X$libobj" | $Xsed -e 's/\.lo$/.o/'` ;;
Daniel Veillard36169f81998-07-24 19:30:47 +0000323 *)
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000324 $echo "$modename: cannot determine name of library object from \`$srcfile'" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +0000325 exit 1
326 ;;
327 esac
328
329 if test -z "$base_compile"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000330 $echo "$modename: you must specify a compilation command" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +0000331 $echo "$help" 1>&2
332 exit 1
333 fi
334
335 # Delete any leftover library objects.
336 if test "$build_old_libs" = yes; then
337 $run $rm $obj $libobj
338 trap "$run $rm $obj $libobj; exit 1" 1 2 15
339 else
340 $run $rm $libobj
341 trap "$run $rm $libobj; exit 1" 1 2 15
342 fi
343
344 # Only build a PIC object if we are building libtool libraries.
345 if test "$build_libtool_libs" = yes; then
346 # Without this assignment, base_compile gets emptied.
347 fbsd_hideous_sh_bug=$base_compile
348
349 # All platforms use -DPIC, to notify preprocessed assembler code.
350 $show "$base_compile$pic_flag -DPIC $srcfile"
351 if $run eval "$base_compile\$pic_flag -DPIC \$srcfile"; then :
352 else
353 test -n "$obj" && $run $rm $obj
354 exit 1
355 fi
356
357 # If we have no pic_flag, then copy the object into place and finish.
358 if test -z "$pic_flag"; then
359 $show "$LN_S $obj $libobj"
360 $run $LN_S $obj $libobj
361 exit $?
362 fi
363
364 # Just move the object, then go on to compile the next one
365 $show "$mv $obj $libobj"
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000366 $run $mv $obj $libobj || exit $?
Daniel Veillard36169f81998-07-24 19:30:47 +0000367
368 # Allow error messages only from the first compilation.
369 suppress_output=' >/dev/null 2>&1'
370 fi
371
372 # Only build a position-dependent object if we build old libraries.
373 if test "$build_old_libs" = yes; then
374 # Suppress compiler output if we already did a PIC compilation.
375 $show "$base_compile $srcfile$suppress_output"
376 if $run eval "$base_compile \$srcfile$suppress_output"; then :
377 else
378 $run $rm $obj $libobj
379 exit 1
380 fi
381 fi
382
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000383 # Create an invalid libtool object if no PIC, so that we do not
384 # accidentally link it into a program.
Daniel Veillard36169f81998-07-24 19:30:47 +0000385 if test "$build_libtool_libs" != yes; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000386 $show "echo timestamp > $libobj"
387 $run eval "echo timestamp > \$libobj" || exit $?
Daniel Veillard36169f81998-07-24 19:30:47 +0000388 fi
389
390 exit 0
391 ;;
392
393 # libtool link mode
394 link)
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000395 modename="$modename: link"
Daniel Veillard36169f81998-07-24 19:30:47 +0000396 CC="$nonopt"
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000397 allow_undefined=yes
Daniel Veillard36169f81998-07-24 19:30:47 +0000398 compile_command="$CC"
399 finalize_command="$CC"
400
401 compile_shlibpath=
402 finalize_shlibpath=
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000403 convenience=
404 old_convenience=
Daniel Veillard36169f81998-07-24 19:30:47 +0000405 deplibs=
406 dlfiles=
407 dlprefiles=
408 export_dynamic=no
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000409 generated=
Daniel Veillard36169f81998-07-24 19:30:47 +0000410 hardcode_libdirs=
411 libobjs=
412 link_against_libtool_libs=
413 ltlibs=
414 objs=
415 prev=
416 prevarg=
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000417 release=
Daniel Veillard36169f81998-07-24 19:30:47 +0000418 rpath=
419 perm_rpath=
420 temp_rpath=
421 vinfo=
422
423 # We need to know -static, to get the right output filenames.
424 for arg
425 do
426 case "$arg" in
427 -all-static | -static)
428 if test "X$arg" = "X-all-static" && test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000429 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +0000430 fi
431 build_libtool_libs=no
432 build_old_libs=yes
433 break
434 ;;
435 esac
436 done
437
438 # See if our shared archives depend on static archives.
439 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
440
441 # Go through the arguments, transforming them on the way.
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000442 while test $# -gt 0; do
443 arg="$1"
444 shift
445
Daniel Veillard36169f81998-07-24 19:30:47 +0000446 # If the previous option needs an argument, assign it.
447 if test -n "$prev"; then
448 case "$prev" in
449 output)
450 compile_command="$compile_command @OUTPUT@"
451 finalize_command="$finalize_command @OUTPUT@"
452 ;;
453 esac
454
455 case "$prev" in
456 dlfiles|dlprefiles)
457 case "$arg" in
458 *.la | *.lo) ;; # We handle these cases below.
459 *)
460 dlprefiles="$dlprefiles $arg"
461 test "$prev" = dlfiles && dlfiles="$dlfiles $arg"
462 prev=
463 ;;
464 esac
465 ;;
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000466 release)
467 release="-$arg"
468 prev=
469 continue
470 ;;
Daniel Veillard36169f81998-07-24 19:30:47 +0000471 rpath)
472 rpath="$rpath $arg"
473 prev=
474 continue
475 ;;
476 *)
477 eval "$prev=\"\$arg\""
478 prev=
479 continue
480 ;;
481 esac
482 fi
483
484 prevarg="$arg"
485
486 case "$arg" in
487 -all-static)
488 if test -n "$link_static_flag"; then
489 compile_command="$compile_command $link_static_flag"
490 finalize_command="$finalize_command $link_static_flag"
491 fi
492 continue
493 ;;
494
495 -allow-undefined)
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000496 # FIXME: remove this flag sometime in the future.
497 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +0000498 continue
499 ;;
500
501 -dlopen)
502 prev=dlfiles
503 continue
504 ;;
505
506 -dlpreopen)
507 prev=dlprefiles
508 continue
509 ;;
510
511 -export-dynamic)
512 if test "$export_dynamic" != yes; then
513 export_dynamic=yes
514 if test -n "$export_dynamic_flag_spec"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000515 eval arg=\"$export_dynamic_flag_spec\"
Daniel Veillard36169f81998-07-24 19:30:47 +0000516 else
517 arg=
518 fi
519
520 # Add the symbol object into the linking commands.
521 compile_command="$compile_command @SYMFILE@"
522 finalize_command="$finalize_command @SYMFILE@"
523 fi
524 ;;
525
526 -L*)
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000527 dir=`$echo "X$arg" | $Xsed -e 's%^-L\(.*\)$%\1%'`
Daniel Veillard36169f81998-07-24 19:30:47 +0000528 case "$dir" in
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000529 /* | [A-Za-z]:[/\\]*)
Daniel Veillard36169f81998-07-24 19:30:47 +0000530 # Add the corresponding hardcode_libdir_flag, if it is not identical.
531 ;;
532 *)
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000533 $echo "$modename: \`-L$dir' cannot specify a relative directory" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +0000534 exit 1
535 ;;
536 esac
537 deplibs="$deplibs $arg"
538 ;;
539
540 -l*) deplibs="$deplibs $arg" ;;
541
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000542 -no-undefined)
543 allow_undefined=no
544 continue
545 ;;
546
Daniel Veillard36169f81998-07-24 19:30:47 +0000547 -o) prev=output ;;
548
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000549 -release)
550 prev=release
551 continue
552 ;;
553
Daniel Veillard36169f81998-07-24 19:30:47 +0000554 -rpath)
555 prev=rpath
556 continue
557 ;;
558
559 -static)
560 # If we have no pic_flag, then this is the same as -all-static.
561 if test -z "$pic_flag" && test -n "$link_static_flag"; then
562 compile_command="$compile_command $link_static_flag"
563 finalize_command="$finalize_command $link_static_flag"
564 fi
565 continue
566 ;;
567
568 -version-info)
569 prev=vinfo
570 continue
571 ;;
572
573 # Some other compiler flag.
574 -* | +*)
575 # Unknown arguments in both finalize_command and compile_command need
576 # to be aesthetically quoted because they are evaled later.
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000577 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
Daniel Veillard36169f81998-07-24 19:30:47 +0000578 case "$arg" in
579 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
580 arg="\"$arg\""
581 ;;
582 esac
583 ;;
584
585 *.o | *.a)
586 # A standard object.
587 objs="$objs $arg"
588 ;;
589
590 *.lo)
591 # A library object.
592 if test "$prev" = dlfiles; then
593 dlfiles="$dlfiles $arg"
594 if test "$build_libtool_libs" = yes; then
595 prev=
596 continue
597 else
598 # If libtool objects are unsupported, then we need to preload.
599 prev=dlprefiles
600 fi
601 fi
602
603 if test "$prev" = dlprefiles; then
604 # Preload the old-style object.
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000605 dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e 's/\.lo$/.o/'`
Daniel Veillard36169f81998-07-24 19:30:47 +0000606 prev=
607 fi
608 libobjs="$libobjs $arg"
609 ;;
610
611 *.la)
612 # A libtool-controlled library.
613
614 dlname=
615 libdir=
616 library_names=
617 old_library=
618
619 # Check to see that this really is a libtool archive.
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000620 if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
Daniel Veillard36169f81998-07-24 19:30:47 +0000621 else
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000622 $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +0000623 exit 1
624 fi
625
626 # If there is no directory component, then add one.
627 case "$arg" in
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000628 */* | *\\*) . $arg ;;
Daniel Veillard36169f81998-07-24 19:30:47 +0000629 *) . ./$arg ;;
630 esac
631
Daniel Veillard36169f81998-07-24 19:30:47 +0000632 # Get the name of the library we link against.
633 linklib=
634 for l in $old_library $library_names; do
635 linklib="$l"
636 done
637
638 if test -z "$linklib"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000639 $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +0000640 exit 1
641 fi
642
643 # Find the relevant object directory and library name.
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000644 name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
645 dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
Daniel Veillard36169f81998-07-24 19:30:47 +0000646 if test "X$dir" = "X$arg"; then
647 dir="$objdir"
648 else
649 dir="$dir/$objdir"
650 fi
651
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000652 if test -z "$libdir"; then
653 # It is a libtool convenience library, so add in its objects.
654 convenience="$convenience $dir/$old_library"l
655 old_convenience="$old_convenience $dir/$old_library"
656 compile_command="$compile_command $dir/$old_library"
657 finalize_command="$finalize_command $dir/$old_library"
658 continue
659 fi
660
Daniel Veillard36169f81998-07-24 19:30:47 +0000661 # This library was specified with -dlopen.
662 if test "$prev" = dlfiles; then
663 dlfiles="$dlfiles $arg"
664 if test -z "$dlname"; then
665 # If there is no dlname, we need to preload.
666 prev=dlprefiles
667 else
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000668 # We should not create a dependency on this library, but we
669 # may need any libraries it requires.
670 compile_command="$compile_command$dependency_libs"
671 finalize_command="$finalize_command$dependency_libs"
Daniel Veillard36169f81998-07-24 19:30:47 +0000672 prev=
673 continue
674 fi
675 fi
676
677 # The library was specified with -dlpreopen.
678 if test "$prev" = dlprefiles; then
679 # Prefer using a static library (so that no silly _DYNAMIC symbols
680 # are required to link).
681 if test -n "$old_library"; then
682 dlprefiles="$dlprefiles $dir/$old_library"
683 else
684 dlprefiles="$dlprefiles $dir/$linklib"
685 fi
686 prev=
687 fi
688
689 if test "$build_libtool_libs" = yes && test -n "$library_names"; then
690 link_against_libtool_libs="$link_against_libtool_libs $arg"
691 if test -n "$shlibpath_var"; then
692 # Make sure the rpath contains only unique directories.
693 case "$temp_rpath " in
694 *" $dir "*) ;;
695 *) temp_rpath="$temp_rpath $dir" ;;
696 esac
697 fi
698
699 # This is the magic to use -rpath.
700 if test -n "$hardcode_libdir_flag_spec"; then
701 if test -n "$hardcode_libdir_separator"; then
702 if test -z "$hardcode_libdirs"; then
703 # Put the magic libdir with the hardcode flag.
704 hardcode_libdirs="$libdir"
705 libdir="@HARDCODE_LIBDIRS@"
706 else
707 # Just accumulate the unique libdirs.
708 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
709 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
710 ;;
711 *)
712 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
713 ;;
714 esac
715 libdir=
716 fi
717 fi
718
719 if test -n "$libdir"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000720 eval flag=\"$hardcode_libdir_flag_spec\"
Daniel Veillard36169f81998-07-24 19:30:47 +0000721
722 compile_command="$compile_command $flag"
723 finalize_command="$finalize_command $flag"
724 fi
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000725 elif test -n "$runpath_var"; then
Daniel Veillard36169f81998-07-24 19:30:47 +0000726 # Do the same for the permanent run path.
727 case "$perm_rpath " in
728 *" $libdir "*) ;;
729 *) perm_rpath="$perm_rpath $libdir" ;;
730 esac
731 fi
732
733
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000734 lib_linked=yes
Daniel Veillard36169f81998-07-24 19:30:47 +0000735 case "$hardcode_action" in
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000736 immediate | unsupported)
Daniel Veillard36169f81998-07-24 19:30:47 +0000737 if test "$hardcode_direct" = no; then
738 compile_command="$compile_command $dir/$linklib"
739 elif test "$hardcode_minus_L" = no; then
740 compile_command="$compile_command -L$dir -l$name"
741 elif test "$hardcode_shlibpath_var" = no; then
742 compile_shlibpath="$compile_shlibpath$dir:"
743 compile_command="$compile_command -l$name"
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000744 else
745 lib_linked=no
Daniel Veillard36169f81998-07-24 19:30:47 +0000746 fi
747 ;;
748
749 relink)
750 # We need an absolute path.
751 case "$dir" in
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000752 /* | [A-Za-z]:[/\\]*) ;;
Daniel Veillard36169f81998-07-24 19:30:47 +0000753 *)
754 absdir=`cd "$dir" && pwd`
755 if test -z "$absdir"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000756 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +0000757 exit 1
758 fi
759 dir="$absdir"
760 ;;
761 esac
762
763 if test "$hardcode_direct" = yes; then
764 compile_command="$compile_command $dir/$linklib"
765 elif test "$hardcode_minus_L" = yes; then
766 compile_command="$compile_command -L$dir -l$name"
767 elif test "$hardcode_shlibpath_var" = yes; then
768 compile_shlibpath="$compile_shlibpath$dir:"
769 compile_command="$compile_command -l$name"
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000770 else
771 lib_linked=no
Daniel Veillard36169f81998-07-24 19:30:47 +0000772 fi
773 ;;
774
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000775 *)
776 lib_linked=no
777 ;;
Daniel Veillard36169f81998-07-24 19:30:47 +0000778 esac
779
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000780 if test "$lib_linked" != yes; then
781 $echo "$modename: configuration error: unsupported hardcode properties"
782 exit 1
783 fi
784
Daniel Veillard36169f81998-07-24 19:30:47 +0000785 # Finalize command for both is simple: just hardcode it.
786 if test "$hardcode_direct" = yes; then
787 finalize_command="$finalize_command $libdir/$linklib"
788 elif test "$hardcode_minus_L" = yes; then
789 finalize_command="$finalize_command -L$libdir -l$name"
790 elif test "$hardcode_shlibpath_var" = yes; then
791 finalize_shlibpath="$finalize_shlibpath$libdir:"
792 finalize_command="$finalize_command -l$name"
793 else
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000794 # We cannot seem to hardcode it, guess we'll fake it.
Daniel Veillard36169f81998-07-24 19:30:47 +0000795 finalize_command="$finalize_command -L$libdir -l$name"
796 fi
797 else
798 # Transform directly to old archives if we don't build new libraries.
799 if test -n "$pic_flag" && test -z "$old_library"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000800 $echo "$modename: cannot find static library for \`$arg'" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +0000801 exit 1
802 fi
803
804 # Here we assume that one of hardcode_direct or hardcode_minus_L
805 # is not unsupported. This is valid on all known static and
806 # shared platforms.
807 if test "$hardcode_direct" != unsupported; then
808 test -n "$old_library" && linklib="$old_library"
809 compile_command="$compile_command $dir/$linklib"
810 finalize_command="$finalize_command $dir/$linklib"
811 else
812 compile_command="$compile_command -L$dir -l$name"
813 finalize_command="$finalize_command -L$dir -l$name"
814 fi
815 fi
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000816
817 # Add in any libraries that this one depends upon.
818 compile_command="$compile_command$dependency_libs"
819 finalize_command="$finalize_command$dependency_libs"
Daniel Veillard36169f81998-07-24 19:30:47 +0000820 continue
821 ;;
822
823 # Some other compiler argument.
824 *)
825 # Unknown arguments in both finalize_command and compile_command need
826 # to be aesthetically quoted because they are evaled later.
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000827 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
Daniel Veillard36169f81998-07-24 19:30:47 +0000828 case "$arg" in
829 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
830 arg="\"$arg\""
831 ;;
832 esac
833 ;;
834 esac
835
836 # Now actually substitute the argument into the commands.
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000837 if test -n "$arg"; then
838 compile_command="$compile_command $arg"
839 finalize_command="$finalize_command $arg"
840 fi
Daniel Veillard36169f81998-07-24 19:30:47 +0000841 done
842
843 if test -n "$prev"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000844 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +0000845 $echo "$help" 1>&2
846 exit 1
847 fi
848
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000849 oldlibs=
Daniel Veillard36169f81998-07-24 19:30:47 +0000850 case "$output" in
851 "")
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000852 $echo "$modename: you must specify an output file" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +0000853 $echo "$help" 1>&2
854 exit 1
855 ;;
856
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000857 */* | *\\*)
858 $echo "$modename: output file \`$output' must have no directory components" 1>&2
859 $echo "$help" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +0000860 exit 1
861 ;;
862
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000863 *.a)
864 if test -n "$link_against_libtool_libs"; then
865 $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
866 exit 1
867 fi
868
869 if test -n "$deplibs"; then
870 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
871 fi
872
873 if test -n "$dlfiles$dlprefiles"; then
874 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
875 fi
876
877 if test -n "$rpath"; then
878 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
879 fi
880
881 if test -n "$vinfo"; then
882 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
883 fi
884
885 if test -n "$release"; then
886 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
887 fi
888
889 # Now set the variables for building old libraries.
890 build_libtool_libs=no
891 oldlibs="$output"
892 ;;
893
Daniel Veillard36169f81998-07-24 19:30:47 +0000894 *.la)
895 # Make sure we only generate libraries of the form `libNAME.la'.
896 case "$output" in
897 lib*) ;;
898 *)
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000899 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +0000900 $echo "$help" 1>&2
901 exit 1
902 ;;
903 esac
904
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000905 name=`$echo "X$output" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
906 eval libname=\"$libname_spec\"
Daniel Veillard36169f81998-07-24 19:30:47 +0000907
908 # All the library-specific variables (install_libdir is set above).
909 library_names=
910 old_library=
911 dlname=
Daniel Veillard36169f81998-07-24 19:30:47 +0000912
913 if test -n "$objs"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000914 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
Daniel Veillard36169f81998-07-24 19:30:47 +0000915 exit 1
916 fi
917
918 # How the heck are we supposed to write a wrapper for a shared library?
919 if test -n "$link_against_libtool_libs"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000920 $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +0000921 exit 1
922 fi
923
Daniel Veillard36169f81998-07-24 19:30:47 +0000924 if test -n "$dlfiles$dlprefiles"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000925 $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +0000926 fi
927
928 set dummy $rpath
929 if test $# -gt 2; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000930 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +0000931 fi
932 install_libdir="$2"
933
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000934 # Now set the variables for building old libraries.
935 oldlibs="$objdir/$libname.a"
936 if test -z "$rpath"; then
937 # Building a libtool convenience library.
938 oldlibs="$objdir/$libname.al $oldlibs"
939 build_libtool_libs=convenience
Daniel Veillard36169f81998-07-24 19:30:47 +0000940
Daniel Veillardda4d3c41998-11-04 20:07:05 +0000941 if test -n "$vinfo"; then
942 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
943 fi
944
945 if test -n "$release"; then
946 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
947 fi
948 else
949
950 # Parse the version information argument.
951 IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
952 set dummy $vinfo 0 0 0
953 IFS="$save_ifs"
954
955 if test -n "$8"; then
956 $echo "$modename: too many parameters to \`-version-info'" 1>&2
957 $echo "$help" 1>&2
958 exit 1
959 fi
960
961 current="$2"
962 revision="$3"
963 age="$4"
964
965 # Check that each of the things are valid numbers.
966 case "$current" in
967 0 | [1-9] | [1-9][0-9]*) ;;
968 *)
969 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
970 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
971 exit 1
972 ;;
973 esac
974
975 case "$revision" in
976 0 | [1-9] | [1-9][0-9]*) ;;
977 *)
978 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
979 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
980 exit 1
981 ;;
982 esac
983
984 case "$age" in
985 0 | [1-9] | [1-9][0-9]*) ;;
986 *)
987 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
988 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
989 exit 1
990 ;;
991 esac
992
993 if test $age -gt $current; then
994 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
995 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
996 exit 1
997 fi
998
999 # Calculate the version variables.
1000 major=
1001 versuffix=
1002 verstring=
1003 case "$version_type" in
1004 none) ;;
1005
1006 linux)
1007 major=.`expr $current - $age`
1008 versuffix="$major.$age.$revision"
1009 ;;
1010
1011 osf)
1012 major=`expr $current - $age`
1013 versuffix=".$current.$age.$revision"
1014 verstring="$current.$age.$revision"
1015
1016 # Add in all the interfaces that we are compatible with.
1017 loop=$age
1018 while test $loop != 0; do
1019 iface=`expr $current - $loop`
1020 loop=`expr $loop - 1`
1021 verstring="$verstring:${iface}.0"
1022 done
1023
1024 # Make executables depend on our current version.
1025 verstring="$verstring:${current}.0"
1026 ;;
1027
1028 sunos)
1029 major=".$current"
1030 versuffix=".$current.$revision"
1031 ;;
1032
1033 *)
1034 $echo "$modename: unknown library version type \`$version_type'" 1>&2
1035 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
1036 exit 1
1037 ;;
1038 esac
1039
1040 # Clear the version info if we defaulted, and they specified a release.
1041 if test -z "$vinfo" && test -n "$release"; then
1042 major=
1043 versuffix=
1044 verstring="0.0"
1045 fi
1046
1047 # Check to see if the archive will have undefined symbols.
1048 if test "$allow_undefined" = yes; then
1049 if test "$allow_undefined_flag" = unsupported; then
1050 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
1051 build_libtool_libs=no
1052 build_old_libs=yes
1053 fi
1054 else
1055 # Don't allow undefined symbols.
1056 allow_undefined_flag="$no_undefined_flag"
1057 fi
1058
1059 # Add libc to deplibs on all systems.
1060 dependency_libs="$deplibs"
1061 deplibs="$deplibs -lc"
Daniel Veillard36169f81998-07-24 19:30:47 +00001062 fi
1063
Daniel Veillard36169f81998-07-24 19:30:47 +00001064 # Create the output directory, or remove our outputs if we need to.
1065 if test -d $objdir; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001066 $show "${rm}r $objdir/$output $objdir/$libname.* $objdir/${libname}${release}.*"
1067 $run ${rm}r $objdir/$output $objdir/$libname.* $objdir/${libname}${release}.*
Daniel Veillard36169f81998-07-24 19:30:47 +00001068 else
1069 $show "$mkdir $objdir"
1070 $run $mkdir $objdir
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001071 status=$?
1072 if test $status -ne 0 && test ! -d $objdir; then
1073 exit $status
Daniel Veillard36169f81998-07-24 19:30:47 +00001074 fi
Daniel Veillard36169f81998-07-24 19:30:47 +00001075 fi
1076
1077 if test "$build_libtool_libs" = yes; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001078 # Get the real and link names of the library.
1079 eval library_names=\"$library_names_spec\"
1080 set dummy $library_names
1081 realname="$2"
1082 shift; shift
Daniel Veillard36169f81998-07-24 19:30:47 +00001083
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001084 if test -n "$soname_spec"; then
1085 eval soname=\"$soname_spec\"
1086 else
1087 soname="$realname"
1088 fi
Daniel Veillard36169f81998-07-24 19:30:47 +00001089
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001090 lib="$objdir/$realname"
Daniel Veillard36169f81998-07-24 19:30:47 +00001091 for link
1092 do
1093 linknames="$linknames $link"
1094 done
1095
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001096 # Use standard objects if they are PIC.
1097 test -z "$pic_flag" && libobjs=`$echo "X$libobjs " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//g'`
Daniel Veillard36169f81998-07-24 19:30:47 +00001098
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001099 # Transform .lo files to .o files.
1100 test "$build_old_libs" = yes && oldobjs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^ ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
Daniel Veillard36169f81998-07-24 19:30:47 +00001101
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001102 if test -n "$whole_archive_flag_spec"; then
1103 if test -n "$convenience"; then
1104 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
1105 fi
1106 else
1107 for xlib in $convenience; do
1108 # Extract the objects.
1109 xdir="$xlib"x
1110 generated="$generated $xdir"
1111 xlib=`echo "$xlib" | $Xsed -e 's%^.*/%%'`
Daniel Veillard36169f81998-07-24 19:30:47 +00001112
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001113 $show "${rm}r $xdir"
1114 $run ${rm}r "$xdir"
1115 $show "mkdir $xdir"
1116 $run mkdir "$xdir"
1117 status=$?
1118 if test $status -ne 0 && test ! -d "$xdir"; then
1119 exit $status
1120 fi
1121 $show "(cd $xdir && $AR x ../$xlib)"
1122 $run eval "(cd \$xdir && $AR x ../\$xlib)" || exit $?
1123
1124 libobjs="$libobjs `echo $xdir/*`"
1125 done
1126 fi
1127
1128 # Do each of the archive commands.
1129 eval cmds=\"$archive_cmds\"
1130 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
1131 for cmd in $cmds; do
1132 IFS="$save_ifs"
1133 $show "$cmd"
1134 $run eval "$cmd" || exit $?
1135 done
1136 IFS="$save_ifs"
1137
1138 # Create links to the real library.
1139 for linkname in $linknames; do
1140 if test "$realname" != "$linkname"; then
1141 $show "(cd $objdir && $LN_S $realname $linkname)"
1142 $run eval '(cd $objdir && $LN_S $realname $linkname)' || exit $?
1143 fi
1144 done
1145
1146 # If -export-dynamic was specified, set the dlname.
1147 if test "$export_dynamic" = yes; then
1148 # On all known operating systems, these are identical.
1149 dlname="$soname"
1150 fi
Daniel Veillard36169f81998-07-24 19:30:47 +00001151 fi
1152 ;;
1153
1154 *.lo | *.o)
1155 if test -n "$link_against_libtool_libs"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001156 $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00001157 exit 1
1158 fi
1159
1160 if test -n "$deplibs"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001161 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00001162 fi
1163
1164 if test -n "$dlfiles$dlprefiles"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001165 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00001166 fi
1167
1168 if test -n "$rpath"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001169 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00001170 fi
1171
1172 if test -n "$vinfo"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001173 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
1174 fi
1175
1176 if test -n "$release"; then
1177 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00001178 fi
1179
1180 case "$output" in
1181 *.lo)
1182 if test -n "$objs"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001183 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00001184 exit 1
1185 fi
1186 libobj="$output"
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001187 obj=`$echo "X$output" | $Xsed -e 's/\.lo$/.o/'`
Daniel Veillard36169f81998-07-24 19:30:47 +00001188 ;;
1189 *)
1190 libobj=
1191 obj="$output"
1192 ;;
1193 esac
1194
1195 # Delete the old objects.
1196 $run $rm $obj $libobj
1197
1198 # Create the old-style object.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001199 reload_objs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^ ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
Daniel Veillard36169f81998-07-24 19:30:47 +00001200
1201 output="$obj"
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001202 eval cmds=\"$reload_cmds\"
Daniel Veillard36169f81998-07-24 19:30:47 +00001203 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
1204 for cmd in $cmds; do
1205 IFS="$save_ifs"
1206 $show "$cmd"
1207 $run eval "$cmd" || exit $?
1208 done
1209 IFS="$save_ifs"
1210
1211 # Exit if we aren't doing a library object file.
1212 test -z "$libobj" && exit 0
1213
1214 if test "$build_libtool_libs" != yes; then
1215 # Create an invalid libtool object if no PIC, so that we don't
1216 # accidentally link it into a program.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001217 $show "echo timestamp > $libobj"
1218 $run eval "echo timestamp > $libobj" || exit $?
Daniel Veillard36169f81998-07-24 19:30:47 +00001219 exit 0
1220 fi
1221
1222 if test -n "$pic_flag"; then
1223 # Only do commands if we really have different PIC objects.
1224 reload_objs="$libobjs"
1225 output="$libobj"
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001226 eval cmds=\"$reload_cmds\"
Daniel Veillard36169f81998-07-24 19:30:47 +00001227 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
1228 for cmd in $cmds; do
1229 IFS="$save_ifs"
1230 $show "$cmd"
1231 $run eval "$cmd" || exit $?
1232 done
1233 IFS="$save_ifs"
1234 else
1235 # Just create a symlink.
1236 $show "$LN_S $obj $libobj"
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001237 $run $LN_S $obj $libobj || exit $?
Daniel Veillard36169f81998-07-24 19:30:47 +00001238 fi
1239
1240 exit 0
1241 ;;
1242
1243 *)
1244 if test -n "$vinfo"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001245 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
1246 fi
1247
1248 if test -n "$release"; then
1249 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00001250 fi
1251
1252 if test -n "$rpath"; then
1253 # If the user specified any rpath flags, then add them.
1254 for libdir in $rpath; do
1255 if test -n "$hardcode_libdir_flag_spec"; then
1256 if test -n "$hardcode_libdir_separator"; then
1257 if test -z "$hardcode_libdirs"; then
1258 # Put the magic libdir with the hardcode flag.
1259 hardcode_libdirs="$libdir"
1260 libdir="@HARDCODE_LIBDIRS@"
1261 else
1262 # Just accumulate the unique libdirs.
1263 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
1264 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
1265 ;;
1266 *)
1267 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
1268 ;;
1269 esac
1270 libdir=
1271 fi
1272 fi
1273
1274 if test -n "$libdir"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001275 eval flag=\"$hardcode_libdir_flag_spec\"
Daniel Veillard36169f81998-07-24 19:30:47 +00001276
1277 compile_command="$compile_command $flag"
1278 finalize_command="$finalize_command $flag"
1279 fi
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001280 elif test -n "$runpath_var"; then
Daniel Veillard36169f81998-07-24 19:30:47 +00001281 case "$perm_rpath " in
1282 *" $libdir "*) ;;
1283 *) perm_rpath="$perm_rpath $libdir" ;;
1284 esac
1285 fi
1286 done
1287 fi
1288
1289 # Substitute the hardcoded libdirs into the compile commands.
1290 if test -n "$hardcode_libdir_separator"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001291 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
1292 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
Daniel Veillard36169f81998-07-24 19:30:47 +00001293 fi
1294
1295 if test -n "$libobjs" && test "$build_old_libs" = yes; then
1296 # Transform all the library objects into standard objects.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001297 compile_command=`$echo "X$compile_command " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
1298 finalize_command=`$echo "X$finalize_command " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
Daniel Veillard36169f81998-07-24 19:30:47 +00001299 fi
1300
1301 if test "$export_dynamic" = yes && test -n "$NM" && test -n "$global_symbol_pipe"; then
1302 dlsyms="${output}S.c"
1303 else
1304 dlsyms=
1305 fi
1306
1307 if test -n "$dlsyms"; then
1308 # Add our own program objects to the preloaded list.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001309 dlprefiles=`$echo "X$objs$dlprefiles " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
Daniel Veillard36169f81998-07-24 19:30:47 +00001310
1311 # Discover the nlist of each of the dlfiles.
1312 nlist="$objdir/${output}.nm"
1313
1314 if test -d $objdir; then
1315 $show "$rm $nlist ${nlist}T"
1316 $run $rm "$nlist" "${nlist}T"
1317 else
1318 $show "$mkdir $objdir"
1319 $run $mkdir $objdir
1320 status=$?
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001321 if test $status -ne 0 && test ! -d $objdir; then
Daniel Veillard36169f81998-07-24 19:30:47 +00001322 exit $status
1323 fi
1324 fi
1325
1326 for arg in $dlprefiles; do
1327 $show "extracting global C symbols from \`$arg'"
1328 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
1329 done
1330
1331 # Parse the name list into a source file.
1332 $show "creating $objdir/$dlsyms"
1333 if test -z "$run"; then
1334 # Make sure we at least have an empty file.
1335 test -f "$nlist" || : > "$nlist"
1336
1337 # Try sorting and uniquifying the output.
1338 if sort "$nlist" | uniq > "$nlist"T; then
1339 mv -f "$nlist"T "$nlist"
1340 wcout=`wc "$nlist" 2>/dev/null`
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001341 count=`echo "X$wcout" | $Xsed -e 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
Daniel Veillard36169f81998-07-24 19:30:47 +00001342 (test "$count" -ge 0) 2>/dev/null || count=-1
1343 else
1344 $rm "$nlist"T
1345 count=-1
1346 fi
1347
1348 case "$dlsyms" in
1349 "") ;;
1350 *.c)
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001351 $echo > "$objdir/$dlsyms" "\
Daniel Veillard36169f81998-07-24 19:30:47 +00001352/* $dlsyms - symbol resolution table for \`$output' dlsym emulation. */
1353/* Generated by $PROGRAM - GNU $PACKAGE $VERSION */
1354
1355#ifdef __cplusplus
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001356extern \"C\" {
Daniel Veillard36169f81998-07-24 19:30:47 +00001357#endif
1358
1359/* Prevent the only kind of declaration conflicts we can make. */
1360#define dld_preloaded_symbol_count some_other_symbol
1361#define dld_preloaded_symbols some_other_symbol
1362
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001363/* External symbol declarations for the compiler. */\
1364"
1365
Daniel Veillard36169f81998-07-24 19:30:47 +00001366 if test -f "$nlist"; then
1367 sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$objdir/$dlsyms"
1368 else
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001369 echo '/* NONE */' >> "$objdir/$dlsyms"
Daniel Veillard36169f81998-07-24 19:30:47 +00001370 fi
1371
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001372 $echo >> "$objdir/$dlsyms" "\
Daniel Veillard36169f81998-07-24 19:30:47 +00001373
1374#undef dld_preloaded_symbol_count
1375#undef dld_preloaded_symbols
1376
1377#if defined (__STDC__) && __STDC__
1378# define __ptr_t void *
1379#else
1380# define __ptr_t char *
1381#endif
1382
1383/* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
1384int dld_preloaded_symbol_count = $count;
1385
1386/* The mapping between symbol names and symbols. */
1387struct {
1388 char *name;
1389 __ptr_t address;
1390}
1391dld_preloaded_symbols[] =
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001392{\
1393"
Daniel Veillard36169f81998-07-24 19:30:47 +00001394
1395 if test -f "$nlist"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001396 sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$nlist" >> "$objdir/$dlsyms"
Daniel Veillard36169f81998-07-24 19:30:47 +00001397 fi
1398
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001399 $echo >> "$objdir/$dlsyms" "\
1400 {0, (__ptr_t) 0}
Daniel Veillard36169f81998-07-24 19:30:47 +00001401};
1402
1403#ifdef __cplusplus
1404}
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001405#endif\
1406"
Daniel Veillard36169f81998-07-24 19:30:47 +00001407 ;;
1408
1409 *)
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001410 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00001411 exit 1
1412 ;;
1413 esac
1414 fi
1415
1416 # Now compile the dynamic symbol file.
1417 $show "(cd $objdir && $CC -c$no_builtin_flag \"$dlsyms\")"
1418 $run eval '(cd $objdir && $CC -c$no_builtin_flag "$dlsyms")' || exit $?
1419
1420 # Transform the symbol file into the correct name.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001421 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.o%"`
1422 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.o%"`
Daniel Veillard36169f81998-07-24 19:30:47 +00001423 elif test "$export_dynamic" != yes; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001424 test -n "$dlfiles$dlprefiles" && $echo "$modename: warning: \`-dlopen' and \`-dlpreopen' are ignored without \`-export-dynamic'" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00001425 else
1426 # We keep going just in case the user didn't refer to
1427 # dld_preloaded_symbols. The linker will fail if global_symbol_pipe
1428 # really was required.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001429 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00001430
1431 # Nullify the symbol file.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001432 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
1433 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
Daniel Veillard36169f81998-07-24 19:30:47 +00001434 fi
1435
1436 if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
1437 # Replace the output file specification.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001438 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
1439 finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
Daniel Veillard36169f81998-07-24 19:30:47 +00001440
1441 # We have no uninstalled library dependencies, so finalize right now.
1442 $show "$compile_command"
1443 $run eval "$compile_command"
1444 exit $?
1445 fi
1446
1447 # Replace the output file specification.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001448 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$objdir/$output"'%g'`
1449 finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$objdir/$output"'T%g'`
Daniel Veillard36169f81998-07-24 19:30:47 +00001450
1451 # Create the binary in the object directory, then wrap it.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001452 if test ! -d $objdir; then
Daniel Veillard36169f81998-07-24 19:30:47 +00001453 $show "$mkdir $objdir"
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001454 $run $mkdir $objdir
1455 status=$?
1456 if test $status -ne 0 && test ! -d $objdir; then
1457 exit $status
1458 fi
Daniel Veillard36169f81998-07-24 19:30:47 +00001459 fi
1460
1461 if test -n "$shlibpath_var"; then
1462 # We should set the shlibpath_var
1463 rpath=
1464 for dir in $temp_rpath; do
1465 case "$dir" in
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001466 /* | [A-Za-z]:[/\\]*)
Daniel Veillard36169f81998-07-24 19:30:47 +00001467 # Absolute path.
1468 rpath="$rpath$dir:"
1469 ;;
1470 *)
1471 # Relative path: add a thisdir entry.
1472 rpath="$rpath\$thisdir/$dir:"
1473 ;;
1474 esac
1475 done
1476 temp_rpath="$rpath"
1477 fi
1478
1479 # Delete the old output file.
1480 $run $rm $output
1481
1482 if test -n "$compile_shlibpath"; then
1483 compile_command="$shlibpath_var=\"$compile_shlibpath\$$shlibpath_var\" $compile_command"
1484 fi
1485 if test -n "$finalize_shlibpath"; then
1486 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
1487 fi
1488
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001489 if test -n "$runpath_var" && test -n "$perm_rpath"; then
Daniel Veillard36169f81998-07-24 19:30:47 +00001490 # We should set the runpath_var.
1491 rpath=
1492 for dir in $perm_rpath; do
1493 rpath="$rpath$dir:"
1494 done
1495 compile_command="$runpath_var=\"$rpath\$$runpath_var\" $compile_command"
1496 finalize_command="$runpath_var=\"$rpath\$$runpath_var\" $finalize_command"
1497 fi
1498
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001499 if test "$hardcode_action" = relink; then
Daniel Veillard36169f81998-07-24 19:30:47 +00001500 # AGH! Flame the AIX and HP-UX people for me, will ya?
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001501 $echo "$modename: warning: using a buggy system linker" 1>&2
1502 $echo "$modename: relinking will be required before \`$output' can be installed" 1>&2
1503 fi
Daniel Veillard36169f81998-07-24 19:30:47 +00001504
1505 $show "$compile_command"
1506 $run eval "$compile_command" || exit $?
1507
1508 # Now create the wrapper script.
1509 $show "creating $output"
1510
1511 # Quote the finalize command for shipping.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001512 finalize_command=`$echo "X$finalize_command" | $Xsed -e "$sed_quote_subst"`
1513
1514 # Quote $echo for shipping.
1515 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
Daniel Veillard36169f81998-07-24 19:30:47 +00001516
1517 # Only actually do things if our run command is non-null.
1518 if test -z "$run"; then
1519 $rm $output
1520 trap "$rm $output; exit 1" 1 2 15
1521
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001522 $echo > $output "\
1523#! $SHELL
Daniel Veillard36169f81998-07-24 19:30:47 +00001524
1525# $output - temporary wrapper script for $objdir/$output
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001526# Generated by $PROGRAM - GNU $PACKAGE $VERSION
Daniel Veillard36169f81998-07-24 19:30:47 +00001527#
1528# The $output program cannot be directly executed until all the libtool
1529# libraries that it depends on are installed.
1530#
1531# This wrapper script should never be moved out of \``pwd`'.
1532# If it is, it will not operate correctly.
1533
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001534# Sed substitution that helps us do robust quoting. It backslashifies
1535# metacharacters that are still active within double-quoted strings.
1536Xsed='sed -e s/^X//'
1537sed_quote_subst='$sed_quote_subst'
1538
1539# The HP-UX ksh and POSIX shell print the target directory to stdout
1540# if CDPATH is set.
1541if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
1542
Daniel Veillard36169f81998-07-24 19:30:47 +00001543# This environment variable determines our operation mode.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001544if test \"\$libtool_install_magic\" = \"$magic\"; then
Daniel Veillard36169f81998-07-24 19:30:47 +00001545 # install mode needs the following variables:
1546 link_against_libtool_libs='$link_against_libtool_libs'
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001547 finalize_command=\"$finalize_command\"
Daniel Veillard36169f81998-07-24 19:30:47 +00001548else
1549 # When we are sourced in execute mode, \$file and \$echo are already set.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001550 if test \"\$libtool_execute_magic\" != \"$magic\"; then
1551 echo=\"$qecho\"
1552 file=\"\$0\"
1553 # Make sure echo works.
1554 if test \"X\$1\" = X--no-reexec; then
1555 # Discard the --no-reexec flag, and continue.
1556 shift
1557 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
1558 # Yippee, \$echo works!
1559 :
1560 else
1561 # Restart under the correct shell, and then maybe \$echo will work.
1562 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
1563 fi
1564 fi\
1565"
1566 $echo >> $output "\
Daniel Veillard36169f81998-07-24 19:30:47 +00001567
1568 # Find the directory that this script lives in.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001569 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
1570 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
Daniel Veillard36169f81998-07-24 19:30:47 +00001571
1572 # Follow symbolic links until we get to the real thisdir.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001573 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
1574 while test -n \"\$file\"; do
1575 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
Daniel Veillard36169f81998-07-24 19:30:47 +00001576
1577 # If there was a directory component, then change thisdir.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001578 if test \"x\$destdir\" != \"x\$file\"; then
1579 case \"\$destdir\" in
1580 /* | [A-Za-z]:[/\\]*) thisdir=\"\$destdir\" ;;
1581 *) thisdir=\"\$thisdir/\$destdir\" ;;
Daniel Veillard36169f81998-07-24 19:30:47 +00001582 esac
1583 fi
1584
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001585 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
1586 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
Daniel Veillard36169f81998-07-24 19:30:47 +00001587 done
1588
1589 # Try to get the absolute directory name.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001590 absdir=\`cd \"\$thisdir\" && pwd\`
1591 test -n \"\$absdir\" && thisdir=\"\$absdir\"
Daniel Veillard36169f81998-07-24 19:30:47 +00001592
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001593 progdir=\"\$thisdir/$objdir\"
Daniel Veillard36169f81998-07-24 19:30:47 +00001594 program='$output'
1595
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001596 if test -f \"\$progdir/\$program\"; then"
Daniel Veillard36169f81998-07-24 19:30:47 +00001597
1598 # Export our shlibpath_var if we have one.
1599 if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001600 $echo >> $output "\
Daniel Veillard36169f81998-07-24 19:30:47 +00001601 # Add our own library path to $shlibpath_var
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001602 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
Daniel Veillard36169f81998-07-24 19:30:47 +00001603
1604 # Some systems cannot cope with colon-terminated $shlibpath_var
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001605 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/:*\$//'\`
Daniel Veillard36169f81998-07-24 19:30:47 +00001606
1607 export $shlibpath_var
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001608"
Daniel Veillard36169f81998-07-24 19:30:47 +00001609 fi
1610
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001611 $echo >> $output "\
1612 if test \"\$libtool_execute_magic\" != \"$magic\"; then
Daniel Veillard36169f81998-07-24 19:30:47 +00001613 # Run the actual program with our arguments.
Daniel Veillard36169f81998-07-24 19:30:47 +00001614
1615 # Export the path to the program.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001616 PATH=\"\$progdir:\$PATH\"
Daniel Veillard36169f81998-07-24 19:30:47 +00001617 export PATH
1618
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001619 exec \$program \${1+\"\$@\"}
Daniel Veillard36169f81998-07-24 19:30:47 +00001620
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001621 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
Daniel Veillard36169f81998-07-24 19:30:47 +00001622 exit 1
1623 fi
1624 else
1625 # The program doesn't exist.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001626 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
1627 \$echo \"This script is just a wrapper for \$program.\" 1>&2
1628 echo \"See the $PACKAGE documentation for more information.\" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00001629 exit 1
1630 fi
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001631fi\
1632"
Daniel Veillard36169f81998-07-24 19:30:47 +00001633 chmod +x $output
1634 fi
1635 exit 0
1636 ;;
1637 esac
1638
Daniel Veillard36169f81998-07-24 19:30:47 +00001639 # See if we need to build an old-fashioned archive.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001640 for oldlib in $oldlibs; do
Daniel Veillard36169f81998-07-24 19:30:47 +00001641
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001642 if test "$build_libtool_libs" = convenience; then
1643 oldobjs="$libobjs"
1644 addlibs="$convenience"
1645 build_libtool_libs=no
Daniel Veillard36169f81998-07-24 19:30:47 +00001646 else
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001647 addlibs="$old_convenience"
Daniel Veillard36169f81998-07-24 19:30:47 +00001648 fi
1649
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001650 # Add in members from convenience archives.
1651 for xlib in $addlibs; do
1652 # Extract the objects.
1653 xdir="$xlib"x
1654 generated="$generated $xdir"
1655 xlib=`echo "$xlib" | $Xsed -e 's%^.*/%%'`
1656
1657 $show "${rm}r $xdir"
1658 $run ${rm}r "$xdir"
1659 $show "mkdir $xdir"
1660 $run mkdir "$xdir"
1661 status=$?
1662 if test $status -ne 0 && test ! -d "$xdir"; then
1663 exit $status
1664 fi
1665 $show "(cd $xdir && $AR x ../$xlib)"
1666 $run eval "(cd \$xdir && $AR x ../\$xlib)" || exit $?
1667
1668 oldobjs="$oldobjs `echo $xdir/*`"
1669 done
1670
Daniel Veillard36169f81998-07-24 19:30:47 +00001671 # Do each command in the archive commands.
1672 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001673 eval cmds=\"$old_archive_from_new_cmds\"
Daniel Veillard36169f81998-07-24 19:30:47 +00001674 else
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001675 eval cmds=\"$old_archive_cmds\"
Daniel Veillard36169f81998-07-24 19:30:47 +00001676 fi
1677 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
1678 for cmd in $cmds; do
1679 IFS="$save_ifs"
1680 $show "$cmd"
1681 $run eval "$cmd" || exit $?
1682 done
1683 IFS="$save_ifs"
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001684 done
1685
1686 if test -n "$generated"; then
1687 $show "${rm}r$generated"
1688 $run ${rm}r$generated
Daniel Veillard36169f81998-07-24 19:30:47 +00001689 fi
1690
1691 # Now create the libtool archive.
1692 case "$output" in
1693 *.la)
1694 old_library=
1695 test "$build_old_libs" = yes && old_library="$libname.a"
Daniel Veillard36169f81998-07-24 19:30:47 +00001696 $show "creating $output"
1697
1698 # Only create the output if not a dry run.
1699 if test -z "$run"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001700 $echo > $output "\
Daniel Veillard36169f81998-07-24 19:30:47 +00001701# $output - a libtool library file
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001702# Generated by $PROGRAM - GNU $PACKAGE $VERSION
Daniel Veillard36169f81998-07-24 19:30:47 +00001703
1704# The name that we can dlopen(3).
1705dlname='$dlname'
1706
1707# Names of this library.
1708library_names='$library_names'
1709
1710# The name of the static archive.
1711old_library='$old_library'
1712
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001713# Libraries that this one depends upon.
1714dependency_libs='$dependency_libs'
1715
Daniel Veillard36169f81998-07-24 19:30:47 +00001716# Version information for $libname.
1717current=$current
1718age=$age
1719revision=$revision
1720
1721# Directory that this library needs to be installed in:
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001722libdir='$install_libdir'\
1723"
Daniel Veillard36169f81998-07-24 19:30:47 +00001724 fi
1725
1726 # Do a symbolic link so that the libtool archive can be found in
1727 # LD_LIBRARY_PATH before the program is installed.
1728 $show "(cd $objdir && $LN_S ../$output $output)"
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001729 $run eval "(cd $objdir && $LN_S ../$output $output)" || exit $?
Daniel Veillard36169f81998-07-24 19:30:47 +00001730 ;;
1731 esac
1732 exit 0
1733 ;;
1734
1735 # libtool install mode
1736 install)
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001737 modename="$modename: install"
Daniel Veillard36169f81998-07-24 19:30:47 +00001738
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001739 # There may be an optional sh(1) argument at the beginning of
Daniel Veillard36169f81998-07-24 19:30:47 +00001740 # install_prog (especially on Windows NT).
1741 if test "$nonopt" = "$SHELL"; then
1742 # Aesthetically quote it.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001743 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
Daniel Veillard36169f81998-07-24 19:30:47 +00001744 case "$arg" in
1745 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1746 arg="\"$arg\""
1747 ;;
1748 esac
1749 install_prog="$arg "
1750 arg="$1"
1751 shift
1752 else
1753 install_prog=
1754 arg="$nonopt"
1755 fi
1756
1757 # The real first argument should be the name of the installation program.
1758 # Aesthetically quote it.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001759 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
Daniel Veillard36169f81998-07-24 19:30:47 +00001760 case "$arg" in
1761 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1762 arg="\"$arg\""
1763 ;;
1764 esac
1765 install_prog="$install_prog$arg"
1766
1767 # We need to accept at least all the BSD install flags.
1768 dest=
1769 files=
1770 opts=
1771 prev=
1772 install_type=
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001773 isdir=no
Daniel Veillard36169f81998-07-24 19:30:47 +00001774 stripme=
1775 for arg
1776 do
1777 if test -n "$dest"; then
1778 files="$files $dest"
1779 dest="$arg"
1780 continue
1781 fi
1782
1783 case "$arg" in
1784 -d) isdir=yes ;;
1785 -f) prev="-f" ;;
1786 -g) prev="-g" ;;
1787 -m) prev="-m" ;;
1788 -o) prev="-o" ;;
1789 -s)
1790 stripme=" -s"
1791 continue
1792 ;;
1793 -*) ;;
1794
1795 *)
1796 # If the previous option needed an argument, then skip it.
1797 if test -n "$prev"; then
1798 prev=
1799 else
1800 dest="$arg"
1801 continue
1802 fi
1803 ;;
1804 esac
1805
1806 # Aesthetically quote the argument.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001807 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
Daniel Veillard36169f81998-07-24 19:30:47 +00001808 case "$arg" in
1809 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1810 arg="\"$arg\""
1811 ;;
1812 esac
1813 install_prog="$install_prog $arg"
1814 done
1815
1816 if test -z "$install_prog"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001817 $echo "$modename: you must specify an install program" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00001818 $echo "$help" 1>&2
1819 exit 1
1820 fi
1821
1822 if test -n "$prev"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001823 $echo "$modename: the \`$prev' option requires an argument" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00001824 $echo "$help" 1>&2
1825 exit 1
1826 fi
1827
1828 if test -z "$files"; then
1829 if test -z "$dest"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001830 $echo "$modename: no file or destination specified" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00001831 else
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001832 $echo "$modename: you must specify a destination" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00001833 fi
1834 $echo "$help" 1>&2
1835 exit 1
1836 fi
1837
1838 # Strip any trailing slash from the destination.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001839 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
Daniel Veillard36169f81998-07-24 19:30:47 +00001840
1841 # Check to see that the destination is a directory.
1842 test -d "$dest" && isdir=yes
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001843 if test "$isdir" = yes; then
Daniel Veillard36169f81998-07-24 19:30:47 +00001844 destdir="$dest"
1845 destname=
1846 else
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001847 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
Daniel Veillard36169f81998-07-24 19:30:47 +00001848 test "X$destdir" = "X$dest" && destdir=.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001849 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
Daniel Veillard36169f81998-07-24 19:30:47 +00001850
1851 # Not a directory, so check to see that there is only one file specified.
1852 set dummy $files
1853 if test $# -gt 2; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001854 $echo "$modename: \`$dest' is not a directory" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00001855 $echo "$help" 1>&2
1856 exit 1
1857 fi
1858 fi
1859 case "$destdir" in
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001860 /* | [A-Za-z]:[/\\]*) ;;
Daniel Veillard36169f81998-07-24 19:30:47 +00001861 *)
1862 for file in $files; do
1863 case "$file" in
1864 *.lo) ;;
1865 *)
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001866 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00001867 $echo "$help" 1>&2
1868 exit 1
1869 ;;
1870 esac
1871 done
1872 ;;
1873 esac
1874
1875 # This variable tells wrapper scripts just to set variables rather
1876 # than running their programs.
1877 libtool_install_magic="$magic"
1878
1879 staticlibs=
1880 future_libdirs=
1881 current_libdirs=
1882 for file in $files; do
1883
1884 # Do each installation.
1885 case "$file" in
1886 *.a)
1887 # Do the static libraries later.
1888 staticlibs="$staticlibs $file"
1889 ;;
1890
1891 *.la)
1892 # Check to see that this really is a libtool archive.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001893 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
Daniel Veillard36169f81998-07-24 19:30:47 +00001894 else
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001895 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00001896 $echo "$help" 1>&2
1897 exit 1
1898 fi
1899
1900 library_names=
1901 old_library=
1902 # If there is no directory component, then add one.
1903 case "$file" in
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001904 */* | *\\*) . $file ;;
Daniel Veillard36169f81998-07-24 19:30:47 +00001905 *) . ./$file ;;
1906 esac
1907
1908 # Add the libdir to current_libdirs if it is the destination.
1909 if test "X$destdir" = "X$libdir"; then
1910 case "$current_libdirs " in
1911 *" $libdir "*) ;;
1912 *) current_libdirs="$current_libdirs $libdir" ;;
1913 esac
1914 else
1915 # Note the libdir as a future libdir.
1916 case "$future_libdirs " in
1917 *" $libdir "*) ;;
1918 *) future_libdirs="$future_libdirs $libdir" ;;
1919 esac
1920 fi
1921
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001922 dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
Daniel Veillard36169f81998-07-24 19:30:47 +00001923 test "X$dir" = "X$file/" && dir=
1924 dir="$dir$objdir"
1925
1926 # See the names of the shared library.
1927 set dummy $library_names
1928 if test -n "$2"; then
1929 realname="$2"
1930 shift
1931 shift
1932
1933 # Install the shared library and build the symlinks.
1934 $show "$install_prog $dir/$realname $destdir/$realname"
1935 $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
1936 test "X$dlname" = "X$realname" && dlname=
1937
Daniel Veillard36169f81998-07-24 19:30:47 +00001938 if test $# -gt 0; then
1939 # Delete the old symlinks.
1940 rmcmd="$rm"
1941 for linkname
1942 do
1943 rmcmd="$rmcmd $destdir/$linkname"
1944 done
1945 $show "$rmcmd"
1946 $run $rmcmd
1947
1948 # ... and create new ones.
1949 for linkname
1950 do
1951 test "X$dlname" = "X$linkname" && dlname=
1952 $show "(cd $destdir && $LN_S $realname $linkname)"
1953 $run eval "(cd $destdir && $LN_S $realname $linkname)"
1954 done
1955 fi
1956
1957 if test -n "$dlname"; then
1958 # Install the dynamically-loadable library.
1959 $show "$install_prog $dir/$dlname $destdir/$dlname"
1960 $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $?
1961 fi
1962
1963 # Do each command in the postinstall commands.
1964 lib="$destdir/$realname"
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001965 eval cmds=\"$postinstall_cmds\"
Daniel Veillard36169f81998-07-24 19:30:47 +00001966 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
1967 for cmd in $cmds; do
1968 IFS="$save_ifs"
1969 $show "$cmd"
1970 $run eval "$cmd" || exit $?
1971 done
1972 IFS="$save_ifs"
1973 fi
1974
1975 # Install the pseudo-library for information purposes.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001976 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
Daniel Veillard36169f81998-07-24 19:30:47 +00001977 $show "$install_prog $file $destdir/$name"
1978 $run eval "$install_prog $file $destdir/$name" || exit $?
1979
1980 # Maybe install the static library, too.
1981 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
1982 ;;
1983
1984 *.lo)
1985 # Install (i.e. copy) a libtool object.
1986
1987 # Figure out destination file name, if it wasn't already specified.
1988 if test -n "$destname"; then
1989 destfile="$destdir/$destname"
1990 else
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001991 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
Daniel Veillard36169f81998-07-24 19:30:47 +00001992 destfile="$destdir/$destfile"
1993 fi
1994
1995 # Deduce the name of the destination old-style object file.
1996 case "$destfile" in
1997 *.lo)
Daniel Veillardda4d3c41998-11-04 20:07:05 +00001998 staticdest=`$echo "X$destfile" | $Xsed -e 's/\.lo$/.o/'`
Daniel Veillard36169f81998-07-24 19:30:47 +00001999 ;;
2000 *.o)
2001 staticdest="$destfile"
2002 destfile=
2003 ;;
2004 *)
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002005 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00002006 $echo "$help" 1>&2
2007 exit 1
2008 ;;
2009 esac
2010
2011 # Install the libtool object if requested.
2012 if test -n "$destfile"; then
2013 $show "$install_prog $file $destfile"
2014 $run eval "$install_prog $file $destfile" || exit $?
2015 fi
2016
2017 # Install the old object if enabled.
2018 if test "$build_old_libs" = yes; then
2019 # Deduce the name of the old-style object file.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002020 staticobj=`$echo "X$file" | $Xsed -e 's/\.lo$/.o/'`
Daniel Veillard36169f81998-07-24 19:30:47 +00002021
2022 $show "$install_prog $staticobj $staticdest"
2023 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
2024 fi
2025 exit 0
2026 ;;
2027
2028 *)
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002029 # Figure out destination file name, if it wasn't already specified.
2030 if test -n "$destname"; then
2031 destfile="$destdir/$destname"
2032 else
2033 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
2034 destfile="$destdir/$destfile"
2035 fi
2036
Daniel Veillard36169f81998-07-24 19:30:47 +00002037 # Do a test to see if this is really a libtool program.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002038 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
Daniel Veillard36169f81998-07-24 19:30:47 +00002039 link_against_libtool_libs=
2040 finalize_command=
2041
2042 # If there is no directory component, then add one.
2043 case "$file" in
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002044 */* | *\\*) . $file ;;
Daniel Veillard36169f81998-07-24 19:30:47 +00002045 *) . ./$file ;;
2046 esac
2047
2048 # Check the variables that should have been set.
2049 if test -z "$link_against_libtool_libs" || test -z "$finalize_command"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002050 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00002051 exit 1
2052 fi
2053
2054 finalize=yes
2055 for lib in $link_against_libtool_libs; do
2056 # Check to see that each library is installed.
2057 libdir=
2058 if test -f "$lib"; then
2059 # If there is no directory component, then add one.
2060 case "$lib" in
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002061 */* | *\\*) . $lib ;;
Daniel Veillard36169f81998-07-24 19:30:47 +00002062 *) . ./$lib ;;
2063 esac
2064 fi
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002065 libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
2066 if test -n "$libdir" && test ! -f "$libfile"; then
2067 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00002068 finalize=no
2069 fi
2070 done
2071
2072 if test "$hardcode_action" = relink; then
2073 if test "$finalize" = yes; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002074 $echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00002075 $show "$finalize_command"
2076 if $run eval "$finalize_command"; then :
2077 else
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002078 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00002079 continue
2080 fi
2081 file="$objdir/$file"T
2082 else
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002083 $echo "$modename: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00002084 fi
2085 else
2086 # Install the binary that we compiled earlier.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002087 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
Daniel Veillard36169f81998-07-24 19:30:47 +00002088 fi
2089 fi
2090
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002091 $show "$install_prog$stripme $file $destfile"
2092 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
Daniel Veillard36169f81998-07-24 19:30:47 +00002093 ;;
2094 esac
2095 done
2096
2097 for file in $staticlibs; do
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002098 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
Daniel Veillard36169f81998-07-24 19:30:47 +00002099
2100 # Set up the ranlib parameters.
2101 oldlib="$destdir/$name"
2102
2103 $show "$install_prog $file $oldlib"
2104 $run eval "$install_prog \$file \$oldlib" || exit $?
2105
Daniel Veillard36169f81998-07-24 19:30:47 +00002106 # Do each command in the postinstall commands.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002107 eval cmds=\"$old_postinstall_cmds\"
Daniel Veillard36169f81998-07-24 19:30:47 +00002108 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
2109 for cmd in $cmds; do
2110 IFS="$save_ifs"
2111 $show "$cmd"
2112 $run eval "$cmd" || exit $?
2113 done
2114 IFS="$save_ifs"
2115 done
2116
2117 if test -n "$future_libdirs"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002118 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00002119 fi
2120
2121 if test -n "$current_libdirs"; then
2122 # Maybe just do a dry run.
2123 test -n "$run" && current_libdirs=" -n$current_libdirs"
2124 exec $SHELL $0 --finish$current_libdirs
2125 exit 1
2126 fi
2127
2128 exit 0
2129 ;;
2130
2131 # libtool finish mode
2132 finish)
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002133 modename="$modename: finish"
Daniel Veillard36169f81998-07-24 19:30:47 +00002134 libdirs="$nonopt"
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002135 admincmds=
Daniel Veillard36169f81998-07-24 19:30:47 +00002136
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002137 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
Daniel Veillard36169f81998-07-24 19:30:47 +00002138 for dir
2139 do
2140 libdirs="$libdirs $dir"
2141 done
2142
2143 for libdir in $libdirs; do
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002144 if test -n "$finish_cmds"; then
2145 # Do each command in the finish commands.
2146 eval cmds=\"$finish_cmds\"
2147 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
2148 for cmd in $cmds; do
2149 IFS="$save_ifs"
2150 $show "$cmd"
2151 $run eval "$cmd" || admincmds="$admincmds
2152 $cmd"
2153 done
Daniel Veillard36169f81998-07-24 19:30:47 +00002154 IFS="$save_ifs"
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002155 fi
2156 if test -n "$finish_eval"; then
2157 # Do the single finish_eval.
2158 eval cmds=\"$finish_eval\"
2159 $run eval "$cmds" || admincmds="$admincmds
2160 $cmds"
2161 fi
Daniel Veillard36169f81998-07-24 19:30:47 +00002162 done
2163 fi
2164
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002165 echo "----------------------------------------------------------------------"
2166 echo "Libraries have been installed in:"
2167 for libdir in $libdirs; do
2168 echo " $libdir"
2169 done
2170 echo
2171 echo "To link against installed libraries in a given directory, LIBDIR,"
2172 echo "you must use the \`-LLIBDIR' flag during linking."
2173 echo
2174 echo " You will also need to do at least one of the following:"
Daniel Veillard36169f81998-07-24 19:30:47 +00002175 if test -n "$shlibpath_var"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002176 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
2177 echo " during execution"
Daniel Veillard36169f81998-07-24 19:30:47 +00002178 fi
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002179 if test -n "$runpath_var"; then
2180 echo " - add LIBDIR to the \`$runpath_var' environment variable"
2181 echo " during linking"
2182 fi
2183 if test -n "$hardcode_libdir_flag_spec"; then
2184 libdir=LIBDIR
2185 eval flag=\"$hardcode_libdir_flag_spec\"
2186
2187 echo " - use the \`$flag' linker flag"
2188 fi
2189 if test -n "$admincmds"; then
2190 echo " - have your system administrator run these commands:$admincmds"
2191 fi
2192 if test -f /etc/ld.so.conf; then
2193 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2194 fi
2195 echo
2196 echo "See any operating system documentation about shared libraries for"
2197 echo "more information, such as the ld(1) and ld.so(8) manual pages."
2198 echo "----------------------------------------------------------------------"
Daniel Veillard36169f81998-07-24 19:30:47 +00002199 exit 0
2200 ;;
2201
2202 # libtool execute mode
2203 execute)
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002204 modename="$modename: execute"
Daniel Veillard36169f81998-07-24 19:30:47 +00002205
2206 # The first argument is the command name.
2207 cmd="$nonopt"
2208 if test -z "$cmd"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002209 $echo "$modename: you must specify a COMMAND" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00002210 $echo "$help"
2211 exit 1
2212 fi
2213
2214 # Handle -dlopen flags immediately.
2215 for file in $execute_dlfiles; do
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002216 if test ! -f "$file"; then
2217 $echo "$modename: \`$file' is not a file" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00002218 $echo "$help" 1>&2
2219 exit 1
2220 fi
2221
2222 dir=
2223 case "$file" in
2224 *.la)
2225 # Check to see that this really is a libtool archive.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002226 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
Daniel Veillard36169f81998-07-24 19:30:47 +00002227 else
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002228 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00002229 $echo "$help" 1>&2
2230 exit 1
2231 fi
2232
2233 # Read the libtool library.
2234 dlname=
2235 library_names=
2236
2237 # If there is no directory component, then add one.
2238 case "$file" in
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002239 */* | *\\*) . $file ;;
Daniel Veillard36169f81998-07-24 19:30:47 +00002240 *) . ./$file ;;
2241 esac
2242
2243 # Skip this library if it cannot be dlopened.
2244 if test -z "$dlname"; then
2245 # Warn if it was a shared library.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002246 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
Daniel Veillard36169f81998-07-24 19:30:47 +00002247 continue
2248 fi
2249
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002250 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
Daniel Veillard36169f81998-07-24 19:30:47 +00002251 test "X$dir" = "X$file" && dir=.
2252
2253 if test -f "$dir/$objdir/$dlname"; then
2254 dir="$dir/$objdir"
2255 else
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002256 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00002257 exit 1
2258 fi
2259 ;;
2260
2261 *.lo)
2262 # Just add the directory containing the .lo file.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002263 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
Daniel Veillard36169f81998-07-24 19:30:47 +00002264 test "X$dir" = "X$file" && dir=.
2265 ;;
2266
2267 *)
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002268 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00002269 continue
2270 ;;
2271 esac
2272
2273 # Get the absolute pathname.
2274 absdir=`cd "$dir" && pwd`
2275 test -n "$absdir" && dir="$absdir"
2276
2277 # Now add the directory to shlibpath_var.
2278 if eval "test -z \"\$$shlibpath_var\""; then
2279 eval "$shlibpath_var=\"\$dir\""
2280 else
2281 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
2282 fi
2283 done
2284
2285 # This variable tells wrapper scripts just to set shlibpath_var
2286 # rather than running their programs.
2287 libtool_execute_magic="$magic"
2288
2289 # Check if any of the arguments is a wrapper script.
2290 args=
2291 for file
2292 do
2293 case "$file" in
2294 -*) ;;
2295 *)
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002296 # Do a test to see if this is really a libtool program.
2297 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
Daniel Veillard36169f81998-07-24 19:30:47 +00002298 # If there is no directory component, then add one.
2299 case "$file" in
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002300 */* | *\\*) . $file ;;
Daniel Veillard36169f81998-07-24 19:30:47 +00002301 *) . ./$file ;;
2302 esac
2303
2304 # Transform arg to wrapped name.
2305 file="$progdir/$program"
2306 fi
2307 ;;
2308 esac
2309 # Quote arguments (to preserve shell metacharacters).
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002310 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
Daniel Veillard36169f81998-07-24 19:30:47 +00002311 args="$args \"$file\""
2312 done
2313
2314 if test -z "$run"; then
2315 # Export the shlibpath_var.
2316 eval "export $shlibpath_var"
2317
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002318 # Restore saved enviroment variables
2319 if test "${save_LC_ALL+set}" = set; then
2320 LC_ALL="$save_LC_ALL"; export LC_ALL
2321 fi
2322 if test "${save_LANG+set}" = set; then
2323 LANG="$save_LANG"; export LANG
2324 fi
2325
Daniel Veillard36169f81998-07-24 19:30:47 +00002326 # Now actually exec the command.
2327 eval "exec \$cmd$args"
2328
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002329 $echo "$modename: cannot exec \$cmd$args"
Daniel Veillard36169f81998-07-24 19:30:47 +00002330 exit 1
2331 else
2332 # Display what would be done.
2333 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
2334 $echo "export $shlibpath_var"
2335 $echo "$cmd$args"
2336 exit 0
2337 fi
2338 ;;
2339
2340 # libtool uninstall mode
2341 uninstall)
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002342 modename="$modename: uninstall"
Daniel Veillard36169f81998-07-24 19:30:47 +00002343 rm="$nonopt"
2344 files=
2345
2346 for arg
2347 do
2348 case "$arg" in
2349 -*) rm="$rm $arg" ;;
2350 *) files="$files $arg" ;;
2351 esac
2352 done
2353
2354 if test -z "$rm"; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002355 $echo "$modename: you must specify an RM program" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00002356 $echo "$help" 1>&2
2357 exit 1
2358 fi
2359
2360 for file in $files; do
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002361 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
Daniel Veillard36169f81998-07-24 19:30:47 +00002362 test "X$dir" = "X$file" && dir=.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002363 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
Daniel Veillard36169f81998-07-24 19:30:47 +00002364
2365 rmfiles="$file"
2366
2367 case "$name" in
2368 *.la)
2369 # Possibly a libtool archive, so verify it.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002370 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
Daniel Veillard36169f81998-07-24 19:30:47 +00002371 . $dir/$name
2372
2373 # Delete the libtool libraries and symlinks.
2374 for n in $library_names; do
2375 rmfiles="$rmfiles $dir/$n"
2376 test "X$n" = "X$dlname" && dlname=
2377 done
2378 test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname"
2379 test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
2380
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002381 $show "$rm $rmfiles"
2382 $run $rm $rmfiles
2383
2384 if test -n "$library_names"; then
2385 # Do each command in the postuninstall commands.
2386 eval cmds=\"$postuninstall_cmds\"
2387 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
2388 for cmd in $cmds; do
2389 IFS="$save_ifs"
2390 $show "$cmd"
2391 $run eval "$cmd"
2392 done
2393 IFS="$save_ifs"
2394 fi
2395
2396 if test -n "$old_library"; then
2397 # Do each command in the old_postuninstall commands.
2398 eval cmds=\"$old_postuninstall_cmds\"
2399 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
2400 for cmd in $cmds; do
2401 IFS="$save_ifs"
2402 $show "$cmd"
2403 $run eval "$cmd"
2404 done
2405 IFS="$save_ifs"
2406 fi
2407
Daniel Veillard36169f81998-07-24 19:30:47 +00002408 # FIXME: should reinstall the best remaining shared library.
2409 fi
2410 ;;
2411
2412 *.lo)
2413 if test "$build_old_libs" = yes; then
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002414 oldobj=`$echo "X$name" | $Xsed -e 's/\.lo$/.o/'`
Daniel Veillard36169f81998-07-24 19:30:47 +00002415 rmfiles="$rmfiles $dir/$oldobj"
2416 fi
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002417 $show "$rm $rmfiles"
2418 $run $rm $rmfiles
Daniel Veillard36169f81998-07-24 19:30:47 +00002419 ;;
Miguel de Icaza442321c1998-11-04 18:13:38 +00002420
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002421 *)
2422 $show "$rm $rmfiles"
2423 $run $rm $rmfiles
2424 ;;
2425 esac
Daniel Veillard36169f81998-07-24 19:30:47 +00002426 done
2427 exit 0
2428 ;;
2429
2430 "")
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002431 $echo "$modename: you must specify a MODE" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00002432 $echo "$generic_help" 1>&2
2433 exit 1
2434 ;;
2435 esac
2436
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002437 $echo "$modename: invalid operation mode \`$mode'" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00002438 $echo "$generic_help" 1>&2
2439 exit 1
2440fi # test -z "$show_help"
2441
2442# We need to display help for each of the modes.
2443case "$mode" in
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002444"") $echo \
2445"Usage: $modename [OPTION]... [MODE-ARG]...
Daniel Veillard36169f81998-07-24 19:30:47 +00002446
2447Provide generalized library-building support services.
2448
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002449 --config show all configuration variables
2450 --debug enable verbose shell tracing
Daniel Veillard36169f81998-07-24 19:30:47 +00002451-n, --dry-run display commands without modifying any files
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002452 --features display basic configuration information and exit
Daniel Veillard36169f81998-07-24 19:30:47 +00002453 --finish same as \`--mode=finish'
2454 --help display this help message and exit
2455 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
2456 --quiet same as \`--silent'
2457 --silent don't print informational messages
2458 --version print version information
2459
2460MODE must be one of the following:
2461
2462 compile compile a source file into a libtool object
2463 execute automatically set library path, then run a program
2464 finish complete the installation of libtool libraries
2465 install install libraries or executables
2466 link create a library or an executable
2467 uninstall remove libraries from an installed directory
2468
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002469MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
2470a more detailed description of MODE."
2471 exit 0
Daniel Veillard36169f81998-07-24 19:30:47 +00002472 ;;
2473
2474compile)
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002475 $echo \
2476"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
Daniel Veillard36169f81998-07-24 19:30:47 +00002477
2478Compile a source file into a libtool library object.
2479
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002480This mode accepts the following additional options:
2481
2482 -static always build a \`.o' file suitable for static linking
2483
Daniel Veillard36169f81998-07-24 19:30:47 +00002484COMPILE-COMMAND is a command to be used in creating a \`standard' object file
2485from the given SOURCEFILE.
2486
2487The output file name is determined by removing the directory component from
2488SOURCEFILE, then substituting the C source code suffix \`.c' with the
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002489library object suffix, \`.lo'."
Daniel Veillard36169f81998-07-24 19:30:47 +00002490 ;;
2491
2492execute)
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002493 $echo \
2494"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
Daniel Veillard36169f81998-07-24 19:30:47 +00002495
2496Automatically set library path, then run a program.
2497
2498This mode accepts the following additional options:
2499
2500 -dlopen FILE add the directory containing FILE to the library path
2501
2502This mode sets the library path environment variable according to \`-dlopen'
2503flags.
2504
2505If any of the ARGS are libtool executable wrappers, then they are translated
2506into their corresponding uninstalled binary, and any of their required library
2507directories are added to the library path.
2508
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002509Then, COMMAND is executed, with ARGS as arguments."
Daniel Veillard36169f81998-07-24 19:30:47 +00002510 ;;
2511
2512finish)
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002513 $echo \
2514"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
Daniel Veillard36169f81998-07-24 19:30:47 +00002515
2516Complete the installation of libtool libraries.
2517
2518Each LIBDIR is a directory that contains libtool libraries.
2519
2520The commands that this mode executes may require superuser privileges. Use
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002521the \`--dry-run' option if you just want to see what would be executed."
Daniel Veillard36169f81998-07-24 19:30:47 +00002522 ;;
2523
2524install)
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002525 $echo \
2526"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
Daniel Veillard36169f81998-07-24 19:30:47 +00002527
2528Install executables or libraries.
2529
2530INSTALL-COMMAND is the installation command. The first component should be
2531either the \`install' or \`cp' program.
2532
2533The rest of the components are interpreted as arguments to that command (only
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002534BSD-compatible install options are recognized)."
Daniel Veillard36169f81998-07-24 19:30:47 +00002535 ;;
2536
2537link)
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002538 $echo \
2539"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
Daniel Veillard36169f81998-07-24 19:30:47 +00002540
2541Link object files or libraries together to form another library, or to
2542create an executable program.
2543
2544LINK-COMMAND is a command using the C compiler that you would use to create
2545a program from several object files.
2546
2547The following components of LINK-COMMAND are treated specially:
2548
2549 -all-static do not do any dynamic linking at all
2550 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
2551 -dlpreopen FILE link in FILE and add its symbols to dld_preloaded_symbols
2552 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2553 -LLIBDIR search LIBDIR for required installed libraries
2554 -lNAME OUTPUT-FILE requires the installed library libNAME
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002555 -no-undefined declare that a library does not refer to external symbols
Daniel Veillard36169f81998-07-24 19:30:47 +00002556 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002557 -release RELEASE specify package release information
Daniel Veillard36169f81998-07-24 19:30:47 +00002558 -rpath LIBDIR the created library will eventually be installed in LIBDIR
2559 -static do not do any dynamic linking of libtool libraries
2560 -version-info CURRENT[:REVISION[:AGE]]
2561 specify library version info [each variable defaults to 0]
2562
2563All other options (arguments beginning with \`-') are ignored.
2564
2565Every other argument is treated as a filename. Files ending in \`.la' are
2566treated as uninstalled libtool libraries, other files are standard or library
2567object files.
2568
2569If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only
2570library objects (\`.lo' files) may be specified, and \`-rpath' is required.
2571
2572If OUTPUT-FILE ends in \`.a', then a standard library is created using \`ar'
2573and \`ranlib'.
2574
2575If OUTPUT-FILE ends in \`.lo' or \`.o', then a reloadable object file is
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002576created, otherwise an executable program is created."
Daniel Veillard36169f81998-07-24 19:30:47 +00002577 ;;
2578
2579uninstall)
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002580 $echo
2581"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
Daniel Veillard36169f81998-07-24 19:30:47 +00002582
2583Remove libraries from an installation directory.
2584
2585RM is the name of the program to use to delete files associated with each FILE
2586(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2587to RM.
2588
2589If FILE is a libtool library, all the files associated with it are deleted.
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002590Otherwise, only FILE itself is deleted using RM."
Daniel Veillard36169f81998-07-24 19:30:47 +00002591 ;;
2592
2593*)
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002594 $echo "$modename: invalid operation mode \`$mode'" 1>&2
Daniel Veillard36169f81998-07-24 19:30:47 +00002595 $echo "$help" 1>&2
2596 exit 1
2597 ;;
2598esac
2599
Daniel Veillardda4d3c41998-11-04 20:07:05 +00002600echo
2601$echo "Try \`$modename --help' for more information about other modes."
Daniel Veillard36169f81998-07-24 19:30:47 +00002602
2603exit 0
2604
2605# Local Variables:
2606# mode:shell-script
2607# sh-indentation:2
2608# End: