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