source: abuse/trunk/libtool @ 2

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