source: trunk/third/librsvg/ltmain.sh @ 17277

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