source: trunk/third/gtkhtml3/ltmain.sh @ 20142

Revision 20142, 137.2 KB checked in by ghudson, 21 years ago (diff)
Reintroduce revs 1.2-1.3 (the source-developers [603] fix). Apparently 3.0.8 was packaged with a fixed libtool (so the local mod was merged out) but 3.0.9 was not.
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              add="-l$name"
1918            fi
1919
1920            if test "$linkmode" = prog; then
1921              test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
1922              test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
1923            else
1924              test -n "$add_dir" && deplibs="$add_dir $deplibs"
1925              test -n "$add" && deplibs="$add $deplibs"
1926            fi
1927          fi
1928        elif test "$linkmode" = prog; then
1929          if test "$alldeplibs" = yes &&
1930             { test "$deplibs_check_method" = pass_all ||
1931               { test "$build_libtool_libs" = yes &&
1932                 test -n "$library_names"; }; }; then
1933            # We only need to search for static libraries
1934            continue
1935          fi
1936
1937          # Try to link the static library
1938          # Here we assume that one of hardcode_direct or hardcode_minus_L
1939          # is not unsupported.  This is valid on all known static and
1940          # shared platforms.
1941          if test "$hardcode_direct" != unsupported; then
1942            test -n "$old_library" && linklib="$old_library"
1943            compile_deplibs="$dir/$linklib $compile_deplibs"
1944            finalize_deplibs="$dir/$linklib $finalize_deplibs"
1945          else
1946            compile_deplibs="-l$name -L$dir $compile_deplibs"
1947            finalize_deplibs="-l$name -L$dir $finalize_deplibs"
1948          fi
1949        elif test "$build_libtool_libs" = yes; then
1950          # Not a shared library
1951          if test "$deplibs_check_method" != pass_all; then
1952            # We're trying link a shared library against a static one
1953            # but the system doesn't support it.
1954
1955            # Just print a warning and add the library to dependency_libs so
1956            # that the program can be linked against the static library.
1957            echo
1958            echo "*** Warning: This library needs some functionality provided by $lib."
1959            echo "*** I have the capability to make that library automatically link in when"
1960            echo "*** you link to this library.  But I can only do this if you have a"
1961            echo "*** shared version of the library, which you do not appear to have."
1962            if test "$module" = yes; then
1963              echo "*** Therefore, libtool will create a static module, that should work "
1964              echo "*** as long as the dlopening application is linked with the -dlopen flag."
1965              if test -z "$global_symbol_pipe"; then
1966                echo
1967                echo "*** However, this would only work if libtool was able to extract symbol"
1968                echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
1969                echo "*** not find such a program.  So, this module is probably useless."
1970                echo "*** \`nm' from GNU binutils and a full rebuild may help."
1971              fi
1972              if test "$build_old_libs" = no; then
1973                build_libtool_libs=module
1974                build_old_libs=yes
1975              else
1976                build_libtool_libs=no
1977              fi
1978            fi
1979          else
1980            convenience="$convenience $dir/$old_library"
1981            old_convenience="$old_convenience $dir/$old_library"
1982            deplibs="$dir/$old_library $deplibs"
1983            link_static=yes
1984          fi
1985        fi # link shared/static library?
1986
1987        if test "$linkmode" = lib; then
1988          if test -n "$dependency_libs" &&
1989             { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
1990               test "$link_static" = yes; }; then
1991            # Extract -R from dependency_libs
1992            temp_deplibs=
1993            for libdir in $dependency_libs; do
1994              case $libdir in
1995              -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
1996                   case " $xrpath " in
1997                   *" $temp_xrpath "*) ;;
1998                   *) xrpath="$xrpath $temp_xrpath";;
1999                   esac;;
2000              *) temp_deplibs="$temp_deplibs $libdir";;
2001              esac
2002            done
2003            dependency_libs="$temp_deplibs"
2004          fi
2005
2006          newlib_search_path="$newlib_search_path $absdir"
2007          # Link against this library
2008          test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2009          # ... and its dependency_libs
2010          tmp_libs=
2011          for deplib in $dependency_libs; do
2012            newdependency_libs="$deplib $newdependency_libs"
2013            case "$tmp_libs " in
2014            *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2015            esac
2016            tmp_libs="$tmp_libs $deplib"
2017          done
2018
2019          if test "$link_all_deplibs" != no; then
2020            # Add the search paths of all dependency libraries
2021            for deplib in $dependency_libs; do
2022              case $deplib in
2023              -L*) path="$deplib" ;;
2024              *.la)
2025                dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2026                test "X$dir" = "X$deplib" && dir="."
2027                # We need an absolute path.
2028                case $dir in
2029                [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2030                *)
2031                  absdir=`cd "$dir" && pwd`
2032                  if test -z "$absdir"; then
2033                    $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2034                    absdir="$dir"
2035                  fi
2036                  ;;
2037                esac
2038                if grep "^installed=no" $deplib > /dev/null; then
2039                  path="-L$absdir/$objdir"
2040                else
2041                  eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2042                  if test -z "$libdir"; then
2043                    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2044                    exit 1
2045                  fi
2046                  if test "$absdir" != "$libdir"; then
2047                    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2048                  fi
2049                  path="-L$absdir"
2050                fi
2051                ;;
2052              *) continue ;;
2053              esac
2054              case " $deplibs " in
2055              *" $path "*) ;;
2056              *) deplibs="$deplibs $path" ;;
2057              esac
2058            done
2059          fi # link_all_deplibs != no
2060        fi # linkmode = lib
2061      done # for deplib in $libs
2062      if test "$pass" = dlpreopen; then
2063        # Link the dlpreopened libraries before other libraries
2064        for deplib in $save_deplibs; do
2065          deplibs="$deplib $deplibs"
2066        done
2067      fi
2068      if test "$pass" != dlopen; then
2069        test "$pass" != scan && dependency_libs="$newdependency_libs"
2070        if test "$pass" != conv; then
2071          # Make sure lib_search_path contains only unique directories.
2072          lib_search_path=
2073          for dir in $newlib_search_path; do
2074            case "$lib_search_path " in
2075            *" $dir "*) ;;
2076            *) lib_search_path="$lib_search_path $dir" ;;
2077            esac
2078          done
2079          newlib_search_path=
2080        fi
2081
2082        if test "$linkmode,$pass" != "prog,link"; then
2083          vars="deplibs"
2084        else
2085          vars="compile_deplibs finalize_deplibs"
2086        fi
2087        for var in $vars dependency_libs; do
2088          # Add libraries to $var in reverse order
2089          eval tmp_libs=\"\$$var\"
2090          new_libs=
2091          for deplib in $tmp_libs; do
2092            case $deplib in
2093            -L*) new_libs="$deplib $new_libs" ;;
2094            *)
2095              case " $specialdeplibs " in
2096              *" $deplib "*) new_libs="$deplib $new_libs" ;;
2097              *)
2098                case " $new_libs " in
2099                *" $deplib "*) ;;
2100                *) new_libs="$deplib $new_libs" ;;
2101                esac
2102                ;;
2103              esac
2104              ;;
2105            esac
2106          done
2107          tmp_libs=
2108          for deplib in $new_libs; do
2109            case $deplib in
2110            -L*)
2111              case " $tmp_libs " in
2112              *" $deplib "*) ;;
2113              *) tmp_libs="$tmp_libs $deplib" ;;
2114              esac
2115              ;;
2116            *) tmp_libs="$tmp_libs $deplib" ;;
2117            esac
2118          done
2119          eval $var=\"$tmp_libs\"
2120        done # for var
2121      fi
2122      if test "$pass" = "conv" &&
2123       { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
2124        libs="$deplibs" # reset libs
2125        deplibs=
2126      fi
2127    done # for pass
2128    if test "$linkmode" = prog; then
2129      dlfiles="$newdlfiles"
2130      dlprefiles="$newdlprefiles"
2131    fi
2132
2133    case $linkmode in
2134    oldlib)
2135      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2136        $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2137      fi
2138
2139      if test -n "$rpath"; then
2140        $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2141      fi
2142
2143      if test -n "$xrpath"; then
2144        $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2145      fi
2146
2147      if test -n "$vinfo"; then
2148        $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2149      fi
2150
2151      if test -n "$release"; then
2152        $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2153      fi
2154
2155      if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2156        $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2157      fi
2158
2159      # Now set the variables for building old libraries.
2160      build_libtool_libs=no
2161      oldlibs="$output"
2162      objs="$objs$old_deplibs"
2163      ;;
2164
2165    lib)
2166      # Make sure we only generate libraries of the form `libNAME.la'.
2167      case $outputname in
2168      lib*)
2169        name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2170        eval libname=\"$libname_spec\"
2171        ;;
2172      *)
2173        if test "$module" = no; then
2174          $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2175          $echo "$help" 1>&2
2176          exit 1
2177        fi
2178        if test "$need_lib_prefix" != no; then
2179          # Add the "lib" prefix for modules if required
2180          name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2181          eval libname=\"$libname_spec\"
2182        else
2183          libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2184        fi
2185        ;;
2186      esac
2187
2188      if test -n "$objs"; then
2189        if test "$deplibs_check_method" != pass_all; then
2190          $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2191          exit 1
2192        else
2193          echo
2194          echo "*** Warning: Linking the shared library $output against the non-libtool"
2195          echo "*** objects $objs is not portable!"
2196          libobjs="$libobjs $objs"
2197        fi
2198      fi
2199
2200      if test "$dlself" != no; then
2201        $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2202      fi
2203
2204      set dummy $rpath
2205      if test "$#" -gt 2; then
2206        $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2207      fi
2208      install_libdir="$2"
2209
2210      oldlibs=
2211      if test -z "$rpath"; then
2212        if test "$build_libtool_libs" = yes; then
2213          # Building a libtool convenience library.
2214          libext=al
2215          oldlibs="$output_objdir/$libname.$libext $oldlibs"
2216          build_libtool_libs=convenience
2217          build_old_libs=yes
2218        fi
2219
2220        if test -n "$vinfo"; then
2221          $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2222        fi
2223
2224        if test -n "$release"; then
2225          $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2226        fi
2227      else
2228
2229        # Parse the version information argument.
2230        save_ifs="$IFS"; IFS=':'
2231        set dummy $vinfo 0 0 0
2232        IFS="$save_ifs"
2233
2234        if test -n "$8"; then
2235          $echo "$modename: too many parameters to \`-version-info'" 1>&2
2236          $echo "$help" 1>&2
2237          exit 1
2238        fi
2239
2240        current="$2"
2241        revision="$3"
2242        age="$4"
2243
2244        # Check that each of the things are valid numbers.
2245        case $current in
2246        [0-9]*) ;;
2247        *)
2248          $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2249          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2250          exit 1
2251          ;;
2252        esac
2253
2254        case $revision in
2255        [0-9]*) ;;
2256        *)
2257          $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2258          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2259          exit 1
2260          ;;
2261        esac
2262
2263        case $age in
2264        [0-9]*) ;;
2265        *)
2266          $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2267          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2268          exit 1
2269          ;;
2270        esac
2271
2272        if test "$age" -gt "$current"; then
2273          $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2274          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2275          exit 1
2276        fi
2277
2278        # Calculate the version variables.
2279        major=
2280        versuffix=
2281        verstring=
2282        case $version_type in
2283        none) ;;
2284
2285        darwin)
2286          # Like Linux, but with the current version available in
2287          # verstring for coding it into the library header
2288          major=.`expr $current - $age`
2289          versuffix="$major.$age.$revision"
2290          # Darwin ld doesn't like 0 for these options...
2291          minor_current=`expr $current + 1`
2292          verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2293          ;;
2294
2295        freebsd-aout)
2296          major=".$current"
2297          versuffix=".$current.$revision";
2298          ;;
2299
2300        freebsd-elf)
2301          major=".$current"
2302          versuffix=".$current";
2303          ;;
2304
2305        irix)
2306          major=`expr $current - $age + 1`
2307          verstring="sgi$major.$revision"
2308
2309          # Add in all the interfaces that we are compatible with.
2310          loop=$revision
2311          while test "$loop" -ne 0; do
2312            iface=`expr $revision - $loop`
2313            loop=`expr $loop - 1`
2314            verstring="sgi$major.$iface:$verstring"
2315          done
2316
2317          # Before this point, $major must not contain `.'.
2318          major=.$major
2319          versuffix="$major.$revision"
2320          ;;
2321
2322        linux)
2323          major=.`expr $current - $age`
2324          versuffix="$major.$age.$revision"
2325          ;;
2326
2327        osf)
2328          major=`expr $current - $age`
2329          versuffix=".$current.$age.$revision"
2330          verstring="$current.$age.$revision"
2331
2332          # Add in all the interfaces that we are compatible with.
2333          loop=$age
2334          while test "$loop" -ne 0; do
2335            iface=`expr $current - $loop`
2336            loop=`expr $loop - 1`
2337            verstring="$verstring:${iface}.0"
2338          done
2339
2340          # Make executables depend on our current version.
2341          verstring="$verstring:${current}.0"
2342          ;;
2343
2344        sunos)
2345          major=".$current"
2346          versuffix=".$current.$revision"
2347          ;;
2348
2349        windows)
2350          # Use '-' rather than '.', since we only want one
2351          # extension on DOS 8.3 filesystems.
2352          major=`expr $current - $age`
2353          versuffix="-$major"
2354          ;;
2355
2356        *)
2357          $echo "$modename: unknown library version type \`$version_type'" 1>&2
2358          echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
2359          exit 1
2360          ;;
2361        esac
2362
2363        # Clear the version info if we defaulted, and they specified a release.
2364        if test -z "$vinfo" && test -n "$release"; then
2365          major=
2366          verstring="0.0"
2367          case $version_type in
2368          darwin)
2369            # we can't check for "0.0" in archive_cmds due to quoting
2370            # problems, so we reset it completely
2371            verstring=""
2372            ;;
2373          *)
2374            verstring="0.0"
2375            ;;
2376          esac
2377          if test "$need_version" = no; then
2378            versuffix=
2379          else
2380            versuffix=".0.0"
2381          fi
2382        fi
2383
2384        # Remove version info from name if versioning should be avoided
2385        if test "$avoid_version" = yes && test "$need_version" = no; then
2386          major=
2387          versuffix=
2388          verstring=""
2389        fi
2390
2391        # Check to see if the archive will have undefined symbols.
2392        if test "$allow_undefined" = yes; then
2393          if test "$allow_undefined_flag" = unsupported; then
2394            $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2395            build_libtool_libs=no
2396            build_old_libs=yes
2397          fi
2398        else
2399          # Don't allow undefined symbols.
2400          allow_undefined_flag="$no_undefined_flag"
2401        fi
2402      fi
2403
2404      if test "$mode" != relink; then
2405        # Remove our outputs.
2406        $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
2407        $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
2408      fi
2409
2410      # Now set the variables for building old libraries.
2411      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2412        oldlibs="$oldlibs $output_objdir/$libname.$libext"
2413
2414        # Transform .lo files to .o files.
2415        oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2416      fi
2417
2418      # Eliminate all temporary directories.
2419      for path in $notinst_path; do
2420        lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2421        deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2422        dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2423      done
2424
2425      if test -n "$xrpath"; then
2426        # If the user specified any rpath flags, then add them.
2427        temp_xrpath=
2428        for libdir in $xrpath; do
2429          temp_xrpath="$temp_xrpath -R$libdir"
2430          case "$finalize_rpath " in
2431          *" $libdir "*) ;;
2432          *) finalize_rpath="$finalize_rpath $libdir" ;;
2433          esac
2434        done
2435        if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
2436          dependency_libs="$temp_xrpath $dependency_libs"
2437        fi
2438      fi
2439
2440      # Make sure dlfiles contains only unique files that won't be dlpreopened
2441      old_dlfiles="$dlfiles"
2442      dlfiles=
2443      for lib in $old_dlfiles; do
2444        case " $dlprefiles $dlfiles " in
2445        *" $lib "*) ;;
2446        *) dlfiles="$dlfiles $lib" ;;
2447        esac
2448      done
2449
2450      # Make sure dlprefiles contains only unique files
2451      old_dlprefiles="$dlprefiles"
2452      dlprefiles=
2453      for lib in $old_dlprefiles; do
2454        case "$dlprefiles " in
2455        *" $lib "*) ;;
2456        *) dlprefiles="$dlprefiles $lib" ;;
2457        esac
2458      done
2459
2460      if test "$build_libtool_libs" = yes; then
2461        if test -n "$rpath"; then
2462          case $host in
2463          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
2464            # these systems don't actually have a c library (as such)!
2465            ;;
2466          *-*-rhapsody* | *-*-darwin1.[012])
2467            # Rhapsody C library is in the System framework
2468            deplibs="$deplibs -framework System"
2469            ;;
2470          *-*-netbsd*)
2471            # Don't link with libc until the a.out ld.so is fixed.
2472            ;;
2473          *-*-openbsd*)
2474            # Do not include libc due to us having libc/libc_r.
2475            ;;
2476          *)
2477            # Add libc to deplibs on all other systems if necessary.
2478            if test "$build_libtool_need_lc" = "yes"; then
2479              deplibs="$deplibs -lc"
2480            fi
2481            ;;
2482          esac
2483        fi
2484
2485        # Transform deplibs into only deplibs that can be linked in shared.
2486        name_save=$name
2487        libname_save=$libname
2488        release_save=$release
2489        versuffix_save=$versuffix
2490        major_save=$major
2491        # I'm not sure if I'm treating the release correctly.  I think
2492        # release should show up in the -l (ie -lgmp5) so we don't want to
2493        # add it in twice.  Is that correct?
2494        release=""
2495        versuffix=""
2496        major=""
2497        newdeplibs=
2498        droppeddeps=no
2499        case $deplibs_check_method in
2500        pass_all)
2501          # Don't check for shared/static.  Everything works.
2502          # This might be a little naive.  We might want to check
2503          # whether the library exists or not.  But this is on
2504          # osf3 & osf4 and I'm not really sure... Just
2505          # implementing what was already the behaviour.
2506          newdeplibs=$deplibs
2507          ;;
2508        test_compile)
2509          # This code stresses the "libraries are programs" paradigm to its
2510          # limits. Maybe even breaks it.  We compile a program, linking it
2511          # against the deplibs as a proxy for the library.  Then we can check
2512          # whether they linked in statically or dynamically with ldd.
2513          $rm conftest.c
2514          cat > conftest.c <<EOF
2515          int main() { return 0; }
2516EOF
2517          $rm conftest
2518          $CC -o conftest conftest.c $deplibs
2519          if test "$?" -eq 0 ; then
2520            ldd_output=`ldd conftest`
2521            for i in $deplibs; do
2522              name="`expr $i : '-l\(.*\)'`"
2523              # If $name is empty we are operating on a -L argument.
2524              if test -n "$name" && test "$name" != "0"; then
2525                libname=`eval \\$echo \"$libname_spec\"`
2526                deplib_matches=`eval \\$echo \"$library_names_spec\"`
2527                set dummy $deplib_matches
2528                deplib_match=$2
2529                if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2530                  newdeplibs="$newdeplibs $i"
2531                else
2532                  droppeddeps=yes
2533                  echo
2534                  echo "*** Warning: This library needs some functionality provided by $i."
2535                  echo "*** I have the capability to make that library automatically link in when"
2536                  echo "*** you link to this library.  But I can only do this if you have a"
2537                  echo "*** shared version of the library, which you do not appear to have."
2538                fi
2539              else
2540                newdeplibs="$newdeplibs $i"
2541              fi
2542            done
2543          else
2544            # Error occured in the first compile.  Let's try to salvage the situation:
2545            # Compile a seperate program for each library.
2546            for i in $deplibs; do
2547              name="`expr $i : '-l\(.*\)'`"
2548             # If $name is empty we are operating on a -L argument.
2549              if test -n "$name" && test "$name" != "0"; then
2550                $rm conftest
2551                $CC -o conftest conftest.c $i
2552                # Did it work?
2553                if test "$?" -eq 0 ; then
2554                  ldd_output=`ldd conftest`
2555                  libname=`eval \\$echo \"$libname_spec\"`
2556                  deplib_matches=`eval \\$echo \"$library_names_spec\"`
2557                  set dummy $deplib_matches
2558                  deplib_match=$2
2559                  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2560                    newdeplibs="$newdeplibs $i"
2561                  else
2562                    droppeddeps=yes
2563                    echo
2564                    echo "*** Warning: This library needs some functionality provided by $i."
2565                    echo "*** I have the capability to make that library automatically link in when"
2566                    echo "*** you link to this library.  But I can only do this if you have a"
2567                    echo "*** shared version of the library, which you do not appear to have."
2568                  fi
2569                else
2570                  droppeddeps=yes
2571                  echo
2572                  echo "*** Warning!  Library $i is needed by this library but I was not able to"
2573                  echo "***  make it link in!  You will probably need to install it or some"
2574                  echo "*** library that it depends on before this library will be fully"
2575                  echo "*** functional.  Installing it before continuing would be even better."
2576                fi
2577              else
2578                newdeplibs="$newdeplibs $i"
2579              fi
2580            done
2581          fi
2582          ;;
2583        file_magic*)
2584          set dummy $deplibs_check_method
2585          file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2586          for a_deplib in $deplibs; do
2587            name="`expr $a_deplib : '-l\(.*\)'`"
2588            # If $name is empty we are operating on a -L argument.
2589            if test -n "$name" && test "$name" != "0"; then
2590              libname=`eval \\$echo \"$libname_spec\"`
2591              for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2592                    potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2593                    for potent_lib in $potential_libs; do
2594                      # Follow soft links.
2595                      if ls -lLd "$potent_lib" 2>/dev/null \
2596                         | grep " -> " >/dev/null; then
2597                        continue
2598                      fi
2599                      # The statement above tries to avoid entering an
2600                      # endless loop below, in case of cyclic links.
2601                      # We might still enter an endless loop, since a link
2602                      # loop can be closed while we follow links,
2603                      # but so what?
2604                      potlib="$potent_lib"
2605                      while test -h "$potlib" 2>/dev/null; do
2606                        potliblink=`ls -ld $potlib | sed 's/.* -> //'`
2607                        case $potliblink in
2608                        [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2609                        *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2610                        esac
2611                      done
2612                      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2613                         | sed 10q \
2614                         | egrep "$file_magic_regex" > /dev/null; then
2615                        newdeplibs="$newdeplibs $a_deplib"
2616                        a_deplib=""
2617                        break 2
2618                      fi
2619                    done
2620              done
2621              if test -n "$a_deplib" ; then
2622                droppeddeps=yes
2623                echo
2624                echo "*** Warning: This library needs some functionality provided by $a_deplib."
2625                echo "*** I have the capability to make that library automatically link in when"
2626                echo "*** you link to this library.  But I can only do this if you have a"
2627                echo "*** shared version of the library, which you do not appear to have."
2628              fi
2629            else
2630              # Add a -L argument.
2631              newdeplibs="$newdeplibs $a_deplib"
2632            fi
2633          done # Gone through all deplibs.
2634          ;;
2635        match_pattern*)
2636          set dummy $deplibs_check_method
2637          match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2638          for a_deplib in $deplibs; do
2639            name="`expr $a_deplib : '-l\(.*\)'`"
2640            # If $name is empty we are operating on a -L argument.
2641            if test -n "$name" && test "$name" != "0"; then
2642              libname=`eval \\$echo \"$libname_spec\"`
2643              for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2644                potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2645                for potent_lib in $potential_libs; do
2646                  if eval echo \"$potent_lib\" 2>/dev/null \
2647                      | sed 10q \
2648                      | egrep "$match_pattern_regex" > /dev/null; then
2649                    newdeplibs="$newdeplibs $a_deplib"
2650                    a_deplib=""
2651                    break 2
2652                  fi
2653                done
2654              done
2655              if test -n "$a_deplib" ; then
2656                droppeddeps=yes
2657                echo
2658                echo "*** Warning: This library needs some functionality provided by $a_deplib."
2659                echo "*** I have the capability to make that library automatically link in when"
2660                echo "*** you link to this library.  But I can only do this if you have a"
2661                echo "*** shared version of the library, which you do not appear to have."
2662              fi
2663            else
2664              # Add a -L argument.
2665              newdeplibs="$newdeplibs $a_deplib"
2666            fi
2667          done # Gone through all deplibs.
2668          ;;
2669        none | unknown | *)
2670          newdeplibs=""
2671          if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2672               -e 's/ -[LR][^ ]*//g' -e 's/[    ]//g' |
2673             grep . >/dev/null; then
2674            echo
2675            if test "X$deplibs_check_method" = "Xnone"; then
2676              echo "*** Warning: inter-library dependencies are not supported in this platform."
2677            else
2678              echo "*** Warning: inter-library dependencies are not known to be supported."
2679            fi
2680            echo "*** All declared inter-library dependencies are being dropped."
2681            droppeddeps=yes
2682          fi
2683          ;;
2684        esac
2685        versuffix=$versuffix_save
2686        major=$major_save
2687        release=$release_save
2688        libname=$libname_save
2689        name=$name_save
2690
2691        case $host in
2692        *-*-rhapsody* | *-*-darwin1.[012])
2693          # On Rhapsody replace the C library is the System framework
2694          newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
2695          ;;
2696        esac
2697
2698        if test "$droppeddeps" = yes; then
2699          if test "$module" = yes; then
2700            echo
2701            echo "*** Warning: libtool could not satisfy all declared inter-library"
2702            echo "*** dependencies of module $libname.  Therefore, libtool will create"
2703            echo "*** a static module, that should work as long as the dlopening"
2704            echo "*** application is linked with the -dlopen flag."
2705            if test -z "$global_symbol_pipe"; then
2706              echo
2707              echo "*** However, this would only work if libtool was able to extract symbol"
2708              echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2709              echo "*** not find such a program.  So, this module is probably useless."
2710              echo "*** \`nm' from GNU binutils and a full rebuild may help."
2711            fi
2712            if test "$build_old_libs" = no; then
2713              oldlibs="$output_objdir/$libname.$libext"
2714              build_libtool_libs=module
2715              build_old_libs=yes
2716            else
2717              build_libtool_libs=no
2718            fi
2719          else
2720            echo "*** The inter-library dependencies that have been dropped here will be"
2721            echo "*** automatically added whenever a program is linked with this library"
2722            echo "*** or is declared to -dlopen it."
2723
2724            if test "$allow_undefined" = no; then
2725              echo
2726              echo "*** Since this library must not contain undefined symbols,"
2727              echo "*** because either the platform does not support them or"
2728              echo "*** it was explicitly requested with -no-undefined,"
2729              echo "*** libtool will only create a static version of it."
2730              if test "$build_old_libs" = no; then
2731                oldlibs="$output_objdir/$libname.$libext"
2732                build_libtool_libs=module
2733                build_old_libs=yes
2734              else
2735                build_libtool_libs=no
2736              fi
2737            fi
2738          fi
2739        fi
2740        # Done checking deplibs!
2741        deplibs=$newdeplibs
2742      fi
2743
2744      # All the library-specific variables (install_libdir is set above).
2745      library_names=
2746      old_library=
2747      dlname=
2748
2749      # Test again, we may have decided not to build it any more
2750      if test "$build_libtool_libs" = yes; then
2751        if test "$hardcode_into_libs" = yes; then
2752          # Hardcode the library paths
2753          hardcode_libdirs=
2754          dep_rpath=
2755          rpath="$finalize_rpath"
2756          test "$mode" != relink && rpath="$compile_rpath$rpath"
2757          for libdir in $rpath; do
2758            if test -n "$hardcode_libdir_flag_spec"; then
2759              if test -n "$hardcode_libdir_separator"; then
2760                if test -z "$hardcode_libdirs"; then
2761                  hardcode_libdirs="$libdir"
2762                else
2763                  # Just accumulate the unique libdirs.
2764                  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
2765                  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2766                    ;;
2767                  *)
2768                    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2769                    ;;
2770                  esac
2771                fi
2772              else
2773                eval flag=\"$hardcode_libdir_flag_spec\"
2774                dep_rpath="$dep_rpath $flag"
2775              fi
2776            elif test -n "$runpath_var"; then
2777              case "$perm_rpath " in
2778              *" $libdir "*) ;;
2779              *) perm_rpath="$perm_rpath $libdir" ;;
2780              esac
2781            fi
2782          done
2783          # Substitute the hardcoded libdirs into the rpath.
2784          if test -n "$hardcode_libdir_separator" &&
2785             test -n "$hardcode_libdirs"; then
2786            libdir="$hardcode_libdirs"
2787            eval dep_rpath=\"$hardcode_libdir_flag_spec\"
2788          fi
2789          if test -n "$runpath_var" && test -n "$perm_rpath"; then
2790            # We should set the runpath_var.
2791            rpath=
2792            for dir in $perm_rpath; do
2793              rpath="$rpath$dir:"
2794            done
2795            eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
2796          fi
2797          test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
2798        fi
2799
2800        shlibpath="$finalize_shlibpath"
2801        test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
2802        if test -n "$shlibpath"; then
2803          eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
2804        fi
2805
2806        # Get the real and link names of the library.
2807        eval library_names=\"$library_names_spec\"
2808        set dummy $library_names
2809        realname="$2"
2810        shift; shift
2811
2812        if test -n "$soname_spec"; then
2813          eval soname=\"$soname_spec\"
2814        else
2815          soname="$realname"
2816        fi
2817        test -z "$dlname" && dlname=$soname
2818
2819        lib="$output_objdir/$realname"
2820        for link
2821        do
2822          linknames="$linknames $link"
2823        done
2824
2825        # Ensure that we have .o objects for linkers which dislike .lo
2826        # (e.g. aix) in case we are running --disable-static
2827        for obj in $libobjs; do
2828          xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
2829          if test "X$xdir" = "X$obj"; then
2830            xdir="."
2831          else
2832            xdir="$xdir"
2833          fi
2834          baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
2835          oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
2836          if test ! -f $xdir/$oldobj; then
2837            $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
2838            $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
2839          fi
2840        done
2841
2842        # Use standard objects if they are pic
2843        test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2844
2845        # Prepare the list of exported symbols
2846        if test -z "$export_symbols"; then
2847          if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
2848            $show "generating symbol list for \`$libname.la'"
2849            export_symbols="$output_objdir/$libname.exp"
2850            $run $rm $export_symbols
2851            eval cmds=\"$export_symbols_cmds\"
2852            save_ifs="$IFS"; IFS='~'
2853            for cmd in $cmds; do
2854              IFS="$save_ifs"
2855              $show "$cmd"
2856              $run eval "$cmd" || exit $?
2857            done
2858            IFS="$save_ifs"
2859            if test -n "$export_symbols_regex"; then
2860              $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2861              $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2862              $show "$mv \"${export_symbols}T\" \"$export_symbols\""
2863              $run eval '$mv "${export_symbols}T" "$export_symbols"'
2864            fi
2865          fi
2866        fi
2867
2868        if test -n "$export_symbols" && test -n "$include_expsyms"; then
2869          $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
2870        fi
2871
2872        if test -n "$convenience"; then
2873          if test -n "$whole_archive_flag_spec"; then
2874            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
2875          else
2876            gentop="$output_objdir/${outputname}x"
2877            $show "${rm}r $gentop"
2878            $run ${rm}r "$gentop"
2879            $show "mkdir $gentop"
2880            $run mkdir "$gentop"
2881            status=$?
2882            if test "$status" -ne 0 && test ! -d "$gentop"; then
2883              exit $status
2884            fi
2885            generated="$generated $gentop"
2886
2887            for xlib in $convenience; do
2888              # Extract the objects.
2889              case $xlib in
2890              [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2891              *) xabs=`pwd`"/$xlib" ;;
2892              esac
2893              xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2894              xdir="$gentop/$xlib"
2895
2896              $show "${rm}r $xdir"
2897              $run ${rm}r "$xdir"
2898              $show "mkdir $xdir"
2899              $run mkdir "$xdir"
2900              status=$?
2901              if test "$status" -ne 0 && test ! -d "$xdir"; then
2902                exit $status
2903              fi
2904              $show "(cd $xdir && $AR x $xabs)"
2905              $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2906
2907              libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2908            done
2909          fi
2910        fi
2911
2912        if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2913          eval flag=\"$thread_safe_flag_spec\"
2914          linker_flags="$linker_flags $flag"
2915        fi
2916
2917        # Make a backup of the uninstalled library when relinking
2918        if test "$mode" = relink; then
2919          $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
2920        fi
2921
2922        # Do each of the archive commands.
2923        if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2924          eval cmds=\"$archive_expsym_cmds\"
2925        else
2926          eval cmds=\"$archive_cmds\"
2927        fi
2928        save_ifs="$IFS"; IFS='~'
2929        for cmd in $cmds; do
2930          IFS="$save_ifs"
2931          $show "$cmd"
2932          $run eval "$cmd" || exit $?
2933        done
2934        IFS="$save_ifs"
2935
2936        # Restore the uninstalled library and exit
2937        if test "$mode" = relink; then
2938          $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
2939          exit 0
2940        fi
2941
2942        # Create links to the real library.
2943        for linkname in $linknames; do
2944          if test "$realname" != "$linkname"; then
2945            $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
2946            $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
2947          fi
2948        done
2949
2950        # If -module or -export-dynamic was specified, set the dlname.
2951        if test "$module" = yes || test "$export_dynamic" = yes; then
2952          # On all known operating systems, these are identical.
2953          dlname="$soname"
2954        fi
2955      fi
2956      ;;
2957
2958    obj)
2959      if test -n "$deplibs"; then
2960        $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
2961      fi
2962
2963      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2964        $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
2965      fi
2966
2967      if test -n "$rpath"; then
2968        $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
2969      fi
2970
2971      if test -n "$xrpath"; then
2972        $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
2973      fi
2974
2975      if test -n "$vinfo"; then
2976        $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
2977      fi
2978
2979      if test -n "$release"; then
2980        $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
2981      fi
2982
2983      case $output in
2984      *.lo)
2985        if test -n "$objs$old_deplibs"; then
2986          $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
2987          exit 1
2988        fi
2989        libobj="$output"
2990        obj=`$echo "X$output" | $Xsed -e "$lo2o"`
2991        ;;
2992      *)
2993        libobj=
2994        obj="$output"
2995        ;;
2996      esac
2997
2998      # Delete the old objects.
2999      $run $rm $obj $libobj
3000
3001      # Objects from convenience libraries.  This assumes
3002      # single-version convenience libraries.  Whenever we create
3003      # different ones for PIC/non-PIC, this we'll have to duplicate
3004      # the extraction.
3005      reload_conv_objs=
3006      gentop=
3007      # reload_cmds runs $LD directly, so let us get rid of
3008      # -Wl from whole_archive_flag_spec
3009      wl=
3010
3011      if test -n "$convenience"; then
3012        if test -n "$whole_archive_flag_spec"; then
3013          eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3014        else
3015          gentop="$output_objdir/${obj}x"
3016          $show "${rm}r $gentop"
3017          $run ${rm}r "$gentop"
3018          $show "mkdir $gentop"
3019          $run mkdir "$gentop"
3020          status=$?
3021          if test "$status" -ne 0 && test ! -d "$gentop"; then
3022            exit $status
3023          fi
3024          generated="$generated $gentop"
3025
3026          for xlib in $convenience; do
3027            # Extract the objects.
3028            case $xlib in
3029            [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3030            *) xabs=`pwd`"/$xlib" ;;
3031            esac
3032            xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3033            xdir="$gentop/$xlib"
3034
3035            $show "${rm}r $xdir"
3036            $run ${rm}r "$xdir"
3037            $show "mkdir $xdir"
3038            $run mkdir "$xdir"
3039            status=$?
3040            if test "$status" -ne 0 && test ! -d "$xdir"; then
3041              exit $status
3042            fi
3043            $show "(cd $xdir && $AR x $xabs)"
3044            $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3045
3046            reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3047          done
3048        fi
3049      fi
3050
3051      # Create the old-style object.
3052      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
3053
3054      output="$obj"
3055      eval cmds=\"$reload_cmds\"
3056      save_ifs="$IFS"; IFS='~'
3057      for cmd in $cmds; do
3058        IFS="$save_ifs"
3059        $show "$cmd"
3060        $run eval "$cmd" || exit $?
3061      done
3062      IFS="$save_ifs"
3063
3064      # Exit if we aren't doing a library object file.
3065      if test -z "$libobj"; then
3066        if test -n "$gentop"; then
3067          $show "${rm}r $gentop"
3068          $run ${rm}r $gentop
3069        fi
3070
3071        exit 0
3072      fi
3073
3074      if test "$build_libtool_libs" != yes; then
3075        if test -n "$gentop"; then
3076          $show "${rm}r $gentop"
3077          $run ${rm}r $gentop
3078        fi
3079
3080        # Create an invalid libtool object if no PIC, so that we don't
3081        # accidentally link it into a program.
3082        $show "echo timestamp > $libobj"
3083        $run eval "echo timestamp > $libobj" || exit $?
3084        exit 0
3085      fi
3086
3087      if test -n "$pic_flag" || test "$pic_mode" != default; then
3088        # Only do commands if we really have different PIC objects.
3089        reload_objs="$libobjs $reload_conv_objs"
3090        output="$libobj"
3091        eval cmds=\"$reload_cmds\"
3092        save_ifs="$IFS"; IFS='~'
3093        for cmd in $cmds; do
3094          IFS="$save_ifs"
3095          $show "$cmd"
3096          $run eval "$cmd" || exit $?
3097        done
3098        IFS="$save_ifs"
3099      else
3100        # Just create a symlink.
3101        $show $rm $libobj
3102        $run $rm $libobj
3103        xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3104        if test "X$xdir" = "X$libobj"; then
3105          xdir="."
3106        else
3107          xdir="$xdir"
3108        fi
3109        baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
3110        oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3111        $show "(cd $xdir && $LN_S $oldobj $baseobj)"
3112        $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
3113      fi
3114
3115      if test -n "$gentop"; then
3116        $show "${rm}r $gentop"
3117        $run ${rm}r $gentop
3118      fi
3119
3120      exit 0
3121      ;;
3122
3123    prog)
3124      case $host in
3125        *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
3126      esac
3127      if test -n "$vinfo"; then
3128        $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3129      fi
3130
3131      if test -n "$release"; then
3132        $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3133      fi
3134
3135      if test "$preload" = yes; then
3136        if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
3137           test "$dlopen_self_static" = unknown; then
3138          $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3139        fi
3140      fi
3141
3142      case $host in
3143      *-*-rhapsody* | *-*-darwin1.[012])
3144        # On Rhapsody replace the C library is the System framework
3145        compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3146        finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3147        ;;
3148      esac
3149
3150      compile_command="$compile_command $compile_deplibs"
3151      finalize_command="$finalize_command $finalize_deplibs"
3152
3153      if test -n "$rpath$xrpath"; then
3154        # If the user specified any rpath flags, then add them.
3155        for libdir in $rpath $xrpath; do
3156          # This is the magic to use -rpath.
3157          case "$finalize_rpath " in
3158          *" $libdir "*) ;;
3159          *) finalize_rpath="$finalize_rpath $libdir" ;;
3160          esac
3161        done
3162      fi
3163
3164      # Now hardcode the library paths
3165      rpath=
3166      hardcode_libdirs=
3167      for libdir in $compile_rpath $finalize_rpath; do
3168        if test -n "$hardcode_libdir_flag_spec"; then
3169          if test -n "$hardcode_libdir_separator"; then
3170            if test -z "$hardcode_libdirs"; then
3171              hardcode_libdirs="$libdir"
3172            else
3173              # Just accumulate the unique libdirs.
3174              case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3175              *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3176                ;;
3177              *)
3178                hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3179                ;;
3180              esac
3181            fi
3182          else
3183            eval flag=\"$hardcode_libdir_flag_spec\"
3184            rpath="$rpath $flag"
3185          fi
3186        elif test -n "$runpath_var"; then
3187          case "$perm_rpath " in
3188          *" $libdir "*) ;;
3189          *) perm_rpath="$perm_rpath $libdir" ;;
3190          esac
3191        fi
3192        case $host in
3193        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3194          case :$dllsearchpath: in
3195          *":$libdir:"*) ;;
3196          *) dllsearchpath="$dllsearchpath:$libdir";;
3197          esac
3198          ;;
3199        esac
3200      done
3201      # Substitute the hardcoded libdirs into the rpath.
3202      if test -n "$hardcode_libdir_separator" &&
3203         test -n "$hardcode_libdirs"; then
3204        libdir="$hardcode_libdirs"
3205        eval rpath=\" $hardcode_libdir_flag_spec\"
3206      fi
3207      compile_rpath="$rpath"
3208
3209      rpath=
3210      hardcode_libdirs=
3211      for libdir in $finalize_rpath; do
3212        if test -n "$hardcode_libdir_flag_spec"; then
3213          if test -n "$hardcode_libdir_separator"; then
3214            if test -z "$hardcode_libdirs"; then
3215              hardcode_libdirs="$libdir"
3216            else
3217              # Just accumulate the unique libdirs.
3218              case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3219              *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3220                ;;
3221              *)
3222                hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3223                ;;
3224              esac
3225            fi
3226          else
3227            eval flag=\"$hardcode_libdir_flag_spec\"
3228            rpath="$rpath $flag"
3229          fi
3230        elif test -n "$runpath_var"; then
3231          case "$finalize_perm_rpath " in
3232          *" $libdir "*) ;;
3233          *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
3234          esac
3235        fi
3236      done
3237      # Substitute the hardcoded libdirs into the rpath.
3238      if test -n "$hardcode_libdir_separator" &&
3239         test -n "$hardcode_libdirs"; then
3240        libdir="$hardcode_libdirs"
3241        eval rpath=\" $hardcode_libdir_flag_spec\"
3242      fi
3243      finalize_rpath="$rpath"
3244
3245      if test -n "$libobjs" && test "$build_old_libs" = yes; then
3246        # Transform all the library objects into standard objects.
3247        compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3248        finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3249      fi
3250
3251      dlsyms=
3252      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3253        if test -n "$NM" && test -n "$global_symbol_pipe"; then
3254          dlsyms="${outputname}S.c"
3255        else
3256          $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3257        fi
3258      fi
3259
3260      if test -n "$dlsyms"; then
3261        case $dlsyms in
3262        "") ;;
3263        *.c)
3264          # Discover the nlist of each of the dlfiles.
3265          nlist="$output_objdir/${outputname}.nm"
3266
3267          $show "$rm $nlist ${nlist}S ${nlist}T"
3268          $run $rm "$nlist" "${nlist}S" "${nlist}T"
3269
3270          # Parse the name list into a source file.
3271          $show "creating $output_objdir/$dlsyms"
3272
3273          test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3274/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3275/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3276
3277#ifdef __cplusplus
3278extern \"C\" {
3279#endif
3280
3281/* Prevent the only kind of declaration conflicts we can make. */
3282#define lt_preloaded_symbols some_other_symbol
3283
3284/* External symbol declarations for the compiler. */\
3285"
3286
3287          if test "$dlself" = yes; then
3288            $show "generating symbol list for \`$output'"
3289
3290            test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3291
3292            # Add our own program objects to the symbol list.
3293            progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3294            for arg in $progfiles; do
3295              $show "extracting global C symbols from \`$arg'"
3296              $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3297            done
3298
3299            if test -n "$exclude_expsyms"; then
3300              $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3301              $run eval '$mv "$nlist"T "$nlist"'
3302            fi
3303
3304            if test -n "$export_symbols_regex"; then
3305              $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3306              $run eval '$mv "$nlist"T "$nlist"'
3307            fi
3308
3309            # Prepare the list of exported symbols
3310            if test -z "$export_symbols"; then
3311              export_symbols="$output_objdir/$output.exp"
3312              $run $rm $export_symbols
3313              $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3314            else
3315              $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3316              $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3317              $run eval 'mv "$nlist"T "$nlist"'
3318            fi
3319          fi
3320
3321          for arg in $dlprefiles; do
3322            $show "extracting global C symbols from \`$arg'"
3323            name=`echo "$arg" | sed -e 's%^.*/%%'`
3324            $run eval 'echo ": $name " >> "$nlist"'
3325            $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3326          done
3327
3328          if test -z "$run"; then
3329            # Make sure we have at least an empty file.
3330            test -f "$nlist" || : > "$nlist"
3331
3332            if test -n "$exclude_expsyms"; then
3333              egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3334              $mv "$nlist"T "$nlist"
3335            fi
3336
3337            # Try sorting and uniquifying the output.
3338            if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
3339              :
3340            else
3341              grep -v "^: " < "$nlist" > "$nlist"S
3342            fi
3343
3344            if test -f "$nlist"S; then
3345              eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3346            else
3347              echo '/* NONE */' >> "$output_objdir/$dlsyms"
3348            fi
3349
3350            $echo >> "$output_objdir/$dlsyms" "\
3351
3352#undef lt_preloaded_symbols
3353
3354#if defined (__STDC__) && __STDC__
3355# define lt_ptr void *
3356#else
3357# define lt_ptr char *
3358# define const
3359#endif
3360
3361/* The mapping between symbol names and symbols. */
3362const struct {
3363  const char *name;
3364  lt_ptr address;
3365}
3366lt_preloaded_symbols[] =
3367{\
3368"
3369
3370            eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
3371
3372            $echo >> "$output_objdir/$dlsyms" "\
3373  {0, (lt_ptr) 0}
3374};
3375
3376/* This works around a problem in FreeBSD linker */
3377#ifdef FREEBSD_WORKAROUND
3378static const void *lt_preloaded_setup() {
3379  return lt_preloaded_symbols;
3380}
3381#endif
3382
3383#ifdef __cplusplus
3384}
3385#endif\
3386"
3387          fi
3388
3389          pic_flag_for_symtable=
3390          case $host in
3391          # compiling the symbol table file with pic_flag works around
3392          # a FreeBSD bug that causes programs to crash when -lm is
3393          # linked before any other PIC object.  But we must not use
3394          # pic_flag when linking with -static.  The problem exists in
3395          # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3396          *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3397            case "$compile_command " in
3398            *" -static "*) ;;
3399            *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
3400            esac;;
3401          *-*-hpux*)
3402            case "$compile_command " in
3403            *" -static "*) ;;
3404            *) pic_flag_for_symtable=" $pic_flag -DPIC";;
3405            esac
3406          esac
3407
3408          # Now compile the dynamic symbol file.
3409          $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3410          $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
3411
3412          # Clean up the generated files.
3413          $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3414          $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3415
3416          # Transform the symbol file into the correct name.
3417          compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3418          finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3419          ;;
3420        *)
3421          $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3422          exit 1
3423          ;;
3424        esac
3425      else
3426        # We keep going just in case the user didn't refer to
3427        # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
3428        # really was required.
3429
3430        # Nullify the symbol file.
3431        compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3432        finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3433      fi
3434
3435      if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
3436        # Replace the output file specification.
3437        compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3438        link_command="$compile_command$compile_rpath"
3439
3440        # We have no uninstalled library dependencies, so finalize right now.
3441        $show "$link_command"
3442        $run eval "$link_command"
3443        status=$?
3444
3445        # Delete the generated files.
3446        if test -n "$dlsyms"; then
3447          $show "$rm $output_objdir/${outputname}S.${objext}"
3448          $run $rm "$output_objdir/${outputname}S.${objext}"
3449        fi
3450
3451        exit $status
3452      fi
3453
3454      if test -n "$shlibpath_var"; then
3455        # We should set the shlibpath_var
3456        rpath=
3457        for dir in $temp_rpath; do
3458          case $dir in
3459          [\\/]* | [A-Za-z]:[\\/]*)
3460            # Absolute path.
3461            rpath="$rpath$dir:"
3462            ;;
3463          *)
3464            # Relative path: add a thisdir entry.
3465            rpath="$rpath\$thisdir/$dir:"
3466            ;;
3467          esac
3468        done
3469        temp_rpath="$rpath"
3470      fi
3471
3472      if test -n "$compile_shlibpath$finalize_shlibpath"; then
3473        compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3474      fi
3475      if test -n "$finalize_shlibpath"; then
3476        finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3477      fi
3478
3479      compile_var=
3480      finalize_var=
3481      if test -n "$runpath_var"; then
3482        if test -n "$perm_rpath"; then
3483          # We should set the runpath_var.
3484          rpath=
3485          for dir in $perm_rpath; do
3486            rpath="$rpath$dir:"
3487          done
3488          compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
3489        fi
3490        if test -n "$finalize_perm_rpath"; then
3491          # We should set the runpath_var.
3492          rpath=
3493          for dir in $finalize_perm_rpath; do
3494            rpath="$rpath$dir:"
3495          done
3496          finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
3497        fi
3498      fi
3499
3500      if test "$no_install" = yes; then
3501        # We don't need to create a wrapper script.
3502        link_command="$compile_var$compile_command$compile_rpath"
3503        # Replace the output file specification.
3504        link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3505        # Delete the old output file.
3506        $run $rm $output
3507        # Link the executable and exit
3508        $show "$link_command"
3509        $run eval "$link_command" || exit $?
3510        exit 0
3511      fi
3512
3513      if test "$hardcode_action" = relink; then
3514        # Fast installation is not supported
3515        link_command="$compile_var$compile_command$compile_rpath"
3516        relink_command="$finalize_var$finalize_command$finalize_rpath"
3517
3518        $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3519        $echo "$modename: \`$output' will be relinked during installation" 1>&2
3520      else
3521        if test "$fast_install" != no; then
3522          link_command="$finalize_var$compile_command$finalize_rpath"
3523          if test "$fast_install" = yes; then
3524            relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3525          else
3526            # fast_install is set to needless
3527            relink_command=
3528          fi
3529        else
3530          link_command="$compile_var$compile_command$compile_rpath"
3531          relink_command="$finalize_var$finalize_command$finalize_rpath"
3532        fi
3533      fi
3534
3535      # Replace the output file specification.
3536      link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3537
3538      # Delete the old output files.
3539      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
3540
3541      $show "$link_command"
3542      $run eval "$link_command" || exit $?
3543
3544      # Now create the wrapper script.
3545      $show "creating $output"
3546
3547      # Quote the relink command for shipping.
3548      if test -n "$relink_command"; then
3549        # Preserve any variables that may affect compiler behavior
3550        for var in $variables_saved_for_relink; do
3551          if eval test -z \"\${$var+set}\"; then
3552            relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3553          elif eval var_value=\$$var; test -z "$var_value"; then
3554            relink_command="$var=; export $var; $relink_command"
3555          else
3556            var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3557            relink_command="$var=\"$var_value\"; export $var; $relink_command"
3558          fi
3559        done
3560        relink_command="(cd `pwd`; $relink_command)"
3561        relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3562      fi
3563
3564      # Quote $echo for shipping.
3565      if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3566        case $0 in
3567        [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
3568        *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
3569        esac
3570        qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3571      else
3572        qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3573      fi
3574
3575      # Only actually do things if our run command is non-null.
3576      if test -z "$run"; then
3577        # win32 will think the script is a binary if it has
3578        # a .exe suffix, so we strip it off here.
3579        case $output in
3580          *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
3581        esac
3582        # test for cygwin because mv fails w/o .exe extensions
3583        case $host in
3584          *cygwin*) exeext=.exe ;;
3585          *) exeext= ;;
3586        esac
3587        $rm $output
3588        trap "$rm $output; exit 1" 1 2 15
3589
3590        $echo > $output "\
3591#! $SHELL
3592
3593# $output - temporary wrapper script for $objdir/$outputname
3594# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3595#
3596# The $output program cannot be directly executed until all the libtool
3597# libraries that it depends on are installed.
3598#
3599# This wrapper script should never be moved out of the build directory.
3600# If it is, it will not operate correctly.
3601
3602# Sed substitution that helps us do robust quoting.  It backslashifies
3603# metacharacters that are still active within double-quoted strings.
3604Xsed='sed -e 1s/^X//'
3605sed_quote_subst='$sed_quote_subst'
3606
3607# The HP-UX ksh and POSIX shell print the target directory to stdout
3608# if CDPATH is set.
3609if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
3610
3611relink_command=\"$relink_command\"
3612
3613# This environment variable determines our operation mode.
3614if test \"\$libtool_install_magic\" = \"$magic\"; then
3615  # install mode needs the following variable:
3616  notinst_deplibs='$notinst_deplibs'
3617else
3618  # When we are sourced in execute mode, \$file and \$echo are already set.
3619  if test \"\$libtool_execute_magic\" != \"$magic\"; then
3620    echo=\"$qecho\"
3621    file=\"\$0\"
3622    # Make sure echo works.
3623    if test \"X\$1\" = X--no-reexec; then
3624      # Discard the --no-reexec flag, and continue.
3625      shift
3626    elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3627      # Yippee, \$echo works!
3628      :
3629    else
3630      # Restart under the correct shell, and then maybe \$echo will work.
3631      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3632    fi
3633  fi\
3634"
3635        $echo >> $output "\
3636
3637  # Find the directory that this script lives in.
3638  thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3639  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3640
3641  # Follow symbolic links until we get to the real thisdir.
3642  file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
3643  while test -n \"\$file\"; do
3644    destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3645
3646    # If there was a directory component, then change thisdir.
3647    if test \"x\$destdir\" != \"x\$file\"; then
3648      case \"\$destdir\" in
3649      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3650      *) thisdir=\"\$thisdir/\$destdir\" ;;
3651      esac
3652    fi
3653
3654    file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3655    file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
3656  done
3657
3658  # Try to get the absolute directory name.
3659  absdir=\`cd \"\$thisdir\" && pwd\`
3660  test -n \"\$absdir\" && thisdir=\"\$absdir\"
3661"
3662
3663        if test "$fast_install" = yes; then
3664          echo >> $output "\
3665  program=lt-'$outputname'$exeext
3666  progdir=\"\$thisdir/$objdir\"
3667
3668  if test ! -f \"\$progdir/\$program\" || \\
3669     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
3670       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3671
3672    file=\"\$\$-\$program\"
3673
3674    if test ! -d \"\$progdir\"; then
3675      $mkdir \"\$progdir\"
3676    else
3677      $rm \"\$progdir/\$file\"
3678    fi"
3679
3680          echo >> $output "\
3681
3682    # relink executable if necessary
3683    if test -n \"\$relink_command\"; then
3684      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
3685      else
3686        $echo \"\$relink_command_output\" >&2
3687        $rm \"\$progdir/\$file\"
3688        exit 1
3689      fi
3690    fi
3691
3692    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3693    { $rm \"\$progdir/\$program\";
3694      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3695    $rm \"\$progdir/\$file\"
3696  fi"
3697        else
3698          echo >> $output "\
3699  program='$outputname'
3700  progdir=\"\$thisdir/$objdir\"
3701"
3702        fi
3703
3704        echo >> $output "\
3705
3706  if test -f \"\$progdir/\$program\"; then"
3707
3708        # Export our shlibpath_var if we have one.
3709        if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3710          $echo >> $output "\
3711    # Add our own library path to $shlibpath_var
3712    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3713
3714    # Some systems cannot cope with colon-terminated $shlibpath_var
3715    # The second colon is a workaround for a bug in BeOS R4 sed
3716    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3717
3718    export $shlibpath_var
3719"
3720        fi
3721
3722        # fixup the dll searchpath if we need to.
3723        if test -n "$dllsearchpath"; then
3724          $echo >> $output "\
3725    # Add the dll search path components to the executable PATH
3726    PATH=$dllsearchpath:\$PATH
3727"
3728        fi
3729
3730        $echo >> $output "\
3731    if test \"\$libtool_execute_magic\" != \"$magic\"; then
3732      # Run the actual program with our arguments.
3733"
3734        case $host in
3735        # win32 systems need to use the prog path for dll
3736        # lookup to work
3737        *-*-cygwin* | *-*-pw32*)
3738          $echo >> $output "\
3739      exec \$progdir/\$program \${1+\"\$@\"}
3740"
3741          ;;
3742
3743        # Backslashes separate directories on plain windows
3744        *-*-mingw | *-*-os2*)
3745          $echo >> $output "\
3746      exec \$progdir\\\\\$program \${1+\"\$@\"}
3747"
3748          ;;
3749
3750        *)
3751          $echo >> $output "\
3752      # Export the path to the program.
3753      PATH=\"\$progdir:\$PATH\"
3754      export PATH
3755
3756      exec \$program \${1+\"\$@\"}
3757"
3758          ;;
3759        esac
3760        $echo >> $output "\
3761      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
3762      exit 1
3763    fi
3764  else
3765    # The program doesn't exist.
3766    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
3767    \$echo \"This script is just a wrapper for \$program.\" 1>&2
3768    echo \"See the $PACKAGE documentation for more information.\" 1>&2
3769    exit 1
3770  fi
3771fi\
3772"
3773        chmod +x $output
3774      fi
3775      exit 0
3776      ;;
3777    esac
3778
3779    # See if we need to build an old-fashioned archive.
3780    for oldlib in $oldlibs; do
3781
3782      if test "$build_libtool_libs" = convenience; then
3783        oldobjs="$libobjs_save"
3784        addlibs="$convenience"
3785        build_libtool_libs=no
3786      else
3787        if test "$build_libtool_libs" = module; then
3788          oldobjs="$libobjs_save"
3789          build_libtool_libs=no
3790        else
3791          oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
3792        fi
3793        addlibs="$old_convenience"
3794      fi
3795
3796      if test -n "$addlibs"; then
3797        gentop="$output_objdir/${outputname}x"
3798        $show "${rm}r $gentop"
3799        $run ${rm}r "$gentop"
3800        $show "mkdir $gentop"
3801        $run mkdir "$gentop"
3802        status=$?
3803        if test "$status" -ne 0 && test ! -d "$gentop"; then
3804          exit $status
3805        fi
3806        generated="$generated $gentop"
3807
3808        # Add in members from convenience archives.
3809        for xlib in $addlibs; do
3810          # Extract the objects.
3811          case $xlib in
3812          [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3813          *) xabs=`pwd`"/$xlib" ;;
3814          esac
3815          xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3816          xdir="$gentop/$xlib"
3817
3818          $show "${rm}r $xdir"
3819          $run ${rm}r "$xdir"
3820          $show "mkdir $xdir"
3821          $run mkdir "$xdir"
3822          status=$?
3823          if test "$status" -ne 0 && test ! -d "$xdir"; then
3824            exit $status
3825          fi
3826          $show "(cd $xdir && $AR x $xabs)"
3827          $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3828
3829          oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
3830        done
3831      fi
3832
3833      # Do each command in the archive commands.
3834      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3835        eval cmds=\"$old_archive_from_new_cmds\"
3836      else
3837        # Ensure that we have .o objects in place in case we decided
3838        # not to build a shared library, and have fallen back to building
3839        # static libs even though --disable-static was passed!
3840        for oldobj in $oldobjs; do
3841          if test ! -f $oldobj; then
3842            xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
3843            if test "X$xdir" = "X$oldobj"; then
3844              xdir="."
3845            else
3846              xdir="$xdir"
3847            fi
3848            baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
3849            obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
3850            $show "(cd $xdir && ${LN_S} $obj $baseobj)"
3851            $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
3852          fi
3853        done
3854
3855        eval cmds=\"$old_archive_cmds\"
3856      fi
3857      save_ifs="$IFS"; IFS='~'
3858      for cmd in $cmds; do
3859        IFS="$save_ifs"
3860        $show "$cmd"
3861        $run eval "$cmd" || exit $?
3862      done
3863      IFS="$save_ifs"
3864    done
3865
3866    if test -n "$generated"; then
3867      $show "${rm}r$generated"
3868      $run ${rm}r$generated
3869    fi
3870
3871    # Now create the libtool archive.
3872    case $output in
3873    *.la)
3874      old_library=
3875      test "$build_old_libs" = yes && old_library="$libname.$libext"
3876      $show "creating $output"
3877
3878      # Preserve any variables that may affect compiler behavior
3879      for var in $variables_saved_for_relink; do
3880        if eval test -z \"\${$var+set}\"; then
3881          relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3882        elif eval var_value=\$$var; test -z "$var_value"; then
3883          relink_command="$var=; export $var; $relink_command"
3884        else
3885          var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3886          relink_command="$var=\"$var_value\"; export $var; $relink_command"
3887        fi
3888      done
3889      # Quote the link command for shipping.
3890      relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
3891      relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3892
3893      # Only create the output if not a dry run.
3894      if test -z "$run"; then
3895        for installed in no yes; do
3896          if test "$installed" = yes; then
3897            if test -z "$install_libdir"; then
3898              break
3899            fi
3900            output="$output_objdir/$outputname"i
3901            # Replace all uninstalled libtool libraries with the installed ones
3902            newdependency_libs=
3903            for deplib in $dependency_libs; do
3904              case $deplib in
3905              *.la)
3906                name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
3907                eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3908                if test -z "$libdir"; then
3909                  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3910                  exit 1
3911                fi
3912                newdependency_libs="$newdependency_libs $libdir/$name"
3913                ;;
3914              *) newdependency_libs="$newdependency_libs $deplib" ;;
3915              esac
3916            done
3917            dependency_libs="$newdependency_libs"
3918            newdlfiles=
3919            for lib in $dlfiles; do
3920              name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3921              eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3922              if test -z "$libdir"; then
3923                $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3924                exit 1
3925              fi
3926              newdlfiles="$newdlfiles $libdir/$name"
3927            done
3928            dlfiles="$newdlfiles"
3929            newdlprefiles=
3930            for lib in $dlprefiles; do
3931              name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3932              eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3933              if test -z "$libdir"; then
3934                $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3935                exit 1
3936              fi
3937              newdlprefiles="$newdlprefiles $libdir/$name"
3938            done
3939            dlprefiles="$newdlprefiles"
3940          fi
3941          $rm $output
3942          # place dlname in correct position for cygwin
3943          tdlname=$dlname
3944          case $host,$output,$installed,$module,$dlname in
3945            *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
3946          esac
3947          $echo > $output "\
3948# $outputname - a libtool library file
3949# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3950#
3951# Please DO NOT delete this file!
3952# It is necessary for linking the library.
3953
3954# The name that we can dlopen(3).
3955dlname='$tdlname'
3956
3957# Names of this library.
3958library_names='$library_names'
3959
3960# The name of the static archive.
3961old_library='$old_library'
3962
3963# Libraries that this one depends upon.
3964dependency_libs='$dependency_libs'
3965
3966# Version information for $libname.
3967current=$current
3968age=$age
3969revision=$revision
3970
3971# Is this an already installed library?
3972installed=$installed
3973
3974# Files to dlopen/dlpreopen
3975dlopen='$dlfiles'
3976dlpreopen='$dlprefiles'
3977
3978# Directory that this library needs to be installed in:
3979libdir='$install_libdir'"
3980          if test "$installed" = no && test "$need_relink" = yes; then
3981            $echo >> $output "\
3982relink_command=\"$relink_command\""
3983          fi
3984        done
3985      fi
3986
3987      # Do a symbolic link so that the libtool archive can be found in
3988      # LD_LIBRARY_PATH before the program is installed.
3989      $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
3990      $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
3991      ;;
3992    esac
3993    exit 0
3994    ;;
3995
3996  # libtool install mode
3997  install)
3998    modename="$modename: install"
3999
4000    # There may be an optional sh(1) argument at the beginning of
4001    # install_prog (especially on Windows NT).
4002    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
4003       # Allow the use of GNU shtool's install command.
4004       $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
4005      # Aesthetically quote it.
4006      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4007      case $arg in
4008      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
4009        arg="\"$arg\""
4010        ;;
4011      esac
4012      install_prog="$arg "
4013      arg="$1"
4014      shift
4015    else
4016      install_prog=
4017      arg="$nonopt"
4018    fi
4019
4020    # The real first argument should be the name of the installation program.
4021    # Aesthetically quote it.
4022    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4023    case $arg in
4024    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*)
4025      arg="\"$arg\""
4026      ;;
4027    esac
4028    install_prog="$install_prog$arg"
4029
4030    # We need to accept at least all the BSD install flags.
4031    dest=
4032    files=
4033    opts=
4034    prev=
4035    install_type=
4036    isdir=no
4037    stripme=
4038    for arg
4039    do
4040      if test -n "$dest"; then
4041        files="$files $dest"
4042        dest="$arg"
4043        continue
4044      fi
4045
4046      case $arg in
4047      -d) isdir=yes ;;
4048      -f) prev="-f" ;;
4049      -g) prev="-g" ;;
4050      -m) prev="-m" ;;
4051      -o) prev="-o" ;;
4052      -s)
4053        stripme=" -s"
4054        continue
4055        ;;
4056      -*) ;;
4057
4058      *)
4059        # If the previous option needed an argument, then skip it.
4060        if test -n "$prev"; then
4061          prev=
4062        else
4063          dest="$arg"
4064          continue
4065        fi
4066        ;;
4067      esac
4068
4069      # Aesthetically quote the argument.
4070      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4071      case $arg in
4072      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
4073        arg="\"$arg\""
4074        ;;
4075      esac
4076      install_prog="$install_prog $arg"
4077    done
4078
4079    if test -z "$install_prog"; then
4080      $echo "$modename: you must specify an install program" 1>&2
4081      $echo "$help" 1>&2
4082      exit 1
4083    fi
4084
4085    if test -n "$prev"; then
4086      $echo "$modename: the \`$prev' option requires an argument" 1>&2
4087      $echo "$help" 1>&2
4088      exit 1
4089    fi
4090
4091    if test -z "$files"; then
4092      if test -z "$dest"; then
4093        $echo "$modename: no file or destination specified" 1>&2
4094      else
4095        $echo "$modename: you must specify a destination" 1>&2
4096      fi
4097      $echo "$help" 1>&2
4098      exit 1
4099    fi
4100
4101    # Strip any trailing slash from the destination.
4102    dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4103
4104    # Check to see that the destination is a directory.
4105    test -d "$dest" && isdir=yes
4106    if test "$isdir" = yes; then
4107      destdir="$dest"
4108      destname=
4109    else
4110      destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4111      test "X$destdir" = "X$dest" && destdir=.
4112      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4113
4114      # Not a directory, so check to see that there is only one file specified.
4115      set dummy $files
4116      if test "$#" -gt 2; then
4117        $echo "$modename: \`$dest' is not a directory" 1>&2
4118        $echo "$help" 1>&2
4119        exit 1
4120      fi
4121    fi
4122    case $destdir in
4123    [\\/]* | [A-Za-z]:[\\/]*) ;;
4124    *)
4125      for file in $files; do
4126        case $file in
4127        *.lo) ;;
4128        *)
4129          $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4130          $echo "$help" 1>&2
4131          exit 1
4132          ;;
4133        esac
4134      done
4135      ;;
4136    esac
4137
4138    # This variable tells wrapper scripts just to set variables rather
4139    # than running their programs.
4140    libtool_install_magic="$magic"
4141
4142    staticlibs=
4143    future_libdirs=
4144    current_libdirs=
4145    for file in $files; do
4146
4147      # Do each installation.
4148      case $file in
4149      *.$libext)
4150        # Do the static libraries later.
4151        staticlibs="$staticlibs $file"
4152        ;;
4153
4154      *.la)
4155        # Check to see that this really is a libtool archive.
4156        if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4157        else
4158          $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4159          $echo "$help" 1>&2
4160          exit 1
4161        fi
4162
4163        library_names=
4164        old_library=
4165        relink_command=
4166        # If there is no directory component, then add one.
4167        case $file in
4168        */* | *\\*) . $file ;;
4169        *) . ./$file ;;
4170        esac
4171
4172        # Add the libdir to current_libdirs if it is the destination.
4173        if test "X$destdir" = "X$libdir"; then
4174          case "$current_libdirs " in
4175          *" $libdir "*) ;;
4176          *) current_libdirs="$current_libdirs $libdir" ;;
4177          esac
4178        else
4179          # Note the libdir as a future libdir.
4180          case "$future_libdirs " in
4181          *" $libdir "*) ;;
4182          *) future_libdirs="$future_libdirs $libdir" ;;
4183          esac
4184        fi
4185
4186        dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4187        test "X$dir" = "X$file/" && dir=
4188        dir="$dir$objdir"
4189
4190        if test -n "$relink_command"; then
4191          # Determine the prefix the user has applied to our future dir.
4192          inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"`
4193
4194          # Don't allow the user to place us outside of our expected
4195          # location b/c this prevents finding dependent libraries that
4196          # are installed to the same prefix.
4197          if test "$inst_prefix_dir" = "$destdir"; then
4198            $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
4199            exit 1
4200          fi
4201
4202          if test -n "$inst_prefix_dir"; then
4203            # Stick the inst_prefix_dir data into the link command.
4204            relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
4205          else
4206            relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
4207          fi
4208
4209          $echo "$modename: warning: relinking \`$file'" 1>&2
4210          $show "$relink_command"
4211          if $run eval "$relink_command"; then :
4212          else
4213            $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4214            exit 1
4215          fi
4216        fi
4217
4218        # See the names of the shared library.
4219        set dummy $library_names
4220        if test -n "$2"; then
4221          realname="$2"
4222          shift
4223          shift
4224
4225          srcname="$realname"
4226          test -n "$relink_command" && srcname="$realname"T
4227
4228          # Install the shared library and build the symlinks.
4229          $show "$install_prog $dir/$srcname $destdir/$realname"
4230          $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
4231          if test -n "$stripme" && test -n "$striplib"; then
4232            $show "$striplib $destdir/$realname"
4233            $run eval "$striplib $destdir/$realname" || exit $?
4234          fi
4235
4236          if test "$#" -gt 0; then
4237            # Delete the old symlinks, and create new ones.
4238            for linkname
4239            do
4240              if test "$linkname" != "$realname"; then
4241                $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4242                $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4243              fi
4244            done
4245          fi
4246
4247          # Do each command in the postinstall commands.
4248          lib="$destdir/$realname"
4249          eval cmds=\"$postinstall_cmds\"
4250          save_ifs="$IFS"; IFS='~'
4251          for cmd in $cmds; do
4252            IFS="$save_ifs"
4253            $show "$cmd"
4254            $run eval "$cmd" || exit $?
4255          done
4256          IFS="$save_ifs"
4257        fi
4258
4259        # Install the pseudo-library for information purposes.
4260        name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4261        instname="$dir/$name"i
4262        $show "$install_prog $instname $destdir/$name"
4263        $run eval "$install_prog $instname $destdir/$name" || exit $?
4264
4265        # Maybe install the static library, too.
4266        test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
4267        ;;
4268
4269      *.lo)
4270        # Install (i.e. copy) a libtool object.
4271
4272        # Figure out destination file name, if it wasn't already specified.
4273        if test -n "$destname"; then
4274          destfile="$destdir/$destname"
4275        else
4276          destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4277          destfile="$destdir/$destfile"
4278        fi
4279
4280        # Deduce the name of the destination old-style object file.
4281        case $destfile in
4282        *.lo)
4283          staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4284          ;;
4285        *.$objext)
4286          staticdest="$destfile"
4287          destfile=
4288          ;;
4289        *)
4290          $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4291          $echo "$help" 1>&2
4292          exit 1
4293          ;;
4294        esac
4295
4296        # Install the libtool object if requested.
4297        if test -n "$destfile"; then
4298          $show "$install_prog $file $destfile"
4299          $run eval "$install_prog $file $destfile" || exit $?
4300        fi
4301
4302        # Install the old object if enabled.
4303        if test "$build_old_libs" = yes; then
4304          # Deduce the name of the old-style object file.
4305          staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
4306
4307          $show "$install_prog $staticobj $staticdest"
4308          $run eval "$install_prog \$staticobj \$staticdest" || exit $?
4309        fi
4310        exit 0
4311        ;;
4312
4313      *)
4314        # Figure out destination file name, if it wasn't already specified.
4315        if test -n "$destname"; then
4316          destfile="$destdir/$destname"
4317        else
4318          destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4319          destfile="$destdir/$destfile"
4320        fi
4321
4322        # Do a test to see if this is really a libtool program.
4323        if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4324          notinst_deplibs=
4325          relink_command=
4326
4327          # If there is no directory component, then add one.
4328          case $file in
4329          */* | *\\*) . $file ;;
4330          *) . ./$file ;;
4331          esac
4332
4333          # Check the variables that should have been set.
4334          if test -z "$notinst_deplibs"; then
4335            $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
4336            exit 1
4337          fi
4338
4339          finalize=yes
4340          for lib in $notinst_deplibs; do
4341            # Check to see that each library is installed.
4342            libdir=
4343            if test -f "$lib"; then
4344              # If there is no directory component, then add one.
4345              case $lib in
4346              */* | *\\*) . $lib ;;
4347              *) . ./$lib ;;
4348              esac
4349            fi
4350            libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4351            if test -n "$libdir" && test ! -f "$libfile"; then
4352              $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4353              finalize=no
4354            fi
4355          done
4356
4357          relink_command=
4358          # If there is no directory component, then add one.
4359          case $file in
4360          */* | *\\*) . $file ;;
4361          *) . ./$file ;;
4362          esac
4363
4364          outputname=
4365          if test "$fast_install" = no && test -n "$relink_command"; then
4366            if test "$finalize" = yes && test -z "$run"; then
4367              tmpdir="/tmp"
4368              test -n "$TMPDIR" && tmpdir="$TMPDIR"
4369              tmpdir=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null`
4370              if test $? = 0 ; then :
4371              else
4372                tmpdir="$tmpdir/libtool-$$"
4373              fi
4374              if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4375              else
4376                $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4377                continue
4378              fi
4379              file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4380              outputname="$tmpdir/$file"
4381              # Replace the output file specification.
4382              relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4383
4384              $show "$relink_command"
4385              if $run eval "$relink_command"; then :
4386              else
4387                $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4388                ${rm}r "$tmpdir"
4389                continue
4390              fi
4391              file="$outputname"
4392            else
4393              $echo "$modename: warning: cannot relink \`$file'" 1>&2
4394            fi
4395          else
4396            # Install the binary that we compiled earlier.
4397            file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4398          fi
4399        fi
4400
4401        # remove .exe since cygwin /usr/bin/install will append another
4402        # one anyways
4403        case $install_prog,$host in
4404        /usr/bin/install*,*cygwin*)
4405          case $file:$destfile in
4406          *.exe:*.exe)
4407            # this is ok
4408            ;;
4409          *.exe:*)
4410            destfile=$destfile.exe
4411            ;;
4412          *:*.exe)
4413            destfile=`echo $destfile | sed -e 's,.exe$,,'`
4414            ;;
4415          esac
4416          ;;
4417        esac
4418        $show "$install_prog$stripme $file $destfile"
4419        $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
4420        test -n "$outputname" && ${rm}r "$tmpdir"
4421        ;;
4422      esac
4423    done
4424
4425    for file in $staticlibs; do
4426      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4427
4428      # Set up the ranlib parameters.
4429      oldlib="$destdir/$name"
4430
4431      $show "$install_prog $file $oldlib"
4432      $run eval "$install_prog \$file \$oldlib" || exit $?
4433
4434      if test -n "$stripme" && test -n "$striplib"; then
4435        $show "$old_striplib $oldlib"
4436        $run eval "$old_striplib $oldlib" || exit $?
4437      fi
4438
4439      # Do each command in the postinstall commands.
4440      eval cmds=\"$old_postinstall_cmds\"
4441      save_ifs="$IFS"; IFS='~'
4442      for cmd in $cmds; do
4443        IFS="$save_ifs"
4444        $show "$cmd"
4445        $run eval "$cmd" || exit $?
4446      done
4447      IFS="$save_ifs"
4448    done
4449
4450    if test -n "$future_libdirs"; then
4451      $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4452    fi
4453
4454    if test -n "$current_libdirs"; then
4455      # Maybe just do a dry run.
4456      test -n "$run" && current_libdirs=" -n$current_libdirs"
4457      exec_cmd='$SHELL $0 --finish$current_libdirs'
4458    else
4459      exit 0
4460    fi
4461    ;;
4462
4463  # libtool finish mode
4464  finish)
4465    modename="$modename: finish"
4466    libdirs="$nonopt"
4467    admincmds=
4468
4469    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4470      for dir
4471      do
4472        libdirs="$libdirs $dir"
4473      done
4474
4475      for libdir in $libdirs; do
4476        if test -n "$finish_cmds"; then
4477          # Do each command in the finish commands.
4478          eval cmds=\"$finish_cmds\"
4479          save_ifs="$IFS"; IFS='~'
4480          for cmd in $cmds; do
4481            IFS="$save_ifs"
4482            $show "$cmd"
4483            $run eval "$cmd" || admincmds="$admincmds
4484       $cmd"
4485          done
4486          IFS="$save_ifs"
4487        fi
4488        if test -n "$finish_eval"; then
4489          # Do the single finish_eval.
4490          eval cmds=\"$finish_eval\"
4491          $run eval "$cmds" || admincmds="$admincmds
4492       $cmds"
4493        fi
4494      done
4495    fi
4496
4497    # Exit here if they wanted silent mode.
4498    test "$show" = : && exit 0
4499
4500    echo "----------------------------------------------------------------------"
4501    echo "Libraries have been installed in:"
4502    for libdir in $libdirs; do
4503      echo "   $libdir"
4504    done
4505    echo
4506    echo "If you ever happen to want to link against installed libraries"
4507    echo "in a given directory, LIBDIR, you must either use libtool, and"
4508    echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4509    echo "flag during linking and do at least one of the following:"
4510    if test -n "$shlibpath_var"; then
4511      echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
4512      echo "     during execution"
4513    fi
4514    if test -n "$runpath_var"; then
4515      echo "   - add LIBDIR to the \`$runpath_var' environment variable"
4516      echo "     during linking"
4517    fi
4518    if test -n "$hardcode_libdir_flag_spec"; then
4519      libdir=LIBDIR
4520      eval flag=\"$hardcode_libdir_flag_spec\"
4521
4522      echo "   - use the \`$flag' linker flag"
4523    fi
4524    if test -n "$admincmds"; then
4525      echo "   - have your system administrator run these commands:$admincmds"
4526    fi
4527    if test -f /etc/ld.so.conf; then
4528      echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4529    fi
4530    echo
4531    echo "See any operating system documentation about shared libraries for"
4532    echo "more information, such as the ld(1) and ld.so(8) manual pages."
4533    echo "----------------------------------------------------------------------"
4534    exit 0
4535    ;;
4536
4537  # libtool execute mode
4538  execute)
4539    modename="$modename: execute"
4540
4541    # The first argument is the command name.
4542    cmd="$nonopt"
4543    if test -z "$cmd"; then
4544      $echo "$modename: you must specify a COMMAND" 1>&2
4545      $echo "$help"
4546      exit 1
4547    fi
4548
4549    # Handle -dlopen flags immediately.
4550    for file in $execute_dlfiles; do
4551      if test ! -f "$file"; then
4552        $echo "$modename: \`$file' is not a file" 1>&2
4553        $echo "$help" 1>&2
4554        exit 1
4555      fi
4556
4557      dir=
4558      case $file in
4559      *.la)
4560        # Check to see that this really is a libtool archive.
4561        if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4562        else
4563          $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4564          $echo "$help" 1>&2
4565          exit 1
4566        fi
4567
4568        # Read the libtool library.
4569        dlname=
4570        library_names=
4571
4572        # If there is no directory component, then add one.
4573        case $file in
4574        */* | *\\*) . $file ;;
4575        *) . ./$file ;;
4576        esac
4577
4578        # Skip this library if it cannot be dlopened.
4579        if test -z "$dlname"; then
4580          # Warn if it was a shared library.
4581          test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
4582          continue
4583        fi
4584
4585        dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4586        test "X$dir" = "X$file" && dir=.
4587
4588        if test -f "$dir/$objdir/$dlname"; then
4589          dir="$dir/$objdir"
4590        else
4591          $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
4592          exit 1
4593        fi
4594        ;;
4595
4596      *.lo)
4597        # Just add the directory containing the .lo file.
4598        dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4599        test "X$dir" = "X$file" && dir=.
4600        ;;
4601
4602      *)
4603        $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
4604        continue
4605        ;;
4606      esac
4607
4608      # Get the absolute pathname.
4609      absdir=`cd "$dir" && pwd`
4610      test -n "$absdir" && dir="$absdir"
4611
4612      # Now add the directory to shlibpath_var.
4613      if eval "test -z \"\$$shlibpath_var\""; then
4614        eval "$shlibpath_var=\"\$dir\""
4615      else
4616        eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4617      fi
4618    done
4619
4620    # This variable tells wrapper scripts just to set shlibpath_var
4621    # rather than running their programs.
4622    libtool_execute_magic="$magic"
4623
4624    # Check if any of the arguments is a wrapper script.
4625    args=
4626    for file
4627    do
4628      case $file in
4629      -*) ;;
4630      *)
4631        # Do a test to see if this is really a libtool program.
4632        if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4633          # If there is no directory component, then add one.
4634          case $file in
4635          */* | *\\*) . $file ;;
4636          *) . ./$file ;;
4637          esac
4638
4639          # Transform arg to wrapped name.
4640          file="$progdir/$program"
4641        fi
4642        ;;
4643      esac
4644      # Quote arguments (to preserve shell metacharacters).
4645      file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
4646      args="$args \"$file\""
4647    done
4648
4649    if test -z "$run"; then
4650      if test -n "$shlibpath_var"; then
4651        # Export the shlibpath_var.
4652        eval "export $shlibpath_var"
4653      fi
4654
4655      # Restore saved enviroment variables
4656      if test "${save_LC_ALL+set}" = set; then
4657        LC_ALL="$save_LC_ALL"; export LC_ALL
4658      fi
4659      if test "${save_LANG+set}" = set; then
4660        LANG="$save_LANG"; export LANG
4661      fi
4662
4663      # Now prepare to actually exec the command.
4664      exec_cmd="\$cmd$args"
4665    else
4666      # Display what would be done.
4667      if test -n "$shlibpath_var"; then
4668        eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
4669        $echo "export $shlibpath_var"
4670      fi
4671      $echo "$cmd$args"
4672      exit 0
4673    fi
4674    ;;
4675
4676  # libtool clean and uninstall mode
4677  clean | uninstall)
4678    modename="$modename: $mode"
4679    rm="$nonopt"
4680    files=
4681    rmforce=
4682    exit_status=0
4683
4684    # This variable tells wrapper scripts just to set variables rather
4685    # than running their programs.
4686    libtool_install_magic="$magic"
4687
4688    for arg
4689    do
4690      case $arg in
4691      -f) rm="$rm $arg"; rmforce=yes ;;
4692      -*) rm="$rm $arg" ;;
4693      *) files="$files $arg" ;;
4694      esac
4695    done
4696
4697    if test -z "$rm"; then
4698      $echo "$modename: you must specify an RM program" 1>&2
4699      $echo "$help" 1>&2
4700      exit 1
4701    fi
4702
4703    rmdirs=
4704
4705    for file in $files; do
4706      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4707      if test "X$dir" = "X$file"; then
4708        dir=.
4709        objdir="$objdir"
4710      else
4711        objdir="$dir/$objdir"
4712      fi
4713      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4714      test "$mode" = uninstall && objdir="$dir"
4715
4716      # Remember objdir for removal later, being careful to avoid duplicates
4717      if test "$mode" = clean; then
4718        case " $rmdirs " in
4719          *" $objdir "*) ;;
4720          *) rmdirs="$rmdirs $objdir" ;;
4721        esac
4722      fi
4723
4724      # Don't error if the file doesn't exist and rm -f was used.
4725      if (test -L "$file") >/dev/null 2>&1 \
4726        || (test -h "$file") >/dev/null 2>&1 \
4727        || test -f "$file"; then
4728        :
4729      elif test -d "$file"; then
4730        exit_status=1
4731        continue
4732      elif test "$rmforce" = yes; then
4733        continue
4734      fi
4735
4736      rmfiles="$file"
4737
4738      case $name in
4739      *.la)
4740        # Possibly a libtool archive, so verify it.
4741        if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4742          . $dir/$name
4743
4744          # Delete the libtool libraries and symlinks.
4745          for n in $library_names; do
4746            rmfiles="$rmfiles $objdir/$n"
4747          done
4748          test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
4749          test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
4750
4751          if test "$mode" = uninstall; then
4752            if test -n "$library_names"; then
4753              # Do each command in the postuninstall commands.
4754              eval cmds=\"$postuninstall_cmds\"
4755              save_ifs="$IFS"; IFS='~'
4756              for cmd in $cmds; do
4757                IFS="$save_ifs"
4758                $show "$cmd"
4759                $run eval "$cmd"
4760                if test "$?" -ne 0 && test "$rmforce" != yes; then
4761                  exit_status=1
4762                fi
4763              done
4764              IFS="$save_ifs"
4765            fi
4766
4767            if test -n "$old_library"; then
4768              # Do each command in the old_postuninstall commands.
4769              eval cmds=\"$old_postuninstall_cmds\"
4770              save_ifs="$IFS"; IFS='~'
4771              for cmd in $cmds; do
4772                IFS="$save_ifs"
4773                $show "$cmd"
4774                $run eval "$cmd"
4775                if test "$?" -ne 0 && test "$rmforce" != yes; then
4776                  exit_status=1
4777                fi
4778              done
4779              IFS="$save_ifs"
4780            fi
4781            # FIXME: should reinstall the best remaining shared library.
4782          fi
4783        fi
4784        ;;
4785
4786      *.lo)
4787        if test "$build_old_libs" = yes; then
4788          oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
4789          rmfiles="$rmfiles $dir/$oldobj"
4790        fi
4791        ;;
4792
4793      *)
4794        # Do a test to see if this is a libtool program.
4795        if test "$mode" = clean &&
4796           (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4797          relink_command=
4798          . $dir/$file
4799
4800          rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
4801          if test "$fast_install" = yes && test -n "$relink_command"; then
4802            rmfiles="$rmfiles $objdir/lt-$name"
4803          fi
4804        fi
4805        ;;
4806      esac
4807      $show "$rm $rmfiles"
4808      $run $rm $rmfiles || exit_status=1
4809    done
4810
4811    # Try to remove the ${objdir}s in the directories where we deleted files
4812    for dir in $rmdirs; do
4813      if test -d "$dir"; then
4814        $show "rmdir $dir"
4815        $run rmdir $dir >/dev/null 2>&1
4816      fi
4817    done
4818
4819    exit $exit_status
4820    ;;
4821
4822  "")
4823    $echo "$modename: you must specify a MODE" 1>&2
4824    $echo "$generic_help" 1>&2
4825    exit 1
4826    ;;
4827  esac
4828
4829  if test -z "$exec_cmd"; then
4830    $echo "$modename: invalid operation mode \`$mode'" 1>&2
4831    $echo "$generic_help" 1>&2
4832    exit 1
4833  fi
4834fi # test -z "$show_help"
4835
4836if test -n "$exec_cmd"; then
4837  eval exec $exec_cmd
4838  exit 1
4839fi
4840
4841# We need to display help for each of the modes.
4842case $mode in
4843"") $echo \
4844"Usage: $modename [OPTION]... [MODE-ARG]...
4845
4846Provide generalized library-building support services.
4847
4848    --config          show all configuration variables
4849    --debug           enable verbose shell tracing
4850-n, --dry-run         display commands without modifying any files
4851    --features        display basic configuration information and exit
4852    --finish          same as \`--mode=finish'
4853    --help            display this help message and exit
4854    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
4855    --quiet           same as \`--silent'
4856    --silent          don't print informational messages
4857    --version         print version information
4858
4859MODE must be one of the following:
4860
4861      clean           remove files from the build directory
4862      compile         compile a source file into a libtool object
4863      execute         automatically set library path, then run a program
4864      finish          complete the installation of libtool libraries
4865      install         install libraries or executables
4866      link            create a library or an executable
4867      uninstall       remove libraries from an installed directory
4868
4869MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
4870a more detailed description of MODE."
4871  exit 0
4872  ;;
4873
4874clean)
4875  $echo \
4876"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
4877
4878Remove files from the build directory.
4879
4880RM is the name of the program to use to delete files associated with each FILE
4881(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
4882to RM.
4883
4884If FILE is a libtool library, object or program, all the files associated
4885with it are deleted. Otherwise, only FILE itself is deleted using RM."
4886  ;;
4887
4888compile)
4889  $echo \
4890"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
4891
4892Compile a source file into a libtool library object.
4893
4894This mode accepts the following additional options:
4895
4896  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
4897  -prefer-pic       try to building PIC objects only
4898  -prefer-non-pic   try to building non-PIC objects only
4899  -static           always build a \`.o' file suitable for static linking
4900
4901COMPILE-COMMAND is a command to be used in creating a \`standard' object file
4902from the given SOURCEFILE.
4903
4904The output file name is determined by removing the directory component from
4905SOURCEFILE, then substituting the C source code suffix \`.c' with the
4906library object suffix, \`.lo'."
4907  ;;
4908
4909execute)
4910  $echo \
4911"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
4912
4913Automatically set library path, then run a program.
4914
4915This mode accepts the following additional options:
4916
4917  -dlopen FILE      add the directory containing FILE to the library path
4918
4919This mode sets the library path environment variable according to \`-dlopen'
4920flags.
4921
4922If any of the ARGS are libtool executable wrappers, then they are translated
4923into their corresponding uninstalled binary, and any of their required library
4924directories are added to the library path.
4925
4926Then, COMMAND is executed, with ARGS as arguments."
4927  ;;
4928
4929finish)
4930  $echo \
4931"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
4932
4933Complete the installation of libtool libraries.
4934
4935Each LIBDIR is a directory that contains libtool libraries.
4936
4937The commands that this mode executes may require superuser privileges.  Use
4938the \`--dry-run' option if you just want to see what would be executed."
4939  ;;
4940
4941install)
4942  $echo \
4943"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
4944
4945Install executables or libraries.
4946
4947INSTALL-COMMAND is the installation command.  The first component should be
4948either the \`install' or \`cp' program.
4949
4950The rest of the components are interpreted as arguments to that command (only
4951BSD-compatible install options are recognized)."
4952  ;;
4953
4954link)
4955  $echo \
4956"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
4957
4958Link object files or libraries together to form another library, or to
4959create an executable program.
4960
4961LINK-COMMAND is a command using the C compiler that you would use to create
4962a program from several object files.
4963
4964The following components of LINK-COMMAND are treated specially:
4965
4966  -all-static       do not do any dynamic linking at all
4967  -avoid-version    do not add a version suffix if possible
4968  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
4969  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
4970  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
4971  -export-symbols SYMFILE
4972                    try to export only the symbols listed in SYMFILE
4973  -export-symbols-regex REGEX
4974                    try to export only the symbols matching REGEX
4975  -LLIBDIR          search LIBDIR for required installed libraries
4976  -lNAME            OUTPUT-FILE requires the installed library libNAME
4977  -module           build a library that can dlopened
4978  -no-fast-install  disable the fast-install mode
4979  -no-install       link a not-installable executable
4980  -no-undefined     declare that a library does not refer to external symbols
4981  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
4982  -release RELEASE  specify package release information
4983  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
4984  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
4985  -static           do not do any dynamic linking of libtool libraries
4986  -version-info CURRENT[:REVISION[:AGE]]
4987                    specify library version info [each variable defaults to 0]
4988
4989All other options (arguments beginning with \`-') are ignored.
4990
4991Every other argument is treated as a filename.  Files ending in \`.la' are
4992treated as uninstalled libtool libraries, other files are standard or library
4993object files.
4994
4995If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
4996only library objects (\`.lo' files) may be specified, and \`-rpath' is
4997required, except when creating a convenience library.
4998
4999If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
5000using \`ar' and \`ranlib', or on Windows using \`lib'.
5001
5002If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
5003is created, otherwise an executable program is created."
5004  ;;
5005
5006uninstall)
5007  $echo \
5008"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
5009
5010Remove libraries from an installation directory.
5011
5012RM is the name of the program to use to delete files associated with each FILE
5013(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
5014to RM.
5015
5016If FILE is a libtool library, all the files associated with it are deleted.
5017Otherwise, only FILE itself is deleted using RM."
5018  ;;
5019
5020*)
5021  $echo "$modename: invalid operation mode \`$mode'" 1>&2
5022  $echo "$help" 1>&2
5023  exit 1
5024  ;;
5025esac
5026
5027echo
5028$echo "Try \`$modename --help' for more information about other modes."
5029
5030exit 0
5031
5032# Local Variables:
5033# mode:shell-script
5034# sh-indentation:2
5035# End:
Note: See TracBrowser for help on using the repository browser.