"Fossies" - the Fresh Open Source Software Archive

Member "libmcrypt-2.5.8/libtool" (19 Feb 2007, 230192 Bytes) of package /linux/privat/old/libmcrypt-2.5.8.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

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