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