source: trunk/third/bonobo-activation/ltmain.sh @ 18311

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