OSDN Git Service

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