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