ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/autoconf/ltmain.sh
Revision: 1.1
Committed: Mon Nov 24 17:28:08 2003 UTC (20 years, 7 months ago) by pcg
Content type: application/x-sh
Branch: MAIN
CVS Tags: rel-2_1_0, rel-5_5, rel-5_4, rel-5_1, rel-5_0, rel-5_3, rel-5_2, rel-4_4, rel-4_6, rel-4_7, rel-4_2, rel-4_3, rel-3_7, rel-3_8, rel-3_5, rel-3_4, rel-3_3, rel-3_2, rel-2_8, rel-3_0, rel-4_0, rel-2_4, rel-2_5, rel-2_2, rel-2_3, rel-2_0, rel-4_1, rel-1-9, rel-1-3, rel-1-2, rxvt-2-0, rel-1_9, rel-3_6, rel-2_7, rel-4_8, rel-4_9
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 pcg 1.1 # ltmain.sh - Provide generalized library-building support services.
2     # NOTE: Changing this file will not affect anything until you rerun ltconfig.
3     #
4     # Copyright (C) 1996-2000 Free Software Foundation, Inc.
5     # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
6     #
7     # This program is free software; you can redistribute it and/or modify
8     # it under the terms of the GNU General Public License as published by
9     # the Free Software Foundation; either version 2 of the License, or
10     # (at your option) any later version.
11     #
12     # This program is distributed in the hope that it will be useful, but
13     # WITHOUT ANY WARRANTY; without even the implied warranty of
14     # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15     # General Public License for more details.
16     #
17     # You should have received a copy of the GNU General Public License
18     # along with this program; if not, write to the Free Software
19     # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20     #
21     # As a special exception to the GNU General Public License, if you
22     # distribute this file as part of a program that contains a
23     # configuration script generated by Autoconf, you may include it under
24     # the same distribution terms that you use for the rest of that program.
25    
26     # Check that we have a working $echo.
27     if test "X$1" = X--no-reexec; then
28     # Discard the --no-reexec flag, and continue.
29     shift
30     elif test "X$1" = X--fallback-echo; then
31     # Avoid inline document here, it may be left over
32     :
33     elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
34     # Yippee, $echo works!
35     :
36     else
37     # Restart under the correct shell, and then maybe $echo will work.
38     exec $SHELL "$0" --no-reexec ${1+"$@"}
39     fi
40    
41     if test "X$1" = X--fallback-echo; then
42     # used as fallback echo
43     shift
44     cat <<EOF
45     $*
46     EOF
47     exit 0
48     fi
49    
50     # The name of this program.
51     progname=`$echo "$0" | sed 's%^.*/%%'`
52     modename="$progname"
53    
54     # Constants.
55     PROGRAM=ltmain.sh
56     PACKAGE=libtool
57     VERSION=1.3c
58     TIMESTAMP=" (1.862 2001/02/23 22:58:19)"
59    
60     default_mode=
61     help="Try \`$progname --help' for more information."
62     magic="%%%MAGIC variable%%%"
63     mkdir="mkdir"
64     mv="mv -f"
65     rm="rm -f"
66    
67     # Sed substitution that helps us do robust quoting. It backslashifies
68     # metacharacters that are still active within double-quoted strings.
69     Xsed='sed -e 1s/^X//'
70     sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
71     SP2NL='tr \040 \012'
72     NL2SP='tr \015\012 \040\040'
73    
74     # NLS nuisances.
75     # Only set LANG and LC_ALL to C if already set.
76     # These must not be set unconditionally because not all systems understand
77     # e.g. LANG=C (notably SCO).
78     # We save the old values to restore during execute mode.
79     if test "${LC_ALL+set}" = set; then
80     save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
81     fi
82     if test "${LANG+set}" = set; then
83     save_LANG="$LANG"; LANG=C; export LANG
84     fi
85    
86     if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
87     echo "$modename: not configured to build any kind of library" 1>&2
88     echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
89     exit 1
90     fi
91    
92     # Global variables.
93     mode=$default_mode
94     nonopt=
95     prev=
96     prevopt=
97     run=
98     show="$echo"
99     show_help=
100     execute_dlfiles=
101     lo2o="s/\\.lo\$/.${objext}/"
102     o2lo="s/\\.${objext}\$/.lo/"
103    
104     # Parse our command line options once, thoroughly.
105     while test $# -gt 0
106     do
107     arg="$1"
108     shift
109    
110     case "$arg" in
111     -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
112     *) optarg= ;;
113     esac
114    
115     # If the previous option needs an argument, assign it.
116     if test -n "$prev"; then
117     case "$prev" in
118     execute_dlfiles)
119     execute_dlfiles="$execute_dlfiles $arg"
120     ;;
121     *)
122     eval "$prev=\$arg"
123     ;;
124     esac
125    
126     prev=
127     prevopt=
128     continue
129     fi
130    
131     # Have we seen a non-optional argument yet?
132     case "$arg" in
133     --help)
134     show_help=yes
135     ;;
136    
137     --version)
138     echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
139     exit 0
140     ;;
141    
142     --config)
143     sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
144     exit 0
145     ;;
146    
147     --debug)
148     echo "$progname: enabling shell trace mode"
149     set -x
150     ;;
151    
152     --dry-run | -n)
153     run=:
154     ;;
155    
156     --features)
157     echo "host: $host"
158     if test "$build_libtool_libs" = yes; then
159     echo "enable shared libraries"
160     else
161     echo "disable shared libraries"
162     fi
163     if test "$build_old_libs" = yes; then
164     echo "enable static libraries"
165     else
166     echo "disable static libraries"
167     fi
168     exit 0
169     ;;
170    
171     --finish) mode="finish" ;;
172    
173     --mode) prevopt="--mode" prev=mode ;;
174     --mode=*) mode="$optarg" ;;
175    
176     --quiet | --silent)
177     show=:
178     ;;
179    
180     -dlopen)
181     prevopt="-dlopen"
182     prev=execute_dlfiles
183     ;;
184    
185     -*)
186     $echo "$modename: unrecognized option \`$arg'" 1>&2
187     $echo "$help" 1>&2
188     exit 1
189     ;;
190    
191     *)
192     nonopt="$arg"
193     break
194     ;;
195     esac
196     done
197    
198     if test -n "$prevopt"; then
199     $echo "$modename: option \`$prevopt' requires an argument" 1>&2
200     $echo "$help" 1>&2
201     exit 1
202     fi
203    
204     if test -z "$show_help"; then
205    
206     # Infer the operation mode.
207     if test -z "$mode"; then
208     case "$nonopt" in
209     *cc | *++ | gcc* | *-gcc*)
210     mode=link
211     for arg
212     do
213     case "$arg" in
214     -c)
215     mode=compile
216     break
217     ;;
218     esac
219     done
220     ;;
221     *db | *dbx | *strace | *truss)
222     mode=execute
223     ;;
224     *install*|cp|mv)
225     mode=install
226     ;;
227     *rm)
228     mode=uninstall
229     ;;
230     *)
231     # If we have no mode, but dlfiles were specified, then do execute mode.
232     test -n "$execute_dlfiles" && mode=execute
233    
234     # Just use the default operation mode.
235     if test -z "$mode"; then
236     if test -n "$nonopt"; then
237     $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
238     else
239     $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
240     fi
241     fi
242     ;;
243     esac
244     fi
245    
246     # Only execute mode is allowed to have -dlopen flags.
247     if test -n "$execute_dlfiles" && test "$mode" != execute; then
248     $echo "$modename: unrecognized option \`-dlopen'" 1>&2
249     $echo "$help" 1>&2
250     exit 1
251     fi
252    
253     # Change the help message to a mode-specific one.
254     generic_help="$help"
255     help="Try \`$modename --help --mode=$mode' for more information."
256    
257     # These modes are in order of execution frequency so that they run quickly.
258     case "$mode" in
259     # libtool compile mode
260     compile)
261     modename="$modename: compile"
262     # Get the compilation command and the source file.
263     base_compile=
264     prev=
265     lastarg=
266     srcfile="$nonopt"
267     suppress_output=
268    
269     user_target=no
270     for arg
271     do
272     case "$prev" in
273     "") ;;
274     xcompiler)
275     # Aesthetically quote the previous argument.
276     prev=
277     lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
278    
279     case "$arg" in
280     # Double-quote args containing other shell metacharacters.
281     # Many Bourne shells cannot handle close brackets correctly
282     # in scan sets, so we specify it separately.
283     *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
284     arg="\"$arg\""
285     ;;
286     esac
287    
288     # Add the previous argument to base_compile.
289     if test -z "$base_compile"; then
290     base_compile="$lastarg"
291     else
292     base_compile="$base_compile $lastarg"
293     fi
294     continue
295     ;;
296     esac
297    
298     # Accept any command-line options.
299     case "$arg" in
300     -o)
301     if test "$user_target" != "no"; then
302     $echo "$modename: you cannot specify \`-o' more than once" 1>&2
303     exit 1
304     fi
305     user_target=next
306     ;;
307    
308     -static)
309     build_old_libs=yes
310     continue
311     ;;
312    
313     -prefer-pic)
314     pic_mode=yes
315     continue
316     ;;
317    
318     -prefer-non-pic)
319     pic_mode=no
320     continue
321     ;;
322    
323     -Xcompiler)
324     prev=xcompiler
325     continue
326     ;;
327    
328     -Wc,*)
329     args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
330     lastarg=
331     IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
332     for arg in $args; do
333     IFS="$save_ifs"
334    
335     # Double-quote args containing other shell metacharacters.
336     # Many Bourne shells cannot handle close brackets correctly
337     # in scan sets, so we specify it separately.
338     case "$arg" in
339     *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
340     arg="\"$arg\""
341     ;;
342     esac
343     lastarg="$lastarg $arg"
344     done
345     IFS="$save_ifs"
346     lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
347    
348     # Add the arguments to base_compile.
349     if test -z "$base_compile"; then
350     base_compile="$lastarg"
351     else
352     base_compile="$base_compile $lastarg"
353     fi
354     continue
355     ;;
356     esac
357    
358     case "$user_target" in
359     next)
360     # The next one is the -o target name
361     user_target=yes
362     continue
363     ;;
364     yes)
365     # We got the output file
366     user_target=set
367     libobj="$arg"
368     continue
369     ;;
370     esac
371    
372     # Accept the current argument as the source file.
373     lastarg="$srcfile"
374     srcfile="$arg"
375    
376     # Aesthetically quote the previous argument.
377    
378     # Backslashify any backslashes, double quotes, and dollar signs.
379     # These are the only characters that are still specially
380     # interpreted inside of double-quoted scrings.
381     lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
382    
383     # Double-quote args containing other shell metacharacters.
384     # Many Bourne shells cannot handle close brackets correctly
385     # in scan sets, so we specify it separately.
386     case "$lastarg" in
387     *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
388     lastarg="\"$lastarg\""
389     ;;
390     esac
391    
392     # Add the previous argument to base_compile.
393     if test -z "$base_compile"; then
394     base_compile="$lastarg"
395     else
396     base_compile="$base_compile $lastarg"
397     fi
398     done
399    
400     case "$user_target" in
401     set)
402     ;;
403     no)
404     # Get the name of the library object.
405     libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
406     ;;
407     *)
408     $echo "$modename: you must specify a target with \`-o'" 1>&2
409     exit 1
410     ;;
411     esac
412    
413     # Recognize several different file suffixes.
414     # If the user specifies -o file.o, it is replaced with file.lo
415     xform='[cCFSfmso]'
416     case "$libobj" in
417     *.ada) xform=ada ;;
418     *.adb) xform=adb ;;
419     *.ads) xform=ads ;;
420     *.asm) xform=asm ;;
421     *.c++) xform=c++ ;;
422     *.cc) xform=cc ;;
423     *.cpp) xform=cpp ;;
424     *.cxx) xform=cxx ;;
425     *.f90) xform=f90 ;;
426     *.for) xform=for ;;
427     esac
428    
429     libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
430    
431     case "$libobj" in
432     *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
433     *)
434     $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
435     exit 1
436     ;;
437     esac
438    
439     if test -z "$base_compile"; then
440     $echo "$modename: you must specify a compilation command" 1>&2
441     $echo "$help" 1>&2
442     exit 1
443     fi
444    
445     # Delete any leftover library objects.
446     if test "$build_old_libs" = yes; then
447     removelist="$obj $libobj"
448     else
449     removelist="$libobj"
450     fi
451    
452     $run $rm $removelist
453     trap "$run $rm $removelist; exit 1" 1 2 15
454    
455     # On Cygwin there's no "real" PIC flag so we must build both object types
456     case "$host_os" in
457     cygwin* | mingw* | pw32* | os2*)
458     pic_mode=default
459     ;;
460     esac
461     if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then
462     # non-PIC code in shared libraries is not supported
463     pic_mode=default
464     fi
465    
466     # Calculate the filename of the output object if compiler does
467     # not support -o with -c
468     if test "$compiler_c_o" = no; then
469     output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
470     lockfile="$output_obj.lock"
471     removelist="$removelist $output_obj $lockfile"
472     trap "$run $rm $removelist; exit 1" 1 2 15
473     else
474     need_locks=no
475     lockfile=
476     fi
477    
478     # Lock this critical section if it is needed
479     # We use this script file to make the link, it avoids creating a new file
480     if test "$need_locks" = yes; then
481     until $run ln "$0" "$lockfile" 2>/dev/null; do
482     $show "Waiting for $lockfile to be removed"
483     sleep 2
484     done
485     elif test "$need_locks" = warn; then
486     if test -f "$lockfile"; then
487     echo "\
488     *** ERROR, $lockfile exists and contains:
489     `cat $lockfile 2>/dev/null`
490    
491     This indicates that another process is trying to use the same
492     temporary object file, and libtool could not work around it because
493     your compiler does not support \`-c' and \`-o' together. If you
494     repeat this compilation, it may succeed, by chance, but you had better
495     avoid parallel builds (make -j) in this platform, or get a better
496     compiler."
497    
498     $run $rm $removelist
499     exit 1
500     fi
501     echo $srcfile > "$lockfile"
502     fi
503    
504     if test -n "$fix_srcfile_path"; then
505     eval srcfile=\"$fix_srcfile_path\"
506     fi
507    
508     # Only build a PIC object if we are building libtool libraries.
509     if test "$build_libtool_libs" = yes; then
510     # Without this assignment, base_compile gets emptied.
511     fbsd_hideous_sh_bug=$base_compile
512    
513     if test "$pic_mode" != no; then
514     # All platforms use -DPIC, to notify preprocessed assembler code.
515     command="$base_compile $srcfile $pic_flag -DPIC"
516     else
517     # Don't build PIC code
518     command="$base_compile $srcfile"
519     fi
520     if test "$build_old_libs" = yes; then
521     lo_libobj="$libobj"
522     dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
523     if test "X$dir" = "X$libobj"; then
524     dir="$objdir"
525     else
526     dir="$dir/$objdir"
527     fi
528     libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
529    
530     if test -d "$dir"; then
531     $show "$rm $libobj"
532     $run $rm $libobj
533     else
534     $show "$mkdir $dir"
535     $run $mkdir $dir
536     status=$?
537     if test $status -ne 0 && test ! -d $dir; then
538     exit $status
539     fi
540     fi
541     fi
542     if test "$compiler_o_lo" = yes; then
543     output_obj="$libobj"
544     command="$command -o $output_obj"
545     elif test "$compiler_c_o" = yes; then
546     output_obj="$obj"
547     command="$command -o $output_obj"
548     fi
549    
550     $run $rm "$output_obj"
551     $show "$command"
552     if $run eval "$command"; then :
553     else
554     test -n "$output_obj" && $run $rm $removelist
555     exit 1
556     fi
557    
558     if test "$need_locks" = warn &&
559     test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
560     echo "\
561     *** ERROR, $lockfile contains:
562     `cat $lockfile 2>/dev/null`
563    
564     but it should contain:
565     $srcfile
566    
567     This indicates that another process is trying to use the same
568     temporary object file, and libtool could not work around it because
569     your compiler does not support \`-c' and \`-o' together. If you
570     repeat this compilation, it may succeed, by chance, but you had better
571     avoid parallel builds (make -j) in this platform, or get a better
572     compiler."
573    
574     $run $rm $removelist
575     exit 1
576     fi
577    
578     # Just move the object if needed, then go on to compile the next one
579     if test x"$output_obj" != x"$libobj"; then
580     $show "$mv $output_obj $libobj"
581     if $run $mv $output_obj $libobj; then :
582     else
583     error=$?
584     $run $rm $removelist
585     exit $error
586     fi
587     fi
588    
589     # If we have no pic_flag, then copy the object into place and finish.
590     if (test -z "$pic_flag" || test "$pic_mode" != default) &&
591     test "$build_old_libs" = yes; then
592     # Rename the .lo from within objdir to obj
593     if test -f $obj; then
594     $show $rm $obj
595     $run $rm $obj
596     fi
597    
598     $show "$mv $libobj $obj"
599     if $run $mv $libobj $obj; then :
600     else
601     error=$?
602     $run $rm $removelist
603     exit $error
604     fi
605    
606     xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
607     if test "X$xdir" = "X$obj"; then
608     xdir="."
609     else
610     xdir="$xdir"
611     fi
612     baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
613     libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
614     # Now arrange that obj and lo_libobj become the same file
615     $show "(cd $xdir && $LN_S $baseobj $libobj)"
616     if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
617     exit 0
618     else
619     error=$?
620     $run $rm $removelist
621     exit $error
622     fi
623     fi
624    
625     # Allow error messages only from the first compilation.
626     suppress_output=' >/dev/null 2>&1'
627     fi
628    
629     # Only build a position-dependent object if we build old libraries.
630     if test "$build_old_libs" = yes; then
631     if test "$pic_mode" != yes; then
632     # Don't build PIC code
633     command="$base_compile $srcfile"
634     else
635     # All platforms use -DPIC, to notify preprocessed assembler code.
636     command="$base_compile $srcfile $pic_flag -DPIC"
637     fi
638     if test "$compiler_c_o" = yes; then
639     command="$command -o $obj"
640     output_obj="$obj"
641     fi
642    
643     # Suppress compiler output if we already did a PIC compilation.
644     command="$command$suppress_output"
645     $run $rm "$output_obj"
646     $show "$command"
647     if $run eval "$command"; then :
648     else
649     $run $rm $removelist
650     exit 1
651     fi
652    
653     if test "$need_locks" = warn &&
654     test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
655     echo "\
656     *** ERROR, $lockfile contains:
657     `cat $lockfile 2>/dev/null`
658    
659     but it should contain:
660     $srcfile
661    
662     This indicates that another process is trying to use the same
663     temporary object file, and libtool could not work around it because
664     your compiler does not support \`-c' and \`-o' together. If you
665     repeat this compilation, it may succeed, by chance, but you had better
666     avoid parallel builds (make -j) in this platform, or get a better
667     compiler."
668    
669     $run $rm $removelist
670     exit 1
671     fi
672    
673     # Just move the object if needed
674     if test x"$output_obj" != x"$obj"; then
675     $show "$mv $output_obj $obj"
676     if $run $mv $output_obj $obj; then :
677     else
678     error=$?
679     $run $rm $removelist
680     exit $error
681     fi
682     fi
683    
684     # Create an invalid libtool object if no PIC, so that we do not
685     # accidentally link it into a program.
686     if test "$build_libtool_libs" != yes; then
687     $show "echo timestamp > $libobj"
688     $run eval "echo timestamp > \$libobj" || exit $?
689     else
690     # Move the .lo from within objdir
691     $show "$mv $libobj $lo_libobj"
692     if $run $mv $libobj $lo_libobj; then :
693     else
694     error=$?
695     $run $rm $removelist
696     exit $error
697     fi
698     fi
699     fi
700    
701     # Unlock the critical section if it was locked
702     if test "$need_locks" != no; then
703     $run $rm "$lockfile"
704     fi
705    
706     exit 0
707     ;;
708    
709     # libtool link mode
710     link | relink)
711     modename="$modename: link"
712     case "$host" in
713     *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
714     # It is impossible to link a dll without this setting, and
715     # we shouldn't force the makefile maintainer to figure out
716     # which system we are compiling for in order to pass an extra
717     # flag for every libtool invokation.
718     # allow_undefined=no
719    
720     # FIXME: Unfortunately, there are problems with the above when trying
721     # to make a dll which has undefined symbols, in which case not
722     # even a static library is built. For now, we need to specify
723     # -no-undefined on the libtool link line when we can be certain
724     # that all symbols are satisfied, otherwise we get a static library.
725     allow_undefined=yes
726     ;;
727     *)
728     allow_undefined=yes
729     ;;
730     esac
731     libtool_args="$nonopt"
732     compile_command="$nonopt"
733     finalize_command="$nonopt"
734    
735     compile_rpath=
736     finalize_rpath=
737     compile_shlibpath=
738     finalize_shlibpath=
739     convenience=
740     old_convenience=
741     deplibs=
742     old_deplibs=
743     compiler_flags=
744     linker_flags=
745     dllsearchpath=
746     lib_search_path=`pwd`
747    
748     avoid_version=no
749     dlfiles=
750     dlprefiles=
751     dlself=no
752     export_dynamic=no
753     export_symbols=
754     export_symbols_regex=
755     generated=
756     libobjs=
757     ltlibs=
758     module=no
759     no_install=no
760     objs=
761     prefer_static_libs=no
762     preload=no
763     prev=
764     prevarg=
765     release=
766     rpath=
767     xrpath=
768     perm_rpath=
769     temp_rpath=
770     thread_safe=no
771     vinfo=
772    
773     # We need to know -static, to get the right output filenames.
774     for arg
775     do
776     case "$arg" in
777     -all-static | -static)
778     if test "X$arg" = "X-all-static"; then
779     if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
780     $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
781     fi
782     if test -n "$link_static_flag"; then
783     dlopen_self=$dlopen_self_static
784     fi
785     else
786     if test -z "$pic_flag" && test -n "$link_static_flag"; then
787     dlopen_self=$dlopen_self_static
788     fi
789     fi
790     build_libtool_libs=no
791     build_old_libs=yes
792     prefer_static_libs=yes
793     break
794     ;;
795     esac
796     done
797    
798     # See if our shared archives depend on static archives.
799     test -n "$old_archive_from_new_cmds" && build_old_libs=yes
800    
801     # Go through the arguments, transforming them on the way.
802     while test $# -gt 0; do
803     arg="$1"
804     shift
805     case "$arg" in
806     *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
807     qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
808     ;;
809     *) qarg=$arg ;;
810     esac
811     libtool_args="$libtool_args $qarg"
812    
813     # If the previous option needs an argument, assign it.
814     if test -n "$prev"; then
815     case "$prev" in
816     output)
817     compile_command="$compile_command @OUTPUT@"
818     finalize_command="$finalize_command @OUTPUT@"
819     ;;
820     esac
821    
822     case "$prev" in
823     dlfiles|dlprefiles)
824     if test "$preload" = no; then
825     # Add the symbol object into the linking commands.
826     compile_command="$compile_command @SYMFILE@"
827     finalize_command="$finalize_command @SYMFILE@"
828     preload=yes
829     fi
830     case "$arg" in
831     *.la | *.lo) ;; # We handle these cases below.
832     force)
833     if test "$dlself" = no; then
834     dlself=needless
835     export_dynamic=yes
836     fi
837     prev=
838     continue
839     ;;
840     self)
841     if test "$prev" = dlprefiles; then
842     dlself=yes
843     elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
844     dlself=yes
845     else
846     dlself=needless
847     export_dynamic=yes
848     fi
849     prev=
850     continue
851     ;;
852     *)
853     if test "$prev" = dlfiles; then
854     dlfiles="$dlfiles $arg"
855     else
856     dlprefiles="$dlprefiles $arg"
857     fi
858     prev=
859     continue
860     ;;
861     esac
862     ;;
863     expsyms)
864     export_symbols="$arg"
865     if test ! -f "$arg"; then
866     $echo "$modename: symbol file \`$arg' does not exist"
867     exit 1
868     fi
869     prev=
870     continue
871     ;;
872     expsyms_regex)
873     export_symbols_regex="$arg"
874     prev=
875     continue
876     ;;
877     release)
878     release="-$arg"
879     prev=
880     continue
881     ;;
882     rpath | xrpath)
883     # We need an absolute path.
884     case "$arg" in
885     [\\/]* | [A-Za-z]:[\\/]*) ;;
886     *)
887     $echo "$modename: only absolute run-paths are allowed" 1>&2
888     exit 1
889     ;;
890     esac
891     if test "$prev" = rpath; then
892     case "$rpath " in
893     *" $arg "*) ;;
894     *) rpath="$rpath $arg" ;;
895     esac
896     else
897     case "$xrpath " in
898     *" $arg "*) ;;
899     *) xrpath="$xrpath $arg" ;;
900     esac
901     fi
902     prev=
903     continue
904     ;;
905     xcompiler)
906     compiler_flags="$compiler_flags $qarg"
907     prev=
908     compile_command="$compile_command $qarg"
909     finalize_command="$finalize_command $qarg"
910     continue
911     ;;
912     xlinker)
913     linker_flags="$linker_flags $qarg"
914     compiler_flags="$compiler_flags $wl$qarg"
915     prev=
916     compile_command="$compile_command $wl$qarg"
917     finalize_command="$finalize_command $wl$qarg"
918     continue
919     ;;
920     *)
921     eval "$prev=\"\$arg\""
922     prev=
923     continue
924     ;;
925     esac
926     fi
927    
928     prevarg="$arg"
929    
930     case "$arg" in
931     -all-static)
932     if test -n "$link_static_flag"; then
933     compile_command="$compile_command $link_static_flag"
934     finalize_command="$finalize_command $link_static_flag"
935     fi
936     continue
937     ;;
938    
939     -allow-undefined)
940     # FIXME: remove this flag sometime in the future.
941     $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
942     continue
943     ;;
944    
945     -avoid-version)
946     avoid_version=yes
947     continue
948     ;;
949    
950     -dlopen)
951     prev=dlfiles
952     continue
953     ;;
954    
955     -dlpreopen)
956     prev=dlprefiles
957     continue
958     ;;
959    
960     -export-dynamic)
961     export_dynamic=yes
962     continue
963     ;;
964    
965     -export-symbols | -export-symbols-regex)
966     if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
967     $echo "$modename: not more than one -exported-symbols argument allowed"
968     exit 1
969     fi
970     if test "X$arg" = "X-export-symbols"; then
971     prev=expsyms
972     else
973     prev=expsyms_regex
974     fi
975     continue
976     ;;
977    
978     # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
979     # so, if we see these flags be careful not to treat them like -L
980     -L[A-Z][A-Z]*:*)
981     case $with_gcc/$host in
982     no/*-*-irix*)
983     compile_command="$compile_command $arg"
984     finalize_command="$finalize_command $arg"
985     ;;
986     esac
987     continue
988     ;;
989    
990     -L*)
991     dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
992     # We need an absolute path.
993     case "$dir" in
994     [\\/]* | [A-Za-z]:[\\/]*) ;;
995     *)
996     absdir=`cd "$dir" && pwd`
997     if test -z "$absdir"; then
998     $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
999     exit 1
1000     fi
1001     dir="$absdir"
1002     ;;
1003     esac
1004     case "$deplibs " in
1005     *" -L$dir "*) ;;
1006     *)
1007     deplibs="$deplibs -L$dir"
1008     lib_search_path="$lib_search_path $dir"
1009     ;;
1010     esac
1011     case "$host" in
1012     *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1013     case ":$dllsearchpath:" in
1014     *":$dir:"*) ;;
1015     *) dllsearchpath="$dllsearchpath:$dir";;
1016     esac
1017     ;;
1018     esac
1019     continue
1020     ;;
1021    
1022     -l*)
1023     if test "$arg" = "-lc"; then
1024     case "$host" in
1025     *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
1026     # These systems don't actually have c library (as such)
1027     continue
1028     ;;
1029     *-*-rhapsody* | *-*-darwin*)
1030     # Darwin C library is in the System framework
1031     deplibs="$deplibs -framework System"
1032     ;;
1033     esac
1034     elif test "$arg" = "-lm"; then
1035     case "$host" in
1036     *-*-cygwin* | *-*-pw32* | *-*-beos*)
1037     # These systems don't actually have math library (as such)
1038     continue
1039     ;;
1040     *-*-rhapsody* | *-*-darwin*)
1041     # Darwin math library is in the System framework
1042     deplibs="$deplibs -framework System"
1043     ;;
1044     esac
1045     fi
1046     deplibs="$deplibs $arg"
1047     continue
1048     ;;
1049    
1050     -module)
1051     module=yes
1052     continue
1053     ;;
1054    
1055     -no-fast-install)
1056     fast_install=no
1057     continue
1058     ;;
1059    
1060     -no-install)
1061     case "$host" in
1062     *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1063     # The PATH hackery in wrapper scripts is required on Windows
1064     # in order for the loader to find any dlls it needs.
1065     $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1066     $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1067     fast_install=no
1068     ;;
1069     *-*-rhapsody* | *-*-darwin*)
1070     # Darwin C library is in the System framework
1071     deplibs="$deplibs -framework System"
1072     ;;
1073     *)
1074     no_install=yes
1075     ;;
1076     esac
1077     continue
1078     ;;
1079    
1080     -no-undefined)
1081     allow_undefined=no
1082     continue
1083     ;;
1084    
1085     -o) prev=output ;;
1086    
1087     -release)
1088     prev=release
1089     continue
1090     ;;
1091    
1092     -rpath)
1093     prev=rpath
1094     continue
1095     ;;
1096    
1097     -R)
1098     prev=xrpath
1099     continue
1100     ;;
1101    
1102     -R*)
1103     dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1104     # We need an absolute path.
1105     case "$dir" in
1106     [\\/]* | [A-Za-z]:[\\/]*) ;;
1107     *)
1108     $echo "$modename: only absolute run-paths are allowed" 1>&2
1109     exit 1
1110     ;;
1111     esac
1112     case "$xrpath " in
1113     *" $dir "*) ;;
1114     *) xrpath="$xrpath $dir" ;;
1115     esac
1116     continue
1117     ;;
1118    
1119     -static)
1120     # The effects of -static are defined in a previous loop.
1121     # We used to do the same as -all-static on platforms that
1122     # didn't have a PIC flag, but the assumption that the effects
1123     # would be equivalent was wrong. It would break on at least
1124     # Digital Unix and AIX.
1125     continue
1126     ;;
1127    
1128     -thread-safe)
1129     thread_safe=yes
1130     continue
1131     ;;
1132    
1133     -version-info)
1134     prev=vinfo
1135     continue
1136     ;;
1137    
1138     -Wc,*)
1139     args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1140     arg=
1141     IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
1142     for flag in $args; do
1143     IFS="$save_ifs"
1144     case "$flag" in
1145     *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1146     flag="\"$flag\""
1147     ;;
1148     esac
1149     arg="$arg $wl$flag"
1150     compiler_flags="$compiler_flags $flag"
1151     done
1152     IFS="$save_ifs"
1153     arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1154     ;;
1155    
1156     -Wl,*)
1157     args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1158     arg=
1159     IFS="${IFS= }"; save_ifs="$IFS"; IFS=','
1160     for flag in $args; do
1161     IFS="$save_ifs"
1162     case "$flag" in
1163     *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1164     flag="\"$flag\""
1165     ;;
1166     esac
1167     arg="$arg $wl$flag"
1168     compiler_flags="$compiler_flags $wl$flag"
1169     linker_flags="$linker_flags $flag"
1170     done
1171     IFS="$save_ifs"
1172     arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1173     ;;
1174    
1175     -Xcompiler)
1176     prev=xcompiler
1177     continue
1178     ;;
1179    
1180     -Xlinker)
1181     prev=xlinker
1182     continue
1183     ;;
1184    
1185     # Some other compiler flag.
1186     -* | +*)
1187     # Unknown arguments in both finalize_command and compile_command need
1188     # to be aesthetically quoted because they are evaled later.
1189     arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1190     case "$arg" in
1191     *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1192     arg="\"$arg\""
1193     ;;
1194     esac
1195     ;;
1196    
1197     *.$objext)
1198     # A standard object.
1199     objs="$objs $arg"
1200     ;;
1201    
1202     *.lo)
1203     # A library object.
1204     if test "$prev" = dlfiles; then
1205     # This file was specified with -dlopen.
1206     if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1207     dlfiles="$dlfiles $arg"
1208     prev=
1209     continue
1210     else
1211     # If libtool objects are unsupported, then we need to preload.
1212     prev=dlprefiles
1213     fi
1214     fi
1215    
1216     if test "$prev" = dlprefiles; then
1217     # Preload the old-style object.
1218     dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1219     prev=
1220     else
1221     libobjs="$libobjs $arg"
1222     fi
1223     ;;
1224    
1225     *.$libext)
1226     # An archive.
1227     deplibs="$deplibs $arg"
1228     old_deplibs="$old_deplibs $arg"
1229     continue
1230     ;;
1231    
1232     *.la)
1233     # A libtool-controlled library.
1234    
1235     if test "$prev" = dlfiles; then
1236     # This library was specified with -dlopen.
1237     dlfiles="$dlfiles $arg"
1238     prev=
1239     elif test "$prev" = dlprefiles; then
1240     # The library was specified with -dlpreopen.
1241     dlprefiles="$dlprefiles $arg"
1242     prev=
1243     else
1244     deplibs="$deplibs $arg"
1245     fi
1246     continue
1247     ;;
1248    
1249     # Some other compiler argument.
1250     *)
1251     # Unknown arguments in both finalize_command and compile_command need
1252     # to be aesthetically quoted because they are evaled later.
1253     arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1254     case "$arg" in
1255     *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1256     arg="\"$arg\""
1257     ;;
1258     esac
1259     ;;
1260     esac
1261    
1262     # Now actually substitute the argument into the commands.
1263     if test -n "$arg"; then
1264     compile_command="$compile_command $arg"
1265     finalize_command="$finalize_command $arg"
1266     fi
1267     done
1268    
1269     if test -n "$prev"; then
1270     $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1271     $echo "$help" 1>&2
1272     exit 1
1273     fi
1274    
1275     if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1276     eval arg=\"$export_dynamic_flag_spec\"
1277     compile_command="$compile_command $arg"
1278     finalize_command="$finalize_command $arg"
1279     fi
1280    
1281     oldlibs=
1282     # calculate the name of the file, without its directory
1283     outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1284     libobjs_save="$libobjs"
1285    
1286     if test -n "$shlibpath_var"; then
1287     # get the directories listed in $shlibpath_var
1288     eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1289     else
1290     shlib_search_path=
1291     fi
1292     eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1293     eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1294    
1295     output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1296     if test "X$output_objdir" = "X$output"; then
1297     output_objdir="$objdir"
1298     else
1299     output_objdir="$output_objdir/$objdir"
1300     fi
1301     # Create the object directory.
1302     if test ! -d $output_objdir; then
1303     $show "$mkdir $output_objdir"
1304     $run $mkdir $output_objdir
1305     status=$?
1306     if test $status -ne 0 && test ! -d $output_objdir; then
1307     exit $status
1308     fi
1309     fi
1310    
1311     # Determine the type of output
1312     case "$output" in
1313     "")
1314     $echo "$modename: you must specify an output file" 1>&2
1315     $echo "$help" 1>&2
1316     exit 1
1317     ;;
1318     *.$libext) linkmode=oldlib ;;
1319     *.lo | *.$objext) linkmode=obj ;;
1320     *.la) linkmode=lib ;;
1321     *) linkmode=prog ;; # Anything else should be a program.
1322     esac
1323    
1324     specialdeplibs=
1325     libs=
1326     # Find all interdependent deplibs by searching for libraries
1327     # that are linked more than once (e.g. -la -lb -la)
1328     for deplib in $deplibs; do
1329     case "$libs " in
1330     *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1331     esac
1332     libs="$libs $deplib"
1333     done
1334     deplibs=
1335     newdependency_libs=
1336     newlib_search_path=
1337     need_relink=no # whether we're linking any uninstalled libtool libraries
1338     uninst_deplibs= # uninstalled libtool libraries
1339     uninst_path= # paths that contain uninstalled libtool libraries
1340     case $linkmode in
1341     lib)
1342     passes="conv link"
1343     for file in $dlfiles $dlprefiles; do
1344     case "$file" in
1345     *.la) ;;
1346     *)
1347     $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1348     exit 1
1349     ;;
1350     esac
1351     done
1352     ;;
1353     prog)
1354     compile_deplibs=
1355     finalize_deplibs=
1356     alldeplibs=no
1357     newdlfiles=
1358     newdlprefiles=
1359     passes="conv scan dlopen dlpreopen link"
1360     ;;
1361     *) passes="conv"
1362     ;;
1363     esac
1364     for pass in $passes; do
1365     if test "$linkmode,$pass" = "lib,link" ||
1366     test "$linkmode,$pass" = "prog,scan"; then
1367     libs="$deplibs"
1368     deplibs=
1369     fi
1370     if test $linkmode = prog; then
1371     case $pass in
1372     dlopen) libs="$dlfiles" ;;
1373     dlpreopen) libs="$dlprefiles" ;;
1374     link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1375     esac
1376     fi
1377     if test $pass = dlopen; then
1378     # Collect dlpreopened libraries
1379     save_deplibs="$deplibs"
1380     deplibs=
1381     fi
1382     for deplib in $libs; do
1383     lib=
1384     found=no
1385     case "$deplib" in
1386     -l*)
1387     if test $linkmode != lib && test $linkmode != prog; then
1388     $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1389     continue
1390     fi
1391     if test $pass = conv; then
1392     deplibs="$deplib $deplibs"
1393     continue
1394     fi
1395     name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1396     for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1397     # Search the libtool library
1398     lib="$searchdir/lib${name}.la"
1399     if test -f "$lib"; then
1400     found=yes
1401     break
1402     fi
1403     done
1404     if test "$found" != yes; then
1405     if test "$linkmode,$pass" = "prog,link"; then
1406     compile_deplibs="$deplib $compile_deplibs"
1407     finalize_deplibs="$deplib $finalize_deplibs"
1408     else
1409     deplibs="$deplib $deplibs"
1410     test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
1411     fi
1412     continue
1413     fi
1414     ;;
1415     -L*)
1416     case $linkmode in
1417     lib)
1418     deplibs="$deplib $deplibs"
1419     test $pass = conv && continue
1420     newdependency_libs="$deplib $newdependency_libs"
1421     newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1422     ;;
1423     prog)
1424     if test $pass = conv; then
1425     deplibs="$deplib $deplibs"
1426     continue
1427     fi
1428     if test $pass = scan; then
1429     deplibs="$deplib $deplibs"
1430     newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1431     else
1432     compile_deplibs="$deplib $compile_deplibs"
1433     finalize_deplibs="$deplib $finalize_deplibs"
1434     fi
1435     ;;
1436     *)
1437     $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1438     ;;
1439     esac
1440     continue
1441     ;;
1442     -R*)
1443     if test $pass = link; then
1444     dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1445     # Make sure the xrpath contains only unique directories.
1446     case "$xrpath " in
1447     *" $dir "*) ;;
1448     *) xrpath="$xrpath $dir" ;;
1449     esac
1450     fi
1451     deplibs="$deplib $deplibs"
1452     continue
1453     ;;
1454     *.la) lib="$deplib" ;;
1455     *.$libext)
1456     if test $pass = conv; then
1457     deplibs="$deplib $deplibs"
1458     continue
1459     fi
1460     case $linkmode in
1461     lib)
1462     if test "$deplibs_check_method" != pass_all; then
1463     echo
1464     echo "*** Warning: This library needs some functionality provided by $deplib."
1465     echo "*** I have the capability to make that library automatically link in when"
1466     echo "*** you link to this library. But I can only do this if you have a"
1467     echo "*** shared version of the library, which you do not appear to have."
1468     else
1469     echo
1470     echo "*** Warning: Linking the shared library $output against the"
1471     echo "*** static library $deplib is not portable!"
1472     deplibs="$deplib $deplibs"
1473     fi
1474     continue
1475     ;;
1476     prog)
1477     if test $pass != link; then
1478     deplibs="$deplib $deplibs"
1479     else
1480     compile_deplibs="$deplib $compile_deplibs"
1481     finalize_deplibs="$deplib $finalize_deplibs"
1482     fi
1483     continue
1484     ;;
1485     esac
1486     ;;
1487     *.lo | *.$objext)
1488     if test $pass = conv; then
1489     deplibs="$deplib $deplibs"
1490     elif test $linkmode = prog; then
1491     if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1492     # If there is no dlopen support or we're linking statically,
1493     # we need to preload.
1494     newdlprefiles="$newdlprefiles $deplib"
1495     compile_deplibs="$deplib $compile_deplibs"
1496     finalize_deplibs="$deplib $finalize_deplibs"
1497     else
1498     newdlfiles="$newdlfiles $deplib"
1499     fi
1500     fi
1501     continue
1502     ;;
1503     %DEPLIBS%)
1504     alldeplibs=yes
1505     continue
1506     ;;
1507     esac
1508     if test $found = yes || test -f "$lib"; then :
1509     else
1510     $echo "$modename: cannot find the library \`$lib'" 1>&2
1511     exit 1
1512     fi
1513    
1514     # Check to see that this really is a libtool archive.
1515     if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1516     else
1517     $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1518     exit 1
1519     fi
1520    
1521     ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1522     test "X$ladir" = "X$lib" && ladir="."
1523    
1524     dlname=
1525     dlopen=
1526     dlpreopen=
1527     libdir=
1528     library_names=
1529     old_library=
1530     # If the library was installed with an old release of libtool,
1531     # it will not redefine variable installed.
1532     installed=yes
1533    
1534     # Read the .la file
1535     case "$lib" in
1536     */* | *\\*) . $lib ;;
1537     *) . ./$lib ;;
1538     esac
1539    
1540     if test "$linkmode,$pass" = "lib,link" ||
1541     test "$linkmode,$pass" = "prog,scan" ||
1542     { test $linkmode != prog && test $linkmode != lib; }; then
1543     test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1544     test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1545     fi
1546    
1547     if test $pass = conv; then
1548     # only check for convenience libraries
1549     deplibs="$lib $deplibs"
1550     if test -z "$libdir"; then
1551     if test -z "$old_library"; then
1552     $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1553     exit 1
1554     fi
1555     # It is a libtool convenience library, so add in its objects.
1556     convenience="$convenience $ladir/$objdir/$old_library"
1557     old_convenience="$old_convenience $ladir/$objdir/$old_library"
1558     tmp_libs=
1559     for deplib in $dependency_libs; do
1560     deplibs="$deplib $deplibs"
1561     case "$tmp_libs " in
1562     *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1563     esac
1564     tmp_libs="$tmp_libs $deplib"
1565     done
1566     elif test $linkmode != prog && test $linkmode != lib; then
1567     $echo "$modename: \`$lib' is not a convenience library" 1>&2
1568     exit 1
1569     fi
1570     continue
1571     fi
1572    
1573     # Get the name of the library we link against.
1574     linklib=
1575     for l in $old_library $library_names; do
1576     linklib="$l"
1577     done
1578     if test -z "$linklib"; then
1579     $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1580     exit 1
1581     fi
1582    
1583     # This library was specified with -dlopen.
1584     if test $pass = dlopen; then
1585     if test -z "$libdir"; then
1586     $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1587     exit 1
1588     fi
1589     if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1590     # If there is no dlname, no dlopen support or we're linking
1591     # statically, we need to preload. We also need to preload any
1592     # dependent libraries so libltdl's deplib preloader doesn't
1593     # bomb out in the load deplibs phase.
1594     dlprefiles="$dlprefiles $lib $dependency_libs"
1595     else
1596     newdlfiles="$newdlfiles $lib"
1597     fi
1598     continue
1599     fi
1600    
1601     # We need an absolute path.
1602     case "$ladir" in
1603     [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
1604     *)
1605     abs_ladir=`cd "$ladir" && pwd`
1606     if test -z "$abs_ladir"; then
1607     $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1608     $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1609     abs_ladir="$ladir"
1610     fi
1611     ;;
1612     esac
1613     laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1614    
1615     # Find the relevant object directory and library name.
1616     if test "X$installed" = Xyes; then
1617     if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1618     $echo "$modename: warning: library \`$lib' was moved." 1>&2
1619     dir="$ladir"
1620     absdir="$abs_ladir"
1621     libdir="$abs_ladir"
1622     else
1623     dir="$libdir"
1624     absdir="$libdir"
1625     fi
1626     else
1627     dir="$ladir/$objdir"
1628     absdir="$abs_ladir/$objdir"
1629     # Remove this search path later
1630     uninst_path="$uninst_path $abs_ladir"
1631     fi
1632     name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1633    
1634     # This library was specified with -dlpreopen.
1635     if test $pass = dlpreopen; then
1636     if test -z "$libdir"; then
1637     $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1638     exit 1
1639     fi
1640     # Prefer using a static library (so that no silly _DYNAMIC symbols
1641     # are required to link).
1642     if test -n "$old_library"; then
1643     newdlprefiles="$newdlprefiles $dir/$old_library"
1644     # Otherwise, use the dlname, so that lt_dlopen finds it.
1645     elif test -n "$dlname"; then
1646     newdlprefiles="$newdlprefiles $dir/$dlname"
1647     else
1648     newdlprefiles="$newdlprefiles $dir/$linklib"
1649     fi
1650     fi
1651    
1652     if test -z "$libdir"; then
1653     # link the convenience library
1654     if test $linkmode = lib; then
1655     deplibs="$dir/$old_library $deplibs"
1656     elif test "$linkmode,$pass" = "prog,link"; then
1657     compile_deplibs="$dir/$old_library $compile_deplibs"
1658     finalize_deplibs="$dir/$old_library $finalize_deplibs"
1659     else
1660     deplibs="$lib $deplibs" # used for prog,scan pass
1661     fi
1662     continue
1663     fi
1664    
1665     if test $linkmode = prog && test $pass != link; then
1666     newlib_search_path="$newlib_search_path $ladir"
1667     deplibs="$lib $deplibs"
1668    
1669     linkalldeplibs=no
1670     if test "$link_all_deplibs" != no || test -z "$library_names" ||
1671     test "$build_libtool_libs" = no; then
1672     linkalldeplibs=yes
1673     fi
1674    
1675     tmp_libs=
1676     for deplib in $dependency_libs; do
1677     case "$deplib" in
1678     -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1679     esac
1680     # Need to link against all dependency_libs?
1681     if test $linkalldeplibs = yes; then
1682     deplibs="$deplib $deplibs"
1683     else
1684     # Need to hardcode shared library paths
1685     # or/and link against static libraries
1686     newdependency_libs="$deplib $newdependency_libs"
1687     fi
1688     case "$tmp_libs " in
1689     *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1690     esac
1691     tmp_libs="$tmp_libs $deplib"
1692     done
1693     continue
1694     fi
1695    
1696     if test "$linkmode,$pass" = "prog,link"; then
1697     if test -n "$library_names" &&
1698     { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1699     # We need to hardcode the library path
1700     if test -n "$shlibpath_var"; then
1701     # Make sure the rpath contains only unique directories.
1702     case "$temp_rpath " in
1703     *" $dir "*) ;;
1704     *" $absdir "*) ;;
1705     *) temp_rpath="$temp_rpath $dir" ;;
1706     esac
1707     fi
1708    
1709     # Hardcode the library path.
1710     # Skip directories that are in the system default run-time
1711     # search path.
1712     case " $sys_lib_dlsearch_path " in
1713     *" $absdir "*) ;;
1714     *)
1715     case "$compile_rpath " in
1716     *" $absdir "*) ;;
1717     *) compile_rpath="$compile_rpath $absdir"
1718     esac
1719     ;;
1720     esac
1721    
1722     case " $sys_lib_dlsearch_path " in
1723     *" $libdir "*) ;;
1724     *)
1725     case "$finalize_rpath " in
1726     *" $libdir "*) ;;
1727     *) finalize_rpath="$finalize_rpath $libdir"
1728     esac
1729     ;;
1730     esac
1731     fi
1732    
1733     if test "$alldeplibs" = yes &&
1734     { test "$deplibs_check_method" = pass_all ||
1735     { test "$build_libtool_libs" = yes &&
1736     test -n "$library_names"; }; }; then
1737     # We only need to search for static libraries
1738     continue
1739     fi
1740     fi
1741    
1742     link_static=no # Whether the deplib will be linked statically
1743     if test -n "$library_names" &&
1744     { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1745     if test "$installed" = no; then
1746     uninst_deplibs="$uninst_deplibs $lib"
1747     need_relink=yes
1748     fi
1749     # This is a shared library
1750     if test $linkmode = lib &&
1751     test $hardcode_into_libs = yes; then
1752     # Hardcode the library path.
1753     # Skip directories that are in the system default run-time
1754     # search path.
1755     case " $sys_lib_dlsearch_path " in
1756     *" $absdir "*) ;;
1757     *)
1758     case "$compile_rpath " in
1759     *" $absdir "*) ;;
1760     *) compile_rpath="$compile_rpath $absdir"
1761     esac
1762     ;;
1763     esac
1764     case " $sys_lib_dlsearch_path " in
1765     *" $libdir "*) ;;
1766     *)
1767     case "$finalize_rpath " in
1768     *" $libdir "*) ;;
1769     *) finalize_rpath="$finalize_rpath $libdir"
1770     esac
1771     ;;
1772     esac
1773     fi
1774    
1775     if test -n "$old_archive_from_expsyms_cmds"; then
1776     # figure out the soname
1777     set dummy $library_names
1778     realname="$2"
1779     shift; shift
1780     libname=`eval \\$echo \"$libname_spec\"`
1781     if test -n "$soname_spec"; then
1782     eval soname=\"$soname_spec\"
1783     else
1784     soname="$realname"
1785     fi
1786    
1787     # Make a new name for the extract_expsyms_cmds to use
1788     newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
1789    
1790     # If the library has no export list, then create one now
1791     if test -f "$output_objdir/$soname-def"; then :
1792     else
1793     $show "extracting exported symbol list from \`$soname'"
1794     IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
1795     eval cmds=\"$extract_expsyms_cmds\"
1796     for cmd in $cmds; do
1797     IFS="$save_ifs"
1798     $show "$cmd"
1799     $run eval "$cmd" || exit $?
1800     done
1801     IFS="$save_ifs"
1802     fi
1803    
1804     # Create $newlib
1805     if test -f "$output_objdir/$newlib"; then :; else
1806     $show "generating import library for \`$soname'"
1807     IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
1808     eval cmds=\"$old_archive_from_expsyms_cmds\"
1809     for cmd in $cmds; do
1810     IFS="$save_ifs"
1811     $show "$cmd"
1812     $run eval "$cmd" || exit $?
1813     done
1814     IFS="$save_ifs"
1815     fi
1816     # make sure the library variables are pointing to the new library
1817     dir=$output_objdir
1818     linklib=$newlib
1819     fi
1820    
1821     if test $linkmode = prog || test "$mode" != relink; then
1822     add_shlibpath=
1823     add_dir=
1824     add=
1825     lib_linked=yes
1826     case "$hardcode_action" in
1827     immediate | unsupported)
1828     if test "$hardcode_direct" = no; then
1829     add="$dir/$linklib"
1830     elif test "$hardcode_minus_L" = no; then
1831     case "$host" in
1832     *-*-sunos*) add_shlibpath="$dir" ;;
1833     esac
1834     add_dir="-L$dir"
1835     add="-l$name"
1836     elif test "$hardcode_shlibpath_var" = no; then
1837     add_shlibpath="$dir"
1838     add="-l$name"
1839     else
1840     lib_linked=no
1841     fi
1842     ;;
1843     relink)
1844     if test "$hardcode_direct" = yes; then
1845     add="$dir/$linklib"
1846     elif test "$hardcode_minus_L" = yes; then
1847     add_dir="-L$dir"
1848     add="-l$name"
1849     elif test "$hardcode_shlibpath_var" = yes; then
1850     add_shlibpath="$dir"
1851     add="-l$name"
1852     else
1853     lib_linked=no
1854     fi
1855     ;;
1856     *) lib_linked=no ;;
1857     esac
1858    
1859     if test "$lib_linked" != yes; then
1860     $echo "$modename: configuration error: unsupported hardcode properties"
1861     exit 1
1862     fi
1863    
1864     if test -n "$add_shlibpath"; then
1865     case ":$compile_shlibpath:" in
1866     *":$add_shlibpath:"*) ;;
1867     *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
1868     esac
1869     fi
1870     if test $linkmode = prog; then
1871     test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
1872     test -n "$add" && compile_deplibs="$add $compile_deplibs"
1873     else
1874     test -n "$add_dir" && deplibs="$add_dir $deplibs"
1875     test -n "$add" && deplibs="$add $deplibs"
1876     if test "$hardcode_direct" != yes && \
1877     test "$hardcode_minus_L" != yes && \
1878     test "$hardcode_shlibpath_var" = yes; then
1879     case ":$finalize_shlibpath:" in
1880     *":$libdir:"*) ;;
1881     *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
1882     esac
1883     fi
1884     fi
1885     fi
1886    
1887     if test $linkmode = prog || test "$mode" = relink; then
1888     add_shlibpath=
1889     add_dir=
1890     add=
1891     # Finalize command for both is simple: just hardcode it.
1892     if test "$hardcode_direct" = yes; then
1893     add="$libdir/$linklib"
1894     elif test "$hardcode_minus_L" = yes; then
1895     add_dir="-L$libdir"
1896     add="-l$name"
1897     elif test "$hardcode_shlibpath_var" = yes; then
1898     case ":$finalize_shlibpath:" in
1899     *":$libdir:"*) ;;
1900     *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
1901     esac
1902     add="-l$name"
1903     else
1904     # We cannot seem to hardcode it, guess we'll fake it.
1905     add_dir="-L$libdir"
1906     add="-l$name"
1907     fi
1908    
1909     if test $linkmode = prog; then
1910     test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
1911     test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
1912     else
1913     test -n "$add_dir" && deplibs="$add_dir $deplibs"
1914     test -n "$add" && deplibs="$add $deplibs"
1915     fi
1916     fi
1917     elif test $linkmode = prog; then
1918     # Here we assume that one of hardcode_direct or hardcode_minus_L
1919     # is not unsupported. This is valid on all known static and
1920     # shared platforms.
1921     if test "$hardcode_direct" != unsupported; then
1922     test -n "$old_library" && linklib="$old_library"
1923     compile_deplibs="$dir/$linklib $compile_deplibs"
1924     finalize_deplibs="$dir/$linklib $finalize_deplibs"
1925     else
1926     compile_deplibs="-l$name -L$dir $compile_deplibs"
1927     finalize_deplibs="-l$name -L$dir $finalize_deplibs"
1928     fi
1929     elif test "$build_libtool_libs" = yes; then
1930     # Not a shared library
1931     if test "$deplibs_check_method" != pass_all; then
1932     # We're trying link a shared library against a static one
1933     # but the system doesn't support it.
1934     # Just print a warning and add the library to dependency_libs so
1935     # that the program can be linked against the static library.
1936     echo
1937     echo "*** Warning: This library needs some functionality provided by $lib."
1938     echo "*** I have the capability to make that library automatically link in when"
1939     echo "*** you link to this library. But I can only do this if you have a"
1940     echo "*** shared version of the library, which you do not appear to have."
1941     else
1942     convenience="$convenience $dir/$old_library"
1943     old_convenience="$old_convenience $dir/$old_library"
1944     deplibs="$dir/$old_library $deplibs"
1945     link_static=yes
1946     fi
1947     fi
1948    
1949     if test $linkmode = lib; then
1950     if test -n "$dependency_libs" &&
1951     { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
1952     test $link_static = yes; }; then
1953     # Extract -R from dependency_libs
1954     temp_deplibs=
1955     for libdir in $dependency_libs; do
1956     case "$libdir" in
1957     -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
1958     case " $xrpath " in
1959     *" $temp_xrpath "*) ;;
1960     *) xrpath="$xrpath $temp_xrpath";;
1961     esac;;
1962     *) temp_deplibs="$temp_deplibs $libdir";;
1963     esac
1964     done
1965     dependency_libs="$temp_deplibs"
1966     fi
1967    
1968     newlib_search_path="$newlib_search_path $absdir"
1969     # Link against this library
1970     test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
1971     # ... and its dependency_libs
1972     tmp_libs=
1973     for deplib in $dependency_libs; do
1974     newdependency_libs="$deplib $newdependency_libs"
1975     case "$tmp_libs " in
1976     *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1977     esac
1978     tmp_libs="$tmp_libs $deplib"
1979     done
1980    
1981     if test $link_all_deplibs != no; then
1982     # Add the search paths of all dependency libraries
1983     for deplib in $dependency_libs; do
1984     case "$deplib" in
1985     -L*) path="$deplib" ;;
1986     *.la)
1987     dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
1988     test "X$dir" = "X$deplib" && dir="."
1989     # We need an absolute path.
1990     case "$dir" in
1991     [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
1992     *)
1993     absdir=`cd "$dir" && pwd`
1994     if test -z "$absdir"; then
1995     $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
1996     absdir="$dir"
1997     fi
1998     ;;
1999     esac
2000     if grep "^installed=no" $deplib > /dev/null; then
2001     path="-L$absdir/$objdir"
2002     else
2003     eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2004     if test -z "$libdir"; then
2005     $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2006     exit 1
2007     fi
2008     if test "$absdir" != "$libdir"; then
2009     $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2010     fi
2011     path="-L$absdir"
2012     fi
2013     ;;
2014     *) continue ;;
2015     esac
2016     case " $deplibs " in
2017     *" $path "*) ;;
2018     *) deplibs="$deplibs $path" ;;
2019     esac
2020     done
2021     fi
2022     fi
2023     done
2024     dependency_libs="$newdependency_libs"
2025     if test $pass = dlpreopen; then
2026     # Link the dlpreopened libraries before other libraries
2027     for deplib in $save_deplibs; do
2028     deplibs="$deplib $deplibs"
2029     done
2030     fi
2031     if test $pass != dlopen; then
2032     if test $pass != conv; then
2033     # Make sure lib_search_path contains only unique directories.
2034     lib_search_path=
2035     for dir in $newlib_search_path; do
2036     case "$lib_search_path " in
2037     *" $dir "*) ;;
2038     *) lib_search_path="$lib_search_path $dir" ;;
2039     esac
2040     done
2041     newlib_search_path=
2042     fi
2043    
2044     if test "$linkmode,$pass" != "prog,link"; then
2045     vars="deplibs"
2046     else
2047     vars="compile_deplibs finalize_deplibs"
2048     fi
2049     for var in $vars dependency_libs; do
2050     # Make sure that $var contains only unique libraries
2051     # and add them in reverse order
2052     eval tmp_libs=\"\$$var\"
2053     new_libs=
2054     for deplib in $tmp_libs; do
2055     case "$deplib" in
2056     -L*) new_libs="$deplib $new_libs" ;;
2057     *)
2058     case " $specialdeplibs " in
2059     *" $deplib "*) new_libs="$deplib $new_libs" ;;
2060     *)
2061     case " $new_libs " in
2062     *" $deplib "*) ;;
2063     *) new_libs="$deplib $new_libs" ;;
2064     esac
2065     ;;
2066     esac
2067     ;;
2068     esac
2069     done
2070     tmp_libs=
2071     for deplib in $new_libs; do
2072     case "$deplib" in
2073     -L*)
2074     case " $tmp_libs " in
2075     *" $deplib "*) ;;
2076     *) tmp_libs="$tmp_libs $deplib" ;;
2077     esac
2078     ;;
2079     *) tmp_libs="$tmp_libs $deplib" ;;
2080     esac
2081     done
2082     eval $var=\"$tmp_libs\"
2083     done
2084     fi
2085     done
2086     if test $linkmode = prog; then
2087     dlfiles="$newdlfiles"
2088     dlprefiles="$newdlprefiles"
2089     fi
2090    
2091     case $linkmode in
2092     oldlib)
2093     if test -n "$deplibs"; then
2094     $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2095     fi
2096    
2097     if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2098     $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2099     fi
2100    
2101     if test -n "$rpath"; then
2102     $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2103     fi
2104    
2105     if test -n "$xrpath"; then
2106     $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2107     fi
2108    
2109     if test -n "$vinfo"; then
2110     $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2111     fi
2112    
2113     if test -n "$release"; then
2114     $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2115     fi
2116    
2117     if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2118     $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2119     fi
2120    
2121     # Now set the variables for building old libraries.
2122     build_libtool_libs=no
2123     oldlibs="$output"
2124     objs="$objs$old_deplibs"
2125     ;;
2126    
2127     lib)
2128     # Make sure we only generate libraries of the form `libNAME.la'.
2129     case "$outputname" in
2130     lib*)
2131     name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2132     eval libname=\"$libname_spec\"
2133     ;;
2134     *)
2135     if test "$module" = no; then
2136     $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2137     $echo "$help" 1>&2
2138     exit 1
2139     fi
2140     if test "$need_lib_prefix" != no; then
2141     # Add the "lib" prefix for modules if required
2142     name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2143     eval libname=\"$libname_spec\"
2144     else
2145     libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2146     fi
2147     ;;
2148     esac
2149    
2150     if test -n "$objs"; then
2151     if test "$deplibs_check_method" != pass_all; then
2152     $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2153     exit 1
2154     else
2155     echo
2156     echo "*** Warning: Linking the shared library $output against the non-libtool"
2157     echo "*** objects $objs is not portable!"
2158     libobjs="$libobjs $objs"
2159     fi
2160     fi
2161    
2162     if test "$dlself" != no; then
2163     $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2164     fi
2165    
2166     set dummy $rpath
2167     if test $# -gt 2; then
2168     $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2169     fi
2170     install_libdir="$2"
2171    
2172     oldlibs=
2173     if test -z "$rpath"; then
2174     if test "$build_libtool_libs" = yes; then
2175     # Building a libtool convenience library.
2176     libext=al
2177     oldlibs="$output_objdir/$libname.$libext $oldlibs"
2178     build_libtool_libs=convenience
2179     build_old_libs=yes
2180     fi
2181    
2182     if test -n "$vinfo"; then
2183     $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2184     fi
2185    
2186     if test -n "$release"; then
2187     $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2188     fi
2189     else
2190    
2191     # Parse the version information argument.
2192     IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
2193     set dummy $vinfo 0 0 0
2194     IFS="$save_ifs"
2195    
2196     if test -n "$8"; then
2197     $echo "$modename: too many parameters to \`-version-info'" 1>&2
2198     $echo "$help" 1>&2
2199     exit 1
2200     fi
2201    
2202     current="$2"
2203     revision="$3"
2204     age="$4"
2205    
2206     # Check that each of the things are valid numbers.
2207     case "$current" in
2208     0 | [1-9] | [1-9][0-9]*) ;;
2209     *)
2210     $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2211     $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2212     exit 1
2213     ;;
2214     esac
2215    
2216     case "$revision" in
2217     0 | [1-9] | [1-9][0-9]*) ;;
2218     *)
2219     $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2220     $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2221     exit 1
2222     ;;
2223     esac
2224    
2225     case "$age" in
2226     0 | [1-9] | [1-9][0-9]*) ;;
2227     *)
2228     $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2229     $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2230     exit 1
2231     ;;
2232     esac
2233    
2234     if test $age -gt $current; then
2235     $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2236     $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2237     exit 1
2238     fi
2239    
2240     # Calculate the version variables.
2241     major=
2242     versuffix=
2243     verstring=
2244     case "$version_type" in
2245     none) ;;
2246    
2247     irix)
2248     major=`expr $current - $age + 1`
2249     verstring="sgi$major.$revision"
2250    
2251     # Add in all the interfaces that we are compatible with.
2252     loop=$revision
2253     while test $loop != 0; do
2254     iface=`expr $revision - $loop`
2255     loop=`expr $loop - 1`
2256     verstring="sgi$major.$iface:$verstring"
2257     done
2258    
2259     # Before this point, $major must not contain `.'.
2260     major=.$major
2261     versuffix="$major.$revision"
2262     ;;
2263    
2264     linux)
2265     major=.`expr $current - $age`
2266     versuffix="$major.$age.$revision"
2267     ;;
2268    
2269     osf)
2270     major=`expr $current - $age`
2271     versuffix=".$current.$age.$revision"
2272     verstring="$current.$age.$revision"
2273    
2274     # Add in all the interfaces that we are compatible with.
2275     loop=$age
2276     while test $loop != 0; do
2277     iface=`expr $current - $loop`
2278     loop=`expr $loop - 1`
2279     verstring="$verstring:${iface}.0"
2280     done
2281    
2282     # Make executables depend on our current version.
2283     verstring="$verstring:${current}.0"
2284     ;;
2285    
2286     sunos)
2287     major=".$current"
2288     versuffix=".$current.$revision"
2289     ;;
2290    
2291     freebsd-aout)
2292     major=".$current"
2293     versuffix=".$current.$revision";
2294     ;;
2295    
2296     freebsd-elf)
2297     major=".$current"
2298     versuffix=".$current";
2299     ;;
2300    
2301     windows)
2302     # Use '-' rather than '.', since we only want one
2303     # extension on DOS 8.3 filesystems.
2304     major=`expr $current - $age`
2305     versuffix="-$major"
2306     ;;
2307    
2308     *)
2309     $echo "$modename: unknown library version type \`$version_type'" 1>&2
2310     echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2311     exit 1
2312     ;;
2313     esac
2314    
2315     # Clear the version info if we defaulted, and they specified a release.
2316     if test -z "$vinfo" && test -n "$release"; then
2317     major=
2318     verstring="0.0"
2319     if test "$need_version" = no; then
2320     versuffix=
2321     else
2322     versuffix=".0.0"
2323     fi
2324     fi
2325    
2326     # Remove version info from name if versioning should be avoided
2327     if test "$avoid_version" = yes && test "$need_version" = no; then
2328     major=
2329     versuffix=
2330     verstring=""
2331     fi
2332    
2333     # Check to see if the archive will have undefined symbols.
2334     if test "$allow_undefined" = yes; then
2335     if test "$allow_undefined_flag" = unsupported; then
2336     $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2337     build_libtool_libs=no
2338     build_old_libs=yes
2339     fi
2340     else
2341     # Don't allow undefined symbols.
2342     allow_undefined_flag="$no_undefined_flag"
2343     fi
2344     fi
2345    
2346     if test "$mode" != relink; then
2347     # Remove our outputs.
2348     $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
2349     $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
2350     fi
2351    
2352     # Now set the variables for building old libraries.
2353     if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2354     oldlibs="$oldlibs $output_objdir/$libname.$libext"
2355    
2356     # Transform .lo files to .o files.
2357     oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2358     fi
2359    
2360     # Eliminate all temporary directories.
2361     for path in $uninst_path; do
2362     lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2363     deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2364     dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2365     done
2366    
2367     if test -n "$xrpath"; then
2368     # If the user specified any rpath flags, then add them.
2369     temp_xrpath=
2370     for libdir in $xrpath; do
2371     temp_xrpath="$temp_xrpath -R$libdir"
2372     case "$finalize_rpath " in
2373     *" $libdir "*) ;;
2374     *) finalize_rpath="$finalize_rpath $libdir" ;;
2375     esac
2376     done
2377     if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
2378     dependency_libs="$temp_xrpath $dependency_libs"
2379     fi
2380     fi
2381    
2382     # Make sure dlfiles contains only unique files that won't be dlpreopened
2383     old_dlfiles="$dlfiles"
2384     dlfiles=
2385     for lib in $old_dlfiles; do
2386     case " $dlprefiles $dlfiles " in
2387     *" $lib "*) ;;
2388     *) dlfiles="$dlfiles $lib" ;;
2389     esac
2390     done
2391    
2392     # Make sure dlprefiles contains only unique files
2393     old_dlprefiles="$dlprefiles"
2394     dlprefiles=
2395     for lib in $old_dlprefiles; do
2396     case "$dlprefiles " in
2397     *" $lib "*) ;;
2398     *) dlprefiles="$dlprefiles $lib" ;;
2399     esac
2400     done
2401    
2402     if test "$build_libtool_libs" = yes; then
2403     if test -n "$rpath"; then
2404     case "$host" in
2405     *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
2406     # these systems don't actually have a c library (as such)!
2407     ;;
2408     *)
2409     # Add libc to deplibs on all other systems if necessary.
2410     if test $build_libtool_need_lc = "yes"; then
2411     deplibs="$deplibs -lc"
2412     fi
2413     ;;
2414     esac
2415     fi
2416    
2417     # Transform deplibs into only deplibs that can be linked in shared.
2418     name_save=$name
2419     libname_save=$libname
2420     release_save=$release
2421     versuffix_save=$versuffix
2422     major_save=$major
2423     # I'm not sure if I'm treating the release correctly. I think
2424     # release should show up in the -l (ie -lgmp5) so we don't want to
2425     # add it in twice. Is that correct?
2426     release=""
2427     versuffix=""
2428     major=""
2429     newdeplibs=
2430     droppeddeps=no
2431     case "$deplibs_check_method" in
2432     pass_all)
2433     # Don't check for shared/static. Everything works.
2434     # This might be a little naive. We might want to check
2435     # whether the library exists or not. But this is on
2436     # osf3 & osf4 and I'm not really sure... Just
2437     # implementing what was already the behaviour.
2438     newdeplibs=$deplibs
2439     ;;
2440     test_compile)
2441     # This code stresses the "libraries are programs" paradigm to its
2442     # limits. Maybe even breaks it. We compile a program, linking it
2443     # against the deplibs as a proxy for the library. Then we can check
2444     # whether they linked in statically or dynamically with ldd.
2445     $rm conftest.c
2446     cat > conftest.c <<EOF
2447     int main() { return 0; }
2448     EOF
2449     $rm conftest
2450     $CC -o conftest conftest.c $deplibs
2451     if test $? -eq 0 ; then
2452     ldd_output=`ldd conftest`
2453     for i in $deplibs; do
2454     name="`expr $i : '-l\(.*\)'`"
2455     # If $name is empty we are operating on a -L argument.
2456     if test "$name" != "" -a "$name" != "0"; then
2457     libname=`eval \\$echo \"$libname_spec\"`
2458     deplib_matches=`eval \\$echo \"$library_names_spec\"`
2459     set dummy $deplib_matches
2460     deplib_match=$2
2461     if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2462     newdeplibs="$newdeplibs $i"
2463     else
2464     droppeddeps=yes
2465     echo
2466     echo "*** Warning: This library needs some functionality provided by $i."
2467     echo "*** I have the capability to make that library automatically link in when"
2468     echo "*** you link to this library. But I can only do this if you have a"
2469     echo "*** shared version of the library, which you do not appear to have."
2470     fi
2471     else
2472     newdeplibs="$newdeplibs $i"
2473     fi
2474     done
2475     else
2476     # Error occured in the first compile. Let's try to salvage the situation:
2477     # Compile a seperate program for each library.
2478     for i in $deplibs; do
2479     name="`expr $i : '-l\(.*\)'`"
2480     # If $name is empty we are operating on a -L argument.
2481     if test "$name" != "" -a "$name" != "0"; then
2482     $rm conftest
2483     $CC -o conftest conftest.c $i
2484     # Did it work?
2485     if test $? -eq 0 ; then
2486     ldd_output=`ldd conftest`
2487     libname=`eval \\$echo \"$libname_spec\"`
2488     deplib_matches=`eval \\$echo \"$library_names_spec\"`
2489     set dummy $deplib_matches
2490     deplib_match=$2
2491     if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2492     newdeplibs="$newdeplibs $i"
2493     else
2494     droppeddeps=yes
2495     echo
2496     echo "*** Warning: This library needs some functionality provided by $i."
2497     echo "*** I have the capability to make that library automatically link in when"
2498     echo "*** you link to this library. But I can only do this if you have a"
2499     echo "*** shared version of the library, which you do not appear to have."
2500     fi
2501     else
2502     droppeddeps=yes
2503     echo
2504     echo "*** Warning! Library $i is needed by this library but I was not able to"
2505     echo "*** make it link in! You will probably need to install it or some"
2506     echo "*** library that it depends on before this library will be fully"
2507     echo "*** functional. Installing it before continuing would be even better."
2508     fi
2509     else
2510     newdeplibs="$newdeplibs $i"
2511     fi
2512     done
2513     fi
2514     ;;
2515     file_magic*)
2516     set dummy $deplibs_check_method
2517     file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2518     for a_deplib in $deplibs; do
2519     name="`expr $a_deplib : '-l\(.*\)'`"
2520     # If $name is empty we are operating on a -L argument.
2521     if test "$name" != "" -a "$name" != "0"; then
2522     libname=`eval \\$echo \"$libname_spec\"`
2523     for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2524     potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2525     for potent_lib in $potential_libs; do
2526     # Follow soft links.
2527     if ls -lLd "$potent_lib" 2>/dev/null \
2528     | grep " -> " >/dev/null; then
2529     continue
2530     fi
2531     # The statement above tries to avoid entering an
2532     # endless loop below, in case of cyclic links.
2533     # We might still enter an endless loop, since a link
2534     # loop can be closed while we follow links,
2535     # but so what?
2536     potlib="$potent_lib"
2537     while test -h "$potlib" 2>/dev/null; do
2538     potliblink=`ls -ld $potlib | sed 's/.* -> //'`
2539     case "$potliblink" in
2540     [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2541     *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2542     esac
2543     done
2544     if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2545     | sed 10q \
2546     | egrep "$file_magic_regex" > /dev/null; then
2547     newdeplibs="$newdeplibs $a_deplib"
2548     a_deplib=""
2549     break 2
2550     fi
2551     done
2552     done
2553     if test -n "$a_deplib" ; then
2554     droppeddeps=yes
2555     echo
2556     echo "*** Warning: This library needs some functionality provided by $a_deplib."
2557     echo "*** I have the capability to make that library automatically link in when"
2558     echo "*** you link to this library. But I can only do this if you have a"
2559     echo "*** shared version of the library, which you do not appear to have."
2560     fi
2561     else
2562     # Add a -L argument.
2563     newdeplibs="$newdeplibs $a_deplib"
2564     fi
2565     done # Gone through all deplibs.
2566     ;;
2567     none | unknown | *)
2568     newdeplibs=""
2569     if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2570     -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2571     grep . >/dev/null; then
2572     echo
2573     if test "X$deplibs_check_method" = "Xnone"; then
2574     echo "*** Warning: inter-library dependencies are not supported in this platform."
2575     else
2576     echo "*** Warning: inter-library dependencies are not known to be supported."
2577     fi
2578     echo "*** All declared inter-library dependencies are being dropped."
2579     droppeddeps=yes
2580     fi
2581     ;;
2582     esac
2583     versuffix=$versuffix_save
2584     major=$major_save
2585     release=$release_save
2586     libname=$libname_save
2587     name=$name_save
2588    
2589     if test "$droppeddeps" = yes; then
2590     if test "$module" = yes; then
2591     echo
2592     echo "*** Warning: libtool could not satisfy all declared inter-library"
2593     echo "*** dependencies of module $libname. Therefore, libtool will create"
2594     echo "*** a static module, that should work as long as the dlopening"
2595     echo "*** application is linked with the -dlopen flag."
2596     if test -z "$global_symbol_pipe"; then
2597     echo
2598     echo "*** However, this would only work if libtool was able to extract symbol"
2599     echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2600     echo "*** not find such a program. So, this module is probably useless."
2601     echo "*** \`nm' from GNU binutils and a full rebuild may help."
2602     fi
2603     if test "$build_old_libs" = no; then
2604     oldlibs="$output_objdir/$libname.$libext"
2605     build_libtool_libs=module
2606     build_old_libs=yes
2607     else
2608     build_libtool_libs=no
2609     fi
2610     else
2611     echo "*** The inter-library dependencies that have been dropped here will be"
2612     echo "*** automatically added whenever a program is linked with this library"
2613     echo "*** or is declared to -dlopen it."
2614     fi
2615     fi
2616     # Done checking deplibs!
2617     deplibs=$newdeplibs
2618     fi
2619    
2620     # All the library-specific variables (install_libdir is set above).
2621     library_names=
2622     old_library=
2623     dlname=
2624    
2625     # Test again, we may have decided not to build it any more
2626     if test "$build_libtool_libs" = yes; then
2627     if test $hardcode_into_libs = yes; then
2628     # Hardcode the library paths
2629     hardcode_libdirs=
2630     dep_rpath=
2631     rpath="$finalize_rpath"
2632     test "$mode" != relink && rpath="$compile_rpath$rpath"
2633     for libdir in $rpath; do
2634     if test -n "$hardcode_libdir_flag_spec"; then
2635     if test -n "$hardcode_libdir_separator"; then
2636     if test -z "$hardcode_libdirs"; then
2637     hardcode_libdirs="$libdir"
2638     else
2639     # Just accumulate the unique libdirs.
2640     case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2641     *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2642     ;;
2643     *)
2644     hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2645     ;;
2646     esac
2647     fi
2648     else
2649     eval flag=\"$hardcode_libdir_flag_spec\"
2650     dep_rpath="$dep_rpath $flag"
2651     fi
2652     elif test -n "$runpath_var"; then
2653     case "$perm_rpath " in
2654     *" $libdir "*) ;;
2655     *) perm_rpath="$perm_rpath $libdir" ;;
2656     esac
2657     fi
2658     done
2659     # Substitute the hardcoded libdirs into the rpath.
2660     if test -n "$hardcode_libdir_separator" &&
2661     test -n "$hardcode_libdirs"; then
2662     libdir="$hardcode_libdirs"
2663     eval dep_rpath=\"$hardcode_libdir_flag_spec\"
2664     fi
2665     if test -n "$runpath_var" && test -n "$perm_rpath"; then
2666     # We should set the runpath_var.
2667     rpath=
2668     for dir in $perm_rpath; do
2669     rpath="$rpath$dir:"
2670     done
2671     eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
2672     fi
2673     test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
2674     fi
2675    
2676     shlibpath="$finalize_shlibpath"
2677     test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
2678     if test -n "$shlibpath"; then
2679     eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
2680     fi
2681    
2682     # Get the real and link names of the library.
2683     eval library_names=\"$library_names_spec\"
2684     set dummy $library_names
2685     realname="$2"
2686     shift; shift
2687    
2688     if test -n "$soname_spec"; then
2689     eval soname=\"$soname_spec\"
2690     else
2691     soname="$realname"
2692     fi
2693    
2694     lib="$output_objdir/$realname"
2695     for link
2696     do
2697     linknames="$linknames $link"
2698     done
2699    
2700     # Ensure that we have .o objects for linkers which dislike .lo
2701     # (e.g. aix) in case we are running --disable-static
2702     for obj in $libobjs; do
2703     xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
2704     if test "X$xdir" = "X$obj"; then
2705     xdir="."
2706     else
2707     xdir="$xdir"
2708     fi
2709     baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
2710     oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
2711     if test ! -f $xdir/$oldobj; then
2712     $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
2713     $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
2714     fi
2715     done
2716    
2717     # Use standard objects if they are pic
2718     test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2719    
2720     # Prepare the list of exported symbols
2721     if test -z "$export_symbols"; then
2722     if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
2723     $show "generating symbol list for \`$libname.la'"
2724     export_symbols="$output_objdir/$libname.exp"
2725     $run $rm $export_symbols
2726     eval cmds=\"$export_symbols_cmds\"
2727     IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2728     for cmd in $cmds; do
2729     IFS="$save_ifs"
2730     $show "$cmd"
2731     $run eval "$cmd" || exit $?
2732     done
2733     IFS="$save_ifs"
2734     if test -n "$export_symbols_regex"; then
2735     $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2736     $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2737     $show "$mv \"${export_symbols}T\" \"$export_symbols\""
2738     $run eval '$mv "${export_symbols}T" "$export_symbols"'
2739     fi
2740     fi
2741     fi
2742    
2743     if test -n "$export_symbols" && test -n "$include_expsyms"; then
2744     $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
2745     fi
2746    
2747     if test -n "$convenience"; then
2748     if test -n "$whole_archive_flag_spec"; then
2749     eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
2750     else
2751     gentop="$output_objdir/${outputname}x"
2752     $show "${rm}r $gentop"
2753     $run ${rm}r "$gentop"
2754     $show "mkdir $gentop"
2755     $run mkdir "$gentop"
2756     status=$?
2757     if test $status -ne 0 && test ! -d "$gentop"; then
2758     exit $status
2759     fi
2760     generated="$generated $gentop"
2761    
2762     for xlib in $convenience; do
2763     # Extract the objects.
2764     case "$xlib" in
2765     [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2766     *) xabs=`pwd`"/$xlib" ;;
2767     esac
2768     xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2769     xdir="$gentop/$xlib"
2770    
2771     $show "${rm}r $xdir"
2772     $run ${rm}r "$xdir"
2773     $show "mkdir $xdir"
2774     $run mkdir "$xdir"
2775     status=$?
2776     if test $status -ne 0 && test ! -d "$xdir"; then
2777     exit $status
2778     fi
2779     $show "(cd $xdir && $AR x $xabs)"
2780     $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2781    
2782     libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2783     done
2784     fi
2785     fi
2786    
2787     if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2788     eval flag=\"$thread_safe_flag_spec\"
2789     linker_flags="$linker_flags $flag"
2790     fi
2791    
2792     # Make a backup of the uninstalled library when relinking
2793     if test "$mode" = relink; then
2794     $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
2795     fi
2796    
2797     # Do each of the archive commands.
2798     if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2799     eval cmds=\"$archive_expsym_cmds\"
2800     else
2801     eval cmds=\"$archive_cmds\"
2802     fi
2803     IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2804     for cmd in $cmds; do
2805     IFS="$save_ifs"
2806     $show "$cmd"
2807     $run eval "$cmd" || exit $?
2808     done
2809     IFS="$save_ifs"
2810    
2811     # Restore the uninstalled library and exit
2812     if test "$mode" = relink; then
2813     $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
2814     exit 0
2815     fi
2816    
2817     # Create links to the real library.
2818     for linkname in $linknames; do
2819     if test "$realname" != "$linkname"; then
2820     $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
2821     $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
2822     fi
2823     done
2824    
2825     # If -module or -export-dynamic was specified, set the dlname.
2826     if test "$module" = yes || test "$export_dynamic" = yes; then
2827     # On all known operating systems, these are identical.
2828     dlname="$soname"
2829     fi
2830     fi
2831     ;;
2832    
2833     obj)
2834     if test -n "$deplibs"; then
2835     $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
2836     fi
2837    
2838     if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2839     $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
2840     fi
2841    
2842     if test -n "$rpath"; then
2843     $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
2844     fi
2845    
2846     if test -n "$xrpath"; then
2847     $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
2848     fi
2849    
2850     if test -n "$vinfo"; then
2851     $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
2852     fi
2853    
2854     if test -n "$release"; then
2855     $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
2856     fi
2857    
2858     case "$output" in
2859     *.lo)
2860     if test -n "$objs$old_deplibs"; then
2861     $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
2862     exit 1
2863     fi
2864     libobj="$output"
2865     obj=`$echo "X$output" | $Xsed -e "$lo2o"`
2866     ;;
2867     *)
2868     libobj=
2869     obj="$output"
2870     ;;
2871     esac
2872    
2873     # Delete the old objects.
2874     $run $rm $obj $libobj
2875    
2876     # Objects from convenience libraries. This assumes
2877     # single-version convenience libraries. Whenever we create
2878     # different ones for PIC/non-PIC, this we'll have to duplicate
2879     # the extraction.
2880     reload_conv_objs=
2881     gentop=
2882     # reload_cmds runs $LD directly, so let us get rid of
2883     # -Wl from whole_archive_flag_spec
2884     wl=
2885    
2886     if test -n "$convenience"; then
2887     if test -n "$whole_archive_flag_spec"; then
2888     eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
2889     else
2890     gentop="$output_objdir/${obj}x"
2891     $show "${rm}r $gentop"
2892     $run ${rm}r "$gentop"
2893     $show "mkdir $gentop"
2894     $run mkdir "$gentop"
2895     status=$?
2896     if test $status -ne 0 && test ! -d "$gentop"; then
2897     exit $status
2898     fi
2899     generated="$generated $gentop"
2900    
2901     for xlib in $convenience; do
2902     # Extract the objects.
2903     case "$xlib" in
2904     [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2905     *) xabs=`pwd`"/$xlib" ;;
2906     esac
2907     xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2908     xdir="$gentop/$xlib"
2909    
2910     $show "${rm}r $xdir"
2911     $run ${rm}r "$xdir"
2912     $show "mkdir $xdir"
2913     $run mkdir "$xdir"
2914     status=$?
2915     if test $status -ne 0 && test ! -d "$xdir"; then
2916     exit $status
2917     fi
2918     $show "(cd $xdir && $AR x $xabs)"
2919     $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2920    
2921     reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2922     done
2923     fi
2924     fi
2925    
2926     # Create the old-style object.
2927     reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
2928    
2929     output="$obj"
2930     eval cmds=\"$reload_cmds\"
2931     IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2932     for cmd in $cmds; do
2933     IFS="$save_ifs"
2934     $show "$cmd"
2935     $run eval "$cmd" || exit $?
2936     done
2937     IFS="$save_ifs"
2938    
2939     # Exit if we aren't doing a library object file.
2940     if test -z "$libobj"; then
2941     if test -n "$gentop"; then
2942     $show "${rm}r $gentop"
2943     $run ${rm}r $gentop
2944     fi
2945    
2946     exit 0
2947     fi
2948    
2949     if test "$build_libtool_libs" != yes; then
2950     if test -n "$gentop"; then
2951     $show "${rm}r $gentop"
2952     $run ${rm}r $gentop
2953     fi
2954    
2955     # Create an invalid libtool object if no PIC, so that we don't
2956     # accidentally link it into a program.
2957     $show "echo timestamp > $libobj"
2958     $run eval "echo timestamp > $libobj" || exit $?
2959     exit 0
2960     fi
2961    
2962     if test -n "$pic_flag" || test "$pic_mode" != default; then
2963     # Only do commands if we really have different PIC objects.
2964     reload_objs="$libobjs $reload_conv_objs"
2965     output="$libobj"
2966     eval cmds=\"$reload_cmds\"
2967     IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2968     for cmd in $cmds; do
2969     IFS="$save_ifs"
2970     $show "$cmd"
2971     $run eval "$cmd" || exit $?
2972     done
2973     IFS="$save_ifs"
2974     else
2975     # Just create a symlink.
2976     $show $rm $libobj
2977     $run $rm $libobj
2978     xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
2979     if test "X$xdir" = "X$libobj"; then
2980     xdir="."
2981     else
2982     xdir="$xdir"
2983     fi
2984     baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
2985     oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
2986     $show "(cd $xdir && $LN_S $oldobj $baseobj)"
2987     $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
2988     fi
2989    
2990     if test -n "$gentop"; then
2991     $show "${rm}r $gentop"
2992     $run ${rm}r $gentop
2993     fi
2994    
2995     exit 0
2996     ;;
2997    
2998     prog)
2999     if test -n "$vinfo"; then
3000     $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3001     fi
3002    
3003     if test -n "$release"; then
3004     $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3005     fi
3006    
3007     if test "$preload" = yes; then
3008     if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
3009     test "$dlopen_self_static" = unknown; then
3010     $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3011     fi
3012     fi
3013    
3014     compile_command="$compile_command $compile_deplibs"
3015     finalize_command="$finalize_command $finalize_deplibs"
3016    
3017     if test -n "$rpath$xrpath"; then
3018     # If the user specified any rpath flags, then add them.
3019     for libdir in $rpath $xrpath; do
3020     # This is the magic to use -rpath.
3021     case "$finalize_rpath " in
3022     *" $libdir "*) ;;
3023     *) finalize_rpath="$finalize_rpath $libdir" ;;
3024     esac
3025     done
3026     fi
3027    
3028     # Now hardcode the library paths
3029     rpath=
3030     hardcode_libdirs=
3031     for libdir in $compile_rpath $finalize_rpath; do
3032     if test -n "$hardcode_libdir_flag_spec"; then
3033     if test -n "$hardcode_libdir_separator"; then
3034     if test -z "$hardcode_libdirs"; then
3035     hardcode_libdirs="$libdir"
3036     else
3037     # Just accumulate the unique libdirs.
3038     case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
3039     *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3040     ;;
3041     *)
3042     hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3043     ;;
3044     esac
3045     fi
3046     else
3047     eval flag=\"$hardcode_libdir_flag_spec\"
3048     rpath="$rpath $flag"
3049     fi
3050     elif test -n "$runpath_var"; then
3051     case "$perm_rpath " in
3052     *" $libdir "*) ;;
3053     *) perm_rpath="$perm_rpath $libdir" ;;
3054     esac
3055     fi
3056     case "$host" in
3057     *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3058     case ":$dllsearchpath:" in
3059     *":$libdir:"*) ;;
3060     *) dllsearchpath="$dllsearchpath:$libdir";;
3061     esac
3062     ;;
3063     esac
3064     done
3065     # Substitute the hardcoded libdirs into the rpath.
3066     if test -n "$hardcode_libdir_separator" &&
3067     test -n "$hardcode_libdirs"; then
3068     libdir="$hardcode_libdirs"
3069     eval rpath=\" $hardcode_libdir_flag_spec\"
3070     fi
3071     compile_rpath="$rpath"
3072    
3073     rpath=
3074     hardcode_libdirs=
3075     for libdir in $finalize_rpath; do
3076     if test -n "$hardcode_libdir_flag_spec"; then
3077     if test -n "$hardcode_libdir_separator"; then
3078     if test -z "$hardcode_libdirs"; then
3079     hardcode_libdirs="$libdir"
3080     else
3081     # Just accumulate the unique libdirs.
3082     case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
3083     *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3084     ;;
3085     *)
3086     hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3087     ;;
3088     esac
3089     fi
3090     else
3091     eval flag=\"$hardcode_libdir_flag_spec\"
3092     rpath="$rpath $flag"
3093     fi
3094     elif test -n "$runpath_var"; then
3095     case "$finalize_perm_rpath " in
3096     *" $libdir "*) ;;
3097     *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
3098     esac
3099     fi
3100     done
3101     # Substitute the hardcoded libdirs into the rpath.
3102     if test -n "$hardcode_libdir_separator" &&
3103     test -n "$hardcode_libdirs"; then
3104     libdir="$hardcode_libdirs"
3105     eval rpath=\" $hardcode_libdir_flag_spec\"
3106     fi
3107     finalize_rpath="$rpath"
3108    
3109     if test -n "$libobjs" && test "$build_old_libs" = yes; then
3110     # Transform all the library objects into standard objects.
3111     compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3112     finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3113     fi
3114    
3115     dlsyms=
3116     if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3117     if test -n "$NM" && test -n "$global_symbol_pipe"; then
3118     dlsyms="${outputname}S.c"
3119     else
3120     $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3121     fi
3122     fi
3123    
3124     if test -n "$dlsyms"; then
3125     case "$dlsyms" in
3126     "") ;;
3127     *.c)
3128     # Discover the nlist of each of the dlfiles.
3129     nlist="$output_objdir/${outputname}.nm"
3130    
3131     $show "$rm $nlist ${nlist}S ${nlist}T"
3132     $run $rm "$nlist" "${nlist}S" "${nlist}T"
3133    
3134     # Parse the name list into a source file.
3135     $show "creating $output_objdir/$dlsyms"
3136    
3137     test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3138     /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3139     /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3140    
3141     #ifdef __cplusplus
3142     extern \"C\" {
3143     #endif
3144    
3145     /* Prevent the only kind of declaration conflicts we can make. */
3146     #define lt_preloaded_symbols some_other_symbol
3147    
3148     /* External symbol declarations for the compiler. */\
3149     "
3150    
3151     if test "$dlself" = yes; then
3152     $show "generating symbol list for \`$output'"
3153    
3154     test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3155    
3156     # Add our own program objects to the symbol list.
3157     progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3158     for arg in $progfiles; do
3159     $show "extracting global C symbols from \`$arg'"
3160     $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3161     done
3162    
3163     if test -n "$exclude_expsyms"; then
3164     $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3165     $run eval '$mv "$nlist"T "$nlist"'
3166     fi
3167    
3168     if test -n "$export_symbols_regex"; then
3169     $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3170     $run eval '$mv "$nlist"T "$nlist"'
3171     fi
3172    
3173     # Prepare the list of exported symbols
3174     if test -z "$export_symbols"; then
3175     export_symbols="$output_objdir/$output.exp"
3176     $run $rm $export_symbols
3177     $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3178     else
3179     $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3180     $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3181     $run eval 'mv "$nlist"T "$nlist"'
3182     fi
3183     fi
3184    
3185     for arg in $dlprefiles; do
3186     $show "extracting global C symbols from \`$arg'"
3187     name=`echo "$arg" | sed -e 's%^.*/%%'`
3188     $run eval 'echo ": $name " >> "$nlist"'
3189     $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3190     done
3191    
3192     if test -z "$run"; then
3193     # Make sure we have at least an empty file.
3194     test -f "$nlist" || : > "$nlist"
3195    
3196     if test -n "$exclude_expsyms"; then
3197     egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3198     $mv "$nlist"T "$nlist"
3199     fi
3200    
3201     # Try sorting and uniquifying the output.
3202     if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
3203     :
3204     else
3205     grep -v "^: " < "$nlist" > "$nlist"S
3206     fi
3207    
3208     if test -f "$nlist"S; then
3209     eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3210     else
3211     echo '/* NONE */' >> "$output_objdir/$dlsyms"
3212     fi
3213    
3214     $echo >> "$output_objdir/$dlsyms" "\
3215    
3216     #undef lt_preloaded_symbols
3217    
3218     #if defined (__STDC__) && __STDC__
3219     # define lt_ptr_t void *
3220     #else
3221     # define lt_ptr_t char *
3222     # define const
3223     #endif
3224    
3225     /* The mapping between symbol names and symbols. */
3226     const struct {
3227     const char *name;
3228     lt_ptr_t address;
3229     }
3230     lt_preloaded_symbols[] =
3231     {\
3232     "
3233    
3234     sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
3235     -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
3236     < "$nlist" >> "$output_objdir/$dlsyms"
3237    
3238     $echo >> "$output_objdir/$dlsyms" "\
3239     {0, (lt_ptr_t) 0}
3240     };
3241    
3242     /* This works around a problem in FreeBSD linker */
3243     #ifdef FREEBSD_WORKAROUND
3244     static const void *lt_preloaded_setup() {
3245     return lt_preloaded_symbols;
3246     }
3247     #endif
3248    
3249     #ifdef __cplusplus
3250     }
3251     #endif\
3252     "
3253     fi
3254    
3255     pic_flag_for_symtable=
3256     case "$host" in
3257     # compiling the symbol table file with pic_flag works around
3258     # a FreeBSD bug that causes programs to crash when -lm is
3259     # linked before any other PIC object. But we must not use
3260     # pic_flag when linking with -static. The problem exists in
3261     # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3262     *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3263     case "$compile_command " in
3264     *" -static "*) ;;
3265     *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
3266     esac;;
3267     *-*-hpux*)
3268     case "$compile_command " in
3269     *" -static "*) ;;
3270     *) pic_flag_for_symtable=" $pic_flag -DPIC";;
3271     esac
3272     esac
3273    
3274     # Now compile the dynamic symbol file.
3275     $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3276     $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
3277    
3278     # Clean up the generated files.
3279     $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3280     $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3281    
3282     # Transform the symbol file into the correct name.
3283     compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3284     finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3285     ;;
3286     *)
3287     $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3288     exit 1
3289     ;;
3290     esac
3291     else
3292     # We keep going just in case the user didn't refer to
3293     # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3294     # really was required.
3295    
3296     # Nullify the symbol file.
3297     compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3298     finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3299     fi
3300    
3301     if test $need_relink = no || test "$build_libtool_libs" != yes; then
3302     # Replace the output file specification.
3303     compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3304     link_command="$compile_command$compile_rpath"
3305    
3306     # We have no uninstalled library dependencies, so finalize right now.
3307     $show "$link_command"
3308     $run eval "$link_command"
3309     status=$?
3310    
3311     # Delete the generated files.
3312     if test -n "$dlsyms"; then
3313     $show "$rm $output_objdir/${outputname}S.${objext}"
3314     $run $rm "$output_objdir/${outputname}S.${objext}"
3315     fi
3316    
3317     exit $status
3318     fi
3319    
3320     if test -n "$shlibpath_var"; then
3321     # We should set the shlibpath_var
3322     rpath=
3323     for dir in $temp_rpath; do
3324     case "$dir" in
3325     [\\/]* | [A-Za-z]:[\\/]*)
3326     # Absolute path.
3327     rpath="$rpath$dir:"
3328     ;;
3329     *)
3330     # Relative path: add a thisdir entry.
3331     rpath="$rpath\$thisdir/$dir:"
3332     ;;
3333     esac
3334     done
3335     temp_rpath="$rpath"
3336     fi
3337    
3338     if test -n "$compile_shlibpath$finalize_shlibpath"; then
3339     compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3340     fi
3341     if test -n "$finalize_shlibpath"; then
3342     finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3343     fi
3344    
3345     compile_var=
3346     finalize_var=
3347     if test -n "$runpath_var"; then
3348     if test -n "$perm_rpath"; then
3349     # We should set the runpath_var.
3350     rpath=
3351     for dir in $perm_rpath; do
3352     rpath="$rpath$dir:"
3353     done
3354     compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
3355     fi
3356     if test -n "$finalize_perm_rpath"; then
3357     # We should set the runpath_var.
3358     rpath=
3359     for dir in $finalize_perm_rpath; do
3360     rpath="$rpath$dir:"
3361     done
3362     finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
3363     fi
3364     fi
3365    
3366     if test "$no_install" = yes; then
3367     # We don't need to create a wrapper script.
3368     link_command="$compile_var$compile_command$compile_rpath"
3369     # Replace the output file specification.
3370     link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3371     # Delete the old output file.
3372     $run $rm $output
3373     # Link the executable and exit
3374     $show "$link_command"
3375     $run eval "$link_command" || exit $?
3376     exit 0
3377     fi
3378    
3379     if test "$hardcode_action" = relink; then
3380     # Fast installation is not supported
3381     link_command="$compile_var$compile_command$compile_rpath"
3382     relink_command="$finalize_var$finalize_command$finalize_rpath"
3383    
3384     $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3385     $echo "$modename: \`$output' will be relinked during installation" 1>&2
3386     else
3387     if test "$fast_install" != no; then
3388     link_command="$finalize_var$compile_command$finalize_rpath"
3389     if test "$fast_install" = yes; then
3390     relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3391     else
3392     # fast_install is set to needless
3393     relink_command=
3394     fi
3395     else
3396     link_command="$compile_var$compile_command$compile_rpath"
3397     relink_command="$finalize_var$finalize_command$finalize_rpath"
3398     fi
3399     fi
3400    
3401     # Replace the output file specification.
3402     link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3403    
3404     # Delete the old output files.
3405     $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
3406    
3407     $show "$link_command"
3408     $run eval "$link_command" || exit $?
3409    
3410     # Now create the wrapper script.
3411     $show "creating $output"
3412    
3413     # Quote the relink command for shipping.
3414     if test -n "$relink_command"; then
3415     # Preserve any variables that may affect compiler behavior
3416     for var in $variables_saved_for_relink; do
3417     if eval test -z \"\${$var+set}\"; then
3418     relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3419     elif eval var_value=\$$var; test -z "$var_value"; then
3420     relink_command="$var=; export $var; $relink_command"
3421     else
3422     var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3423     relink_command="$var=\"$var_value\"; export $var; $relink_command"
3424     fi
3425     done
3426     relink_command="cd `pwd`; $relink_command"
3427     relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3428     fi
3429    
3430     # Quote $echo for shipping.
3431     if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3432     case "$0" in
3433     [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
3434     *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
3435     esac
3436     qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3437     else
3438     qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3439     fi
3440    
3441     # Only actually do things if our run command is non-null.
3442     if test -z "$run"; then
3443     # win32 will think the script is a binary if it has
3444     # a .exe suffix, so we strip it off here.
3445     case $output in
3446     *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
3447     esac
3448     $rm $output
3449     trap "$rm $output; exit 1" 1 2 15
3450    
3451     $echo > $output "\
3452     #! $SHELL
3453    
3454     # $output - temporary wrapper script for $objdir/$outputname
3455     # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3456     #
3457     # The $output program cannot be directly executed until all the libtool
3458     # libraries that it depends on are installed.
3459     #
3460     # This wrapper script should never be moved out of the build directory.
3461     # If it is, it will not operate correctly.
3462    
3463     # Sed substitution that helps us do robust quoting. It backslashifies
3464     # metacharacters that are still active within double-quoted strings.
3465     Xsed='sed -e 1s/^X//'
3466     sed_quote_subst='$sed_quote_subst'
3467    
3468     # The HP-UX ksh and POSIX shell print the target directory to stdout
3469     # if CDPATH is set.
3470     if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
3471    
3472     relink_command=\"$relink_command\"
3473    
3474     # This environment variable determines our operation mode.
3475     if test \"\$libtool_install_magic\" = \"$magic\"; then
3476     # install mode needs the following variable:
3477     uninst_deplibs='$uninst_deplibs'
3478     else
3479     # When we are sourced in execute mode, \$file and \$echo are already set.
3480     if test \"\$libtool_execute_magic\" != \"$magic\"; then
3481     echo=\"$qecho\"
3482     file=\"\$0\"
3483     # Make sure echo works.
3484     if test \"X\$1\" = X--no-reexec; then
3485     # Discard the --no-reexec flag, and continue.
3486     shift
3487     elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3488     # Yippee, \$echo works!
3489     :
3490     else
3491     # Restart under the correct shell, and then maybe \$echo will work.
3492     exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3493     fi
3494     fi\
3495     "
3496     $echo >> $output "\
3497    
3498     # Find the directory that this script lives in.
3499     thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3500     test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3501    
3502     # Follow symbolic links until we get to the real thisdir.
3503     file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
3504     while test -n \"\$file\"; do
3505     destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3506    
3507     # If there was a directory component, then change thisdir.
3508     if test \"x\$destdir\" != \"x\$file\"; then
3509     case \"\$destdir\" in
3510     [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3511     *) thisdir=\"\$thisdir/\$destdir\" ;;
3512     esac
3513     fi
3514    
3515     file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3516     file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
3517     done
3518    
3519     # Try to get the absolute directory name.
3520     absdir=\`cd \"\$thisdir\" && pwd\`
3521     test -n \"\$absdir\" && thisdir=\"\$absdir\"
3522     "
3523    
3524     if test "$fast_install" = yes; then
3525     echo >> $output "\
3526     program=lt-'$outputname'
3527     progdir=\"\$thisdir/$objdir\"
3528    
3529     if test ! -f \"\$progdir/\$program\" || \\
3530     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
3531     test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3532    
3533     file=\"\$\$-\$program\"
3534    
3535     if test ! -d \"\$progdir\"; then
3536     $mkdir \"\$progdir\"
3537     else
3538     $rm \"\$progdir/\$file\"
3539     fi"
3540    
3541     echo >> $output "\
3542    
3543     # relink executable if necessary
3544     if test -n \"\$relink_command\"; then
3545     if (eval \$relink_command); then :
3546     else
3547     $rm \"\$progdir/\$file\"
3548     exit 1
3549     fi
3550     fi
3551    
3552     $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3553     { $rm \"\$progdir/\$program\";
3554     $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3555     $rm \"\$progdir/\$file\"
3556     fi"
3557     else
3558     echo >> $output "\
3559     program='$outputname'
3560     progdir=\"\$thisdir/$objdir\"
3561     "
3562     fi
3563    
3564     echo >> $output "\
3565    
3566     if test -f \"\$progdir/\$program\"; then"
3567    
3568     # Export our shlibpath_var if we have one.
3569     if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3570     $echo >> $output "\
3571     # Add our own library path to $shlibpath_var
3572     $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3573    
3574     # Some systems cannot cope with colon-terminated $shlibpath_var
3575     # The second colon is a workaround for a bug in BeOS R4 sed
3576     $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3577    
3578     export $shlibpath_var
3579     "
3580     fi
3581    
3582     # fixup the dll searchpath if we need to.
3583     if test -n "$dllsearchpath"; then
3584     $echo >> $output "\
3585     # Add the dll search path components to the executable PATH
3586     PATH=$dllsearchpath:\$PATH
3587     "
3588     fi
3589    
3590     $echo >> $output "\
3591     if test \"\$libtool_execute_magic\" != \"$magic\"; then
3592     # Run the actual program with our arguments.
3593     "
3594     case $host in
3595     # win32 systems need to use the prog path for dll
3596     # lookup to work
3597     *-*-cygwin* | *-*-pw32*)
3598     $echo >> $output "\
3599     exec \$progdir/\$program \${1+\"\$@\"}
3600     "
3601     ;;
3602    
3603     # Backslashes separate directories on plain windows
3604     *-*-mingw | *-*-os2*)
3605     $echo >> $output "\
3606     exec \$progdir\\\\\$program \${1+\"\$@\"}
3607     "
3608     ;;
3609    
3610     *)
3611     $echo >> $output "\
3612     # Export the path to the program.
3613     PATH=\"\$progdir:\$PATH\"
3614     export PATH
3615    
3616     exec \$program \${1+\"\$@\"}
3617     "
3618     ;;
3619     esac
3620     $echo >> $output "\
3621     \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
3622     exit 1
3623     fi
3624     else
3625     # The program doesn't exist.
3626     \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
3627     \$echo \"This script is just a wrapper for \$program.\" 1>&2
3628     echo \"See the $PACKAGE documentation for more information.\" 1>&2
3629     exit 1
3630     fi
3631     fi\
3632     "
3633     chmod +x $output
3634     fi
3635     exit 0
3636     ;;
3637     esac
3638    
3639     # See if we need to build an old-fashioned archive.
3640     for oldlib in $oldlibs; do
3641    
3642     if test "$build_libtool_libs" = convenience; then
3643     oldobjs="$libobjs_save"
3644     addlibs="$convenience"
3645     build_libtool_libs=no
3646     else
3647     if test "$build_libtool_libs" = module; then
3648     oldobjs="$libobjs_save"
3649     build_libtool_libs=no
3650     else
3651     oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
3652     fi
3653     addlibs="$old_convenience"
3654     fi
3655    
3656     if test -n "$addlibs"; then
3657     gentop="$output_objdir/${outputname}x"
3658     $show "${rm}r $gentop"
3659     $run ${rm}r "$gentop"
3660     $show "mkdir $gentop"
3661     $run mkdir "$gentop"
3662     status=$?
3663     if test $status -ne 0 && test ! -d "$gentop"; then
3664     exit $status
3665     fi
3666     generated="$generated $gentop"
3667    
3668     # Add in members from convenience archives.
3669     for xlib in $addlibs; do
3670     # Extract the objects.
3671     case "$xlib" in
3672     [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3673     *) xabs=`pwd`"/$xlib" ;;
3674     esac
3675     xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3676     xdir="$gentop/$xlib"
3677    
3678     $show "${rm}r $xdir"
3679     $run ${rm}r "$xdir"
3680     $show "mkdir $xdir"
3681     $run mkdir "$xdir"
3682     status=$?
3683     if test $status -ne 0 && test ! -d "$xdir"; then
3684     exit $status
3685     fi
3686     $show "(cd $xdir && $AR x $xabs)"
3687     $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3688    
3689     oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
3690     done
3691     fi
3692    
3693     # Do each command in the archive commands.
3694     if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3695     eval cmds=\"$old_archive_from_new_cmds\"
3696     else
3697     # Ensure that we have .o objects in place in case we decided
3698     # not to build a shared library, and have fallen back to building
3699     # static libs even though --disable-static was passed!
3700     for oldobj in $oldobjs; do
3701     if test ! -f $oldobj; then
3702     xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
3703     if test "X$xdir" = "X$oldobj"; then
3704     xdir="."
3705     else
3706     xdir="$xdir"
3707     fi
3708     baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
3709     obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
3710     $show "(cd $xdir && ${LN_S} $obj $baseobj)"
3711     $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
3712     fi
3713     done
3714    
3715     eval cmds=\"$old_archive_cmds\"
3716     fi
3717     IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3718     for cmd in $cmds; do
3719     IFS="$save_ifs"
3720     $show "$cmd"
3721     $run eval "$cmd" || exit $?
3722     done
3723     IFS="$save_ifs"
3724     done
3725    
3726     if test -n "$generated"; then
3727     $show "${rm}r$generated"
3728     $run ${rm}r$generated
3729     fi
3730    
3731     # Now create the libtool archive.
3732     case "$output" in
3733     *.la)
3734     old_library=
3735     test "$build_old_libs" = yes && old_library="$libname.$libext"
3736     $show "creating $output"
3737    
3738     # Preserve any variables that may affect compiler behavior
3739     for var in $variables_saved_for_relink; do
3740     if eval test -z \"\${$var+set}\"; then
3741     relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3742     elif eval var_value=\$$var; test -z "$var_value"; then
3743     relink_command="$var=; export $var; $relink_command"
3744     else
3745     var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3746     relink_command="$var=\"$var_value\"; export $var; $relink_command"
3747     fi
3748     done
3749     # Quote the link command for shipping.
3750     relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args"
3751     relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3752    
3753     # Only create the output if not a dry run.
3754     if test -z "$run"; then
3755     for installed in no yes; do
3756     if test "$installed" = yes; then
3757     if test -z "$install_libdir"; then
3758     break
3759     fi
3760     output="$output_objdir/$outputname"i
3761     # Replace all uninstalled libtool libraries with the installed ones
3762     newdependency_libs=
3763     for deplib in $dependency_libs; do
3764     case "$deplib" in
3765     *.la)
3766     name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
3767     eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3768     if test -z "$libdir"; then
3769     $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3770     exit 1
3771     fi
3772     newdependency_libs="$newdependency_libs $libdir/$name"
3773     ;;
3774     *) newdependency_libs="$newdependency_libs $deplib" ;;
3775     esac
3776     done
3777     dependency_libs="$newdependency_libs"
3778     newdlfiles=
3779     for lib in $dlfiles; do
3780     name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3781     eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3782     if test -z "$libdir"; then
3783     $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3784     exit 1
3785     fi
3786     newdlfiles="$newdlfiles $libdir/$name"
3787     done
3788     dlfiles="$newdlfiles"
3789     newdlprefiles=
3790     for lib in $dlprefiles; do
3791     name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3792     eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3793     if test -z "$libdir"; then
3794     $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3795     exit 1
3796     fi
3797     newdlprefiles="$newdlprefiles $libdir/$name"
3798     done
3799     dlprefiles="$newdlprefiles"
3800     fi
3801     $rm $output
3802     $echo > $output "\
3803     # $outputname - a libtool library file
3804     # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3805     #
3806     # Please DO NOT delete this file!
3807     # It is necessary for linking the library.
3808    
3809     # The name that we can dlopen(3).
3810     dlname='$dlname'
3811    
3812     # Names of this library.
3813     library_names='$library_names'
3814    
3815     # The name of the static archive.
3816     old_library='$old_library'
3817    
3818     # Libraries that this one depends upon.
3819     dependency_libs='$dependency_libs'
3820    
3821     # Version information for $libname.
3822     current=$current
3823     age=$age
3824     revision=$revision
3825    
3826     # Is this an already installed library?
3827     installed=$installed
3828    
3829     # Files to dlopen/dlpreopen
3830     dlopen='$dlfiles'
3831     dlpreopen='$dlprefiles'
3832    
3833     # Directory that this library needs to be installed in:
3834     libdir='$install_libdir'"
3835     if test "$installed" = no && test $need_relink = yes; then
3836     $echo >> $output "\
3837     relink_command=\"$relink_command\""
3838     fi
3839     done
3840     fi
3841    
3842     # Do a symbolic link so that the libtool archive can be found in
3843     # LD_LIBRARY_PATH before the program is installed.
3844     $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
3845     $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
3846     ;;
3847     esac
3848     exit 0
3849     ;;
3850    
3851     # libtool install mode
3852     install)
3853     modename="$modename: install"
3854    
3855     # There may be an optional sh(1) argument at the beginning of
3856     # install_prog (especially on Windows NT).
3857     if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
3858     # Allow the use of GNU shtool's install command.
3859     $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
3860     # Aesthetically quote it.
3861     arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
3862     case "$arg" in
3863     *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3864     arg="\"$arg\""
3865     ;;
3866     esac
3867     install_prog="$arg "
3868     arg="$1"
3869     shift
3870     else
3871     install_prog=
3872     arg="$nonopt"
3873     fi
3874    
3875     # The real first argument should be the name of the installation program.
3876     # Aesthetically quote it.
3877     arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3878     case "$arg" in
3879     *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3880     arg="\"$arg\""
3881     ;;
3882     esac
3883     install_prog="$install_prog$arg"
3884    
3885     # We need to accept at least all the BSD install flags.
3886     dest=
3887     files=
3888     opts=
3889     prev=
3890     install_type=
3891     isdir=no
3892     stripme=
3893     for arg
3894     do
3895     if test -n "$dest"; then
3896     files="$files $dest"
3897     dest="$arg"
3898     continue
3899     fi
3900    
3901     case "$arg" in
3902     -d) isdir=yes ;;
3903     -f) prev="-f" ;;
3904     -g) prev="-g" ;;
3905     -m) prev="-m" ;;
3906     -o) prev="-o" ;;
3907     -s)
3908     stripme=" -s"
3909     continue
3910     ;;
3911     -*) ;;
3912    
3913     *)
3914     # If the previous option needed an argument, then skip it.
3915     if test -n "$prev"; then
3916     prev=
3917     else
3918     dest="$arg"
3919     continue
3920     fi
3921     ;;
3922     esac
3923    
3924     # Aesthetically quote the argument.
3925     arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3926     case "$arg" in
3927     *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3928     arg="\"$arg\""
3929     ;;
3930     esac
3931     install_prog="$install_prog $arg"
3932     done
3933    
3934     if test -z "$install_prog"; then
3935     $echo "$modename: you must specify an install program" 1>&2
3936     $echo "$help" 1>&2
3937     exit 1
3938     fi
3939    
3940     if test -n "$prev"; then
3941     $echo "$modename: the \`$prev' option requires an argument" 1>&2
3942     $echo "$help" 1>&2
3943     exit 1
3944     fi
3945    
3946     if test -z "$files"; then
3947     if test -z "$dest"; then
3948     $echo "$modename: no file or destination specified" 1>&2
3949     else
3950     $echo "$modename: you must specify a destination" 1>&2
3951     fi
3952     $echo "$help" 1>&2
3953     exit 1
3954     fi
3955    
3956     # Strip any trailing slash from the destination.
3957     dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
3958    
3959     # Check to see that the destination is a directory.
3960     test -d "$dest" && isdir=yes
3961     if test "$isdir" = yes; then
3962     destdir="$dest"
3963     destname=
3964     else
3965     destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
3966     test "X$destdir" = "X$dest" && destdir=.
3967     destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
3968    
3969     # Not a directory, so check to see that there is only one file specified.
3970     set dummy $files
3971     if test $# -gt 2; then
3972     $echo "$modename: \`$dest' is not a directory" 1>&2
3973     $echo "$help" 1>&2
3974     exit 1
3975     fi
3976     fi
3977     case "$destdir" in
3978     [\\/]* | [A-Za-z]:[\\/]*) ;;
3979     *)
3980     for file in $files; do
3981     case "$file" in
3982     *.lo) ;;
3983     *)
3984     $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
3985     $echo "$help" 1>&2
3986     exit 1
3987     ;;
3988     esac
3989     done
3990     ;;
3991     esac
3992    
3993     # This variable tells wrapper scripts just to set variables rather
3994     # than running their programs.
3995     libtool_install_magic="$magic"
3996    
3997     staticlibs=
3998     future_libdirs=
3999     current_libdirs=
4000     for file in $files; do
4001    
4002     # Do each installation.
4003     case "$file" in
4004     *.$libext)
4005     # Do the static libraries later.
4006     staticlibs="$staticlibs $file"
4007     ;;
4008    
4009     *.la)
4010     # Check to see that this really is a libtool archive.
4011     if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4012     else
4013     $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4014     $echo "$help" 1>&2
4015     exit 1
4016     fi
4017    
4018     library_names=
4019     old_library=
4020     relink_command=
4021     # If there is no directory component, then add one.
4022     case "$file" in
4023     */* | *\\*) . $file ;;
4024     *) . ./$file ;;
4025     esac
4026    
4027     # Add the libdir to current_libdirs if it is the destination.
4028     if test "X$destdir" = "X$libdir"; then
4029     case "$current_libdirs " in
4030     *" $libdir "*) ;;
4031     *) current_libdirs="$current_libdirs $libdir" ;;
4032     esac
4033     else
4034     # Note the libdir as a future libdir.
4035     case "$future_libdirs " in
4036     *" $libdir "*) ;;
4037     *) future_libdirs="$future_libdirs $libdir" ;;
4038     esac
4039     fi
4040    
4041     dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4042     test "X$dir" = "X$file/" && dir=
4043     dir="$dir$objdir"
4044    
4045     if test -n "$relink_command"; then
4046     $echo "$modename: warning: relinking \`$file'" 1>&2
4047     $show "$relink_command"
4048     if $run eval "$relink_command"; then :
4049     else
4050     $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4051     continue
4052     fi
4053     fi
4054    
4055     # See the names of the shared library.
4056     set dummy $library_names
4057     if test -n "$2"; then
4058     realname="$2"
4059     shift
4060     shift
4061    
4062     srcname="$realname"
4063     test -n "$relink_command" && srcname="$realname"T
4064    
4065     # Install the shared library and build the symlinks.
4066     $show "$install_prog $dir/$srcname $destdir/$realname"
4067     $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
4068     if test -n "$stripme" && test -n "$striplib"; then
4069     $show "$striplib $destdir/$realname"
4070     $run eval "$striplib $destdir/$realname" || exit $?
4071     fi
4072    
4073     if test $# -gt 0; then
4074     # Delete the old symlinks, and create new ones.
4075     for linkname
4076     do
4077     if test "$linkname" != "$realname"; then
4078     $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4079     $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4080     fi
4081     done
4082     fi
4083    
4084     # Do each command in the postinstall commands.
4085     lib="$destdir/$realname"
4086     eval cmds=\"$postinstall_cmds\"
4087     IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4088     for cmd in $cmds; do
4089     IFS="$save_ifs"
4090     $show "$cmd"
4091     $run eval "$cmd" || exit $?
4092     done
4093     IFS="$save_ifs"
4094     fi
4095    
4096     # Install the pseudo-library for information purposes.
4097     name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4098     instname="$dir/$name"i
4099     $show "$install_prog $instname $destdir/$name"
4100     $run eval "$install_prog $instname $destdir/$name" || exit $?
4101    
4102     # Maybe install the static library, too.
4103     test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
4104     ;;
4105    
4106     *.lo)
4107     # Install (i.e. copy) a libtool object.
4108    
4109     # Figure out destination file name, if it wasn't already specified.
4110     if test -n "$destname"; then
4111     destfile="$destdir/$destname"
4112     else
4113     destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4114     destfile="$destdir/$destfile"
4115     fi
4116    
4117     # Deduce the name of the destination old-style object file.
4118     case "$destfile" in
4119     *.lo)
4120     staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4121     ;;
4122     *.$objext)
4123     staticdest="$destfile"
4124     destfile=
4125     ;;
4126     *)
4127     $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4128     $echo "$help" 1>&2
4129     exit 1
4130     ;;
4131     esac
4132    
4133     # Install the libtool object if requested.
4134     if test -n "$destfile"; then
4135     $show "$install_prog $file $destfile"
4136     $run eval "$install_prog $file $destfile" || exit $?
4137     fi
4138    
4139     # Install the old object if enabled.
4140     if test "$build_old_libs" = yes; then
4141     # Deduce the name of the old-style object file.
4142     staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
4143    
4144     $show "$install_prog $staticobj $staticdest"
4145     $run eval "$install_prog \$staticobj \$staticdest" || exit $?
4146     fi
4147     exit 0
4148     ;;
4149    
4150     *)
4151     # Figure out destination file name, if it wasn't already specified.
4152     if test -n "$destname"; then
4153     destfile="$destdir/$destname"
4154     else
4155     destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4156     destfile="$destdir/$destfile"
4157     fi
4158    
4159     # Do a test to see if this is really a libtool program.
4160     if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4161     uninst_deplibs=
4162     relink_command=
4163    
4164     # If there is no directory component, then add one.
4165     case "$file" in
4166     */* | *\\*) . $file ;;
4167     *) . ./$file ;;
4168     esac
4169    
4170     # Check the variables that should have been set.
4171     if test -z "$uninst_deplibs"; then
4172     $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
4173     exit 1
4174     fi
4175    
4176     finalize=yes
4177     for lib in $uninst_deplibs; do
4178     # Check to see that each library is installed.
4179     libdir=
4180     if test -f "$lib"; then
4181     # If there is no directory component, then add one.
4182     case "$lib" in
4183     */* | *\\*) . $lib ;;
4184     *) . ./$lib ;;
4185     esac
4186     fi
4187     libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4188     if test -n "$libdir" && test ! -f "$libfile"; then
4189     $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4190     finalize=no
4191     fi
4192     done
4193    
4194     relink_command=
4195     # If there is no directory component, then add one.
4196     case "$file" in
4197     */* | *\\*) . $file ;;
4198     *) . ./$file ;;
4199     esac
4200    
4201     outputname=
4202     if test "$fast_install" = no && test -n "$relink_command"; then
4203     if test "$finalize" = yes && test -z "$run"; then
4204     tmpdir="/tmp"
4205     test -n "$TMPDIR" && tmpdir="$TMPDIR"
4206     tmpdir="$tmpdir/libtool-$$"
4207     if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4208     else
4209     $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4210     continue
4211     fi
4212     file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4213     outputname="$tmpdir/$file"
4214     # Replace the output file specification.
4215     relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4216    
4217     $show "$relink_command"
4218     if $run eval "$relink_command"; then :
4219     else
4220     $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4221     ${rm}r "$tmpdir"
4222     continue
4223     fi
4224     file="$outputname"
4225     else
4226     $echo "$modename: warning: cannot relink \`$file'" 1>&2
4227     fi
4228     else
4229     # Install the binary that we compiled earlier.
4230     file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4231     fi
4232     fi
4233    
4234     $show "$install_prog$stripme $file $destfile"
4235     $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
4236     test -n "$outputname" && ${rm}r "$tmpdir"
4237     ;;
4238     esac
4239     done
4240    
4241     for file in $staticlibs; do
4242     name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4243    
4244     # Set up the ranlib parameters.
4245     oldlib="$destdir/$name"
4246    
4247     $show "$install_prog $file $oldlib"
4248     $run eval "$install_prog \$file \$oldlib" || exit $?
4249    
4250     if test -n "$stripme" && test -n "$striplib"; then
4251     $show "$old_striplib $oldlib"
4252     $run eval "$old_striplib $oldlib" || exit $?
4253     fi
4254    
4255     # Do each command in the postinstall commands.
4256     eval cmds=\"$old_postinstall_cmds\"
4257     IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4258     for cmd in $cmds; do
4259     IFS="$save_ifs"
4260     $show "$cmd"
4261     $run eval "$cmd" || exit $?
4262     done
4263     IFS="$save_ifs"
4264     done
4265    
4266     if test -n "$future_libdirs"; then
4267     $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4268     fi
4269    
4270     if test -n "$current_libdirs"; then
4271     # Maybe just do a dry run.
4272     test -n "$run" && current_libdirs=" -n$current_libdirs"
4273     exec $SHELL $0 --finish$current_libdirs
4274     exit 1
4275     fi
4276    
4277     exit 0
4278     ;;
4279    
4280     # libtool finish mode
4281     finish)
4282     modename="$modename: finish"
4283     libdirs="$nonopt"
4284     admincmds=
4285    
4286     if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4287     for dir
4288     do
4289     libdirs="$libdirs $dir"
4290     done
4291    
4292     for libdir in $libdirs; do
4293     if test -n "$finish_cmds"; then
4294     # Do each command in the finish commands.
4295     eval cmds=\"$finish_cmds\"
4296     IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4297     for cmd in $cmds; do
4298     IFS="$save_ifs"
4299     $show "$cmd"
4300     $run eval "$cmd" || admincmds="$admincmds
4301     $cmd"
4302     done
4303     IFS="$save_ifs"
4304     fi
4305     if test -n "$finish_eval"; then
4306     # Do the single finish_eval.
4307     eval cmds=\"$finish_eval\"
4308     $run eval "$cmds" || admincmds="$admincmds
4309     $cmds"
4310     fi
4311     done
4312     fi
4313    
4314     # Exit here if they wanted silent mode.
4315     test "$show" = : && exit 0
4316    
4317     echo "----------------------------------------------------------------------"
4318     echo "Libraries have been installed in:"
4319     for libdir in $libdirs; do
4320     echo " $libdir"
4321     done
4322     echo
4323     echo "If you ever happen to want to link against installed libraries"
4324     echo "in a given directory, LIBDIR, you must either use libtool, and"
4325     echo "specify the full pathname of the library, or use \`-LLIBDIR'"
4326     echo "flag during linking and do at least one of the following:"
4327     if test -n "$shlibpath_var"; then
4328     echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4329     echo " during execution"
4330     fi
4331     if test -n "$runpath_var"; then
4332     echo " - add LIBDIR to the \`$runpath_var' environment variable"
4333     echo " during linking"
4334     fi
4335     if test -n "$hardcode_libdir_flag_spec"; then
4336     libdir=LIBDIR
4337     eval flag=\"$hardcode_libdir_flag_spec\"
4338    
4339     echo " - use the \`$flag' linker flag"
4340     fi
4341     if test -n "$admincmds"; then
4342     echo " - have your system administrator run these commands:$admincmds"
4343     fi
4344     if test -f /etc/ld.so.conf; then
4345     echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4346     fi
4347     echo
4348     echo "See any operating system documentation about shared libraries for"
4349     echo "more information, such as the ld(1) and ld.so(8) manual pages."
4350     echo "----------------------------------------------------------------------"
4351     exit 0
4352     ;;
4353    
4354     # libtool execute mode
4355     execute)
4356     modename="$modename: execute"
4357    
4358     # The first argument is the command name.
4359     cmd="$nonopt"
4360     if test -z "$cmd"; then
4361     $echo "$modename: you must specify a COMMAND" 1>&2
4362     $echo "$help"
4363     exit 1
4364     fi
4365    
4366     # Handle -dlopen flags immediately.
4367     for file in $execute_dlfiles; do
4368     if test ! -f "$file"; then
4369     $echo "$modename: \`$file' is not a file" 1>&2
4370     $echo "$help" 1>&2
4371     exit 1
4372     fi
4373    
4374     dir=
4375     case "$file" in
4376     *.la)
4377     # Check to see that this really is a libtool archive.
4378     if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4379     else
4380     $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4381     $echo "$help" 1>&2
4382     exit 1
4383     fi
4384    
4385     # Read the libtool library.
4386     dlname=
4387     library_names=
4388    
4389     # If there is no directory component, then add one.
4390     case "$file" in
4391     */* | *\\*) . $file ;;
4392     *) . ./$file ;;
4393     esac
4394    
4395     # Skip this library if it cannot be dlopened.
4396     if test -z "$dlname"; then
4397     # Warn if it was a shared library.
4398     test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
4399     continue
4400     fi
4401    
4402     dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4403     test "X$dir" = "X$file" && dir=.
4404    
4405     if test -f "$dir/$objdir/$dlname"; then
4406     dir="$dir/$objdir"
4407     else
4408     $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
4409     exit 1
4410     fi
4411     ;;
4412    
4413     *.lo)
4414     # Just add the directory containing the .lo file.
4415     dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4416     test "X$dir" = "X$file" && dir=.
4417     ;;
4418    
4419     *)
4420     $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
4421     continue
4422     ;;
4423     esac
4424    
4425     # Get the absolute pathname.
4426     absdir=`cd "$dir" && pwd`
4427     test -n "$absdir" && dir="$absdir"
4428    
4429     # Now add the directory to shlibpath_var.
4430     if eval "test -z \"\$$shlibpath_var\""; then
4431     eval "$shlibpath_var=\"\$dir\""
4432     else
4433     eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4434     fi
4435     done
4436    
4437     # This variable tells wrapper scripts just to set shlibpath_var
4438     # rather than running their programs.
4439     libtool_execute_magic="$magic"
4440    
4441     # Check if any of the arguments is a wrapper script.
4442     args=
4443     for file
4444     do
4445     case "$file" in
4446     -*) ;;
4447     *)
4448     # Do a test to see if this is really a libtool program.
4449     if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4450     # If there is no directory component, then add one.
4451     case "$file" in
4452     */* | *\\*) . $file ;;
4453     *) . ./$file ;;
4454     esac
4455    
4456     # Transform arg to wrapped name.
4457     file="$progdir/$program"
4458     fi
4459     ;;
4460     esac
4461     # Quote arguments (to preserve shell metacharacters).
4462     file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
4463     args="$args \"$file\""
4464     done
4465    
4466     if test -z "$run"; then
4467     if test -n "$shlibpath_var"; then
4468     # Export the shlibpath_var.
4469     eval "export $shlibpath_var"
4470     fi
4471    
4472     # Restore saved enviroment variables
4473     if test "${save_LC_ALL+set}" = set; then
4474     LC_ALL="$save_LC_ALL"; export LC_ALL
4475     fi
4476     if test "${save_LANG+set}" = set; then
4477     LANG="$save_LANG"; export LANG
4478     fi
4479    
4480     # Now actually exec the command.
4481     eval "exec \$cmd$args"
4482    
4483     $echo "$modename: cannot exec \$cmd$args"
4484     exit 1
4485     else
4486     # Display what would be done.
4487     if test -n "$shlibpath_var"; then
4488     eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
4489     $echo "export $shlibpath_var"
4490     fi
4491     $echo "$cmd$args"
4492     exit 0
4493     fi
4494     ;;
4495    
4496     # libtool clean and uninstall mode
4497     clean | uninstall)
4498     modename="$modename: $mode"
4499     rm="$nonopt"
4500     files=
4501    
4502     # This variable tells wrapper scripts just to set variables rather
4503     # than running their programs.
4504     libtool_install_magic="$magic"
4505    
4506     for arg
4507     do
4508     case "$arg" in
4509     -*) rm="$rm $arg" ;;
4510     *) files="$files $arg" ;;
4511     esac
4512     done
4513    
4514     if test -z "$rm"; then
4515     $echo "$modename: you must specify an RM program" 1>&2
4516     $echo "$help" 1>&2
4517     exit 1
4518     fi
4519    
4520     for file in $files; do
4521     dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4522     if test "X$dir" = "X$file"; then
4523     dir=.
4524     objdir="$objdir"
4525     else
4526     objdir="$dir/$objdir"
4527     fi
4528     name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4529     test $mode = uninstall && objdir="$dir"
4530    
4531     rmfiles="$file"
4532    
4533     case "$name" in
4534     *.la)
4535     # Possibly a libtool archive, so verify it.
4536     if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4537     . $dir/$name
4538    
4539     # Delete the libtool libraries and symlinks.
4540     for n in $library_names; do
4541     rmfiles="$rmfiles $objdir/$n"
4542     done
4543     test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
4544     test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
4545    
4546     if test $mode = uninstall; then
4547     if test -n "$library_names"; then
4548     # Do each command in the postuninstall commands.
4549     eval cmds=\"$postuninstall_cmds\"
4550     IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4551     for cmd in $cmds; do
4552     IFS="$save_ifs"
4553     $show "$cmd"
4554     $run eval "$cmd"
4555     done
4556     IFS="$save_ifs"
4557     fi
4558    
4559     if test -n "$old_library"; then
4560     # Do each command in the old_postuninstall commands.
4561     eval cmds=\"$old_postuninstall_cmds\"
4562     IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4563     for cmd in $cmds; do
4564     IFS="$save_ifs"
4565     $show "$cmd"
4566     $run eval "$cmd"
4567     done
4568     IFS="$save_ifs"
4569     fi
4570     # FIXME: should reinstall the best remaining shared library.
4571     fi
4572     fi
4573     ;;
4574    
4575     *.lo)
4576     if test "$build_old_libs" = yes; then
4577     oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
4578     rmfiles="$rmfiles $dir/$oldobj"
4579     fi
4580     ;;
4581    
4582     *)
4583     # Do a test to see if this is a libtool program.
4584     if test $mode = clean &&
4585     (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4586     relink_command=
4587     . $dir/$file
4588    
4589     rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
4590     if test "$fast_install" = yes && test -n "$relink_command"; then
4591     rmfiles="$rmfiles $objdir/lt-$name"
4592     fi
4593     fi
4594     ;;
4595     esac
4596     $show "$rm $rmfiles"
4597     $run $rm $rmfiles
4598     done
4599     exit 0
4600     ;;
4601    
4602     "")
4603     $echo "$modename: you must specify a MODE" 1>&2
4604     $echo "$generic_help" 1>&2
4605     exit 1
4606     ;;
4607     esac
4608    
4609     $echo "$modename: invalid operation mode \`$mode'" 1>&2
4610     $echo "$generic_help" 1>&2
4611     exit 1
4612     fi # test -z "$show_help"
4613    
4614     # We need to display help for each of the modes.
4615     case "$mode" in
4616     "") $echo \
4617     "Usage: $modename [OPTION]... [MODE-ARG]...
4618    
4619     Provide generalized library-building support services.
4620    
4621     --config show all configuration variables
4622     --debug enable verbose shell tracing
4623     -n, --dry-run display commands without modifying any files
4624     --features display basic configuration information and exit
4625     --finish same as \`--mode=finish'
4626     --help display this help message and exit
4627     --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
4628     --quiet same as \`--silent'
4629     --silent don't print informational messages
4630     --version print version information
4631    
4632     MODE must be one of the following:
4633    
4634     clean remove files from the build directory
4635     compile compile a source file into a libtool object
4636     execute automatically set library path, then run a program
4637     finish complete the installation of libtool libraries
4638     install install libraries or executables
4639     link create a library or an executable
4640     uninstall remove libraries from an installed directory
4641    
4642     MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
4643     a more detailed description of MODE."
4644     exit 0
4645     ;;
4646    
4647     clean)
4648     $echo \
4649     "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
4650    
4651     Remove files from the build directory.
4652    
4653     RM is the name of the program to use to delete files associated with each FILE
4654     (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
4655     to RM.
4656    
4657     If FILE is a libtool library, object or program, all the files associated
4658     with it are deleted. Otherwise, only FILE itself is deleted using RM."
4659     ;;
4660    
4661     compile)
4662     $echo \
4663     "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
4664    
4665     Compile a source file into a libtool library object.
4666    
4667     This mode accepts the following additional options:
4668    
4669     -o OUTPUT-FILE set the output file name to OUTPUT-FILE
4670     -static always build a \`.o' file suitable for static linking
4671    
4672     COMPILE-COMMAND is a command to be used in creating a \`standard' object file
4673     from the given SOURCEFILE.
4674    
4675     The output file name is determined by removing the directory component from
4676     SOURCEFILE, then substituting the C source code suffix \`.c' with the
4677     library object suffix, \`.lo'."
4678     ;;
4679    
4680     execute)
4681     $echo \
4682     "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
4683    
4684     Automatically set library path, then run a program.
4685    
4686     This mode accepts the following additional options:
4687    
4688     -dlopen FILE add the directory containing FILE to the library path
4689    
4690     This mode sets the library path environment variable according to \`-dlopen'
4691     flags.
4692    
4693     If any of the ARGS are libtool executable wrappers, then they are translated
4694     into their corresponding uninstalled binary, and any of their required library
4695     directories are added to the library path.
4696    
4697     Then, COMMAND is executed, with ARGS as arguments."
4698     ;;
4699    
4700     finish)
4701     $echo \
4702     "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
4703    
4704     Complete the installation of libtool libraries.
4705    
4706     Each LIBDIR is a directory that contains libtool libraries.
4707    
4708     The commands that this mode executes may require superuser privileges. Use
4709     the \`--dry-run' option if you just want to see what would be executed."
4710     ;;
4711    
4712     install)
4713     $echo \
4714     "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
4715    
4716     Install executables or libraries.
4717    
4718     INSTALL-COMMAND is the installation command. The first component should be
4719     either the \`install' or \`cp' program.
4720    
4721     The rest of the components are interpreted as arguments to that command (only
4722     BSD-compatible install options are recognized)."
4723     ;;
4724    
4725     link)
4726     $echo \
4727     "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
4728    
4729     Link object files or libraries together to form another library, or to
4730     create an executable program.
4731    
4732     LINK-COMMAND is a command using the C compiler that you would use to create
4733     a program from several object files.
4734    
4735     The following components of LINK-COMMAND are treated specially:
4736    
4737     -all-static do not do any dynamic linking at all
4738     -avoid-version do not add a version suffix if possible
4739     -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
4740     -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
4741     -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
4742     -export-symbols SYMFILE
4743     try to export only the symbols listed in SYMFILE
4744     -export-symbols-regex REGEX
4745     try to export only the symbols matching REGEX
4746     -LLIBDIR search LIBDIR for required installed libraries
4747     -lNAME OUTPUT-FILE requires the installed library libNAME
4748     -module build a library that can dlopened
4749     -no-fast-install disable the fast-install mode
4750     -no-install link a not-installable executable
4751     -no-undefined declare that a library does not refer to external symbols
4752     -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
4753     -release RELEASE specify package release information
4754     -rpath LIBDIR the created library will eventually be installed in LIBDIR
4755     -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
4756     -static do not do any dynamic linking of libtool libraries
4757     -version-info CURRENT[:REVISION[:AGE]]
4758     specify library version info [each variable defaults to 0]
4759    
4760     All other options (arguments beginning with \`-') are ignored.
4761    
4762     Every other argument is treated as a filename. Files ending in \`.la' are
4763     treated as uninstalled libtool libraries, other files are standard or library
4764     object files.
4765    
4766     If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
4767     only library objects (\`.lo' files) may be specified, and \`-rpath' is
4768     required, except when creating a convenience library.
4769    
4770     If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
4771     using \`ar' and \`ranlib', or on Windows using \`lib'.
4772    
4773     If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
4774     is created, otherwise an executable program is created."
4775     ;;
4776    
4777     uninstall)
4778     $echo \
4779     "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
4780    
4781     Remove libraries from an installation directory.
4782    
4783     RM is the name of the program to use to delete files associated with each FILE
4784     (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
4785     to RM.
4786    
4787     If FILE is a libtool library, all the files associated with it are deleted.
4788     Otherwise, only FILE itself is deleted using RM."
4789     ;;
4790    
4791     *)
4792     $echo "$modename: invalid operation mode \`$mode'" 1>&2
4793     $echo "$help" 1>&2
4794     exit 1
4795     ;;
4796     esac
4797    
4798     echo
4799     $echo "Try \`$modename --help' for more information about other modes."
4800    
4801     exit 0
4802    
4803     # Local Variables:
4804     # mode:shell-script
4805     # sh-indentation:2
4806     # End: