]> Pileus Git - ~andy/gtk/blob - ltmain.sh
Initial revision
[~andy/gtk] / ltmain.sh
1 # ltmain.sh - Provide generalized library-building support services.
2 # Generated automatically from ltmain.in by configure.
3 # Copyright (C) 1996, 1997 Free Software Foundation, Inc.
4 # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 # General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 #
20 # As a special exception to the GNU General Public License, if you
21 # distribute this file as part of a program that contains a
22 # configuration script generated by Autoconf, you may include it under
23 # the same distribution terms that you use for the rest of that program.
24
25 #FIXME: echo=echo
26 echo='printf %s\n'
27 if test "X`$echo '\t'`" = 'X\t'; then :
28 else
29   # The Solaris and AIX default echo program unquotes backslashes.
30   # This makes it impossible to quote backslashes using
31   #   echo "$something" | sed 's/\\/\\\\/g'
32   # So, we emulate echo with printf '%s\n'
33   echo='printf %s\n'
34   if test "X`$echo '\t'`" = 'X\t'; then :
35   else
36     # Oops.  We have no working printf.  Try to find a not-so-buggy echo.
37     echo=echo
38     IFS="${IFS=         }"; save_ifs="$IFS"; IFS="${IFS}:"
39     save_PATH="$PATH"
40     PATH="$PATH":/usr/ucb
41     for dir in $PATH; do
42       if test -f $dir/echo && test "X`$dir/echo '\t'`" = 'X\t'; then
43         echo="$dir/echo"
44         break
45       fi
46     done
47     IFS="$save_ifs"
48     PATH="$save_PATH"
49   fi
50 fi
51
52 # The name of this program.
53 progname=`$echo "$0" | sed 's%^.*/%%'`
54
55 # Constants.
56 PROGRAM=ltmain.sh
57 PACKAGE=libtool
58 VERSION=1.0f
59
60 default_mode=
61 help="Try \`$progname --help' for more information."
62 magic="%%%MAGIC variable%%%"
63 mkdir="mkdir"
64 mv="mv -f"
65 rm="rm -f"
66
67 # Sed substitution that helps us do robust quoting.  It backslashifies
68 # metacharacters that are still active within double-quoted strings.
69 sed_quote_subst='s/\([\\"$\\\\]\)/\\\1/g'
70
71 # NLS nuisances.
72 # Only set LANG and LC_ALL to C if already set.
73 # These must not be set unconditionally because not all systems understand
74 # e.g. LANG=C (notably SCO).
75 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
76 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
77
78 if test "$LTCONFIG_VERSION" != "$VERSION"; then
79   $echo "$progname: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
80   $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
81   exit 1
82 fi
83
84 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
85   $echo "$progname: not configured to build any kind of library" 1>&2
86   $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
87   exit 1
88 fi
89
90 # Global variables.
91 mode=$default_mode
92 nonopt=
93 prev=
94 prevopt=
95 run=
96 show="$echo"
97 show_help=
98 execute_dlfiles=
99
100 # Parse our command line options once, thoroughly.
101 while test $# -gt 0
102 do
103   arg="$1"
104   shift
105
106   case "$arg" in
107   -*=*) optarg=`$echo "$arg" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
108   *) optarg= ;;
109   esac
110
111   # If the previous option needs an argument, assign it.
112   if test -n "$prev"; then
113     case "$prev" in
114     execute_dlfiles)
115       eval "$prev=\"\$$prev \$arg\""
116       ;;
117     *)
118       eval "$prev=\$arg"
119       ;;
120     esac
121
122     prev=
123     prevopt=
124     continue
125   fi
126
127   # Have we seen a non-optional argument yet?
128   case "$arg" in
129   --help)
130     show_help=yes
131     ;;
132
133   --version)
134     $echo "$PROGRAM (GNU $PACKAGE) $VERSION"
135     exit 0
136     ;;
137
138   --dry-run | -n)
139     run=:
140     ;;
141
142   --features)
143     $echo "host: $host"
144     if test "$build_libtool_libs" = yes; then
145       $echo "enable shared libraries"
146     else
147       $echo "disable shared libraries"
148     fi
149     if test "$build_old_libs" = yes; then
150       $echo "enable static libraries"
151     else
152       $echo "disable static libraries"
153     fi
154     exit 0
155     ;;
156
157   --finish) mode="finish" ;;
158
159   --mode) prevopt="--mode" prev=mode ;;
160   --mode=*) mode="$optarg" ;;
161
162   --quiet | --silent)
163     show=:
164     ;;
165
166   -dlopen)
167     prevopt="-dlopen"
168     prev=execute_dlfiles
169     ;;
170
171   -*)
172     $echo "$progname: unrecognized option \`$arg'" 1>&2
173     $echo "$help" 1>&2
174     exit 1
175     ;;
176
177   *)
178     nonopt="$arg"
179     break
180     ;;
181   esac
182 done
183
184 if test -n "$prevopt"; then
185   $echo "$progname: option \`$prevopt' requires an argument" 1>&2
186   $echo "$help" 1>&2
187   exit 1
188 fi
189
190 if test -z "$show_help"; then
191
192   # Infer the operation mode.
193   if test -z "$mode"; then
194     case "$nonopt" in
195     *cc | *++)
196       mode=link
197       for arg
198       do
199         case "$arg" in
200         -c)
201            mode=compile
202            break
203            ;;
204         esac
205       done
206       ;;
207     *db | *dbx)
208       mode=execute
209       ;;
210     *install*|cp)
211       mode=install
212       ;;
213     *rm)
214       mode=uninstall
215       ;;
216     *)
217       # If we have no mode, but dlfiles were specified, then do execute mode.
218       test -n "$execute_dlfiles" && mode=execute
219
220       # Just use the default operation mode.
221       if test -z "$mode"; then
222         if test -n "$nonopt"; then
223           $echo "$progname: warning: cannot infer operation mode from \`$nonopt'" 1>&2
224         else
225           $echo "$progname: warning: cannot infer operation mode without MODE-ARGS" 1>&2
226         fi
227       fi
228       ;;
229     esac
230   fi
231
232   # Only execute mode is allowed to have -dlopen flags.
233   if test -n "$execute_dlfiles" && test "$mode" != execute; then
234     $echo "$progname: unrecognized option \`-dlopen'" 1>&2
235     $echo "$help" 1>&2
236     exit 1
237   fi
238
239   # Change the help message to a mode-specific one.
240   generic_help="$help"
241   help="Try \`$progname --help --mode=$mode' for more information."
242
243   # These modes are in order of execution frequency so that they run quickly.
244   case "$mode" in
245   # libtool compile mode
246   compile)
247     progname="$progname: compile"
248     # Get the compilation command and the source file.
249     base_compile=
250     lastarg=
251     srcfile="$nonopt"
252     suppress_output=
253
254     for arg
255     do
256       # The only flag that cannot be specified is the output filename.
257       if test "X$arg" = "X-o"; then
258         $echo "$progname: you cannot specify the output filename with \`-o'" 1>&2
259         $echo "$help" 1>&2
260         exit 1
261       fi
262
263       # Accept the current argument as the source file.
264       lastarg="$srcfile"
265       srcfile="$arg"
266
267       # Aesthetically quote the previous argument.
268
269       # Backslashify any backslashes, double quotes, and dollar signs.
270       # These are the only characters that are still specially
271       # interpreted inside of double-quoted scrings.
272       lastarg=`$echo "$lastarg" | sed "$sed_quote_subst"`
273
274       # Double-quote args containing other shell metacharacters.
275       # Many Bourne shells cannot handle close brackets correctly in scan
276       # sets, so we specify it separately.
277       case "$lastarg" in
278       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
279         lastarg="\"$lastarg\""
280         ;;
281       esac
282
283       # Add the previous argument to base_compile.
284       if test -z "$base_compile"; then
285         base_compile="$lastarg"
286       else
287         base_compile="$base_compile $lastarg"
288       fi
289     done
290
291     # Get the name of the library object.
292     libobj=`$echo "$srcfile" | sed -e 's%^.*/%%'`
293
294     # Recognize several different file suffixes.
295     xform='[cCFSfm]'
296     case "$libobj" in
297     *.c++) xform=c++ ;;
298     *.cc) xform=cc ;;
299     *.cpp) xform=cpp ;;
300     *.cxx) xform=cxx ;;
301     *.f90) xform=f90 ;;
302     *.for) xform=for ;;
303     esac
304
305     libobj=`$echo "$libobj" | sed -e "s/\.$xform$/.lo/"`
306
307     case "$libobj" in
308     *.lo) obj=`$echo "$libobj" | sed -e 's/\.lo$/.o/'` ;;
309     *)
310       $echo "$progname: cannot determine name of library object from \`$srcfile'" 1>&2
311       exit 1
312       ;;
313     esac
314
315     if test -z "$base_compile"; then
316       $echo "$progname: you must specify a compilation command" 1>&2
317       $echo "$help" 1>&2
318       exit 1
319     fi
320
321     # Delete any leftover library objects.
322     if test "$build_old_libs" = yes; then
323       $run $rm $obj $libobj
324       trap "$run $rm $obj $libobj; exit 1" 1 2 15
325     else
326       $run $rm $libobj
327       trap "$run $rm $libobj; exit 1" 1 2 15
328     fi
329
330     # Only build a PIC object if we are building libtool libraries.
331     if test "$build_libtool_libs" = yes; then
332       # Without this assignment, base_compile gets emptied.
333       fbsd_hideous_sh_bug=$base_compile
334
335       # All platforms use -DPIC, to notify preprocessed assembler code.
336       $show "$base_compile$pic_flag -DPIC $srcfile"
337       if $run eval "$base_compile\$pic_flag -DPIC \$srcfile"; then :
338       else
339         test -n "$obj" && $run $rm $obj
340         exit 1
341       fi
342
343       # If we have no pic_flag, then copy the object into place and finish.
344       if test -z "$pic_flag"; then
345         $show "$LN_S $obj $libobj"
346         $run $LN_S $obj $libobj
347         exit $?
348       fi
349
350       # Just move the object, then go on to compile the next one
351       $show "$mv $obj $libobj"
352       $run $mv $obj $libobj || exit 1
353
354       # Allow error messages only from the first compilation.
355       suppress_output=' >/dev/null 2>&1'
356     fi
357
358     # Only build a position-dependent object if we build old libraries.
359     if test "$build_old_libs" = yes; then
360       # Suppress compiler output if we already did a PIC compilation.
361       $show "$base_compile $srcfile$suppress_output"
362       if $run eval "$base_compile \$srcfile$suppress_output"; then :
363       else
364         $run $rm $obj $libobj
365         exit 1
366       fi
367     fi
368
369     # Create an invalid libtool object if no PIC, so that we don't accidentally
370     # link it into a program.
371     if test "$build_libtool_libs" != yes; then
372       $show "$echo timestamp > $libobj"
373       $run eval "\$echo timestamp > \$libobj" || exit $?
374     fi
375
376     exit 0
377     ;;
378
379   # libtool link mode
380   link)
381     progname="$progname: link"
382     CC="$nonopt"
383     allow_undefined=no
384     compile_command="$CC"
385     finalize_command="$CC"
386
387     compile_shlibpath=
388     finalize_shlibpath=
389     deplibs=
390     dlfiles=
391     dlprefiles=
392     export_dynamic=no
393     hardcode_libdirs=
394     libobjs=
395     link_against_libtool_libs=
396     ltlibs=
397     objs=
398     prev=
399     prevarg=
400     rpath=
401     perm_rpath=
402     temp_rpath=
403     vinfo=
404
405     # We need to know -static, to get the right output filenames.
406     for arg
407     do
408       case "$arg" in
409       -all-static | -static)
410         if test "X$arg" = "X-all-static" && test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
411             $echo "$progname: warning: complete static linking is impossible in this configuration" 1>&2
412         fi
413         build_libtool_libs=no
414         build_old_libs=yes
415         break
416         ;;
417       esac
418     done
419
420     # See if our shared archives depend on static archives.
421     test -n "$old_archive_from_new_cmds" && build_old_libs=yes
422
423     # Go through the arguments, transforming them on the way.
424     for arg
425     do
426       # If the previous option needs an argument, assign it.
427       if test -n "$prev"; then
428         case "$prev" in
429         output)
430           compile_command="$compile_command @OUTPUT@"
431           finalize_command="$finalize_command @OUTPUT@"
432           ;;
433         esac
434
435         case "$prev" in
436         dlfiles|dlprefiles)
437           case "$arg" in
438           *.la | *.lo) ;;  # We handle these cases below.
439           *)
440             dlprefiles="$dlprefiles $arg"
441             test "$prev" = dlfiles && dlfiles="$dlfiles $arg"
442             prev=
443             ;;
444           esac
445           ;;
446         rpath)
447           rpath="$rpath $arg"
448           prev=
449           continue
450           ;;
451         *)
452           eval "$prev=\"\$arg\""
453           prev=
454           continue
455           ;;
456         esac
457       fi
458
459       prevarg="$arg"
460
461       case "$arg" in
462       -all-static)
463         if test -n "$link_static_flag"; then
464           compile_command="$compile_command $link_static_flag"
465           finalize_command="$finalize_command $link_static_flag"
466         fi
467         continue
468         ;;
469
470       -allow-undefined)
471         allow_undefined=yes
472         continue
473         ;;
474
475       -dlopen)
476         prev=dlfiles
477         continue
478         ;;
479
480       -dlpreopen)
481         prev=dlprefiles
482         continue
483         ;;
484
485       -export-dynamic)
486         if test "$export_dynamic" != yes; then
487           export_dynamic=yes
488           if test -n "$export_dynamic_flag_spec"; then
489             arg=`eval \\$echo "$export_dynamic_flag_spec"`
490           else
491             arg=
492           fi
493
494           # Add the symbol object into the linking commands.
495           compile_command="$compile_command @SYMFILE@"
496           finalize_command="$finalize_command @SYMFILE@"
497         fi
498         ;;
499
500       -L*)
501         dir=`$echo "$arg" | sed 's%^-L\(.*\)$%\1%'`
502         case "$dir" in
503         /*)
504           # Add the corresponding hardcode_libdir_flag, if it is not identical.
505           ;;
506         *)
507           $echo "$progname: \`-L$dir' cannot specify a relative directory" 1>&2
508           exit 1
509           ;;
510         esac
511         deplibs="$deplibs $arg"
512         ;;
513
514       -l*) deplibs="$deplibs $arg" ;;
515
516       -o) prev=output ;;
517
518       -rpath)
519         prev=rpath
520         continue
521         ;;
522
523       -static)
524         # If we have no pic_flag, then this is the same as -all-static.
525         if test -z "$pic_flag" && test -n "$link_static_flag"; then
526           compile_command="$compile_command $link_static_flag"
527           finalize_command="$finalize_command $link_static_flag"
528         fi
529         continue
530         ;;
531
532       -version-info)
533         prev=vinfo
534         continue
535         ;;
536
537       # Some other compiler flag.
538       -* | +*)
539         # Unknown arguments in both finalize_command and compile_command need
540         # to be aesthetically quoted because they are evaled later.
541         arg=`$echo "$arg" | sed "$sed_quote_subst"`
542         case "$arg" in
543         *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*)
544           arg="\"$arg\""
545           ;;
546         esac
547         ;;
548
549       *.o | *.a)
550         # A standard object.
551         objs="$objs $arg"
552         ;;
553
554       *.lo)
555         # A library object.
556         if test "$prev" = dlfiles; then
557           dlfiles="$dlfiles $arg"
558           if test "$build_libtool_libs" = yes; then
559             prev=
560             continue
561           else
562             # If libtool objects are unsupported, then we need to preload.
563             prev=dlprefiles
564           fi
565         fi
566
567         if test "$prev" = dlprefiles; then
568           # Preload the old-style object.
569           dlprefiles="$dlprefiles "`$echo "$arg" | sed 's/\.lo$/\.o/'`
570           prev=
571         fi
572         libobjs="$libobjs $arg"
573         ;;
574
575       *.la)
576         # A libtool-controlled library.
577
578         dlname=
579         libdir=
580         library_names=
581         old_library=
582
583         # Check to see that this really is a libtool archive.
584         if egrep '^# Generated by ltmain.sh' $arg >/dev/null 2>&1; then :
585         else
586           $echo "$progname: \`$arg' is not a valid libtool archive" 1>&2
587           exit 1
588         fi
589
590         # If there is no directory component, then add one.
591         case "$arg" in
592         */*) . $arg ;;
593         *) . ./$arg ;;
594         esac
595
596         if test -z "$libdir"; then
597           $echo "$progname: \`$arg' contains no -rpath information" 1>&2
598           exit 1
599         fi
600
601         # Get the name of the library we link against.
602         linklib=
603         for l in $old_library $library_names; do
604           linklib="$l"
605         done
606
607         if test -z "$linklib"; then
608           $echo "$progname: cannot find name of link library for \`$arg'" 1>&2
609           exit 1
610         fi
611
612         # Find the relevant object directory and library name.
613         name=`$echo "$arg" | sed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
614         dir=`$echo "$arg" | sed 's%/[^/]*$%%'`
615         if test "X$dir" = "X$arg"; then
616           dir="$objdir"
617         else
618           dir="$dir/$objdir"
619         fi
620
621         # This library was specified with -dlopen.
622         if test "$prev" = dlfiles; then
623           dlfiles="$dlfiles $arg"
624           if test -z "$dlname"; then
625             # If there is no dlname, we need to preload.
626             prev=dlprefiles
627           else
628             # We should not create a dependency on this library.
629             prev=
630             continue
631           fi
632         fi
633
634         # The library was specified with -dlpreopen.
635         if test "$prev" = dlprefiles; then
636           # Prefer using a static library (so that no silly _DYNAMIC symbols
637           # are required to link).
638           if test -n "$old_library"; then
639             dlprefiles="$dlprefiles $dir/$old_library"
640           else
641             dlprefiles="$dlprefiles $dir/$linklib"
642           fi
643           prev=
644         fi
645
646         if test "$build_libtool_libs" = yes && test -n "$library_names"; then
647           link_against_libtool_libs="$link_against_libtool_libs $arg"
648           if test -n "$shlibpath_var"; then
649             # Make sure the rpath contains only unique directories.
650             case "$temp_rpath " in
651             *" $dir "*) ;;
652             *) temp_rpath="$temp_rpath $dir" ;;
653             esac
654           fi
655
656           # This is the magic to use -rpath.
657           if test -n "$hardcode_libdir_flag_spec"; then
658             if test -n "$hardcode_libdir_separator"; then
659               if test -z "$hardcode_libdirs"; then
660                 # Put the magic libdir with the hardcode flag.
661                 hardcode_libdirs="$libdir"
662                 libdir="@HARDCODE_LIBDIRS@"
663               else
664                 # Just accumulate the unique libdirs.
665                 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
666                 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
667                   ;;
668                 *)
669                   hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
670                   ;;
671                 esac
672                 libdir=
673               fi
674             fi
675
676             if test -n "$libdir"; then
677               flag=`eval \\$echo \"$hardcode_libdir_flag_spec\"`
678
679               compile_command="$compile_command $flag"
680               finalize_command="$finalize_command $flag"
681             fi
682           elif test "$hardcode_runpath_var" = yes; then
683             # Do the same for the permanent run path.
684             case "$perm_rpath " in
685             *" $libdir "*) ;;
686             *) perm_rpath="$perm_rpath $libdir" ;;
687             esac
688           fi
689
690
691           case "$hardcode_action" in
692           immediate)
693             if test "$hardcode_direct" = no; then
694               compile_command="$compile_command $dir/$linklib"
695             elif test "$hardcode_minus_L" = no; then
696               compile_command="$compile_command -L$dir -l$name"
697             elif test "$hardcode_shlibpath_var" = no; then
698               compile_shlibpath="$compile_shlibpath$dir:"
699               compile_command="$compile_command -l$name"
700             fi
701             ;;
702
703           relink)
704             # We need an absolute path.
705             case "$dir" in
706             /*) ;;
707             *)
708               absdir=`cd "$dir" && pwd`
709               if test -z "$absdir"; then
710                 $echo "$progname: cannot determine absolute directory name of \`$dir'" 1>&2
711                 exit 1
712               fi
713               dir="$absdir"
714               ;;
715             esac
716
717             if test "$hardcode_direct" = yes; then
718               compile_command="$compile_command $dir/$linklib"
719             elif test "$hardcode_minus_L" = yes; then
720               compile_command="$compile_command -L$dir -l$name"
721             elif test "$hardcode_shlibpath_var" = yes; then
722               compile_shlibpath="$compile_shlibpath$dir:"
723               compile_command="$compile_command -l$name"
724             fi
725             ;;
726
727           *)
728             $echo "$progname: \`$hardcode_action' is an unknown hardcode action" 1>&2
729             exit 1
730             ;;
731           esac
732
733           # Finalize command for both is simple: just hardcode it.
734           if test "$hardcode_direct" = yes; then
735             finalize_command="$finalize_command $libdir/$linklib"
736           elif test "$hardcode_minus_L" = yes; then
737             finalize_command="$finalize_command -L$libdir -l$name"
738           elif test "$hardcode_shlibpath_var" = yes; then
739             finalize_shlibpath="$finalize_shlibpath$libdir:"
740             finalize_command="$finalize_command -l$name"
741           else
742             # We can't seem to hardcode it, guess we'll fake it.
743             finalize_command="$finalize_command -L$libdir -l$name"
744           fi
745         else
746           # Transform directly to old archives if we don't build new libraries.
747           if test -n "$pic_flag" && test -z "$old_library"; then
748             $echo "$progname: cannot find static library for \`$arg'" 1>&2
749             exit 1
750           fi
751
752           # Here we assume that one of hardcode_direct or hardcode_minus_L
753           # is not unsupported.  This is valid on all known static and
754           # shared platforms.
755           if test "$hardcode_direct" != unsupported; then
756             test -n "$old_library" && linklib="$old_library"
757             compile_command="$compile_command $dir/$linklib"
758             finalize_command="$finalize_command $dir/$linklib"
759           else
760             compile_command="$compile_command -L$dir -l$name"
761             finalize_command="$finalize_command -L$dir -l$name"
762           fi
763         fi
764         continue
765         ;;
766
767       # Some other compiler argument.
768       *)
769         # Unknown arguments in both finalize_command and compile_command need
770         # to be aesthetically quoted because they are evaled later.
771         arg=`$echo "$arg" | sed "$sed_quote_subst"`
772         case "$arg" in
773         *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*)
774           arg="\"$arg\""
775           ;;
776         esac
777         ;;
778       esac
779
780       # Now actually substitute the argument into the commands.
781       compile_command="$compile_command $arg"
782       finalize_command="$finalize_command $arg"
783     done
784
785     if test -n "$prev"; then
786       $echo "$progname: the \`$prevarg' option requires an argument" 1>&2
787       $echo "$help" 1>&2
788       exit 1
789     fi
790
791     oldlib=
792     oldobjs=
793     case "$output" in
794     "")
795       $echo "$progname: you must specify an output file" 1>&2
796       $echo "$help" 1>&2
797       exit 1
798       ;;
799
800     */*)
801       $echo "$progname: output file \`$output' must have no directory components" 1>&2
802       exit 1
803       ;;
804
805     *.la)
806       # Make sure we only generate libraries of the form `libNAME.la'.
807       case "$output" in
808       lib*) ;;
809       *)
810         $echo "$progname: libtool library \`$arg' must begin with \`lib'" 1>&2
811         $echo "$help" 1>&2
812         exit 1
813         ;;
814       esac
815
816       name=`$echo "$output" | sed -e 's/\.la$//' -e 's/^lib//'`
817       libname=`eval \\$echo \"$libname_spec\"`
818
819       # All the library-specific variables (install_libdir is set above).
820       library_names=
821       old_library=
822       dlname=
823       current=0
824       revision=0
825       age=0
826
827       if test -n "$objs"; then
828         $echo "$progname: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
829         exit 1
830       fi
831
832       # How the heck are we supposed to write a wrapper for a shared library?
833       if test -n "$link_against_libtool_libs"; then
834         $echo "$progname: libtool library \`$output' may not depend on uninstalled libraries:$link_against_libtool_libs" 1>&2
835         exit 1
836       fi
837
838       # Add libc to deplibs on all systems.
839       deplibs="$deplibs -lc"
840
841       if test -n "$dlfiles$dlprefiles"; then
842         $echo "$progname: warning: \`-dlopen' is ignored while creating libtool libraries" 1>&2
843         # Nullify the symbol file.
844         compile_command=`$echo "$compile_command" | sed "s% @SYMFILE@%%"`
845         finalize_command=`$echo "$finalize_command" | sed "s% @SYMFILE@%%"`
846       fi
847
848       if test -z "$rpath"; then
849         $echo "$progname: you must specify an installation directory with \`-rpath'" 1>&2
850         $echo "$help" 1>&2
851         exit 1
852       fi
853
854       set dummy $rpath
855       if test $# -gt 2; then
856         $echo "$progname: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
857       fi
858       install_libdir="$2"
859
860       # Parse the version information argument.
861       IFS="${IFS=       }"; save_ifs="$IFS"; IFS=':'
862       set dummy $vinfo
863       IFS="$save_ifs"
864
865       if test -n "$5"; then
866         $echo "$progname: too many parameters to \`-version-info'" 1>&2
867         $echo "$help" 1>&2
868         exit 1
869       fi
870
871       test -n "$2" && current="$2"
872       test -n "$3" && revision="$3"
873       test -n "$4" && age="$4"
874
875       # Check that each of the things are valid numbers.
876       case "$current" in
877       0 | [1-9] | [1-9][0-9]*) ;;
878       *)
879         $echo "$progname: CURRENT \`$current' is not a nonnegative integer" 1>&2
880         $echo "$progname: \`$vinfo' is not valid version information" 1>&2
881         exit 1
882         ;;
883       esac
884
885       case "$revision" in
886       0 | [1-9] | [1-9][0-9]*) ;;
887       *)
888         $echo "$progname: REVISION \`$revision' is not a nonnegative integer" 1>&2
889         $echo "$progname: \`$vinfo' is not valid version information" 1>&2
890         exit 1
891         ;;
892       esac
893
894       case "$age" in
895       0 | [1-9] | [1-9][0-9]*) ;;
896       *)
897         $echo "$progname: AGE \`$age' is not a nonnegative integer" 1>&2
898         $echo "$progname: \`$vinfo' is not valid version information" 1>&2
899         exit 1
900         ;;
901       esac
902
903       if test $age -gt $current; then
904         $echo "$progname: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
905         $echo "$progname: \`$vinfo' is not valid version information" 1>&2
906         exit 1
907       fi
908
909       # Calculate the version variables.
910       version_vars="version_type current age revision"
911       case "$version_type" in
912       none) ;;
913
914       linux)
915         version_vars="$version_vars major versuffix"
916         major=`expr $current - $age`
917         versuffix="$major.$age.$revision"
918         ;;
919
920       osf)
921         version_vars="$version_vars versuffix verstring"
922         major=`expr $current - $age`
923         versuffix="$current.$age.$revision"
924         verstring="$versuffix"
925
926         # Add in all the interfaces that we are compatible with.
927         loop=$age
928         while test $loop != 0; do
929           iface=`expr $current - $loop`
930           loop=`expr $loop - 1`
931           verstring="$verstring:${iface}.0"
932         done
933
934         # Make executables depend on our current version.
935         verstring="$verstring:${current}.0"
936         ;;
937
938       sunos)
939         version_vars="$version_vars major versuffix"
940         major="$current"
941         versuffix="$current.$revision"
942         ;;
943
944       *)
945         $echo "$progname: unknown library version type \`$version_type'" 1>&2
946         $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
947         exit 1
948         ;;
949       esac
950
951       # Create the output directory, or remove our outputs if we need to.
952       if test -d $objdir; then
953         $show "$rm $objdir/$output $objdir/$libname.*"
954         $run $rm $objdir/$output $objdir/$libname.*
955       else
956         $show "$mkdir $objdir"
957         $run $mkdir $objdir
958         status=$?
959         if test $status -eq 0 || test -d $objdir; then :
960         else
961           exit $status
962         fi
963       fi
964
965       # Check to see if the archive will have undefined symbols.
966       if test "$allow_undefined" = yes; then
967         if test "$allow_undefined_flag" = unsupported; then
968           $echo "$progname: warning: undefined symbols not allowed in $host shared libraries" 1>&2
969           build_libtool_libs=no
970           build_old_libs=yes
971         fi
972       else
973         # Clear the flag.
974         allow_undefined_flag=
975       fi
976
977       if test "$build_libtool_libs" = yes; then
978         # Get the real and link names of the library.
979         library_names=`eval \\$echo \"$library_names_spec\"`
980         set dummy $library_names
981         realname="$2"
982         shift; shift
983
984         if test -n "$soname_spec"; then
985           soname=`eval \\$echo \"$soname_spec\"`
986         else
987           soname="$realname"
988         fi
989
990         lib="$objdir/$realname"
991         for link
992         do
993           linknames="$linknames $link"
994         done
995
996         # Use standard objects if they are PIC.
997         test -z "$pic_flag" && libobjs=`$echo "$libobjs " | sed -e 's/\.lo /.o /g' -e 's/ $//g'`
998
999         # Do each of the archive commands.
1000         cmds=`eval \\$echo \"$archive_cmds\"`
1001         IFS="${IFS=     }"; save_ifs="$IFS"; IFS=';'
1002         for cmd in $cmds; do
1003           IFS="$save_ifs"
1004           $show "$cmd"
1005           $run eval "$cmd" || exit $?
1006         done
1007         IFS="$save_ifs"
1008
1009         # Create links to the real library.
1010         for link in $linknames; do
1011           $show "(cd $objdir && $LN_S $realname $link)"
1012           $run eval '(cd $objdir && $LN_S $realname $link)' || exit $?
1013         done
1014
1015         # If -export-dynamic was specified, set the dlname.
1016         if test "$export_dynamic" = yes; then
1017           # On all known operating systems, these are identical.
1018           dlname="$soname"
1019         fi
1020       fi
1021       ;;
1022
1023     *.lo | *.o)
1024       if test -n "$link_against_libtool_libs"; then
1025         $echo "$progname: error: cannot link libtool libraries into reloadable objects" 1>&2
1026         exit 1
1027       fi
1028
1029       if test -n "$deplibs"; then
1030         $echo "$progname: warning: \`-l' and \`-L' are ignored while creating objects" 1>&2
1031       fi
1032
1033       if test -n "$dlfiles$dlprefiles"; then
1034         $echo "$progname: warning: \`-dlopen' is ignored while creating objects" 1>&2
1035         # Nullify the symbol file.
1036         compile_command=`$echo "$compile_command" | sed "s% @SYMFILE@%%"`
1037         finalize_command=`$echo "$finalize_command" | sed "s% @SYMFILE@%%"`
1038       fi
1039
1040       if test -n "$rpath"; then
1041         $echo "$progname: warning: \`-rpath' is ignored while creating objects" 1>&2
1042       fi
1043
1044       if test -n "$vinfo"; then
1045         $echo "$progname: warning: \`-version-info' is ignored while creating objects" 1>&2
1046       fi
1047
1048       case "$output" in
1049       *.lo)
1050         if test -n "$objs"; then
1051           $echo "$progname: cannot build library object \`$output' from non-libtool objects" 1>&2
1052           exit 1
1053         fi
1054         libobj="$output"
1055         obj=`$echo "$output" | sed 's/\.lo$/.o/'`
1056         ;;
1057       *)
1058         libobj=
1059         obj="$output"
1060         ;;
1061       esac
1062
1063       # Delete the old objects.
1064       $run $rm $obj $libobj
1065
1066       # Create the old-style object.
1067       reload_objs="$objs"`$echo "$libobjs " | sed -e 's/[^       ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
1068
1069       output="$obj"
1070       cmds=`eval \\$echo \"$reload_cmds\"`
1071       IFS="${IFS=       }"; save_ifs="$IFS"; IFS=';'
1072       for cmd in $cmds; do
1073         IFS="$save_ifs"
1074         $show "$cmd"
1075         $run eval "$cmd" || exit $?
1076       done
1077       IFS="$save_ifs"
1078
1079       # Exit if we aren't doing a library object file.
1080       test -z "$libobj" && exit 0
1081
1082       if test "$build_libtool_libs" != yes; then
1083         # Create an invalid libtool object if no PIC, so that we don't
1084         # accidentally link it into a program.
1085         $show "$echo timestamp > $libobj"
1086         $run eval "\$echo timestamp > $libobj" || exit $?
1087         exit 0
1088       fi
1089
1090       if test -n "$pic_flag"; then
1091         # Only do commands if we really have different PIC objects.
1092         reload_objs="$libobjs"
1093         output="$libobj"
1094         cmds=`eval \\$echo \"$reload_cmds\"`
1095         IFS="${IFS=     }"; save_ifs="$IFS"; IFS=';'
1096         for cmd in $cmds; do
1097           IFS="$save_ifs"
1098           $show "$cmd"
1099           $run eval "$cmd" || exit $?
1100         done
1101         IFS="$save_ifs"
1102       else
1103         # Just create a symlink.
1104         $show "$LN_S $obj $libobj"
1105         $run $LN_S $obj $libobj || exit 1
1106       fi
1107
1108       exit 0
1109       ;;
1110
1111     *)
1112       if test -n "$vinfo"; then
1113         $echo "$progname: warning: \`-version-info' is ignored while linking programs" 1>&2
1114       fi
1115
1116       if test -n "$rpath"; then
1117         # If the user specified any rpath flags, then add them.
1118         for libdir in $rpath; do
1119           if test -n "$hardcode_libdir_flag_spec"; then
1120             if test -n "$hardcode_libdir_separator"; then
1121               if test -z "$hardcode_libdirs"; then
1122                 # Put the magic libdir with the hardcode flag.
1123                 hardcode_libdirs="$libdir"
1124                 libdir="@HARDCODE_LIBDIRS@"
1125               else
1126                 # Just accumulate the unique libdirs.
1127                 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
1128                 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
1129                   ;;
1130                 *)
1131                   hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
1132                   ;;
1133                 esac
1134                 libdir=
1135               fi
1136             fi
1137
1138             if test -n "$libdir"; then
1139               flag=`eval \\$echo \"$hardcode_libdir_flag_spec\"`
1140
1141               compile_command="$compile_command $flag"
1142               finalize_command="$finalize_command $flag"
1143             fi
1144           elif test "$hardcode_runpath_var" = yes; then
1145             case "$perm_rpath " in
1146             *" $libdir "*) ;;
1147             *) perm_rpath="$perm_rpath $libdir" ;;
1148             esac
1149           fi
1150         done
1151       fi
1152
1153       # Substitute the hardcoded libdirs into the compile commands.
1154       if test -n "$hardcode_libdir_separator"; then
1155         compile_command=`$echo "$compile_command" | sed "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
1156         finalize_command=`$echo "$finalize_command" | sed "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
1157       fi
1158
1159       if test -n "$libobjs" && test "$build_old_libs" = yes; then
1160         # Transform all the library objects into standard objects.
1161         compile_command=`$echo "$compile_command " | sed -e 's/\.lo /.o /g' -e 's/ $//'`
1162         finalize_command=`$echo "$finalize_command " | sed -e 's/\.lo /.o /g' -e 's/ $//'`
1163       fi
1164
1165       if test "$export_dynamic" = yes && test -n "$NM" && test -n "$global_symbol_pipe"; then
1166         dlsyms="${output}S.c"
1167       else
1168         dlsyms=
1169       fi
1170
1171       if test -n "$dlsyms"; then
1172         # Add our own program objects to the preloaded list.
1173         dlprefiles=`$echo "$objs$dlprefiles " | sed -e 's/\.lo /.o /g' -e 's/ $//'`
1174
1175         # Discover the nlist of each of the dlfiles.
1176         nlist="$objdir/${output}.nm"
1177
1178         if test -d $objdir; then
1179           $show "$rm $nlist ${nlist}T"
1180           $run $rm "$nlist" "${nlist}T"
1181         else
1182           $show "$mkdir $objdir"
1183           $run $mkdir $objdir
1184           status=$?
1185           if test $status -eq 0 || test -d $objdir; then :
1186           else
1187             exit $status
1188           fi
1189         fi
1190
1191         for arg in $dlprefiles; do
1192           $show "extracting global C symbols from \`$arg'"
1193           $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
1194         done
1195
1196         # Parse the name list into a source file.
1197         $show "creating $objdir/$dlsyms"
1198         if test -z "$run"; then
1199           # Make sure we at least have an empty file.
1200           test -f "$nlist" || : > "$nlist"
1201
1202           # Try sorting and uniquifying the output.
1203           if sort "$nlist" | uniq > "$nlist"T; then
1204             mv -f "$nlist"T "$nlist"
1205             wcout=`wc "$nlist" 2>/dev/null`
1206             count=`$echo "$wcout" | sed 's/^[   ]*\([0-9][0-9]*\).*$/\1/'`
1207             (test "$count" -ge 0) 2>/dev/null || count=-1
1208           else
1209             $rm "$nlist"T
1210             count=-1
1211           fi
1212
1213           case "$dlsyms" in
1214           "") ;;
1215           *.c)
1216             cat <<EOF > "$objdir/$dlsyms"
1217 /* $dlsyms - symbol resolution table for \`$output' dlsym emulation. */
1218 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION */
1219
1220 #ifdef __cplusplus
1221 extern "C" {
1222 #endif
1223
1224 /* Prevent the only kind of declaration conflicts we can make. */
1225 #define dld_preloaded_symbol_count some_other_symbol
1226 #define dld_preloaded_symbols some_other_symbol
1227
1228 /* External symbol declarations for the compiler. */
1229 EOF
1230             if test -f "$nlist"; then
1231               sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$objdir/$dlsyms"
1232             else
1233               $echo '/* NONE */' >> "$objdir/$dlsyms"
1234 EOF
1235             fi
1236
1237             cat <<EOF >> "$objdir/$dlsyms"
1238
1239 #undef dld_preloaded_symbol_count
1240 #undef dld_preloaded_symbols
1241
1242 #if defined (__STDC__) && __STDC__
1243 # define __ptr_t void *
1244 #else
1245 # define __ptr_t char *
1246 #endif
1247
1248 /* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
1249 int dld_preloaded_symbol_count = $count;
1250
1251 /* The mapping between symbol names and symbols. */
1252 struct {
1253   char *name;
1254   __ptr_t address;
1255 }
1256 dld_preloaded_symbols[] =
1257 {
1258 EOF
1259
1260             if test -f "$nlist"; then
1261               sed 's/^\(.*\) \(.*\)$/  {"\1", \&\2},/' < "$nlist" >> "$objdir/$dlsyms"
1262             fi
1263
1264             cat <<\EOF >> "$objdir/$dlsyms"
1265   {0},
1266 };
1267
1268 #ifdef __cplusplus
1269 }
1270 #endif
1271 EOF
1272             ;;
1273
1274           *)
1275             echo "$progname: unknown suffix for \`$dlsyms'" 1>&2
1276             exit 1
1277             ;;
1278           esac
1279         fi
1280
1281         # Now compile the dynamic symbol file.
1282         $show "(cd $objdir && $CC -c$no_builtin_flag \"$dlsyms\")"
1283         $run eval '(cd $objdir && $CC -c$no_builtin_flag "$dlsyms")' || exit $?
1284
1285         # Transform the symbol file into the correct name.
1286         compile_command=`$echo "$compile_command" | sed "s%@SYMFILE@%$objdir/${output}S.o%"`
1287         finalize_command=`$echo "$finalize_command" | sed "s%@SYMFILE@%$objdir/${output}S.o%"`
1288       elif test "$export_dynamic" != yes; then
1289         test -n "$dlfiles$dlprefiles" && $echo "$progname: warning: \`-dlopen' and \`-dlpreopen' are ignored without \`-export-dynamic'" 1>&2
1290       else
1291         # We keep going just in case the user didn't refer to
1292         # dld_preloaded_symbols.  The linker will fail if global_symbol_pipe
1293         # really was required.
1294         $echo "$progname: not configured to extract global symbols from dlpreopened files" 1>&2
1295
1296         # Nullify the symbol file.
1297         compile_command=`$echo "$compile_command" | sed "s% @SYMFILE@%%"`
1298         finalize_command=`$echo "$finalize_command" | sed "s% @SYMFILE@%%"`
1299       fi
1300
1301       if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
1302         # Replace the output file specification.
1303         compile_command=`$echo "$compile_command" | sed 's%@OUTPUT@%'"$output"'%g'`
1304         finalize_command=`$echo "$finalize_command" | sed 's%@OUTPUT@%'"$output"'%g'`
1305
1306         # We have no uninstalled library dependencies, so finalize right now.
1307         $show "$compile_command"
1308         $run eval "$compile_command"
1309         exit $?
1310       fi
1311
1312       # Replace the output file specification.
1313       compile_command=`$echo "$compile_command" | sed 's%@OUTPUT@%'"$objdir/$output"'%g'`
1314       finalize_command=`$echo "$finalize_command" | sed 's%@OUTPUT@%'"$objdir/$output"'T%g'`
1315
1316       # Create the binary in the object directory, then wrap it.
1317       if test -d $objdir; then :
1318       else
1319         $show "$mkdir $objdir"
1320         $run $mkdir $objdir || exit $?
1321       fi
1322
1323       if test -n "$shlibpath_var"; then
1324         # We should set the shlibpath_var
1325         rpath=
1326         for dir in $temp_rpath; do
1327           case "$dir" in
1328           /*)
1329             # Absolute path.
1330             rpath="$rpath$dir:"
1331             ;;
1332           *)
1333             # Relative path: add a thisdir entry.
1334             rpath="$rpath\$thisdir/$dir:"
1335             ;;
1336           esac
1337         done
1338         temp_rpath="$rpath"
1339       fi
1340
1341       # Delete the old output file.
1342       $run $rm $output
1343
1344       if test -n "$compile_shlibpath"; then
1345         compile_command="$shlibpath_var=\"$compile_shlibpath\$$shlibpath_var\" $compile_command"
1346       fi
1347       if test -n "$finalize_shlibpath"; then
1348         finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
1349       fi
1350
1351       if test -n "$perm_rpath"; then
1352         # We should set the runpath_var.
1353         rpath=
1354         for dir in $perm_rpath; do
1355           rpath="$rpath$dir:"
1356         done
1357         compile_command="$runpath_var=\"$rpath\$$runpath_var\" $compile_command"
1358         finalize_command="$runpath_var=\"$rpath\$$runpath_var\" $finalize_command"
1359       fi
1360
1361       case "$hardcode_action" in
1362       relink)
1363         # AGH! Flame the AIX and HP-UX people for me, will ya?
1364         $echo "$progname: warning: using a buggy system linker" 1>&2
1365         $echo "$progname: relinking will be required before \`$output' can be installed" 1>&2
1366         ;;
1367       esac
1368
1369       $show "$compile_command"
1370       $run eval "$compile_command" || exit $?
1371
1372       # Now create the wrapper script.
1373       $show "creating $output"
1374
1375       # Quote the finalize command for shipping.
1376       finalize_command=`$echo "$finalize_command" | sed "$sed_quote_subst"`
1377
1378       # Only actually do things if our run command is non-null.
1379       if test -z "$run"; then
1380         $rm $output
1381         trap "$rm $output; exit 1" 1 2 15
1382
1383         cat > $output <<EOF
1384 #! /bin/sh
1385
1386 # $output - temporary wrapper script for $objdir/$output
1387 # Generated by ltmain.sh - GNU $PACKAGE $VERSION
1388 #
1389 # The $output program cannot be directly executed until all the libtool
1390 # libraries that it depends on are installed.
1391 #
1392 # This wrapper script should never be moved out of \``pwd`'.
1393 # If it is, it will not operate correctly.
1394
1395 # This environment variable determines our operation mode.
1396 if test "\$libtool_install_magic" = "$magic"; then
1397   # install mode needs the following variables:
1398   link_against_libtool_libs='$link_against_libtool_libs'
1399   finalize_command="$finalize_command"
1400 else
1401   # When we are sourced in execute mode, \$file and \$echo are already set.
1402   if test "\$libtool_execute_magic" = "$magic"; then :
1403   else
1404     echo='$echo'
1405     file="\$0"
1406   fi
1407
1408   # Find the directory that this script lives in.
1409   thisdir=\`\$echo "\$file" | sed 's%/[^/]*$%%'\`
1410   test "x\$thisdir" = "x\$file" && thisdir=.
1411
1412   # Follow symbolic links until we get to the real thisdir.
1413   file=\`ls -ld "\$file" | sed -n 's/.*-> //p'\`
1414   while test -n "\$file"; do
1415     destdir=\`\$echo "\$file" | sed 's%/[^/]*\$%%'\`
1416
1417     # If there was a directory component, then change thisdir.
1418     if test "x\$destdir" != "x\$file"; then
1419       case "\$destdir" in
1420       /*) thisdir="\$destdir" ;;
1421       *) thisdir="\$thisdir/\$destdir" ;;
1422       esac
1423     fi
1424
1425     file=\`\$echo "\$file" | sed 's%^.*/%%'\`
1426     file=\`ls -ld "\$thisdir/\$file" | sed -n 's/.*-> //p'\`
1427   done
1428
1429   # Try to get the absolute directory name.
1430   absdir=\`cd "\$thisdir" && pwd\`
1431   test -n "\$absdir" && thisdir="\$absdir"
1432
1433   progdir="\$thisdir/$objdir"
1434   program='$output'
1435
1436   if test -f "\$progdir/\$program"; then
1437 EOF
1438
1439         # Export our shlibpath_var if we have one.
1440         if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
1441           cat >> $output <<EOF
1442     # Add our own library path to $shlibpath_var
1443     $shlibpath_var="$temp_rpath\$$shlibpath_var"
1444
1445     # Some systems cannot cope with colon-terminated $shlibpath_var
1446     $shlibpath_var=\`\$echo \$$shlibpath_var | sed -e 's/:*\$//'\`
1447
1448     export $shlibpath_var
1449
1450 EOF
1451         fi
1452
1453         cat >> $output <<EOF
1454     if test "\$libtool_execute_magic" != "$magic"; then
1455       # Run the actual program with our arguments.
1456       args=
1457       for arg
1458       do
1459         # Quote arguments (to preserve shell metacharacters).
1460         sed_quote_subst='$sed_quote_subst'
1461         arg=\`\$echo "\$arg" | sed "\$sed_quote_subst"\`
1462         args="\$args \\"\$arg\\""
1463       done
1464
1465       # Export the path to the program.
1466       PATH="\$progdir:\$PATH"
1467       export PATH
1468
1469       eval "exec \$program \$args"
1470
1471       \$echo "\$0: cannot exec \$program \$args"
1472       exit 1
1473     fi
1474   else
1475     # The program doesn't exist.
1476     \$echo "\$0: error: \$progdir/\$program does not exist" 1>&2
1477     \$echo "This script is just a wrapper for \$program." 1>&2
1478     \$echo "See the $PACKAGE documentation for more information." 1>&2
1479     exit 1
1480   fi
1481 fi
1482 EOF
1483         chmod +x $output
1484       fi
1485       exit 0
1486       ;;
1487     esac
1488
1489
1490     # See if we need to build an old-fashioned archive.
1491     if test "$build_old_libs" = "yes"; then
1492       # Now set the variables for building old libraries.
1493       oldlib="$objdir/$libname.a"
1494
1495       # Transform .lo files to .o files.
1496       oldobjs="$objs"`$echo "$libobjs " | sed -e 's/[^   ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
1497
1498       if test -d "$objdir"; then
1499         $show "$rm $oldlib"
1500         $run $rm $oldlib
1501       else
1502         $show "$mkdir $objdir"
1503         $run $mkdir $objdir
1504       fi
1505
1506       # Do each command in the archive commands.
1507       if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
1508         cmds=`eval \\$echo \"$old_archive_from_new_cmds\"`
1509       else
1510         cmds=`eval \\$echo \"$old_archive_cmds\"`
1511       fi
1512       IFS="${IFS=       }"; save_ifs="$IFS"; IFS=';'
1513       for cmd in $cmds; do
1514         IFS="$save_ifs"
1515         $show "$cmd"
1516         $run eval "$cmd" || exit $?
1517       done
1518       IFS="$save_ifs"
1519     fi
1520
1521     # Now create the libtool archive.
1522     case "$output" in
1523     *.la)
1524       old_library=
1525       test "$build_old_libs" = yes && old_library="$libname.a"
1526
1527       $show "creating $output"
1528
1529       # Only create the output if not a dry run.
1530       if test -z "$run"; then
1531         cat > $output <<EOF
1532 # $output - a libtool library file
1533 # Generated by ltmain.sh - GNU $PACKAGE $VERSION
1534
1535 # The name that we can dlopen(3).
1536 dlname='$dlname'
1537
1538 # Names of this library.
1539 library_names='$library_names'
1540
1541 # The name of the static archive.
1542 old_library='$old_library'
1543
1544 # Version information for $libname.
1545 current=$current
1546 age=$age
1547 revision=$revision
1548
1549 # Directory that this library needs to be installed in:
1550 libdir='$install_libdir'
1551 EOF
1552       fi
1553
1554       # Do a symbolic link so that the libtool archive can be found in
1555       # LD_LIBRARY_PATH before the program is installed.
1556       $show "(cd $objdir && $LN_S ../$output $output)"
1557       $run eval "(cd $objdir && $LN_S ../$output $output)" || exit 1
1558       ;;
1559     esac
1560     exit 0
1561     ;;
1562
1563   # libtool install mode
1564   install)
1565     progname="$progname: install"
1566
1567     # There may be an optional /bin/sh argument at the beginning of
1568     # install_prog (especially on Windows NT).
1569     if test "$nonopt" = "$SHELL"; then
1570       # Aesthetically quote it.
1571       arg=`$echo "$nonopt" | sed "$sed_quote_subst"`
1572       case "$arg" in
1573       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
1574         arg="\"$arg\""
1575         ;;
1576       esac
1577       install_prog="$arg "
1578       arg="$1"
1579       shift
1580     else
1581       install_prog=
1582       arg="$nonopt"
1583     fi
1584
1585     # The real first argument should be the name of the installation program.
1586     # Aesthetically quote it.
1587     arg=`$echo "$arg" | sed "$sed_quote_subst"`
1588     case "$arg" in
1589     *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*)
1590       arg="\"$arg\""
1591       ;;
1592     esac
1593     install_prog="$install_prog$arg"
1594
1595     # We need to accept at least all the BSD install flags.
1596     dest=
1597     files=
1598     opts=
1599     prev=
1600     install_type=
1601     isdir=
1602     stripme=
1603     for arg
1604     do
1605       if test -n "$dest"; then
1606         files="$files $dest"
1607         dest="$arg"
1608         continue
1609       fi
1610
1611       case "$arg" in
1612       -d) isdir=yes ;;
1613       -f) prev="-f" ;;
1614       -g) prev="-g" ;;
1615       -m) prev="-m" ;;
1616       -o) prev="-o" ;;
1617       -s)
1618         stripme=" -s"
1619         continue
1620         ;;
1621       -*) ;;
1622
1623       *)
1624         # If the previous option needed an argument, then skip it.
1625         if test -n "$prev"; then
1626           prev=
1627         else
1628           dest="$arg"
1629           continue
1630         fi
1631         ;;
1632       esac
1633
1634       # Aesthetically quote the argument.
1635       arg=`$echo "$arg" | sed "$sed_quote_subst"`
1636       case "$arg" in
1637       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
1638         arg="\"$arg\""
1639         ;;
1640       esac
1641       install_prog="$install_prog $arg"
1642     done
1643
1644     if test -z "$install_prog"; then
1645       $echo "$progname: you must specify an install program" 1>&2
1646       $echo "$help" 1>&2
1647       exit 1
1648     fi
1649
1650     if test -n "$prev"; then
1651       $echo "$progname: the \`$prev' option requires an argument" 1>&2
1652       $echo "$help" 1>&2
1653       exit 1
1654     fi
1655
1656     if test -z "$files"; then
1657       if test -z "$dest"; then
1658         $echo "$progname: no file or destination specified" 1>&2
1659       else
1660         $echo "$progname: you must specify a destination" 1>&2
1661       fi
1662       $echo "$help" 1>&2
1663       exit 1
1664     fi
1665
1666     # Strip any trailing slash from the destination.
1667     dest=`$echo "$dest" | sed 's%/$%%'`
1668
1669     # Check to see that the destination is a directory.
1670     test -d "$dest" && isdir=yes
1671     if test -n "$isdir"; then
1672       destdir="$dest"
1673       destname=
1674     else
1675       destdir=`$echo "$dest" | sed 's%/[^/]*$%%'`
1676       test "X$destdir" = "X$dest" && destdir=.
1677       destname=`$echo "$dest" | sed 's%^.*/%%'`
1678
1679       # Not a directory, so check to see that there is only one file specified.
1680       set dummy $files
1681       if test $# -gt 2; then
1682         $echo "$progname: \`$dest' is not a directory" 1>&2
1683         $echo "$help" 1>&2
1684         exit 1
1685       fi
1686     fi
1687     case "$destdir" in
1688     /*) ;;
1689     *)
1690       for file in $files; do
1691         case "$file" in
1692         *.lo) ;;
1693         *)
1694           $echo "$progname: \`$destdir' must be an absolute directory name" 1>&2
1695           $echo "$help" 1>&2
1696           exit 1
1697           ;;
1698         esac
1699       done
1700       ;;
1701     esac
1702
1703     # This variable tells wrapper scripts just to set variables rather
1704     # than running their programs.
1705     libtool_install_magic="$magic"
1706
1707     staticlibs=
1708     future_libdirs=
1709     current_libdirs=
1710     for file in $files; do
1711
1712       # Do each installation.
1713       case "$file" in
1714       *.a)
1715         # Do the static libraries later.
1716         staticlibs="$staticlibs $file"
1717         ;;
1718
1719       *.la)
1720         # Check to see that this really is a libtool archive.
1721         if egrep '^# Generated by ltmain.sh' $file >/dev/null 2>&1; then :
1722         else
1723           $echo "$progname: \`$file' is not a valid libtool archive" 1>&2
1724           $echo "$help" 1>&2
1725           exit 1
1726         fi
1727
1728         library_names=
1729         old_library=
1730         # If there is no directory component, then add one.
1731         case "$file" in
1732         */*) . $file ;;
1733         *) . ./$file ;;
1734         esac
1735
1736         # Add the libdir to current_libdirs if it is the destination.
1737         if test "X$destdir" = "X$libdir"; then
1738           case "$current_libdirs " in
1739           *" $libdir "*) ;;
1740           *) current_libdirs="$current_libdirs $libdir" ;;
1741           esac
1742         else
1743           # Note the libdir as a future libdir.
1744           case "$future_libdirs " in
1745           *" $libdir "*) ;;
1746           *) future_libdirs="$future_libdirs $libdir" ;;
1747           esac
1748         fi
1749
1750         dir="`$echo "$file" | sed 's%/[^/]*$%%'`/"
1751         test "X$dir" = "X$file/" && dir=
1752         dir="$dir$objdir"
1753
1754         # See the names of the shared library.
1755         set dummy $library_names
1756         if test -n "$2"; then
1757           realname="$2"
1758           shift
1759           shift
1760
1761           # Install the shared library and build the symlinks.
1762           $show "$install_prog $dir/$realname $destdir/$realname"
1763           $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
1764           test "X$dlname" = "X$realname" && dlname=
1765
1766           # Support stripping libraries.
1767           if test -n "$stripme"; then
1768             if test -n "$striplib"; then
1769               $show "$striplib $destdir/$realname"
1770               $run $striplib $destdir/$realname || exit $?
1771             else
1772               $echo "$progname: warning: no library stripping program" 1>&2
1773             fi
1774           fi
1775
1776           if test $# -gt 0; then
1777             # Delete the old symlinks.
1778             rmcmd="$rm"
1779             for linkname
1780             do
1781               rmcmd="$rmcmd $destdir/$linkname"
1782             done
1783             $show "$rmcmd"
1784             $run $rmcmd
1785
1786             # ... and create new ones.
1787             for linkname
1788             do
1789               test "X$dlname" = "X$linkname" && dlname=
1790               $show "(cd $destdir && $LN_S $realname $linkname)"
1791               $run eval "(cd $destdir && $LN_S $realname $linkname)"
1792             done
1793           fi
1794
1795           if test -n "$dlname"; then
1796             # Install the dynamically-loadable library.
1797             $show "$install_prog $dir/$dlname $destdir/$dlname"
1798             $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $?
1799           fi
1800
1801           # Do each command in the postinstall commands.
1802           lib="$destdir/$realname"
1803           cmds=`eval \\$echo \"$postinstall_cmds\"`
1804           IFS="${IFS=   }"; save_ifs="$IFS"; IFS=';'
1805           for cmd in $cmds; do
1806             IFS="$save_ifs"
1807             $show "$cmd"
1808             $run eval "$cmd" || exit $?
1809           done
1810           IFS="$save_ifs"
1811         fi
1812
1813         # Install the pseudo-library for information purposes.
1814         name=`$echo "$file" | sed 's%^.*/%%'`
1815         $show "$install_prog $file $destdir/$name"
1816         $run eval "$install_prog $file $destdir/$name" || exit $?
1817
1818         # Maybe install the static library, too.
1819         test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
1820         ;;
1821
1822       *.lo)
1823         # Install (i.e. copy) a libtool object.
1824
1825         # Figure out destination file name, if it wasn't already specified.
1826         if test -n "$destname"; then
1827           destfile="$destdir/$destname"
1828         else
1829           destfile=`$echo "$file" | sed 's%^.*/%%'`
1830           destfile="$destdir/$destfile"
1831         fi
1832
1833         # Deduce the name of the destination old-style object file.
1834         case "$destfile" in
1835         *.lo)
1836           staticdest=`$echo "$destfile" | sed 's/\.lo$/\.o/'`
1837           ;;
1838         *.o)
1839           staticdest="$destfile"
1840           destfile=
1841           ;;
1842         *)
1843           $echo "$progname: cannot copy a libtool object to \`$destfile'" 1>&2
1844           $echo "$help" 1>&2
1845           exit 1
1846           ;;
1847         esac
1848
1849         # Install the libtool object if requested.
1850         if test -n "$destfile"; then
1851           $show "$install_prog $file $destfile"
1852           $run eval "$install_prog $file $destfile" || exit $?
1853         fi
1854
1855         # Install the old object if enabled.
1856         if test "$build_old_libs" = yes; then
1857           # Deduce the name of the old-style object file.
1858           staticobj=`$echo "$file" | sed 's/\.lo$/\.o/'`
1859
1860           $show "$install_prog $staticobj $staticdest"
1861           $run eval "$install_prog \$staticobj \$staticdest" || exit $?
1862         fi
1863         exit 0
1864         ;;
1865
1866       *)
1867         # Do a test to see if this is really a libtool program.
1868         if egrep '^# Generated by ltmain.sh' $file >/dev/null 2>&1; then
1869           link_against_libtool_libs=
1870           finalize_command=
1871
1872           # If there is no directory component, then add one.
1873           case "$file" in
1874           */*) . $file ;;
1875           *) . ./$file ;;
1876           esac
1877
1878           # Check the variables that should have been set.
1879           if test -z "$link_against_libtool_libs" || test -z "$finalize_command"; then
1880             $echo "$progname: invalid libtool wrapper script \`$file'" 1>&2
1881             exit 1
1882           fi
1883
1884           finalize=yes
1885           for lib in $link_against_libtool_libs; do
1886             # Check to see that each library is installed.
1887             libdir=
1888             if test -f "$lib"; then
1889               # If there is no directory component, then add one.
1890               case "$lib" in
1891               */*) . $lib ;;
1892               *) . ./$lib ;;
1893               esac
1894             fi
1895             libfile="$libdir/`$echo "$lib" | sed 's%^.*/%%g'`"
1896             if test -z "$libdir"; then
1897               $echo "$progname: warning: \`$lib' contains no -rpath information" 1>&2
1898             elif test -f "$libfile"; then :
1899             else
1900               $echo "$progname: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
1901               finalize=no
1902             fi
1903           done
1904
1905           if test "$hardcode_action" = relink; then
1906             if test "$finalize" = yes; then
1907               $echo "$progname: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
1908               $show "$finalize_command"
1909               if $run eval "$finalize_command"; then :
1910               else
1911                 $echo "$progname: error: relink \`$file' with the above command before installing it" 1>&2
1912                 continue
1913               fi
1914               file="$objdir/$file"T
1915             else
1916               $echo "$progname: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
1917             fi
1918           else
1919             # Install the binary that we compiled earlier.
1920             file=`$echo "$file" | sed "s%\([^/]*\)$%$objdir/\1%"`
1921           fi
1922         fi
1923
1924         $show "$install_prog$stripme $file $dest"
1925         $run eval "$install_prog\$stripme \$file \$dest" || exit $?
1926         ;;
1927       esac
1928     done
1929
1930     for file in $staticlibs; do
1931       name=`$echo "$file" | sed 's%^.*/%%'`
1932
1933       # Set up the ranlib parameters.
1934       oldlib="$destdir/$name"
1935
1936       $show "$install_prog $file $oldlib"
1937       $run eval "$install_prog \$file \$oldlib" || exit $?
1938
1939       # Support stripping libraries.
1940       if test -n "$stripme"; then
1941         if test -n "$old_striplib"; then
1942           $show "$old_striplib $oldlib"
1943           $run $old_striplib $oldlib || exit $?
1944         else
1945           $echo "$progname: warning: no static library stripping program" 1>&2
1946         fi
1947       fi
1948
1949       # Do each command in the postinstall commands.
1950       cmds=`eval \\$echo \"$old_postinstall_cmds\"`
1951       IFS="${IFS=       }"; save_ifs="$IFS"; IFS=';'
1952       for cmd in $cmds; do
1953         IFS="$save_ifs"
1954         $show "$cmd"
1955         $run eval "$cmd" || exit $?
1956       done
1957       IFS="$save_ifs"
1958     done
1959
1960     if test -n "$future_libdirs"; then
1961       $echo "$progname: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
1962     fi
1963
1964     if test -n "$current_libdirs"; then
1965       # Maybe just do a dry run.
1966       test -n "$run" && current_libdirs=" -n$current_libdirs"
1967       exec $SHELL $0 --finish$current_libdirs
1968       exit 1
1969     fi
1970
1971     exit 0
1972     ;;
1973
1974   # libtool finish mode
1975   finish)
1976     progname="$progname: finish"
1977     libdirs="$nonopt"
1978
1979     if test -n "$finish_cmds" && test -n "$libdirs"; then
1980       for dir
1981       do
1982         libdirs="$libdirs $dir"
1983       done
1984
1985       for libdir in $libdirs; do
1986         # Do each command in the postinstall commands.
1987         cmds=`eval \\$echo \"$finish_cmds\"`
1988         IFS="${IFS=     }"; save_ifs="$IFS"; IFS=';'
1989         for cmd in $cmds; do
1990           IFS="$save_ifs"
1991           $show "$cmd"
1992           $run eval "$cmd"
1993         done
1994         IFS="$save_ifs"
1995       done
1996     fi
1997
1998     $echo "To link against installed libraries in LIBDIR, users may have to:"
1999     if test -n "$shlibpath_var"; then
2000       $echo "   - add LIBDIR to their \`$shlibpath_var' environment variable"
2001     fi
2002     $echo "   - use the \`-LLIBDIR' linker flag"
2003     exit 0
2004     ;;
2005
2006   # libtool execute mode
2007   execute)
2008     progname="$progname: execute"
2009
2010     # The first argument is the command name.
2011     cmd="$nonopt"
2012     if test -z "$cmd"; then
2013       $echo "$progname: you must specify a COMMAND" 1>&2
2014       $echo "$help"
2015       exit 1
2016     fi
2017
2018     # Handle -dlopen flags immediately.
2019     for file in $execute_dlfiles; do
2020       if test -f "$file"; then :
2021       else
2022         $echo "$progname: \`$file' is not a file" 1>&2
2023         $echo "$help" 1>&2
2024         exit 1
2025       fi
2026
2027       dir=
2028       case "$file" in
2029       *.la)
2030         # Check to see that this really is a libtool archive.
2031         if egrep '^# Generated by ltmain.sh' $file >/dev/null 2>&1; then :
2032         else
2033           $echo "$progname: \`$lib' is not a valid libtool archive" 1>&2
2034           $echo "$help" 1>&2
2035           exit 1
2036         fi
2037
2038         # Read the libtool library.
2039         dlname=
2040         library_names=
2041
2042         # If there is no directory component, then add one.
2043         case "$file" in
2044         */*) . $file ;;
2045         *) . ./$file ;;
2046         esac
2047
2048         # Skip this library if it cannot be dlopened.
2049         if test -z "$dlname"; then
2050           # Warn if it was a shared library.
2051           test -n "$library_names" && $echo "$progname: warning: \`$file' was not linked with \`-export-dynamic'"
2052           continue
2053         fi
2054
2055         dir=`$echo "$file" | sed 's%/[^/]*$%%'`
2056         test "X$dir" = "X$file" && dir=.
2057
2058         if test -f "$dir/$objdir/$dlname"; then
2059           dir="$dir/$objdir"
2060         else
2061           $echo "$progname: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
2062           exit 1
2063         fi
2064         ;;
2065
2066       *.lo)
2067         # Just add the directory containing the .lo file.
2068         dir=`$echo "$file" | sed 's%/[^/]*$%%'`
2069         test "X$dir" = "X$file" && dir=.
2070         ;;
2071
2072       *)
2073         $echo "$progname: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
2074         continue
2075         ;;
2076       esac
2077
2078       # Get the absolute pathname.
2079       absdir=`cd "$dir" && pwd`
2080       test -n "$absdir" && dir="$absdir"
2081
2082       # Now add the directory to shlibpath_var.
2083       if eval "test -z \"\$$shlibpath_var\""; then
2084         eval "$shlibpath_var=\"\$dir\""
2085       else
2086         eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
2087       fi
2088     done
2089
2090     # This variable tells wrapper scripts just to set shlibpath_var
2091     # rather than running their programs.
2092     libtool_execute_magic="$magic"
2093
2094     # Check if any of the arguments is a wrapper script.
2095     args=
2096     for file
2097     do
2098       case "$file" in
2099       -*) ;;
2100       *)
2101         if egrep '^# Generated by ltmain.sh' $file >/dev/null 2>&1; then
2102           # If there is no directory component, then add one.
2103           case "$file" in
2104           */*) . $file ;;
2105           *) . ./$file ;;
2106           esac
2107
2108           # Transform arg to wrapped name.
2109           file="$progdir/$program"
2110         fi
2111         ;;
2112       esac
2113       # Quote arguments (to preserve shell metacharacters).
2114       file=`$echo "$file" | sed "$sed_quote_subst"`
2115       args="$args \"$file\""
2116     done
2117
2118     if test -z "$run"; then
2119       # Export the shlibpath_var.
2120       eval "export $shlibpath_var"
2121
2122       # Now actually exec the command.
2123       eval "exec \$cmd$args"
2124
2125       $echo "$progname: cannot exec \$cmd$args"
2126       exit 1
2127     else
2128       # Display what would be done.
2129       eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
2130       $echo "export $shlibpath_var"
2131       $echo "$cmd$args"
2132       exit 0
2133     fi
2134     ;;
2135
2136   # libtool uninstall mode
2137   uninstall)
2138     progname="$progname: uninstall"
2139     rm="$nonopt"
2140     files=
2141
2142     for arg
2143     do
2144       case "$arg" in
2145       -*) rm="$rm $arg" ;;
2146       *) files="$files $arg" ;;
2147       esac
2148     done
2149
2150     if test -z "$rm"; then
2151       $echo "$progname: you must specify an RM program" 1>&2
2152       $echo "$help" 1>&2
2153       exit 1
2154     fi
2155
2156     for file in $files; do
2157       dir=`$echo "$file" | sed -e 's%/[^/]*$%%'`
2158       test "X$dir" = "X$file" && dir=.
2159       name=`$echo "$file" | sed -e 's%^.*/%%'`
2160
2161       rmfiles="$file"
2162
2163       case "$name" in
2164       *.la)
2165         # Possibly a libtool archive, so verify it.
2166         if egrep '^# Generated by ltmain.sh' $file >/dev/null 2>&1; then
2167           . $dir/$name
2168
2169           # Delete the libtool libraries and symlinks.
2170           for n in $library_names; do
2171             rmfiles="$rmfiles $dir/$n"
2172             test "X$n" = "X$dlname" && dlname=
2173           done
2174           test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname"
2175           test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
2176
2177           # FIXME: should reinstall the best remaining shared library.
2178         fi
2179         ;;
2180
2181       *.lo)
2182         if test "$build_old_libs" = yes; then
2183           oldobj=`$echo "$name" | sed 's/\.lo$/\.o/'`
2184           rmfiles="$rmfiles $dir/$oldobj"
2185         fi
2186         ;;
2187       esac
2188
2189       $show "$rm $rmfiles"
2190       $run $rm $rmfiles
2191     done
2192     exit 0
2193     ;;
2194
2195   "")
2196     $echo "$progname: you must specify a MODE" 1>&2
2197     $echo "$generic_help" 1>&2
2198     exit 1
2199     ;;
2200   esac
2201
2202   $echo "$progname: invalid operation mode \`$mode'" 1>&2
2203   $echo "$generic_help" 1>&2
2204   exit 1
2205 fi # test -z "$show_help"
2206
2207 # We need to display help for each of the modes.
2208 case "$mode" in
2209 "") cat <<EOF
2210 Usage: $progname [OPTION]... [MODE-ARG]...
2211
2212 Provide generalized library-building support services.
2213
2214 -n, --dry-run         display commands without modifying any files
2215     --features        display configuration information and exit
2216     --finish          same as \`--mode=finish'
2217     --help            display this help message and exit
2218     --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
2219     --quiet           same as \`--silent'
2220     --silent          don't print informational messages
2221     --version         print version information
2222
2223 MODE must be one of the following:
2224
2225       compile         compile a source file into a libtool object
2226       execute         automatically set library path, then run a program
2227       finish          complete the installation of libtool libraries
2228       install         install libraries or executables
2229       link            create a library or an executable
2230       uninstall       remove libraries from an installed directory
2231
2232 MODE-ARGS vary depending on the MODE.  Try \`$progname --help --mode=MODE' for
2233 a more detailed description of MODE.
2234 EOF
2235   ;;
2236
2237 compile)
2238   cat <<EOF
2239 Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
2240
2241 Compile a source file into a libtool library object.
2242
2243 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
2244 from the given SOURCEFILE.
2245
2246 The output file name is determined by removing the directory component from
2247 SOURCEFILE, then substituting the C source code suffix \`.c' with the
2248 library object suffix, \`.lo'.
2249 EOF
2250   ;;
2251
2252 execute)
2253   cat <<EOF
2254 Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
2255
2256 Automatically set library path, then run a program.
2257
2258 This mode accepts the following additional options:
2259
2260   -dlopen FILE      add the directory containing FILE to the library path
2261
2262 This mode sets the library path environment variable according to \`-dlopen'
2263 flags.
2264
2265 If any of the ARGS are libtool executable wrappers, then they are translated
2266 into their corresponding uninstalled binary, and any of their required library
2267 directories are added to the library path.
2268
2269 Then, COMMAND is executed, with ARGS as arguments.
2270 EOF
2271   ;;
2272
2273 finish)
2274   cat <<EOF
2275 Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
2276
2277 Complete the installation of libtool libraries.
2278
2279 Each LIBDIR is a directory that contains libtool libraries.
2280
2281 The commands that this mode executes may require superuser privileges.  Use
2282 the \`--dry-run' option if you just want to see what would be executed.
2283 EOF
2284   ;;
2285
2286 install)
2287   cat <<EOF
2288 Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
2289
2290 Install executables or libraries.
2291
2292 INSTALL-COMMAND is the installation command.  The first component should be
2293 either the \`install' or \`cp' program.
2294
2295 The rest of the components are interpreted as arguments to that command (only
2296 BSD-compatible install options are recognized).
2297 EOF
2298   ;;
2299
2300 link)
2301   cat <<EOF
2302 Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
2303
2304 Link object files or libraries together to form another library, or to
2305 create an executable program.
2306
2307 LINK-COMMAND is a command using the C compiler that you would use to create
2308 a program from several object files.
2309
2310 The following components of LINK-COMMAND are treated specially:
2311
2312   -all-static       do not do any dynamic linking at all
2313   -allow-undefined  allow a libtool library to reference undefined symbols
2314   -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
2315   -dlpreopen FILE   link in FILE and add its symbols to dld_preloaded_symbols
2316   -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2317   -LLIBDIR          search LIBDIR for required installed libraries
2318   -lNAME            OUTPUT-FILE requires the installed library libNAME
2319   -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
2320   -rpath LIBDIR     the created library will eventually be installed in LIBDIR
2321   -static           do not do any dynamic linking of libtool libraries
2322   -version-info CURRENT[:REVISION[:AGE]]
2323                     specify library version info [each variable defaults to 0]
2324
2325 All other options (arguments beginning with \`-') are ignored.
2326
2327 Every other argument is treated as a filename.  Files ending in \`.la' are
2328 treated as uninstalled libtool libraries, other files are standard or library
2329 object files.
2330
2331 If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only
2332 library objects (\`.lo' files) may be specified, and \`-rpath' is required.
2333
2334 If OUTPUT-FILE ends in \`.a', then a standard library is created using \`ar'
2335 and \`ranlib'.
2336
2337 If OUTPUT-FILE ends in \`.lo' or \`.o', then a reloadable object file is
2338 created, otherwise an executable program is created.
2339 EOF
2340   ;;
2341
2342 uninstall)
2343   cat <<EOF
2344 Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
2345
2346 Remove libraries from an installation directory.
2347
2348 RM is the name of the program to use to delete files associated with each FILE
2349 (typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
2350 to RM.
2351
2352 If FILE is a libtool library, all the files associated with it are deleted.
2353 Otherwise, only FILE itself is deleted using RM.
2354 EOF
2355   ;;
2356
2357 *)
2358   $echo "$progname: invalid operation mode \`$mode'" 1>&2
2359   $echo "$help" 1>&2
2360   exit 1
2361   ;;
2362 esac
2363
2364 $echo
2365 $echo "Try \`$progname --help' for more information about other modes."
2366
2367 exit 0
2368
2369 # Local Variables:
2370 # mode:shell-script
2371 # sh-indentation:2
2372 # End: