source: trunk/third/gmp/ltmain.sh @ 18191

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