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