Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:14:58

0001 #! /bin/sh
0002 # Generated automatically by config.status (checkepdmap) 1.00
0003 # Libtool was configured on host sphnxuser01.sdcc.bnl.gov:
0004 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
0005 
0006 # Provide generalized library-building support services.
0007 # Written by Gordon Matzigkeit, 1996
0008 
0009 # Copyright (C) 2014 Free Software Foundation, Inc.
0010 # This is free software; see the source for copying conditions.  There is NO
0011 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
0012 
0013 # GNU Libtool is free software; you can redistribute it and/or modify
0014 # it under the terms of the GNU General Public License as published by
0015 # the Free Software Foundation; either version 2 of of the License, or
0016 # (at your option) any later version.
0017 #
0018 # As a special exception to the GNU General Public License, if you
0019 # distribute this file as part of a program or library that is built
0020 # using GNU Libtool, you may include this file under the  same
0021 # distribution terms that you use for the rest of that program.
0022 #
0023 # GNU Libtool is distributed in the hope that it will be useful, but
0024 # WITHOUT ANY WARRANTY; without even the implied warranty of
0025 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0026 # GNU General Public License for more details.
0027 #
0028 # You should have received a copy of the GNU General Public License
0029 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
0030 
0031 
0032 # The names of the tagged configurations supported by this script.
0033 available_tags='CXX '
0034 
0035 # Configured defaults for sys_lib_dlsearch_path munging.
0036 : ${LT_SYS_LIBRARY_PATH=""}
0037 
0038 # ### BEGIN LIBTOOL CONFIG
0039 
0040 # Which release of libtool.m4 was used?
0041 macro_version=2.4.6
0042 macro_revision=2.4.6
0043 
0044 # Whether or not to build static libraries.
0045 build_old_libs=no
0046 
0047 # Whether or not to build shared libraries.
0048 build_libtool_libs=yes
0049 
0050 # What type of objects to build.
0051 pic_mode=default
0052 
0053 # Whether or not to optimize for fast installation.
0054 fast_install=needless
0055 
0056 # Shared archive member basename,for filename based shared library versioning on AIX.
0057 shared_archive_member_spec=
0058 
0059 # Shell to use when invoking shell scripts.
0060 SHELL="/bin/sh"
0061 
0062 # An echo program that protects backslashes.
0063 ECHO="printf %s\\n"
0064 
0065 # The PATH separator for the build system.
0066 PATH_SEPARATOR=":"
0067 
0068 # The host system.
0069 host_alias=
0070 host=x86_64-pc-linux-gnu
0071 host_os=linux-gnu
0072 
0073 # The build system.
0074 build_alias=
0075 build=x86_64-pc-linux-gnu
0076 build_os=linux-gnu
0077 
0078 # A sed program that does not truncate output.
0079 SED="/usr/bin/sed"
0080 
0081 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
0082 Xsed="$SED -e 1s/^X//"
0083 
0084 # A grep program that handles long lines.
0085 GREP="/usr/bin/grep"
0086 
0087 # An ERE matcher.
0088 EGREP="/usr/bin/grep -E"
0089 
0090 # A literal string matcher.
0091 FGREP="/usr/bin/grep -F"
0092 
0093 # A BSD- or MS-compatible name lister.
0094 NM="/cvmfs/sphenix.sdcc.bnl.gov/alma9.2-gcc-14.2.0/opt/sphenix/core/binutils/2.40-acaab/x86_64-el9/bin/nm -B"
0095 
0096 # Whether we need soft or hard links.
0097 LN_S="ln -s"
0098 
0099 # What is the maximum length of a command?
0100 max_cmd_len=1572864
0101 
0102 # Object file suffix (normally "o").
0103 objext=o
0104 
0105 # Executable file suffix (normally "").
0106 exeext=
0107 
0108 # whether the shell understands "unset".
0109 lt_unset=unset
0110 
0111 # turn spaces into newlines.
0112 SP2NL="tr \\040 \\012"
0113 
0114 # turn newlines into spaces.
0115 NL2SP="tr \\015\\012 \\040\\040"
0116 
0117 # convert $build file names to $host format.
0118 to_host_file_cmd=func_convert_file_noop
0119 
0120 # convert $build files to toolchain format.
0121 to_tool_file_cmd=func_convert_file_noop
0122 
0123 # An object symbol dumper.
0124 OBJDUMP="objdump"
0125 
0126 # Method to check whether dependent libraries are shared objects.
0127 deplibs_check_method="pass_all"
0128 
0129 # Command to use when deplibs_check_method = "file_magic".
0130 file_magic_cmd="\$MAGIC_CMD"
0131 
0132 # How to find potential files when deplibs_check_method = "file_magic".
0133 file_magic_glob=""
0134 
0135 # Find potential files using nocaseglob when deplibs_check_method = "file_magic".
0136 want_nocaseglob="no"
0137 
0138 # DLL creation program.
0139 DLLTOOL="false"
0140 
0141 # Command to associate shared and link libraries.
0142 sharedlib_from_linklib_cmd="printf %s\\n"
0143 
0144 # The archiver.
0145 AR="ar"
0146 
0147 # Flags to create an archive.
0148 AR_FLAGS="cru"
0149 
0150 # How to feed a file listing to the archiver.
0151 archiver_list_spec="@"
0152 
0153 # A symbol stripping program.
0154 STRIP="strip"
0155 
0156 # Commands used to install an old-style archive.
0157 RANLIB="ranlib"
0158 old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$tool_oldlib"
0159 old_postuninstall_cmds=""
0160 
0161 # Whether to use a lock for old archive extraction.
0162 lock_old_archive_extraction=no
0163 
0164 # A C compiler.
0165 LTCC="/cvmfs/sphenix.sdcc.bnl.gov/alma9.2-gcc-14.2.0/opt/sphenix/core/gcc/14.2.0-2f0a0/x86_64-el9/bin/gcc"
0166 
0167 # LTCC compiler flags.
0168 LTCFLAGS="-g -O2"
0169 
0170 # Take the output of nm and produce a listing of raw symbols and C names.
0171 global_symbol_pipe="sed -n -e 's/^.*[    ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[       ][      ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p' | sed '/ __gnu_lto/d'"
0172 
0173 # Transform the output of nm in a proper C declaration.
0174 global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'"
0175 
0176 # Transform the output of nm into a list of symbols to manually relocate.
0177 global_symbol_to_import=""
0178 
0179 # Transform the output of nm in a C name address pair.
0180 global_symbol_to_c_name_address="sed -n -e 's/^: \\(.*\\) .*\$/  {\"\\1\", (void *) 0},/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(.*\\)\$/  {\"\\1\", (void *) \\&\\1},/p'"
0181 
0182 # Transform the output of nm in a C name address pair when lib prefix is needed.
0183 global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\(.*\\) .*\$/  {\"\\1\", (void *) 0},/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(lib.*\\)\$/  {\"\\1\", (void *) \\&\\1},/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(.*\\)\$/  {\"lib\\1\", (void *) \\&\\1},/p'"
0184 
0185 # The name lister interface.
0186 nm_interface="BSD nm"
0187 
0188 # Specify filename containing input files for $NM.
0189 nm_file_list_spec="@"
0190 
0191 # The root where to search for dependent libraries,and where our libraries should be installed.
0192 lt_sysroot=
0193 
0194 # Command to truncate a binary pipe.
0195 lt_truncate_bin="/usr/bin/dd bs=4096 count=1"
0196 
0197 # The name of the directory that contains temporary libtool files.
0198 objdir=.libs
0199 
0200 # Used to examine libraries when file_magic_cmd begins with "file".
0201 MAGIC_CMD=file
0202 
0203 # Must we lock files when doing compilation?
0204 need_locks="no"
0205 
0206 # Manifest tool.
0207 MANIFEST_TOOL=":"
0208 
0209 # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
0210 DSYMUTIL=""
0211 
0212 # Tool to change global to local symbols on Mac OS X.
0213 NMEDIT=""
0214 
0215 # Tool to manipulate fat objects and archives on Mac OS X.
0216 LIPO=""
0217 
0218 # ldd/readelf like tool for Mach-O binaries on Mac OS X.
0219 OTOOL=""
0220 
0221 # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
0222 OTOOL64=""
0223 
0224 # Old archive suffix (normally "a").
0225 libext=a
0226 
0227 # Shared library suffix (normally ".so").
0228 shrext_cmds=".so"
0229 
0230 # The commands to extract the exported symbol list from a shared archive.
0231 extract_expsyms_cmds=""
0232 
0233 # Variables whose values should be saved in libtool wrapper scripts and
0234 # restored at link time.
0235 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
0236 
0237 # Do we need the "lib" prefix for modules?
0238 need_lib_prefix=no
0239 
0240 # Do we need a version for libraries?
0241 need_version=no
0242 
0243 # Library versioning type.
0244 version_type=linux
0245 
0246 # Shared library runtime path variable.
0247 runpath_var=LD_RUN_PATH
0248 
0249 # Shared library path variable.
0250 shlibpath_var=LD_LIBRARY_PATH
0251 
0252 # Is shlibpath searched before the hard-coded library search path?
0253 shlibpath_overrides_runpath=yes
0254 
0255 # Format of library name prefix.
0256 libname_spec="lib\$name"
0257 
0258 # List of archive names.  First name is the real one, the rest are links.
0259 # The last name is the one that the linker finds with -lNAME
0260 library_names_spec="\$libname\$release\$shared_ext\$versuffix \$libname\$release\$shared_ext\$major \$libname\$shared_ext"
0261 
0262 # The coded name of the library, if different from the real name.
0263 soname_spec="\$libname\$release\$shared_ext\$major"
0264 
0265 # Permission mode override for installation of shared libraries.
0266 install_override_mode=""
0267 
0268 # Command to use after installation of a shared archive.
0269 postinstall_cmds=""
0270 
0271 # Command to use after uninstallation of a shared archive.
0272 postuninstall_cmds=""
0273 
0274 # Commands used to finish a libtool library installation in a directory.
0275 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
0276 
0277 # As "finish_cmds", except a single script fragment to be evaled but
0278 # not shown.
0279 finish_eval=""
0280 
0281 # Whether we should hardcode library paths into libraries.
0282 hardcode_into_libs=yes
0283 
0284 # Compile-time system search path for libraries.
0285 sys_lib_search_path_spec="/cvmfs/sphenix.sdcc.bnl.gov/alma9.2-gcc-14.2.0/opt/sphenix/core/gcc/14.2.0-2f0a0/x86_64-el9/lib/gcc/x86_64-pc-linux-gnu/14.2.0 /cvmfs/sphenix.sdcc.bnl.gov/alma9.2-gcc-14.2.0/opt/sphenix/core/gcc/14.2.0-2f0a0/x86_64-el9/lib/gcc /cvmfs/sphenix.sdcc.bnl.gov/alma9.2-gcc-14.2.0/opt/sphenix/core/gcc/14.2.0-2f0a0/x86_64-el9/lib64 /lib64 /usr/lib64 /cvmfs/sphenix.sdcc.bnl.gov/alma9.2-gcc-14.2.0/opt/sphenix/core/gcc/14.2.0-2f0a0/x86_64-el9/lib /lib /usr/lib "
0286 
0287 # Detected run-time system search path for libraries.
0288 sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib /usr/lib64/pipewire-0.3/jack/ "
0289 
0290 # Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
0291 configure_time_lt_sys_library_path=""
0292 
0293 # Whether dlopen is supported.
0294 dlopen_support=unknown
0295 
0296 # Whether dlopen of programs is supported.
0297 dlopen_self=unknown
0298 
0299 # Whether dlopen of statically linked programs is supported.
0300 dlopen_self_static=unknown
0301 
0302 # Commands to strip libraries.
0303 old_striplib="strip --strip-debug"
0304 striplib="strip --strip-unneeded"
0305 
0306 
0307 # The linker used to build libraries.
0308 LD="/cvmfs/sphenix.sdcc.bnl.gov/alma9.2-gcc-14.2.0/opt/sphenix/core/binutils/2.40-acaab/x86_64-el9/bin/ld -m elf_x86_64"
0309 
0310 # How to create reloadable object files.
0311 reload_flag=" -r"
0312 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
0313 
0314 # Commands used to build an old-style archive.
0315 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
0316 
0317 # A language specific compiler.
0318 CC="/cvmfs/sphenix.sdcc.bnl.gov/alma9.2-gcc-14.2.0/opt/sphenix/core/gcc/14.2.0-2f0a0/x86_64-el9/bin/gcc"
0319 
0320 # Is the compiler the GNU compiler?
0321 with_gcc=yes
0322 
0323 # Compiler flag to turn off builtin functions.
0324 no_builtin_flag=" -fno-builtin"
0325 
0326 # Additional compiler flags for building library objects.
0327 pic_flag=" -fPIC -DPIC"
0328 
0329 # How to pass a linker flag through the compiler.
0330 wl="-Wl,"
0331 
0332 # Compiler flag to prevent dynamic linking.
0333 link_static_flag=""
0334 
0335 # Does compiler simultaneously support -c and -o options?
0336 compiler_c_o="yes"
0337 
0338 # Whether or not to add -lc for building shared libraries.
0339 build_libtool_need_lc=no
0340 
0341 # Whether or not to disallow shared libs when runtime libs are static.
0342 allow_libtool_libs_with_static_runtimes=no
0343 
0344 # Compiler flag to allow reflexive dlopens.
0345 export_dynamic_flag_spec="\$wl--export-dynamic"
0346 
0347 # Compiler flag to generate shared objects directly from archives.
0348 whole_archive_flag_spec="\$wl--whole-archive\$convenience \$wl--no-whole-archive"
0349 
0350 # Whether the compiler copes with passing no objects directly.
0351 compiler_needs_object="no"
0352 
0353 # Create an old-style archive from a shared archive.
0354 old_archive_from_new_cmds=""
0355 
0356 # Create a temporary old-style archive to link instead of a shared archive.
0357 old_archive_from_expsyms_cmds=""
0358 
0359 # Commands used to build a shared archive.
0360 archive_cmds="\$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \$wl-soname \$wl\$soname -o \$lib"
0361 archive_expsym_cmds="echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
0362             cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
0363             echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
0364             \$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \$wl-soname \$wl\$soname \$wl-version-script \$wl\$output_objdir/\$libname.ver -o \$lib"
0365 
0366 # Commands used to build a loadable module if different from building
0367 # a shared archive.
0368 module_cmds=""
0369 module_expsym_cmds=""
0370 
0371 # Whether we are building with GNU ld or not.
0372 with_gnu_ld="yes"
0373 
0374 # Flag that allows shared libraries with undefined symbols to be built.
0375 allow_undefined_flag=""
0376 
0377 # Flag that enforces no undefined symbols.
0378 no_undefined_flag=""
0379 
0380 # Flag to hardcode $libdir into a binary during linking.
0381 # This must work even if $libdir does not exist
0382 hardcode_libdir_flag_spec="\$wl-rpath \$wl\$libdir"
0383 
0384 # Whether we need a single "-rpath" flag with a separated argument.
0385 hardcode_libdir_separator=""
0386 
0387 # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
0388 # DIR into the resulting binary.
0389 hardcode_direct=no
0390 
0391 # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
0392 # DIR into the resulting binary and the resulting library dependency is
0393 # "absolute",i.e impossible to change by setting $shlibpath_var if the
0394 # library is relocated.
0395 hardcode_direct_absolute=no
0396 
0397 # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
0398 # into the resulting binary.
0399 hardcode_minus_L=no
0400 
0401 # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
0402 # into the resulting binary.
0403 hardcode_shlibpath_var=unsupported
0404 
0405 # Set to "yes" if building a shared library automatically hardcodes DIR
0406 # into the library and all subsequent libraries and executables linked
0407 # against it.
0408 hardcode_automatic=no
0409 
0410 # Set to yes if linker adds runtime paths of dependent libraries
0411 # to runtime path list.
0412 inherit_rpath=no
0413 
0414 # Whether libtool must link a program against all its dependency libraries.
0415 link_all_deplibs=unknown
0416 
0417 # Set to "yes" if exported symbols are required.
0418 always_export_symbols=no
0419 
0420 # The commands to list exported symbols.
0421 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
0422 
0423 # Symbols that should not be listed in the preloaded symbols.
0424 exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
0425 
0426 # Symbols that must always be exported.
0427 include_expsyms=""
0428 
0429 # Commands necessary for linking programs (against libraries) with templates.
0430 prelink_cmds=""
0431 
0432 # Commands necessary for finishing linking programs.
0433 postlink_cmds=""
0434 
0435 # Specify filename containing input files.
0436 file_list_spec=""
0437 
0438 # How to hardcode a shared library path into an executable.
0439 hardcode_action=immediate
0440 
0441 # The directories searched by this compiler when creating a shared library.
0442 compiler_lib_search_dirs=""
0443 
0444 # Dependencies to place before and after the objects being linked to
0445 # create a shared library.
0446 predep_objects=""
0447 postdep_objects=""
0448 predeps=""
0449 postdeps=""
0450 
0451 # The library search path used internally by the compiler when linking
0452 # a shared library.
0453 compiler_lib_search_path=""
0454 
0455 # ### END LIBTOOL CONFIG
0456 
0457 
0458 # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
0459 
0460 # func_munge_path_list VARIABLE PATH
0461 # -----------------------------------
0462 # VARIABLE is name of variable containing _space_ separated list of
0463 # directories to be munged by the contents of PATH, which is string
0464 # having a format:
0465 # "DIR[:DIR]:"
0466 #       string "DIR[ DIR]" will be prepended to VARIABLE
0467 # ":DIR[:DIR]"
0468 #       string "DIR[ DIR]" will be appended to VARIABLE
0469 # "DIRP[:DIRP]::[DIRA:]DIRA"
0470 #       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
0471 #       "DIRA[ DIRA]" will be appended to VARIABLE
0472 # "DIR[:DIR]"
0473 #       VARIABLE will be replaced by "DIR[ DIR]"
0474 func_munge_path_list ()
0475 {
0476     case x$2 in
0477     x)
0478         ;;
0479     *:)
0480         eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
0481         ;;
0482     x:*)
0483         eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
0484         ;;
0485     *::*)
0486         eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
0487         eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
0488         ;;
0489     *)
0490         eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
0491         ;;
0492     esac
0493 }
0494 
0495 
0496 # Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
0497 func_cc_basename ()
0498 {
0499     for cc_temp in $*""; do
0500       case $cc_temp in
0501         compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
0502         distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
0503         \-*) ;;
0504         *) break;;
0505       esac
0506     done
0507     func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
0508 }
0509 
0510 
0511 # ### END FUNCTIONS SHARED WITH CONFIGURE
0512 
0513 #! /bin/sh
0514 ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
0515 ##               by inline-source v2014-01-03.01
0516 
0517 # libtool (GNU libtool) 2.4.6
0518 # Provide generalized library-building support services.
0519 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
0520 
0521 # Copyright (C) 1996-2015 Free Software Foundation, Inc.
0522 # This is free software; see the source for copying conditions.  There is NO
0523 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
0524 
0525 # GNU Libtool is free software; you can redistribute it and/or modify
0526 # it under the terms of the GNU General Public License as published by
0527 # the Free Software Foundation; either version 2 of the License, or
0528 # (at your option) any later version.
0529 #
0530 # As a special exception to the GNU General Public License,
0531 # if you distribute this file as part of a program or library that
0532 # is built using GNU Libtool, you may include this file under the
0533 # same distribution terms that you use for the rest of that program.
0534 #
0535 # GNU Libtool is distributed in the hope that it will be useful, but
0536 # WITHOUT ANY WARRANTY; without even the implied warranty of
0537 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0538 # General Public License for more details.
0539 #
0540 # You should have received a copy of the GNU General Public License
0541 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
0542 
0543 
0544 PROGRAM=libtool
0545 PACKAGE=libtool
0546 VERSION=2.4.6
0547 package_revision=2.4.6
0548 
0549 
0550 ## ------ ##
0551 ## Usage. ##
0552 ## ------ ##
0553 
0554 # Run './libtool --help' for help with using this script from the
0555 # command line.
0556 
0557 
0558 ## ------------------------------- ##
0559 ## User overridable command paths. ##
0560 ## ------------------------------- ##
0561 
0562 # After configure completes, it has a better idea of some of the
0563 # shell tools we need than the defaults used by the functions shared
0564 # with bootstrap, so set those here where they can still be over-
0565 # ridden by the user, but otherwise take precedence.
0566 
0567 : ${AUTOCONF="autoconf"}
0568 : ${AUTOMAKE="automake"}
0569 
0570 
0571 ## -------------------------- ##
0572 ## Source external libraries. ##
0573 ## -------------------------- ##
0574 
0575 # Much of our low-level functionality needs to be sourced from external
0576 # libraries, which are installed to $pkgauxdir.
0577 
0578 # Set a version string for this script.
0579 scriptversion=2015-01-20.17; # UTC
0580 
0581 # General shell script boiler plate, and helper functions.
0582 # Written by Gary V. Vaughan, 2004
0583 
0584 # Copyright (C) 2004-2015 Free Software Foundation, Inc.
0585 # This is free software; see the source for copying conditions.  There is NO
0586 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
0587 
0588 # This program is free software; you can redistribute it and/or modify
0589 # it under the terms of the GNU General Public License as published by
0590 # the Free Software Foundation; either version 3 of the License, or
0591 # (at your option) any later version.
0592 
0593 # As a special exception to the GNU General Public License, if you distribute
0594 # this file as part of a program or library that is built using GNU Libtool,
0595 # you may include this file under the same distribution terms that you use
0596 # for the rest of that program.
0597 
0598 # This program is distributed in the hope that it will be useful,
0599 # but WITHOUT ANY WARRANTY; without even the implied warranty of
0600 # MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
0601 # General Public License for more details.
0602 
0603 # You should have received a copy of the GNU General Public License
0604 # along with this program. If not, see <http://www.gnu.org/licenses/>.
0605 
0606 # Please report bugs or propose patches to gary@gnu.org.
0607 
0608 
0609 ## ------ ##
0610 ## Usage. ##
0611 ## ------ ##
0612 
0613 # Evaluate this file near the top of your script to gain access to
0614 # the functions and variables defined here:
0615 #
0616 #   . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
0617 #
0618 # If you need to override any of the default environment variable
0619 # settings, do that before evaluating this file.
0620 
0621 
0622 ## -------------------- ##
0623 ## Shell normalisation. ##
0624 ## -------------------- ##
0625 
0626 # Some shells need a little help to be as Bourne compatible as possible.
0627 # Before doing anything else, make sure all that help has been provided!
0628 
0629 DUALCASE=1; export DUALCASE # for MKS sh
0630 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
0631   emulate sh
0632   NULLCMD=:
0633   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
0634   # is contrary to our usage.  Disable this feature.
0635   alias -g '${1+"$@"}'='"$@"'
0636   setopt NO_GLOB_SUBST
0637 else
0638   case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
0639 fi
0640 
0641 # NLS nuisances: We save the old values in case they are required later.
0642 _G_user_locale=
0643 _G_safe_locale=
0644 for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
0645 do
0646   eval "if test set = \"\${$_G_var+set}\"; then
0647           save_$_G_var=\$$_G_var
0648           $_G_var=C
0649           export $_G_var
0650           _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
0651           _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
0652         fi"
0653 done
0654 
0655 # CDPATH.
0656 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
0657 
0658 # Make sure IFS has a sensible default
0659 sp=' '
0660 nl='
0661 '
0662 IFS="$sp        $nl"
0663 
0664 # There are apparently some retarded systems that use ';' as a PATH separator!
0665 if test "${PATH_SEPARATOR+set}" != set; then
0666   PATH_SEPARATOR=:
0667   (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
0668     (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
0669       PATH_SEPARATOR=';'
0670   }
0671 fi
0672 
0673 
0674 
0675 ## ------------------------- ##
0676 ## Locate command utilities. ##
0677 ## ------------------------- ##
0678 
0679 
0680 # func_executable_p FILE
0681 # ----------------------
0682 # Check that FILE is an executable regular file.
0683 func_executable_p ()
0684 {
0685     test -f "$1" && test -x "$1"
0686 }
0687 
0688 
0689 # func_path_progs PROGS_LIST CHECK_FUNC [PATH]
0690 # --------------------------------------------
0691 # Search for either a program that responds to --version with output
0692 # containing "GNU", or else returned by CHECK_FUNC otherwise, by
0693 # trying all the directories in PATH with each of the elements of
0694 # PROGS_LIST.
0695 #
0696 # CHECK_FUNC should accept the path to a candidate program, and
0697 # set $func_check_prog_result if it truncates its output less than
0698 # $_G_path_prog_max characters.
0699 func_path_progs ()
0700 {
0701     _G_progs_list=$1
0702     _G_check_func=$2
0703     _G_PATH=${3-"$PATH"}
0704 
0705     _G_path_prog_max=0
0706     _G_path_prog_found=false
0707     _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
0708     for _G_dir in $_G_PATH; do
0709       IFS=$_G_save_IFS
0710       test -z "$_G_dir" && _G_dir=.
0711       for _G_prog_name in $_G_progs_list; do
0712         for _exeext in '' .EXE; do
0713           _G_path_prog=$_G_dir/$_G_prog_name$_exeext
0714           func_executable_p "$_G_path_prog" || continue
0715           case `"$_G_path_prog" --version 2>&1` in
0716             *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
0717             *)     $_G_check_func $_G_path_prog
0718                    func_path_progs_result=$func_check_prog_result
0719                    ;;
0720           esac
0721           $_G_path_prog_found && break 3
0722         done
0723       done
0724     done
0725     IFS=$_G_save_IFS
0726     test -z "$func_path_progs_result" && {
0727       echo "no acceptable sed could be found in \$PATH" >&2
0728       exit 1
0729     }
0730 }
0731 
0732 
0733 # We want to be able to use the functions in this file before configure
0734 # has figured out where the best binaries are kept, which means we have
0735 # to search for them ourselves - except when the results are already set
0736 # where we skip the searches.
0737 
0738 # Unless the user overrides by setting SED, search the path for either GNU
0739 # sed, or the sed that truncates its output the least.
0740 test -z "$SED" && {
0741   _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
0742   for _G_i in 1 2 3 4 5 6 7; do
0743     _G_sed_script=$_G_sed_script$nl$_G_sed_script
0744   done
0745   echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
0746   _G_sed_script=
0747 
0748   func_check_prog_sed ()
0749   {
0750     _G_path_prog=$1
0751 
0752     _G_count=0
0753     printf 0123456789 >conftest.in
0754     while :
0755     do
0756       cat conftest.in conftest.in >conftest.tmp
0757       mv conftest.tmp conftest.in
0758       cp conftest.in conftest.nl
0759       echo '' >> conftest.nl
0760       "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
0761       diff conftest.out conftest.nl >/dev/null 2>&1 || break
0762       _G_count=`expr $_G_count + 1`
0763       if test "$_G_count" -gt "$_G_path_prog_max"; then
0764         # Best one so far, save it but keep looking for a better one
0765         func_check_prog_result=$_G_path_prog
0766         _G_path_prog_max=$_G_count
0767       fi
0768       # 10*(2^10) chars as input seems more than enough
0769       test 10 -lt "$_G_count" && break
0770     done
0771     rm -f conftest.in conftest.tmp conftest.nl conftest.out
0772   }
0773 
0774   func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
0775   rm -f conftest.sed
0776   SED=$func_path_progs_result
0777 }
0778 
0779 
0780 # Unless the user overrides by setting GREP, search the path for either GNU
0781 # grep, or the grep that truncates its output the least.
0782 test -z "$GREP" && {
0783   func_check_prog_grep ()
0784   {
0785     _G_path_prog=$1
0786 
0787     _G_count=0
0788     _G_path_prog_max=0
0789     printf 0123456789 >conftest.in
0790     while :
0791     do
0792       cat conftest.in conftest.in >conftest.tmp
0793       mv conftest.tmp conftest.in
0794       cp conftest.in conftest.nl
0795       echo 'GREP' >> conftest.nl
0796       "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
0797       diff conftest.out conftest.nl >/dev/null 2>&1 || break
0798       _G_count=`expr $_G_count + 1`
0799       if test "$_G_count" -gt "$_G_path_prog_max"; then
0800         # Best one so far, save it but keep looking for a better one
0801         func_check_prog_result=$_G_path_prog
0802         _G_path_prog_max=$_G_count
0803       fi
0804       # 10*(2^10) chars as input seems more than enough
0805       test 10 -lt "$_G_count" && break
0806     done
0807     rm -f conftest.in conftest.tmp conftest.nl conftest.out
0808   }
0809 
0810   func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
0811   GREP=$func_path_progs_result
0812 }
0813 
0814 
0815 ## ------------------------------- ##
0816 ## User overridable command paths. ##
0817 ## ------------------------------- ##
0818 
0819 # All uppercase variable names are used for environment variables.  These
0820 # variables can be overridden by the user before calling a script that
0821 # uses them if a suitable command of that name is not already available
0822 # in the command search PATH.
0823 
0824 : ${CP="cp -f"}
0825 : ${ECHO="printf %s\n"}
0826 : ${EGREP="$GREP -E"}
0827 : ${FGREP="$GREP -F"}
0828 : ${LN_S="ln -s"}
0829 : ${MAKE="make"}
0830 : ${MKDIR="mkdir"}
0831 : ${MV="mv -f"}
0832 : ${RM="rm -f"}
0833 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
0834 
0835 
0836 ## -------------------- ##
0837 ## Useful sed snippets. ##
0838 ## -------------------- ##
0839 
0840 sed_dirname='s|/[^/]*$||'
0841 sed_basename='s|^.*/||'
0842 
0843 # Sed substitution that helps us do robust quoting.  It backslashifies
0844 # metacharacters that are still active within double-quoted strings.
0845 sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
0846 
0847 # Same as above, but do not quote variable references.
0848 sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
0849 
0850 # Sed substitution that turns a string into a regex matching for the
0851 # string literally.
0852 sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
0853 
0854 # Sed substitution that converts a w32 file name or path
0855 # that contains forward slashes, into one that contains
0856 # (escaped) backslashes.  A very naive implementation.
0857 sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
0858 
0859 # Re-'\' parameter expansions in output of sed_double_quote_subst that
0860 # were '\'-ed in input to the same.  If an odd number of '\' preceded a
0861 # '$' in input to sed_double_quote_subst, that '$' was protected from
0862 # expansion.  Since each input '\' is now two '\'s, look for any number
0863 # of runs of four '\'s followed by two '\'s and then a '$'.  '\' that '$'.
0864 _G_bs='\\'
0865 _G_bs2='\\\\'
0866 _G_bs4='\\\\\\\\'
0867 _G_dollar='\$'
0868 sed_double_backslash="\
0869   s/$_G_bs4/&\\
0870 /g
0871   s/^$_G_bs2$_G_dollar/$_G_bs&/
0872   s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
0873   s/\n//g"
0874 
0875 
0876 ## ----------------- ##
0877 ## Global variables. ##
0878 ## ----------------- ##
0879 
0880 # Except for the global variables explicitly listed below, the following
0881 # functions in the '^func_' namespace, and the '^require_' namespace
0882 # variables initialised in the 'Resource management' section, sourcing
0883 # this file will not pollute your global namespace with anything
0884 # else. There's no portable way to scope variables in Bourne shell
0885 # though, so actually running these functions will sometimes place
0886 # results into a variable named after the function, and often use
0887 # temporary variables in the '^_G_' namespace. If you are careful to
0888 # avoid using those namespaces casually in your sourcing script, things
0889 # should continue to work as you expect. And, of course, you can freely
0890 # overwrite any of the functions or variables defined here before
0891 # calling anything to customize them.
0892 
0893 EXIT_SUCCESS=0
0894 EXIT_FAILURE=1
0895 EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
0896 EXIT_SKIP=77      # $? = 77 is used to indicate a skipped test to automake.
0897 
0898 # Allow overriding, eg assuming that you follow the convention of
0899 # putting '$debug_cmd' at the start of all your functions, you can get
0900 # bash to show function call trace with:
0901 #
0902 #    debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
0903 debug_cmd=${debug_cmd-":"}
0904 exit_cmd=:
0905 
0906 # By convention, finish your script with:
0907 #
0908 #    exit $exit_status
0909 #
0910 # so that you can set exit_status to non-zero if you want to indicate
0911 # something went wrong during execution without actually bailing out at
0912 # the point of failure.
0913 exit_status=$EXIT_SUCCESS
0914 
0915 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
0916 # is ksh but when the shell is invoked as "sh" and the current value of
0917 # the _XPG environment variable is not equal to 1 (one), the special
0918 # positional parameter $0, within a function call, is the name of the
0919 # function.
0920 progpath=$0
0921 
0922 # The name of this program.
0923 progname=`$ECHO "$progpath" |$SED "$sed_basename"`
0924 
0925 # Make sure we have an absolute progpath for reexecution:
0926 case $progpath in
0927   [\\/]*|[A-Za-z]:\\*) ;;
0928   *[\\/]*)
0929      progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
0930      progdir=`cd "$progdir" && pwd`
0931      progpath=$progdir/$progname
0932      ;;
0933   *)
0934      _G_IFS=$IFS
0935      IFS=${PATH_SEPARATOR-:}
0936      for progdir in $PATH; do
0937        IFS=$_G_IFS
0938        test -x "$progdir/$progname" && break
0939      done
0940      IFS=$_G_IFS
0941      test -n "$progdir" || progdir=`pwd`
0942      progpath=$progdir/$progname
0943      ;;
0944 esac
0945 
0946 
0947 ## ----------------- ##
0948 ## Standard options. ##
0949 ## ----------------- ##
0950 
0951 # The following options affect the operation of the functions defined
0952 # below, and should be set appropriately depending on run-time para-
0953 # meters passed on the command line.
0954 
0955 opt_dry_run=false
0956 opt_quiet=false
0957 opt_verbose=false
0958 
0959 # Categories 'all' and 'none' are always available.  Append any others
0960 # you will pass as the first argument to func_warning from your own
0961 # code.
0962 warning_categories=
0963 
0964 # By default, display warnings according to 'opt_warning_types'.  Set
0965 # 'warning_func'  to ':' to elide all warnings, or func_fatal_error to
0966 # treat the next displayed warning as a fatal error.
0967 warning_func=func_warn_and_continue
0968 
0969 # Set to 'all' to display all warnings, 'none' to suppress all
0970 # warnings, or a space delimited list of some subset of
0971 # 'warning_categories' to display only the listed warnings.
0972 opt_warning_types=all
0973 
0974 
0975 ## -------------------- ##
0976 ## Resource management. ##
0977 ## -------------------- ##
0978 
0979 # This section contains definitions for functions that each ensure a
0980 # particular resource (a file, or a non-empty configuration variable for
0981 # example) is available, and if appropriate to extract default values
0982 # from pertinent package files. Call them using their associated
0983 # 'require_*' variable to ensure that they are executed, at most, once.
0984 #
0985 # It's entirely deliberate that calling these functions can set
0986 # variables that don't obey the namespace limitations obeyed by the rest
0987 # of this file, in order that that they be as useful as possible to
0988 # callers.
0989 
0990 
0991 # require_term_colors
0992 # -------------------
0993 # Allow display of bold text on terminals that support it.
0994 require_term_colors=func_require_term_colors
0995 func_require_term_colors ()
0996 {
0997     $debug_cmd
0998 
0999     test -t 1 && {
1000       # COLORTERM and USE_ANSI_COLORS environment variables take
1001       # precedence, because most terminfo databases neglect to describe
1002       # whether color sequences are supported.
1003       test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
1004 
1005       if test 1 = "$USE_ANSI_COLORS"; then
1006         # Standard ANSI escape sequences
1007         tc_reset=''
1008         tc_bold='';   tc_standout=''
1009         tc_red='';   tc_green=''
1010         tc_blue='';  tc_cyan=''
1011       else
1012         # Otherwise trust the terminfo database after all.
1013         test -n "`tput sgr0 2>/dev/null`" && {
1014           tc_reset=`tput sgr0`
1015           test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
1016           tc_standout=$tc_bold
1017           test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
1018           test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
1019           test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
1020           test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
1021           test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
1022         }
1023       fi
1024     }
1025 
1026     require_term_colors=:
1027 }
1028 
1029 
1030 ## ----------------- ##
1031 ## Function library. ##
1032 ## ----------------- ##
1033 
1034 # This section contains a variety of useful functions to call in your
1035 # scripts. Take note of the portable wrappers for features provided by
1036 # some modern shells, which will fall back to slower equivalents on
1037 # less featureful shells.
1038 
1039 
1040 # func_append VAR VALUE
1041 # ---------------------
1042 # Append VALUE onto the existing contents of VAR.
1043 
1044   # We should try to minimise forks, especially on Windows where they are
1045   # unreasonably slow, so skip the feature probes when bash or zsh are
1046   # being used:
1047   if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
1048     : ${_G_HAVE_ARITH_OP="yes"}
1049     : ${_G_HAVE_XSI_OPS="yes"}
1050     # The += operator was introduced in bash 3.1
1051     case $BASH_VERSION in
1052       [12].* | 3.0 | 3.0*) ;;
1053       *)
1054         : ${_G_HAVE_PLUSEQ_OP="yes"}
1055         ;;
1056     esac
1057   fi
1058 
1059   # _G_HAVE_PLUSEQ_OP
1060   # Can be empty, in which case the shell is probed, "yes" if += is
1061   # useable or anything else if it does not work.
1062   test -z "$_G_HAVE_PLUSEQ_OP" \
1063     && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
1064     && _G_HAVE_PLUSEQ_OP=yes
1065 
1066 if test yes = "$_G_HAVE_PLUSEQ_OP"
1067 then
1068   # This is an XSI compatible shell, allowing a faster implementation...
1069   eval 'func_append ()
1070   {
1071     $debug_cmd
1072 
1073     eval "$1+=\$2"
1074   }'
1075 else
1076   # ...otherwise fall back to using expr, which is often a shell builtin.
1077   func_append ()
1078   {
1079     $debug_cmd
1080 
1081     eval "$1=\$$1\$2"
1082   }
1083 fi
1084 
1085 
1086 # func_append_quoted VAR VALUE
1087 # ----------------------------
1088 # Quote VALUE and append to the end of shell variable VAR, separated
1089 # by a space.
1090 if test yes = "$_G_HAVE_PLUSEQ_OP"; then
1091   eval 'func_append_quoted ()
1092   {
1093     $debug_cmd
1094 
1095     func_quote_for_eval "$2"
1096     eval "$1+=\\ \$func_quote_for_eval_result"
1097   }'
1098 else
1099   func_append_quoted ()
1100   {
1101     $debug_cmd
1102 
1103     func_quote_for_eval "$2"
1104     eval "$1=\$$1\\ \$func_quote_for_eval_result"
1105   }
1106 fi
1107 
1108 
1109 # func_append_uniq VAR VALUE
1110 # --------------------------
1111 # Append unique VALUE onto the existing contents of VAR, assuming
1112 # entries are delimited by the first character of VALUE.  For example:
1113 #
1114 #   func_append_uniq options " --another-option option-argument"
1115 #
1116 # will only append to $options if " --another-option option-argument "
1117 # is not already present somewhere in $options already (note spaces at
1118 # each end implied by leading space in second argument).
1119 func_append_uniq ()
1120 {
1121     $debug_cmd
1122 
1123     eval _G_current_value='`$ECHO $'$1'`'
1124     _G_delim=`expr "$2" : '\(.\)'`
1125 
1126     case $_G_delim$_G_current_value$_G_delim in
1127       *"$2$_G_delim"*) ;;
1128       *) func_append "$@" ;;
1129     esac
1130 }
1131 
1132 
1133 # func_arith TERM...
1134 # ------------------
1135 # Set func_arith_result to the result of evaluating TERMs.
1136   test -z "$_G_HAVE_ARITH_OP" \
1137     && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
1138     && _G_HAVE_ARITH_OP=yes
1139 
1140 if test yes = "$_G_HAVE_ARITH_OP"; then
1141   eval 'func_arith ()
1142   {
1143     $debug_cmd
1144 
1145     func_arith_result=$(( $* ))
1146   }'
1147 else
1148   func_arith ()
1149   {
1150     $debug_cmd
1151 
1152     func_arith_result=`expr "$@"`
1153   }
1154 fi
1155 
1156 
1157 # func_basename FILE
1158 # ------------------
1159 # Set func_basename_result to FILE with everything up to and including
1160 # the last / stripped.
1161 if test yes = "$_G_HAVE_XSI_OPS"; then
1162   # If this shell supports suffix pattern removal, then use it to avoid
1163   # forking. Hide the definitions single quotes in case the shell chokes
1164   # on unsupported syntax...
1165   _b='func_basename_result=${1##*/}'
1166   _d='case $1 in
1167         */*) func_dirname_result=${1%/*}$2 ;;
1168         *  ) func_dirname_result=$3        ;;
1169       esac'
1170 
1171 else
1172   # ...otherwise fall back to using sed.
1173   _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
1174   _d='func_dirname_result=`$ECHO "$1"  |$SED "$sed_dirname"`
1175       if test "X$func_dirname_result" = "X$1"; then
1176         func_dirname_result=$3
1177       else
1178         func_append func_dirname_result "$2"
1179       fi'
1180 fi
1181 
1182 eval 'func_basename ()
1183 {
1184     $debug_cmd
1185 
1186     '"$_b"'
1187 }'
1188 
1189 
1190 # func_dirname FILE APPEND NONDIR_REPLACEMENT
1191 # -------------------------------------------
1192 # Compute the dirname of FILE.  If nonempty, add APPEND to the result,
1193 # otherwise set result to NONDIR_REPLACEMENT.
1194 eval 'func_dirname ()
1195 {
1196     $debug_cmd
1197 
1198     '"$_d"'
1199 }'
1200 
1201 
1202 # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
1203 # --------------------------------------------------------
1204 # Perform func_basename and func_dirname in a single function
1205 # call:
1206 #   dirname:  Compute the dirname of FILE.  If nonempty,
1207 #             add APPEND to the result, otherwise set result
1208 #             to NONDIR_REPLACEMENT.
1209 #             value returned in "$func_dirname_result"
1210 #   basename: Compute filename of FILE.
1211 #             value retuned in "$func_basename_result"
1212 # For efficiency, we do not delegate to the functions above but instead
1213 # duplicate the functionality here.
1214 eval 'func_dirname_and_basename ()
1215 {
1216     $debug_cmd
1217 
1218     '"$_b"'
1219     '"$_d"'
1220 }'
1221 
1222 
1223 # func_echo ARG...
1224 # ----------------
1225 # Echo program name prefixed message.
1226 func_echo ()
1227 {
1228     $debug_cmd
1229 
1230     _G_message=$*
1231 
1232     func_echo_IFS=$IFS
1233     IFS=$nl
1234     for _G_line in $_G_message; do
1235       IFS=$func_echo_IFS
1236       $ECHO "$progname: $_G_line"
1237     done
1238     IFS=$func_echo_IFS
1239 }
1240 
1241 
1242 # func_echo_all ARG...
1243 # --------------------
1244 # Invoke $ECHO with all args, space-separated.
1245 func_echo_all ()
1246 {
1247     $ECHO "$*"
1248 }
1249 
1250 
1251 # func_echo_infix_1 INFIX ARG...
1252 # ------------------------------
1253 # Echo program name, followed by INFIX on the first line, with any
1254 # additional lines not showing INFIX.
1255 func_echo_infix_1 ()
1256 {
1257     $debug_cmd
1258 
1259     $require_term_colors
1260 
1261     _G_infix=$1; shift
1262     _G_indent=$_G_infix
1263     _G_prefix="$progname: $_G_infix: "
1264     _G_message=$*
1265 
1266     # Strip color escape sequences before counting printable length
1267     for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
1268     do
1269       test -n "$_G_tc" && {
1270         _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
1271         _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
1272       }
1273     done
1274     _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`"  " ## exclude from sc_prohibit_nested_quotes
1275 
1276     func_echo_infix_1_IFS=$IFS
1277     IFS=$nl
1278     for _G_line in $_G_message; do
1279       IFS=$func_echo_infix_1_IFS
1280       $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
1281       _G_prefix=$_G_indent
1282     done
1283     IFS=$func_echo_infix_1_IFS
1284 }
1285 
1286 
1287 # func_error ARG...
1288 # -----------------
1289 # Echo program name prefixed message to standard error.
1290 func_error ()
1291 {
1292     $debug_cmd
1293 
1294     $require_term_colors
1295 
1296     func_echo_infix_1 "  $tc_standout${tc_red}error$tc_reset" "$*" >&2
1297 }
1298 
1299 
1300 # func_fatal_error ARG...
1301 # -----------------------
1302 # Echo program name prefixed message to standard error, and exit.
1303 func_fatal_error ()
1304 {
1305     $debug_cmd
1306 
1307     func_error "$*"
1308     exit $EXIT_FAILURE
1309 }
1310 
1311 
1312 # func_grep EXPRESSION FILENAME
1313 # -----------------------------
1314 # Check whether EXPRESSION matches any line of FILENAME, without output.
1315 func_grep ()
1316 {
1317     $debug_cmd
1318 
1319     $GREP "$1" "$2" >/dev/null 2>&1
1320 }
1321 
1322 
1323 # func_len STRING
1324 # ---------------
1325 # Set func_len_result to the length of STRING. STRING may not
1326 # start with a hyphen.
1327   test -z "$_G_HAVE_XSI_OPS" \
1328     && (eval 'x=a/b/c;
1329       test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
1330     && _G_HAVE_XSI_OPS=yes
1331 
1332 if test yes = "$_G_HAVE_XSI_OPS"; then
1333   eval 'func_len ()
1334   {
1335     $debug_cmd
1336 
1337     func_len_result=${#1}
1338   }'
1339 else
1340   func_len ()
1341   {
1342     $debug_cmd
1343 
1344     func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
1345   }
1346 fi
1347 
1348 
1349 # func_mkdir_p DIRECTORY-PATH
1350 # ---------------------------
1351 # Make sure the entire path to DIRECTORY-PATH is available.
1352 func_mkdir_p ()
1353 {
1354     $debug_cmd
1355 
1356     _G_directory_path=$1
1357     _G_dir_list=
1358 
1359     if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
1360 
1361       # Protect directory names starting with '-'
1362       case $_G_directory_path in
1363         -*) _G_directory_path=./$_G_directory_path ;;
1364       esac
1365 
1366       # While some portion of DIR does not yet exist...
1367       while test ! -d "$_G_directory_path"; do
1368         # ...make a list in topmost first order.  Use a colon delimited
1369         # list incase some portion of path contains whitespace.
1370         _G_dir_list=$_G_directory_path:$_G_dir_list
1371 
1372         # If the last portion added has no slash in it, the list is done
1373         case $_G_directory_path in */*) ;; *) break ;; esac
1374 
1375         # ...otherwise throw away the child directory and loop
1376         _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
1377       done
1378       _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
1379 
1380       func_mkdir_p_IFS=$IFS; IFS=:
1381       for _G_dir in $_G_dir_list; do
1382         IFS=$func_mkdir_p_IFS
1383         # mkdir can fail with a 'File exist' error if two processes
1384         # try to create one of the directories concurrently.  Don't
1385         # stop in that case!
1386         $MKDIR "$_G_dir" 2>/dev/null || :
1387       done
1388       IFS=$func_mkdir_p_IFS
1389 
1390       # Bail out if we (or some other process) failed to create a directory.
1391       test -d "$_G_directory_path" || \
1392         func_fatal_error "Failed to create '$1'"
1393     fi
1394 }
1395 
1396 
1397 # func_mktempdir [BASENAME]
1398 # -------------------------
1399 # Make a temporary directory that won't clash with other running
1400 # libtool processes, and avoids race conditions if possible.  If
1401 # given, BASENAME is the basename for that directory.
1402 func_mktempdir ()
1403 {
1404     $debug_cmd
1405 
1406     _G_template=${TMPDIR-/tmp}/${1-$progname}
1407 
1408     if test : = "$opt_dry_run"; then
1409       # Return a directory name, but don't create it in dry-run mode
1410       _G_tmpdir=$_G_template-$$
1411     else
1412 
1413       # If mktemp works, use that first and foremost
1414       _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
1415 
1416       if test ! -d "$_G_tmpdir"; then
1417         # Failing that, at least try and use $RANDOM to avoid a race
1418         _G_tmpdir=$_G_template-${RANDOM-0}$$
1419 
1420         func_mktempdir_umask=`umask`
1421         umask 0077
1422         $MKDIR "$_G_tmpdir"
1423         umask $func_mktempdir_umask
1424       fi
1425 
1426       # If we're not in dry-run mode, bomb out on failure
1427       test -d "$_G_tmpdir" || \
1428         func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
1429     fi
1430 
1431     $ECHO "$_G_tmpdir"
1432 }
1433 
1434 
1435 # func_normal_abspath PATH
1436 # ------------------------
1437 # Remove doubled-up and trailing slashes, "." path components,
1438 # and cancel out any ".." path components in PATH after making
1439 # it an absolute path.
1440 func_normal_abspath ()
1441 {
1442     $debug_cmd
1443 
1444     # These SED scripts presuppose an absolute path with a trailing slash.
1445     _G_pathcar='s|^/\([^/]*\).*$|\1|'
1446     _G_pathcdr='s|^/[^/]*||'
1447     _G_removedotparts=':dotsl
1448                 s|/\./|/|g
1449                 t dotsl
1450                 s|/\.$|/|'
1451     _G_collapseslashes='s|/\{1,\}|/|g'
1452     _G_finalslash='s|/*$|/|'
1453 
1454     # Start from root dir and reassemble the path.
1455     func_normal_abspath_result=
1456     func_normal_abspath_tpath=$1
1457     func_normal_abspath_altnamespace=
1458     case $func_normal_abspath_tpath in
1459       "")
1460         # Empty path, that just means $cwd.
1461         func_stripname '' '/' "`pwd`"
1462         func_normal_abspath_result=$func_stripname_result
1463         return
1464         ;;
1465       # The next three entries are used to spot a run of precisely
1466       # two leading slashes without using negated character classes;
1467       # we take advantage of case's first-match behaviour.
1468       ///*)
1469         # Unusual form of absolute path, do nothing.
1470         ;;
1471       //*)
1472         # Not necessarily an ordinary path; POSIX reserves leading '//'
1473         # and for example Cygwin uses it to access remote file shares
1474         # over CIFS/SMB, so we conserve a leading double slash if found.
1475         func_normal_abspath_altnamespace=/
1476         ;;
1477       /*)
1478         # Absolute path, do nothing.
1479         ;;
1480       *)
1481         # Relative path, prepend $cwd.
1482         func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
1483         ;;
1484     esac
1485 
1486     # Cancel out all the simple stuff to save iterations.  We also want
1487     # the path to end with a slash for ease of parsing, so make sure
1488     # there is one (and only one) here.
1489     func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
1490           -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
1491     while :; do
1492       # Processed it all yet?
1493       if test / = "$func_normal_abspath_tpath"; then
1494         # If we ascended to the root using ".." the result may be empty now.
1495         if test -z "$func_normal_abspath_result"; then
1496           func_normal_abspath_result=/
1497         fi
1498         break
1499       fi
1500       func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
1501           -e "$_G_pathcar"`
1502       func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
1503           -e "$_G_pathcdr"`
1504       # Figure out what to do with it
1505       case $func_normal_abspath_tcomponent in
1506         "")
1507           # Trailing empty path component, ignore it.
1508           ;;
1509         ..)
1510           # Parent dir; strip last assembled component from result.
1511           func_dirname "$func_normal_abspath_result"
1512           func_normal_abspath_result=$func_dirname_result
1513           ;;
1514         *)
1515           # Actual path component, append it.
1516           func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
1517           ;;
1518       esac
1519     done
1520     # Restore leading double-slash if one was found on entry.
1521     func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
1522 }
1523 
1524 
1525 # func_notquiet ARG...
1526 # --------------------
1527 # Echo program name prefixed message only when not in quiet mode.
1528 func_notquiet ()
1529 {
1530     $debug_cmd
1531 
1532     $opt_quiet || func_echo ${1+"$@"}
1533 
1534     # A bug in bash halts the script if the last line of a function
1535     # fails when set -e is in force, so we need another command to
1536     # work around that:
1537     :
1538 }
1539 
1540 
1541 # func_relative_path SRCDIR DSTDIR
1542 # --------------------------------
1543 # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
1544 func_relative_path ()
1545 {
1546     $debug_cmd
1547 
1548     func_relative_path_result=
1549     func_normal_abspath "$1"
1550     func_relative_path_tlibdir=$func_normal_abspath_result
1551     func_normal_abspath "$2"
1552     func_relative_path_tbindir=$func_normal_abspath_result
1553 
1554     # Ascend the tree starting from libdir
1555     while :; do
1556       # check if we have found a prefix of bindir
1557       case $func_relative_path_tbindir in
1558         $func_relative_path_tlibdir)
1559           # found an exact match
1560           func_relative_path_tcancelled=
1561           break
1562           ;;
1563         $func_relative_path_tlibdir*)
1564           # found a matching prefix
1565           func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
1566           func_relative_path_tcancelled=$func_stripname_result
1567           if test -z "$func_relative_path_result"; then
1568             func_relative_path_result=.
1569           fi
1570           break
1571           ;;
1572         *)
1573           func_dirname $func_relative_path_tlibdir
1574           func_relative_path_tlibdir=$func_dirname_result
1575           if test -z "$func_relative_path_tlibdir"; then
1576             # Have to descend all the way to the root!
1577             func_relative_path_result=../$func_relative_path_result
1578             func_relative_path_tcancelled=$func_relative_path_tbindir
1579             break
1580           fi
1581           func_relative_path_result=../$func_relative_path_result
1582           ;;
1583       esac
1584     done
1585 
1586     # Now calculate path; take care to avoid doubling-up slashes.
1587     func_stripname '' '/' "$func_relative_path_result"
1588     func_relative_path_result=$func_stripname_result
1589     func_stripname '/' '/' "$func_relative_path_tcancelled"
1590     if test -n "$func_stripname_result"; then
1591       func_append func_relative_path_result "/$func_stripname_result"
1592     fi
1593 
1594     # Normalisation. If bindir is libdir, return '.' else relative path.
1595     if test -n "$func_relative_path_result"; then
1596       func_stripname './' '' "$func_relative_path_result"
1597       func_relative_path_result=$func_stripname_result
1598     fi
1599 
1600     test -n "$func_relative_path_result" || func_relative_path_result=.
1601 
1602     :
1603 }
1604 
1605 
1606 # func_quote_for_eval ARG...
1607 # --------------------------
1608 # Aesthetically quote ARGs to be evaled later.
1609 # This function returns two values:
1610 #   i) func_quote_for_eval_result
1611 #      double-quoted, suitable for a subsequent eval
1612 #  ii) func_quote_for_eval_unquoted_result
1613 #      has all characters that are still active within double
1614 #      quotes backslashified.
1615 func_quote_for_eval ()
1616 {
1617     $debug_cmd
1618 
1619     func_quote_for_eval_unquoted_result=
1620     func_quote_for_eval_result=
1621     while test 0 -lt $#; do
1622       case $1 in
1623         *[\\\`\"\$]*)
1624           _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
1625         *)
1626           _G_unquoted_arg=$1 ;;
1627       esac
1628       if test -n "$func_quote_for_eval_unquoted_result"; then
1629         func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
1630       else
1631         func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
1632       fi
1633 
1634       case $_G_unquoted_arg in
1635         # Double-quote args containing shell metacharacters to delay
1636         # word splitting, command substitution and variable expansion
1637         # for a subsequent eval.
1638         # Many Bourne shells cannot handle close brackets correctly
1639         # in scan sets, so we specify it separately.
1640         *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
1641           _G_quoted_arg=\"$_G_unquoted_arg\"
1642           ;;
1643         *)
1644           _G_quoted_arg=$_G_unquoted_arg
1645           ;;
1646       esac
1647 
1648       if test -n "$func_quote_for_eval_result"; then
1649         func_append func_quote_for_eval_result " $_G_quoted_arg"
1650       else
1651         func_append func_quote_for_eval_result "$_G_quoted_arg"
1652       fi
1653       shift
1654     done
1655 }
1656 
1657 
1658 # func_quote_for_expand ARG
1659 # -------------------------
1660 # Aesthetically quote ARG to be evaled later; same as above,
1661 # but do not quote variable references.
1662 func_quote_for_expand ()
1663 {
1664     $debug_cmd
1665 
1666     case $1 in
1667       *[\\\`\"]*)
1668         _G_arg=`$ECHO "$1" | $SED \
1669             -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
1670       *)
1671         _G_arg=$1 ;;
1672     esac
1673 
1674     case $_G_arg in
1675       # Double-quote args containing shell metacharacters to delay
1676       # word splitting and command substitution for a subsequent eval.
1677       # Many Bourne shells cannot handle close brackets correctly
1678       # in scan sets, so we specify it separately.
1679       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
1680         _G_arg=\"$_G_arg\"
1681         ;;
1682     esac
1683 
1684     func_quote_for_expand_result=$_G_arg
1685 }
1686 
1687 
1688 # func_stripname PREFIX SUFFIX NAME
1689 # ---------------------------------
1690 # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
1691 # PREFIX and SUFFIX must not contain globbing or regex special
1692 # characters, hashes, percent signs, but SUFFIX may contain a leading
1693 # dot (in which case that matches only a dot).
1694 if test yes = "$_G_HAVE_XSI_OPS"; then
1695   eval 'func_stripname ()
1696   {
1697     $debug_cmd
1698 
1699     # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
1700     # positional parameters, so assign one to ordinary variable first.
1701     func_stripname_result=$3
1702     func_stripname_result=${func_stripname_result#"$1"}
1703     func_stripname_result=${func_stripname_result%"$2"}
1704   }'
1705 else
1706   func_stripname ()
1707   {
1708     $debug_cmd
1709 
1710     case $2 in
1711       .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
1712       *)  func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
1713     esac
1714   }
1715 fi
1716 
1717 
1718 # func_show_eval CMD [FAIL_EXP]
1719 # -----------------------------
1720 # Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
1721 # not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
1722 # is given, then evaluate it.
1723 func_show_eval ()
1724 {
1725     $debug_cmd
1726 
1727     _G_cmd=$1
1728     _G_fail_exp=${2-':'}
1729 
1730     func_quote_for_expand "$_G_cmd"
1731     eval "func_notquiet $func_quote_for_expand_result"
1732 
1733     $opt_dry_run || {
1734       eval "$_G_cmd"
1735       _G_status=$?
1736       if test 0 -ne "$_G_status"; then
1737         eval "(exit $_G_status); $_G_fail_exp"
1738       fi
1739     }
1740 }
1741 
1742 
1743 # func_show_eval_locale CMD [FAIL_EXP]
1744 # ------------------------------------
1745 # Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
1746 # not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
1747 # is given, then evaluate it.  Use the saved locale for evaluation.
1748 func_show_eval_locale ()
1749 {
1750     $debug_cmd
1751 
1752     _G_cmd=$1
1753     _G_fail_exp=${2-':'}
1754 
1755     $opt_quiet || {
1756       func_quote_for_expand "$_G_cmd"
1757       eval "func_echo $func_quote_for_expand_result"
1758     }
1759 
1760     $opt_dry_run || {
1761       eval "$_G_user_locale
1762             $_G_cmd"
1763       _G_status=$?
1764       eval "$_G_safe_locale"
1765       if test 0 -ne "$_G_status"; then
1766         eval "(exit $_G_status); $_G_fail_exp"
1767       fi
1768     }
1769 }
1770 
1771 
1772 # func_tr_sh
1773 # ----------
1774 # Turn $1 into a string suitable for a shell variable name.
1775 # Result is stored in $func_tr_sh_result.  All characters
1776 # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
1777 # if $1 begins with a digit, a '_' is prepended as well.
1778 func_tr_sh ()
1779 {
1780     $debug_cmd
1781 
1782     case $1 in
1783     [0-9]* | *[!a-zA-Z0-9_]*)
1784       func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
1785       ;;
1786     * )
1787       func_tr_sh_result=$1
1788       ;;
1789     esac
1790 }
1791 
1792 
1793 # func_verbose ARG...
1794 # -------------------
1795 # Echo program name prefixed message in verbose mode only.
1796 func_verbose ()
1797 {
1798     $debug_cmd
1799 
1800     $opt_verbose && func_echo "$*"
1801 
1802     :
1803 }
1804 
1805 
1806 # func_warn_and_continue ARG...
1807 # -----------------------------
1808 # Echo program name prefixed warning message to standard error.
1809 func_warn_and_continue ()
1810 {
1811     $debug_cmd
1812 
1813     $require_term_colors
1814 
1815     func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
1816 }
1817 
1818 
1819 # func_warning CATEGORY ARG...
1820 # ----------------------------
1821 # Echo program name prefixed warning message to standard error. Warning
1822 # messages can be filtered according to CATEGORY, where this function
1823 # elides messages where CATEGORY is not listed in the global variable
1824 # 'opt_warning_types'.
1825 func_warning ()
1826 {
1827     $debug_cmd
1828 
1829     # CATEGORY must be in the warning_categories list!
1830     case " $warning_categories " in
1831       *" $1 "*) ;;
1832       *) func_internal_error "invalid warning category '$1'" ;;
1833     esac
1834 
1835     _G_category=$1
1836     shift
1837 
1838     case " $opt_warning_types " in
1839       *" $_G_category "*) $warning_func ${1+"$@"} ;;
1840     esac
1841 }
1842 
1843 
1844 # func_sort_ver VER1 VER2
1845 # -----------------------
1846 # 'sort -V' is not generally available.
1847 # Note this deviates from the version comparison in automake
1848 # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
1849 # but this should suffice as we won't be specifying old
1850 # version formats or redundant trailing .0 in bootstrap.conf.
1851 # If we did want full compatibility then we should probably
1852 # use m4_version_compare from autoconf.
1853 func_sort_ver ()
1854 {
1855     $debug_cmd
1856 
1857     printf '%s\n%s\n' "$1" "$2" \
1858       | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
1859 }
1860 
1861 # func_lt_ver PREV CURR
1862 # ---------------------
1863 # Return true if PREV and CURR are in the correct order according to
1864 # func_sort_ver, otherwise false.  Use it like this:
1865 #
1866 #  func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
1867 func_lt_ver ()
1868 {
1869     $debug_cmd
1870 
1871     test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
1872 }
1873 
1874 
1875 # Local variables:
1876 # mode: shell-script
1877 # sh-indentation: 2
1878 # eval: (add-hook 'before-save-hook 'time-stamp)
1879 # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
1880 # time-stamp-time-zone: "UTC"
1881 # End:
1882 #! /bin/sh
1883 
1884 # Set a version string for this script.
1885 scriptversion=2014-01-07.03; # UTC
1886 
1887 # A portable, pluggable option parser for Bourne shell.
1888 # Written by Gary V. Vaughan, 2010
1889 
1890 # Copyright (C) 2010-2015 Free Software Foundation, Inc.
1891 # This is free software; see the source for copying conditions.  There is NO
1892 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1893 
1894 # This program is free software: you can redistribute it and/or modify
1895 # it under the terms of the GNU General Public License as published by
1896 # the Free Software Foundation, either version 3 of the License, or
1897 # (at your option) any later version.
1898 
1899 # This program is distributed in the hope that it will be useful,
1900 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1901 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1902 # GNU General Public License for more details.
1903 
1904 # You should have received a copy of the GNU General Public License
1905 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
1906 
1907 # Please report bugs or propose patches to gary@gnu.org.
1908 
1909 
1910 ## ------ ##
1911 ## Usage. ##
1912 ## ------ ##
1913 
1914 # This file is a library for parsing options in your shell scripts along
1915 # with assorted other useful supporting features that you can make use
1916 # of too.
1917 #
1918 # For the simplest scripts you might need only:
1919 #
1920 #   #!/bin/sh
1921 #   . relative/path/to/funclib.sh
1922 #   . relative/path/to/options-parser
1923 #   scriptversion=1.0
1924 #   func_options ${1+"$@"}
1925 #   eval set dummy "$func_options_result"; shift
1926 #   ...rest of your script...
1927 #
1928 # In order for the '--version' option to work, you will need to have a
1929 # suitably formatted comment like the one at the top of this file
1930 # starting with '# Written by ' and ending with '# warranty; '.
1931 #
1932 # For '-h' and '--help' to work, you will also need a one line
1933 # description of your script's purpose in a comment directly above the
1934 # '# Written by ' line, like the one at the top of this file.
1935 #
1936 # The default options also support '--debug', which will turn on shell
1937 # execution tracing (see the comment above debug_cmd below for another
1938 # use), and '--verbose' and the func_verbose function to allow your script
1939 # to display verbose messages only when your user has specified
1940 # '--verbose'.
1941 #
1942 # After sourcing this file, you can plug processing for additional
1943 # options by amending the variables from the 'Configuration' section
1944 # below, and following the instructions in the 'Option parsing'
1945 # section further down.
1946 
1947 ## -------------- ##
1948 ## Configuration. ##
1949 ## -------------- ##
1950 
1951 # You should override these variables in your script after sourcing this
1952 # file so that they reflect the customisations you have added to the
1953 # option parser.
1954 
1955 # The usage line for option parsing errors and the start of '-h' and
1956 # '--help' output messages. You can embed shell variables for delayed
1957 # expansion at the time the message is displayed, but you will need to
1958 # quote other shell meta-characters carefully to prevent them being
1959 # expanded when the contents are evaled.
1960 usage='$progpath [OPTION]...'
1961 
1962 # Short help message in response to '-h' and '--help'.  Add to this or
1963 # override it after sourcing this library to reflect the full set of
1964 # options your script accepts.
1965 usage_message="\
1966        --debug        enable verbose shell tracing
1967    -W, --warnings=CATEGORY
1968                       report the warnings falling in CATEGORY [all]
1969    -v, --verbose      verbosely report processing
1970        --version      print version information and exit
1971    -h, --help         print short or long help message and exit
1972 "
1973 
1974 # Additional text appended to 'usage_message' in response to '--help'.
1975 long_help_message="
1976 Warning categories include:
1977        'all'          show all warnings
1978        'none'         turn off all the warnings
1979        'error'        warnings are treated as fatal errors"
1980 
1981 # Help message printed before fatal option parsing errors.
1982 fatal_help="Try '\$progname --help' for more information."
1983 
1984 
1985 
1986 ## ------------------------- ##
1987 ## Hook function management. ##
1988 ## ------------------------- ##
1989 
1990 # This section contains functions for adding, removing, and running hooks
1991 # to the main code.  A hook is just a named list of of function, that can
1992 # be run in order later on.
1993 
1994 # func_hookable FUNC_NAME
1995 # -----------------------
1996 # Declare that FUNC_NAME will run hooks added with
1997 # 'func_add_hook FUNC_NAME ...'.
1998 func_hookable ()
1999 {
2000     $debug_cmd
2001 
2002     func_append hookable_fns " $1"
2003 }
2004 
2005 
2006 # func_add_hook FUNC_NAME HOOK_FUNC
2007 # ---------------------------------
2008 # Request that FUNC_NAME call HOOK_FUNC before it returns.  FUNC_NAME must
2009 # first have been declared "hookable" by a call to 'func_hookable'.
2010 func_add_hook ()
2011 {
2012     $debug_cmd
2013 
2014     case " $hookable_fns " in
2015       *" $1 "*) ;;
2016       *) func_fatal_error "'$1' does not accept hook functions." ;;
2017     esac
2018 
2019     eval func_append ${1}_hooks '" $2"'
2020 }
2021 
2022 
2023 # func_remove_hook FUNC_NAME HOOK_FUNC
2024 # ------------------------------------
2025 # Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
2026 func_remove_hook ()
2027 {
2028     $debug_cmd
2029 
2030     eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
2031 }
2032 
2033 
2034 # func_run_hooks FUNC_NAME [ARG]...
2035 # ---------------------------------
2036 # Run all hook functions registered to FUNC_NAME.
2037 # It is assumed that the list of hook functions contains nothing more
2038 # than a whitespace-delimited list of legal shell function names, and
2039 # no effort is wasted trying to catch shell meta-characters or preserve
2040 # whitespace.
2041 func_run_hooks ()
2042 {
2043     $debug_cmd
2044 
2045     case " $hookable_fns " in
2046       *" $1 "*) ;;
2047       *) func_fatal_error "'$1' does not support hook funcions.n" ;;
2048     esac
2049 
2050     eval _G_hook_fns=\$$1_hooks; shift
2051 
2052     for _G_hook in $_G_hook_fns; do
2053       eval $_G_hook '"$@"'
2054 
2055       # store returned options list back into positional
2056       # parameters for next 'cmd' execution.
2057       eval _G_hook_result=\$${_G_hook}_result
2058       eval set dummy "$_G_hook_result"; shift
2059     done
2060 
2061     func_quote_for_eval ${1+"$@"}
2062     func_run_hooks_result=$func_quote_for_eval_result
2063 }
2064 
2065 
2066 
2067 ## --------------- ##
2068 ## Option parsing. ##
2069 ## --------------- ##
2070 
2071 # In order to add your own option parsing hooks, you must accept the
2072 # full positional parameter list in your hook function, remove any
2073 # options that you action, and then pass back the remaining unprocessed
2074 # options in '<hooked_function_name>_result', escaped suitably for
2075 # 'eval'.  Like this:
2076 #
2077 #    my_options_prep ()
2078 #    {
2079 #        $debug_cmd
2080 #
2081 #        # Extend the existing usage message.
2082 #        usage_message=$usage_message'
2083 #      -s, --silent       don'\''t print informational messages
2084 #    '
2085 #
2086 #        func_quote_for_eval ${1+"$@"}
2087 #        my_options_prep_result=$func_quote_for_eval_result
2088 #    }
2089 #    func_add_hook func_options_prep my_options_prep
2090 #
2091 #
2092 #    my_silent_option ()
2093 #    {
2094 #        $debug_cmd
2095 #
2096 #        # Note that for efficiency, we parse as many options as we can
2097 #        # recognise in a loop before passing the remainder back to the
2098 #        # caller on the first unrecognised argument we encounter.
2099 #        while test $# -gt 0; do
2100 #          opt=$1; shift
2101 #          case $opt in
2102 #            --silent|-s) opt_silent=: ;;
2103 #            # Separate non-argument short options:
2104 #            -s*)         func_split_short_opt "$_G_opt"
2105 #                         set dummy "$func_split_short_opt_name" \
2106 #                             "-$func_split_short_opt_arg" ${1+"$@"}
2107 #                         shift
2108 #                         ;;
2109 #            *)            set dummy "$_G_opt" "$*"; shift; break ;;
2110 #          esac
2111 #        done
2112 #
2113 #        func_quote_for_eval ${1+"$@"}
2114 #        my_silent_option_result=$func_quote_for_eval_result
2115 #    }
2116 #    func_add_hook func_parse_options my_silent_option
2117 #
2118 #
2119 #    my_option_validation ()
2120 #    {
2121 #        $debug_cmd
2122 #
2123 #        $opt_silent && $opt_verbose && func_fatal_help "\
2124 #    '--silent' and '--verbose' options are mutually exclusive."
2125 #
2126 #        func_quote_for_eval ${1+"$@"}
2127 #        my_option_validation_result=$func_quote_for_eval_result
2128 #    }
2129 #    func_add_hook func_validate_options my_option_validation
2130 #
2131 # You'll alse need to manually amend $usage_message to reflect the extra
2132 # options you parse.  It's preferable to append if you can, so that
2133 # multiple option parsing hooks can be added safely.
2134 
2135 
2136 # func_options [ARG]...
2137 # ---------------------
2138 # All the functions called inside func_options are hookable. See the
2139 # individual implementations for details.
2140 func_hookable func_options
2141 func_options ()
2142 {
2143     $debug_cmd
2144 
2145     func_options_prep ${1+"$@"}
2146     eval func_parse_options \
2147         ${func_options_prep_result+"$func_options_prep_result"}
2148     eval func_validate_options \
2149         ${func_parse_options_result+"$func_parse_options_result"}
2150 
2151     eval func_run_hooks func_options \
2152         ${func_validate_options_result+"$func_validate_options_result"}
2153 
2154     # save modified positional parameters for caller
2155     func_options_result=$func_run_hooks_result
2156 }
2157 
2158 
2159 # func_options_prep [ARG]...
2160 # --------------------------
2161 # All initialisations required before starting the option parse loop.
2162 # Note that when calling hook functions, we pass through the list of
2163 # positional parameters.  If a hook function modifies that list, and
2164 # needs to propogate that back to rest of this script, then the complete
2165 # modified list must be put in 'func_run_hooks_result' before
2166 # returning.
2167 func_hookable func_options_prep
2168 func_options_prep ()
2169 {
2170     $debug_cmd
2171 
2172     # Option defaults:
2173     opt_verbose=false
2174     opt_warning_types=
2175 
2176     func_run_hooks func_options_prep ${1+"$@"}
2177 
2178     # save modified positional parameters for caller
2179     func_options_prep_result=$func_run_hooks_result
2180 }
2181 
2182 
2183 # func_parse_options [ARG]...
2184 # ---------------------------
2185 # The main option parsing loop.
2186 func_hookable func_parse_options
2187 func_parse_options ()
2188 {
2189     $debug_cmd
2190 
2191     func_parse_options_result=
2192 
2193     # this just eases exit handling
2194     while test $# -gt 0; do
2195       # Defer to hook functions for initial option parsing, so they
2196       # get priority in the event of reusing an option name.
2197       func_run_hooks func_parse_options ${1+"$@"}
2198 
2199       # Adjust func_parse_options positional parameters to match
2200       eval set dummy "$func_run_hooks_result"; shift
2201 
2202       # Break out of the loop if we already parsed every option.
2203       test $# -gt 0 || break
2204 
2205       _G_opt=$1
2206       shift
2207       case $_G_opt in
2208         --debug|-x)   debug_cmd='set -x'
2209                       func_echo "enabling shell trace mode"
2210                       $debug_cmd
2211                       ;;
2212 
2213         --no-warnings|--no-warning|--no-warn)
2214                       set dummy --warnings none ${1+"$@"}
2215                       shift
2216                       ;;
2217 
2218         --warnings|--warning|-W)
2219                       test $# = 0 && func_missing_arg $_G_opt && break
2220                       case " $warning_categories $1" in
2221                         *" $1 "*)
2222                           # trailing space prevents matching last $1 above
2223                           func_append_uniq opt_warning_types " $1"
2224                           ;;
2225                         *all)
2226                           opt_warning_types=$warning_categories
2227                           ;;
2228                         *none)
2229                           opt_warning_types=none
2230                           warning_func=:
2231                           ;;
2232                         *error)
2233                           opt_warning_types=$warning_categories
2234                           warning_func=func_fatal_error
2235                           ;;
2236                         *)
2237                           func_fatal_error \
2238                              "unsupported warning category: '$1'"
2239                           ;;
2240                       esac
2241                       shift
2242                       ;;
2243 
2244         --verbose|-v) opt_verbose=: ;;
2245         --version)    func_version ;;
2246         -\?|-h)       func_usage ;;
2247         --help)       func_help ;;
2248 
2249         # Separate optargs to long options (plugins may need this):
2250         --*=*)        func_split_equals "$_G_opt"
2251                       set dummy "$func_split_equals_lhs" \
2252                           "$func_split_equals_rhs" ${1+"$@"}
2253                       shift
2254                       ;;
2255 
2256        # Separate optargs to short options:
2257         -W*)
2258                       func_split_short_opt "$_G_opt"
2259                       set dummy "$func_split_short_opt_name" \
2260                           "$func_split_short_opt_arg" ${1+"$@"}
2261                       shift
2262                       ;;
2263 
2264         # Separate non-argument short options:
2265         -\?*|-h*|-v*|-x*)
2266                       func_split_short_opt "$_G_opt"
2267                       set dummy "$func_split_short_opt_name" \
2268                           "-$func_split_short_opt_arg" ${1+"$@"}
2269                       shift
2270                       ;;
2271 
2272         --)           break ;;
2273         -*)           func_fatal_help "unrecognised option: '$_G_opt'" ;;
2274         *)            set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
2275       esac
2276     done
2277 
2278     # save modified positional parameters for caller
2279     func_quote_for_eval ${1+"$@"}
2280     func_parse_options_result=$func_quote_for_eval_result
2281 }
2282 
2283 
2284 # func_validate_options [ARG]...
2285 # ------------------------------
2286 # Perform any sanity checks on option settings and/or unconsumed
2287 # arguments.
2288 func_hookable func_validate_options
2289 func_validate_options ()
2290 {
2291     $debug_cmd
2292 
2293     # Display all warnings if -W was not given.
2294     test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
2295 
2296     func_run_hooks func_validate_options ${1+"$@"}
2297 
2298     # Bail if the options were screwed!
2299     $exit_cmd $EXIT_FAILURE
2300 
2301     # save modified positional parameters for caller
2302     func_validate_options_result=$func_run_hooks_result
2303 }
2304 
2305 
2306 
2307 ## ----------------- ##
2308 ## Helper functions. ##
2309 ## ----------------- ##
2310 
2311 # This section contains the helper functions used by the rest of the
2312 # hookable option parser framework in ascii-betical order.
2313 
2314 
2315 # func_fatal_help ARG...
2316 # ----------------------
2317 # Echo program name prefixed message to standard error, followed by
2318 # a help hint, and exit.
2319 func_fatal_help ()
2320 {
2321     $debug_cmd
2322 
2323     eval \$ECHO \""Usage: $usage"\"
2324     eval \$ECHO \""$fatal_help"\"
2325     func_error ${1+"$@"}
2326     exit $EXIT_FAILURE
2327 }
2328 
2329 
2330 # func_help
2331 # ---------
2332 # Echo long help message to standard output and exit.
2333 func_help ()
2334 {
2335     $debug_cmd
2336 
2337     func_usage_message
2338     $ECHO "$long_help_message"
2339     exit 0
2340 }
2341 
2342 
2343 # func_missing_arg ARGNAME
2344 # ------------------------
2345 # Echo program name prefixed message to standard error and set global
2346 # exit_cmd.
2347 func_missing_arg ()
2348 {
2349     $debug_cmd
2350 
2351     func_error "Missing argument for '$1'."
2352     exit_cmd=exit
2353 }
2354 
2355 
2356 # func_split_equals STRING
2357 # ------------------------
2358 # Set func_split_equals_lhs and func_split_equals_rhs shell variables after
2359 # splitting STRING at the '=' sign.
2360 test -z "$_G_HAVE_XSI_OPS" \
2361     && (eval 'x=a/b/c;
2362       test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
2363     && _G_HAVE_XSI_OPS=yes
2364 
2365 if test yes = "$_G_HAVE_XSI_OPS"
2366 then
2367   # This is an XSI compatible shell, allowing a faster implementation...
2368   eval 'func_split_equals ()
2369   {
2370       $debug_cmd
2371 
2372       func_split_equals_lhs=${1%%=*}
2373       func_split_equals_rhs=${1#*=}
2374       test "x$func_split_equals_lhs" = "x$1" \
2375         && func_split_equals_rhs=
2376   }'
2377 else
2378   # ...otherwise fall back to using expr, which is often a shell builtin.
2379   func_split_equals ()
2380   {
2381       $debug_cmd
2382 
2383       func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
2384       func_split_equals_rhs=
2385       test "x$func_split_equals_lhs" = "x$1" \
2386         || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
2387   }
2388 fi #func_split_equals
2389 
2390 
2391 # func_split_short_opt SHORTOPT
2392 # -----------------------------
2393 # Set func_split_short_opt_name and func_split_short_opt_arg shell
2394 # variables after splitting SHORTOPT after the 2nd character.
2395 if test yes = "$_G_HAVE_XSI_OPS"
2396 then
2397   # This is an XSI compatible shell, allowing a faster implementation...
2398   eval 'func_split_short_opt ()
2399   {
2400       $debug_cmd
2401 
2402       func_split_short_opt_arg=${1#??}
2403       func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
2404   }'
2405 else
2406   # ...otherwise fall back to using expr, which is often a shell builtin.
2407   func_split_short_opt ()
2408   {
2409       $debug_cmd
2410 
2411       func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
2412       func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
2413   }
2414 fi #func_split_short_opt
2415 
2416 
2417 # func_usage
2418 # ----------
2419 # Echo short help message to standard output and exit.
2420 func_usage ()
2421 {
2422     $debug_cmd
2423 
2424     func_usage_message
2425     $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
2426     exit 0
2427 }
2428 
2429 
2430 # func_usage_message
2431 # ------------------
2432 # Echo short help message to standard output.
2433 func_usage_message ()
2434 {
2435     $debug_cmd
2436 
2437     eval \$ECHO \""Usage: $usage"\"
2438     echo
2439     $SED -n 's|^# ||
2440         /^Written by/{
2441           x;p;x
2442         }
2443         h
2444         /^Written by/q' < "$progpath"
2445     echo
2446     eval \$ECHO \""$usage_message"\"
2447 }
2448 
2449 
2450 # func_version
2451 # ------------
2452 # Echo version message to standard output and exit.
2453 func_version ()
2454 {
2455     $debug_cmd
2456 
2457     printf '%s\n' "$progname $scriptversion"
2458     $SED -n '
2459         /(C)/!b go
2460         :more
2461         /\./!{
2462           N
2463           s|\n# | |
2464           b more
2465         }
2466         :go
2467         /^# Written by /,/# warranty; / {
2468           s|^# ||
2469           s|^# *$||
2470           s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
2471           p
2472         }
2473         /^# Written by / {
2474           s|^# ||
2475           p
2476         }
2477         /^warranty; /q' < "$progpath"
2478 
2479     exit $?
2480 }
2481 
2482 
2483 # Local variables:
2484 # mode: shell-script
2485 # sh-indentation: 2
2486 # eval: (add-hook 'before-save-hook 'time-stamp)
2487 # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
2488 # time-stamp-time-zone: "UTC"
2489 # End:
2490 
2491 # Set a version string.
2492 scriptversion='(GNU libtool) 2.4.6'
2493 
2494 
2495 # func_echo ARG...
2496 # ----------------
2497 # Libtool also displays the current mode in messages, so override
2498 # funclib.sh func_echo with this custom definition.
2499 func_echo ()
2500 {
2501     $debug_cmd
2502 
2503     _G_message=$*
2504 
2505     func_echo_IFS=$IFS
2506     IFS=$nl
2507     for _G_line in $_G_message; do
2508       IFS=$func_echo_IFS
2509       $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
2510     done
2511     IFS=$func_echo_IFS
2512 }
2513 
2514 
2515 # func_warning ARG...
2516 # -------------------
2517 # Libtool warnings are not categorized, so override funclib.sh
2518 # func_warning with this simpler definition.
2519 func_warning ()
2520 {
2521     $debug_cmd
2522 
2523     $warning_func ${1+"$@"}
2524 }
2525 
2526 
2527 ## ---------------- ##
2528 ## Options parsing. ##
2529 ## ---------------- ##
2530 
2531 # Hook in the functions to make sure our own options are parsed during
2532 # the option parsing loop.
2533 
2534 usage='$progpath [OPTION]... [MODE-ARG]...'
2535 
2536 # Short help message in response to '-h'.
2537 usage_message="Options:
2538        --config             show all configuration variables
2539        --debug              enable verbose shell tracing
2540    -n, --dry-run            display commands without modifying any files
2541        --features           display basic configuration information and exit
2542        --mode=MODE          use operation mode MODE
2543        --no-warnings        equivalent to '-Wnone'
2544        --preserve-dup-deps  don't remove duplicate dependency libraries
2545        --quiet, --silent    don't print informational messages
2546        --tag=TAG            use configuration variables from tag TAG
2547    -v, --verbose            print more informational messages than default
2548        --version            print version information
2549    -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [all]
2550    -h, --help, --help-all   print short, long, or detailed help message
2551 "
2552 
2553 # Additional text appended to 'usage_message' in response to '--help'.
2554 func_help ()
2555 {
2556     $debug_cmd
2557 
2558     func_usage_message
2559     $ECHO "$long_help_message
2560 
2561 MODE must be one of the following:
2562 
2563        clean           remove files from the build directory
2564        compile         compile a source file into a libtool object
2565        execute         automatically set library path, then run a program
2566        finish          complete the installation of libtool libraries
2567        install         install libraries or executables
2568        link            create a library or an executable
2569        uninstall       remove libraries from an installed directory
2570 
2571 MODE-ARGS vary depending on the MODE.  When passed as first option,
2572 '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
2573 Try '$progname --help --mode=MODE' for a more detailed description of MODE.
2574 
2575 When reporting a bug, please describe a test case to reproduce it and
2576 include the following information:
2577 
2578        host-triplet:   $host
2579        shell:          $SHELL
2580        compiler:       $LTCC
2581        compiler flags: $LTCFLAGS
2582        linker:         $LD (gnu? $with_gnu_ld)
2583        version:        $progname (GNU libtool) 2.4.6
2584        automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
2585        autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
2586 
2587 Report bugs to <bug-libtool@gnu.org>.
2588 GNU libtool home page: <http://www.gnu.org/software/libtool/>.
2589 General help using GNU software: <http://www.gnu.org/gethelp/>."
2590     exit 0
2591 }
2592 
2593 
2594 # func_lo2o OBJECT-NAME
2595 # ---------------------
2596 # Transform OBJECT-NAME from a '.lo' suffix to the platform specific
2597 # object suffix.
2598 
2599 lo2o=s/\\.lo\$/.$objext/
2600 o2lo=s/\\.$objext\$/.lo/
2601 
2602 if test yes = "$_G_HAVE_XSI_OPS"; then
2603   eval 'func_lo2o ()
2604   {
2605     case $1 in
2606       *.lo) func_lo2o_result=${1%.lo}.$objext ;;
2607       *   ) func_lo2o_result=$1               ;;
2608     esac
2609   }'
2610 
2611   # func_xform LIBOBJ-OR-SOURCE
2612   # ---------------------------
2613   # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
2614   # suffix to a '.lo' libtool-object suffix.
2615   eval 'func_xform ()
2616   {
2617     func_xform_result=${1%.*}.lo
2618   }'
2619 else
2620   # ...otherwise fall back to using sed.
2621   func_lo2o ()
2622   {
2623     func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
2624   }
2625 
2626   func_xform ()
2627   {
2628     func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
2629   }
2630 fi
2631 
2632 
2633 # func_fatal_configuration ARG...
2634 # -------------------------------
2635 # Echo program name prefixed message to standard error, followed by
2636 # a configuration failure hint, and exit.
2637 func_fatal_configuration ()
2638 {
2639     func_fatal_error ${1+"$@"} \
2640       "See the $PACKAGE documentation for more information." \
2641       "Fatal configuration error."
2642 }
2643 
2644 
2645 # func_config
2646 # -----------
2647 # Display the configuration for all the tags in this script.
2648 func_config ()
2649 {
2650     re_begincf='^# ### BEGIN LIBTOOL'
2651     re_endcf='^# ### END LIBTOOL'
2652 
2653     # Default configuration.
2654     $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
2655 
2656     # Now print the configurations for the tags.
2657     for tagname in $taglist; do
2658       $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
2659     done
2660 
2661     exit $?
2662 }
2663 
2664 
2665 # func_features
2666 # -------------
2667 # Display the features supported by this script.
2668 func_features ()
2669 {
2670     echo "host: $host"
2671     if test yes = "$build_libtool_libs"; then
2672       echo "enable shared libraries"
2673     else
2674       echo "disable shared libraries"
2675     fi
2676     if test yes = "$build_old_libs"; then
2677       echo "enable static libraries"
2678     else
2679       echo "disable static libraries"
2680     fi
2681 
2682     exit $?
2683 }
2684 
2685 
2686 # func_enable_tag TAGNAME
2687 # -----------------------
2688 # Verify that TAGNAME is valid, and either flag an error and exit, or
2689 # enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
2690 # variable here.
2691 func_enable_tag ()
2692 {
2693     # Global variable:
2694     tagname=$1
2695 
2696     re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
2697     re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
2698     sed_extractcf=/$re_begincf/,/$re_endcf/p
2699 
2700     # Validate tagname.
2701     case $tagname in
2702       *[!-_A-Za-z0-9,/]*)
2703         func_fatal_error "invalid tag name: $tagname"
2704         ;;
2705     esac
2706 
2707     # Don't test for the "default" C tag, as we know it's
2708     # there but not specially marked.
2709     case $tagname in
2710         CC) ;;
2711     *)
2712         if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
2713           taglist="$taglist $tagname"
2714 
2715           # Evaluate the configuration.  Be careful to quote the path
2716           # and the sed script, to avoid splitting on whitespace, but
2717           # also don't use non-portable quotes within backquotes within
2718           # quotes we have to do it in 2 steps:
2719           extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
2720           eval "$extractedcf"
2721         else
2722           func_error "ignoring unknown tag $tagname"
2723         fi
2724         ;;
2725     esac
2726 }
2727 
2728 
2729 # func_check_version_match
2730 # ------------------------
2731 # Ensure that we are using m4 macros, and libtool script from the same
2732 # release of libtool.
2733 func_check_version_match ()
2734 {
2735     if test "$package_revision" != "$macro_revision"; then
2736       if test "$VERSION" != "$macro_version"; then
2737         if test -z "$macro_version"; then
2738           cat >&2 <<_LT_EOF
2739 $progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
2740 $progname: definition of this LT_INIT comes from an older release.
2741 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
2742 $progname: and run autoconf again.
2743 _LT_EOF
2744         else
2745           cat >&2 <<_LT_EOF
2746 $progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
2747 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
2748 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
2749 $progname: and run autoconf again.
2750 _LT_EOF
2751         fi
2752       else
2753         cat >&2 <<_LT_EOF
2754 $progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
2755 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
2756 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
2757 $progname: of $PACKAGE $VERSION and run autoconf again.
2758 _LT_EOF
2759       fi
2760 
2761       exit $EXIT_MISMATCH
2762     fi
2763 }
2764 
2765 
2766 # libtool_options_prep [ARG]...
2767 # -----------------------------
2768 # Preparation for options parsed by libtool.
2769 libtool_options_prep ()
2770 {
2771     $debug_mode
2772 
2773     # Option defaults:
2774     opt_config=false
2775     opt_dlopen=
2776     opt_dry_run=false
2777     opt_help=false
2778     opt_mode=
2779     opt_preserve_dup_deps=false
2780     opt_quiet=false
2781 
2782     nonopt=
2783     preserve_args=
2784 
2785     # Shorthand for --mode=foo, only valid as the first argument
2786     case $1 in
2787     clean|clea|cle|cl)
2788       shift; set dummy --mode clean ${1+"$@"}; shift
2789       ;;
2790     compile|compil|compi|comp|com|co|c)
2791       shift; set dummy --mode compile ${1+"$@"}; shift
2792       ;;
2793     execute|execut|execu|exec|exe|ex|e)
2794       shift; set dummy --mode execute ${1+"$@"}; shift
2795       ;;
2796     finish|finis|fini|fin|fi|f)
2797       shift; set dummy --mode finish ${1+"$@"}; shift
2798       ;;
2799     install|instal|insta|inst|ins|in|i)
2800       shift; set dummy --mode install ${1+"$@"}; shift
2801       ;;
2802     link|lin|li|l)
2803       shift; set dummy --mode link ${1+"$@"}; shift
2804       ;;
2805     uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
2806       shift; set dummy --mode uninstall ${1+"$@"}; shift
2807       ;;
2808     esac
2809 
2810     # Pass back the list of options.
2811     func_quote_for_eval ${1+"$@"}
2812     libtool_options_prep_result=$func_quote_for_eval_result
2813 }
2814 func_add_hook func_options_prep libtool_options_prep
2815 
2816 
2817 # libtool_parse_options [ARG]...
2818 # ---------------------------------
2819 # Provide handling for libtool specific options.
2820 libtool_parse_options ()
2821 {
2822     $debug_cmd
2823 
2824     # Perform our own loop to consume as many options as possible in
2825     # each iteration.
2826     while test $# -gt 0; do
2827       _G_opt=$1
2828       shift
2829       case $_G_opt in
2830         --dry-run|--dryrun|-n)
2831                         opt_dry_run=:
2832                         ;;
2833 
2834         --config)       func_config ;;
2835 
2836         --dlopen|-dlopen)
2837                         opt_dlopen="${opt_dlopen+$opt_dlopen
2838 }$1"
2839                         shift
2840                         ;;
2841 
2842         --preserve-dup-deps)
2843                         opt_preserve_dup_deps=: ;;
2844 
2845         --features)     func_features ;;
2846 
2847         --finish)       set dummy --mode finish ${1+"$@"}; shift ;;
2848 
2849         --help)         opt_help=: ;;
2850 
2851         --help-all)     opt_help=': help-all' ;;
2852 
2853         --mode)         test $# = 0 && func_missing_arg $_G_opt && break
2854                         opt_mode=$1
2855                         case $1 in
2856                           # Valid mode arguments:
2857                           clean|compile|execute|finish|install|link|relink|uninstall) ;;
2858 
2859                           # Catch anything else as an error
2860                           *) func_error "invalid argument for $_G_opt"
2861                              exit_cmd=exit
2862                              break
2863                              ;;
2864                         esac
2865                         shift
2866                         ;;
2867 
2868         --no-silent|--no-quiet)
2869                         opt_quiet=false
2870                         func_append preserve_args " $_G_opt"
2871                         ;;
2872 
2873         --no-warnings|--no-warning|--no-warn)
2874                         opt_warning=false
2875                         func_append preserve_args " $_G_opt"
2876                         ;;
2877 
2878         --no-verbose)
2879                         opt_verbose=false
2880                         func_append preserve_args " $_G_opt"
2881                         ;;
2882 
2883         --silent|--quiet)
2884                         opt_quiet=:
2885                         opt_verbose=false
2886                         func_append preserve_args " $_G_opt"
2887                         ;;
2888 
2889         --tag)          test $# = 0 && func_missing_arg $_G_opt && break
2890                         opt_tag=$1
2891                         func_append preserve_args " $_G_opt $1"
2892                         func_enable_tag "$1"
2893                         shift
2894                         ;;
2895 
2896         --verbose|-v)   opt_quiet=false
2897                         opt_verbose=:
2898                         func_append preserve_args " $_G_opt"
2899                         ;;
2900 
2901         # An option not handled by this hook function:
2902         *)              set dummy "$_G_opt" ${1+"$@"};  shift; break  ;;
2903       esac
2904     done
2905 
2906 
2907     # save modified positional parameters for caller
2908     func_quote_for_eval ${1+"$@"}
2909     libtool_parse_options_result=$func_quote_for_eval_result
2910 }
2911 func_add_hook func_parse_options libtool_parse_options
2912 
2913 
2914 
2915 # libtool_validate_options [ARG]...
2916 # ---------------------------------
2917 # Perform any sanity checks on option settings and/or unconsumed
2918 # arguments.
2919 libtool_validate_options ()
2920 {
2921     # save first non-option argument
2922     if test 0 -lt $#; then
2923       nonopt=$1
2924       shift
2925     fi
2926 
2927     # preserve --debug
2928     test : = "$debug_cmd" || func_append preserve_args " --debug"
2929 
2930     case $host in
2931       # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
2932       # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
2933       *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
2934         # don't eliminate duplications in $postdeps and $predeps
2935         opt_duplicate_compiler_generated_deps=:
2936         ;;
2937       *)
2938         opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
2939         ;;
2940     esac
2941 
2942     $opt_help || {
2943       # Sanity checks first:
2944       func_check_version_match
2945 
2946       test yes != "$build_libtool_libs" \
2947         && test yes != "$build_old_libs" \
2948         && func_fatal_configuration "not configured to build any kind of library"
2949 
2950       # Darwin sucks
2951       eval std_shrext=\"$shrext_cmds\"
2952 
2953       # Only execute mode is allowed to have -dlopen flags.
2954       if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
2955         func_error "unrecognized option '-dlopen'"
2956         $ECHO "$help" 1>&2
2957         exit $EXIT_FAILURE
2958       fi
2959 
2960       # Change the help message to a mode-specific one.
2961       generic_help=$help
2962       help="Try '$progname --help --mode=$opt_mode' for more information."
2963     }
2964 
2965     # Pass back the unparsed argument list
2966     func_quote_for_eval ${1+"$@"}
2967     libtool_validate_options_result=$func_quote_for_eval_result
2968 }
2969 func_add_hook func_validate_options libtool_validate_options
2970 
2971 
2972 # Process options as early as possible so that --help and --version
2973 # can return quickly.
2974 func_options ${1+"$@"}
2975 eval set dummy "$func_options_result"; shift
2976 
2977 
2978 
2979 ## ----------- ##
2980 ##    Main.    ##
2981 ## ----------- ##
2982 
2983 magic='%%%MAGIC variable%%%'
2984 magic_exe='%%%MAGIC EXE variable%%%'
2985 
2986 # Global variables.
2987 extracted_archives=
2988 extracted_serial=0
2989 
2990 # If this variable is set in any of the actions, the command in it
2991 # will be execed at the end.  This prevents here-documents from being
2992 # left over by shells.
2993 exec_cmd=
2994 
2995 
2996 # A function that is used when there is no print builtin or printf.
2997 func_fallback_echo ()
2998 {
2999   eval 'cat <<_LTECHO_EOF
3000 $1
3001 _LTECHO_EOF'
3002 }
3003 
3004 # func_generated_by_libtool
3005 # True iff stdin has been generated by Libtool. This function is only
3006 # a basic sanity check; it will hardly flush out determined imposters.
3007 func_generated_by_libtool_p ()
3008 {
3009   $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
3010 }
3011 
3012 # func_lalib_p file
3013 # True iff FILE is a libtool '.la' library or '.lo' object file.
3014 # This function is only a basic sanity check; it will hardly flush out
3015 # determined imposters.
3016 func_lalib_p ()
3017 {
3018     test -f "$1" &&
3019       $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
3020 }
3021 
3022 # func_lalib_unsafe_p file
3023 # True iff FILE is a libtool '.la' library or '.lo' object file.
3024 # This function implements the same check as func_lalib_p without
3025 # resorting to external programs.  To this end, it redirects stdin and
3026 # closes it afterwards, without saving the original file descriptor.
3027 # As a safety measure, use it only where a negative result would be
3028 # fatal anyway.  Works if 'file' does not exist.
3029 func_lalib_unsafe_p ()
3030 {
3031     lalib_p=no
3032     if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
3033         for lalib_p_l in 1 2 3 4
3034         do
3035             read lalib_p_line
3036             case $lalib_p_line in
3037                 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
3038             esac
3039         done
3040         exec 0<&5 5<&-
3041     fi
3042     test yes = "$lalib_p"
3043 }
3044 
3045 # func_ltwrapper_script_p file
3046 # True iff FILE is a libtool wrapper script
3047 # This function is only a basic sanity check; it will hardly flush out
3048 # determined imposters.
3049 func_ltwrapper_script_p ()
3050 {
3051     test -f "$1" &&
3052       $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
3053 }
3054 
3055 # func_ltwrapper_executable_p file
3056 # True iff FILE is a libtool wrapper executable
3057 # This function is only a basic sanity check; it will hardly flush out
3058 # determined imposters.
3059 func_ltwrapper_executable_p ()
3060 {
3061     func_ltwrapper_exec_suffix=
3062     case $1 in
3063     *.exe) ;;
3064     *) func_ltwrapper_exec_suffix=.exe ;;
3065     esac
3066     $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
3067 }
3068 
3069 # func_ltwrapper_scriptname file
3070 # Assumes file is an ltwrapper_executable
3071 # uses $file to determine the appropriate filename for a
3072 # temporary ltwrapper_script.
3073 func_ltwrapper_scriptname ()
3074 {
3075     func_dirname_and_basename "$1" "" "."
3076     func_stripname '' '.exe' "$func_basename_result"
3077     func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
3078 }
3079 
3080 # func_ltwrapper_p file
3081 # True iff FILE is a libtool wrapper script or wrapper executable
3082 # This function is only a basic sanity check; it will hardly flush out
3083 # determined imposters.
3084 func_ltwrapper_p ()
3085 {
3086     func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
3087 }
3088 
3089 
3090 # func_execute_cmds commands fail_cmd
3091 # Execute tilde-delimited COMMANDS.
3092 # If FAIL_CMD is given, eval that upon failure.
3093 # FAIL_CMD may read-access the current command in variable CMD!
3094 func_execute_cmds ()
3095 {
3096     $debug_cmd
3097 
3098     save_ifs=$IFS; IFS='~'
3099     for cmd in $1; do
3100       IFS=$sp$nl
3101       eval cmd=\"$cmd\"
3102       IFS=$save_ifs
3103       func_show_eval "$cmd" "${2-:}"
3104     done
3105     IFS=$save_ifs
3106 }
3107 
3108 
3109 # func_source file
3110 # Source FILE, adding directory component if necessary.
3111 # Note that it is not necessary on cygwin/mingw to append a dot to
3112 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
3113 # behavior happens only for exec(3), not for open(2)!  Also, sourcing
3114 # 'FILE.' does not work on cygwin managed mounts.
3115 func_source ()
3116 {
3117     $debug_cmd
3118 
3119     case $1 in
3120     */* | *\\*) . "$1" ;;
3121     *)          . "./$1" ;;
3122     esac
3123 }
3124 
3125 
3126 # func_resolve_sysroot PATH
3127 # Replace a leading = in PATH with a sysroot.  Store the result into
3128 # func_resolve_sysroot_result
3129 func_resolve_sysroot ()
3130 {
3131   func_resolve_sysroot_result=$1
3132   case $func_resolve_sysroot_result in
3133   =*)
3134     func_stripname '=' '' "$func_resolve_sysroot_result"
3135     func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
3136     ;;
3137   esac
3138 }
3139 
3140 # func_replace_sysroot PATH
3141 # If PATH begins with the sysroot, replace it with = and
3142 # store the result into func_replace_sysroot_result.
3143 func_replace_sysroot ()
3144 {
3145   case $lt_sysroot:$1 in
3146   ?*:"$lt_sysroot"*)
3147     func_stripname "$lt_sysroot" '' "$1"
3148     func_replace_sysroot_result='='$func_stripname_result
3149     ;;
3150   *)
3151     # Including no sysroot.
3152     func_replace_sysroot_result=$1
3153     ;;
3154   esac
3155 }
3156 
3157 # func_infer_tag arg
3158 # Infer tagged configuration to use if any are available and
3159 # if one wasn't chosen via the "--tag" command line option.
3160 # Only attempt this if the compiler in the base compile
3161 # command doesn't match the default compiler.
3162 # arg is usually of the form 'gcc ...'
3163 func_infer_tag ()
3164 {
3165     $debug_cmd
3166 
3167     if test -n "$available_tags" && test -z "$tagname"; then
3168       CC_quoted=
3169       for arg in $CC; do
3170         func_append_quoted CC_quoted "$arg"
3171       done
3172       CC_expanded=`func_echo_all $CC`
3173       CC_quoted_expanded=`func_echo_all $CC_quoted`
3174       case $@ in
3175       # Blanks in the command may have been stripped by the calling shell,
3176       # but not from the CC environment variable when configure was run.
3177       " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
3178       " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
3179       # Blanks at the start of $base_compile will cause this to fail
3180       # if we don't check for them as well.
3181       *)
3182         for z in $available_tags; do
3183           if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
3184             # Evaluate the configuration.
3185             eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
3186             CC_quoted=
3187             for arg in $CC; do
3188               # Double-quote args containing other shell metacharacters.
3189               func_append_quoted CC_quoted "$arg"
3190             done
3191             CC_expanded=`func_echo_all $CC`
3192             CC_quoted_expanded=`func_echo_all $CC_quoted`
3193             case "$@ " in
3194             " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
3195             " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
3196               # The compiler in the base compile command matches
3197               # the one in the tagged configuration.
3198               # Assume this is the tagged configuration we want.
3199               tagname=$z
3200               break
3201               ;;
3202             esac
3203           fi
3204         done
3205         # If $tagname still isn't set, then no tagged configuration
3206         # was found and let the user know that the "--tag" command
3207         # line option must be used.
3208         if test -z "$tagname"; then
3209           func_echo "unable to infer tagged configuration"
3210           func_fatal_error "specify a tag with '--tag'"
3211 #       else
3212 #         func_verbose "using $tagname tagged configuration"
3213         fi
3214         ;;
3215       esac
3216     fi
3217 }
3218 
3219 
3220 
3221 # func_write_libtool_object output_name pic_name nonpic_name
3222 # Create a libtool object file (analogous to a ".la" file),
3223 # but don't create it if we're doing a dry run.
3224 func_write_libtool_object ()
3225 {
3226     write_libobj=$1
3227     if test yes = "$build_libtool_libs"; then
3228       write_lobj=\'$2\'
3229     else
3230       write_lobj=none
3231     fi
3232 
3233     if test yes = "$build_old_libs"; then
3234       write_oldobj=\'$3\'
3235     else
3236       write_oldobj=none
3237     fi
3238 
3239     $opt_dry_run || {
3240       cat >${write_libobj}T <<EOF
3241 # $write_libobj - a libtool object file
3242 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
3243 #
3244 # Please DO NOT delete this file!
3245 # It is necessary for linking the library.
3246 
3247 # Name of the PIC object.
3248 pic_object=$write_lobj
3249 
3250 # Name of the non-PIC object
3251 non_pic_object=$write_oldobj
3252 
3253 EOF
3254       $MV "${write_libobj}T" "$write_libobj"
3255     }
3256 }
3257 
3258 
3259 ##################################################
3260 # FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
3261 ##################################################
3262 
3263 # func_convert_core_file_wine_to_w32 ARG
3264 # Helper function used by file name conversion functions when $build is *nix,
3265 # and $host is mingw, cygwin, or some other w32 environment. Relies on a
3266 # correctly configured wine environment available, with the winepath program
3267 # in $build's $PATH.
3268 #
3269 # ARG is the $build file name to be converted to w32 format.
3270 # Result is available in $func_convert_core_file_wine_to_w32_result, and will
3271 # be empty on error (or when ARG is empty)
3272 func_convert_core_file_wine_to_w32 ()
3273 {
3274   $debug_cmd
3275 
3276   func_convert_core_file_wine_to_w32_result=$1
3277   if test -n "$1"; then
3278     # Unfortunately, winepath does not exit with a non-zero error code, so we
3279     # are forced to check the contents of stdout. On the other hand, if the
3280     # command is not found, the shell will set an exit code of 127 and print
3281     # *an error message* to stdout. So we must check for both error code of
3282     # zero AND non-empty stdout, which explains the odd construction:
3283     func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
3284     if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
3285       func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
3286         $SED -e "$sed_naive_backslashify"`
3287     else
3288       func_convert_core_file_wine_to_w32_result=
3289     fi
3290   fi
3291 }
3292 # end: func_convert_core_file_wine_to_w32
3293 
3294 
3295 # func_convert_core_path_wine_to_w32 ARG
3296 # Helper function used by path conversion functions when $build is *nix, and
3297 # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
3298 # configured wine environment available, with the winepath program in $build's
3299 # $PATH. Assumes ARG has no leading or trailing path separator characters.
3300 #
3301 # ARG is path to be converted from $build format to win32.
3302 # Result is available in $func_convert_core_path_wine_to_w32_result.
3303 # Unconvertible file (directory) names in ARG are skipped; if no directory names
3304 # are convertible, then the result may be empty.
3305 func_convert_core_path_wine_to_w32 ()
3306 {
3307   $debug_cmd
3308 
3309   # unfortunately, winepath doesn't convert paths, only file names
3310   func_convert_core_path_wine_to_w32_result=
3311   if test -n "$1"; then
3312     oldIFS=$IFS
3313     IFS=:
3314     for func_convert_core_path_wine_to_w32_f in $1; do
3315       IFS=$oldIFS
3316       func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
3317       if test -n "$func_convert_core_file_wine_to_w32_result"; then
3318         if test -z "$func_convert_core_path_wine_to_w32_result"; then
3319           func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
3320         else
3321           func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
3322         fi
3323       fi
3324     done
3325     IFS=$oldIFS
3326   fi
3327 }
3328 # end: func_convert_core_path_wine_to_w32
3329 
3330 
3331 # func_cygpath ARGS...
3332 # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
3333 # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
3334 # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
3335 # (2), returns the Cygwin file name or path in func_cygpath_result (input
3336 # file name or path is assumed to be in w32 format, as previously converted
3337 # from $build's *nix or MSYS format). In case (3), returns the w32 file name
3338 # or path in func_cygpath_result (input file name or path is assumed to be in
3339 # Cygwin format). Returns an empty string on error.
3340 #
3341 # ARGS are passed to cygpath, with the last one being the file name or path to
3342 # be converted.
3343 #
3344 # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
3345 # environment variable; do not put it in $PATH.
3346 func_cygpath ()
3347 {
3348   $debug_cmd
3349 
3350   if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
3351     func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
3352     if test "$?" -ne 0; then
3353       # on failure, ensure result is empty
3354       func_cygpath_result=
3355     fi
3356   else
3357     func_cygpath_result=
3358     func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
3359   fi
3360 }
3361 #end: func_cygpath
3362 
3363 
3364 # func_convert_core_msys_to_w32 ARG
3365 # Convert file name or path ARG from MSYS format to w32 format.  Return
3366 # result in func_convert_core_msys_to_w32_result.
3367 func_convert_core_msys_to_w32 ()
3368 {
3369   $debug_cmd
3370 
3371   # awkward: cmd appends spaces to result
3372   func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
3373     $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
3374 }
3375 #end: func_convert_core_msys_to_w32
3376 
3377 
3378 # func_convert_file_check ARG1 ARG2
3379 # Verify that ARG1 (a file name in $build format) was converted to $host
3380 # format in ARG2. Otherwise, emit an error message, but continue (resetting
3381 # func_to_host_file_result to ARG1).
3382 func_convert_file_check ()
3383 {
3384   $debug_cmd
3385 
3386   if test -z "$2" && test -n "$1"; then
3387     func_error "Could not determine host file name corresponding to"
3388     func_error "  '$1'"
3389     func_error "Continuing, but uninstalled executables may not work."
3390     # Fallback:
3391     func_to_host_file_result=$1
3392   fi
3393 }
3394 # end func_convert_file_check
3395 
3396 
3397 # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
3398 # Verify that FROM_PATH (a path in $build format) was converted to $host
3399 # format in TO_PATH. Otherwise, emit an error message, but continue, resetting
3400 # func_to_host_file_result to a simplistic fallback value (see below).
3401 func_convert_path_check ()
3402 {
3403   $debug_cmd
3404 
3405   if test -z "$4" && test -n "$3"; then
3406     func_error "Could not determine the host path corresponding to"
3407     func_error "  '$3'"
3408     func_error "Continuing, but uninstalled executables may not work."
3409     # Fallback.  This is a deliberately simplistic "conversion" and
3410     # should not be "improved".  See libtool.info.
3411     if test "x$1" != "x$2"; then
3412       lt_replace_pathsep_chars="s|$1|$2|g"
3413       func_to_host_path_result=`echo "$3" |
3414         $SED -e "$lt_replace_pathsep_chars"`
3415     else
3416       func_to_host_path_result=$3
3417     fi
3418   fi
3419 }
3420 # end func_convert_path_check
3421 
3422 
3423 # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
3424 # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
3425 # and appending REPL if ORIG matches BACKPAT.
3426 func_convert_path_front_back_pathsep ()
3427 {
3428   $debug_cmd
3429 
3430   case $4 in
3431   $1 ) func_to_host_path_result=$3$func_to_host_path_result
3432     ;;
3433   esac
3434   case $4 in
3435   $2 ) func_append func_to_host_path_result "$3"
3436     ;;
3437   esac
3438 }
3439 # end func_convert_path_front_back_pathsep
3440 
3441 
3442 ##################################################
3443 # $build to $host FILE NAME CONVERSION FUNCTIONS #
3444 ##################################################
3445 # invoked via '$to_host_file_cmd ARG'
3446 #
3447 # In each case, ARG is the path to be converted from $build to $host format.
3448 # Result will be available in $func_to_host_file_result.
3449 
3450 
3451 # func_to_host_file ARG
3452 # Converts the file name ARG from $build format to $host format. Return result
3453 # in func_to_host_file_result.
3454 func_to_host_file ()
3455 {
3456   $debug_cmd
3457 
3458   $to_host_file_cmd "$1"
3459 }
3460 # end func_to_host_file
3461 
3462 
3463 # func_to_tool_file ARG LAZY
3464 # converts the file name ARG from $build format to toolchain format. Return
3465 # result in func_to_tool_file_result.  If the conversion in use is listed
3466 # in (the comma separated) LAZY, no conversion takes place.
3467 func_to_tool_file ()
3468 {
3469   $debug_cmd
3470 
3471   case ,$2, in
3472     *,"$to_tool_file_cmd",*)
3473       func_to_tool_file_result=$1
3474       ;;
3475     *)
3476       $to_tool_file_cmd "$1"
3477       func_to_tool_file_result=$func_to_host_file_result
3478       ;;
3479   esac
3480 }
3481 # end func_to_tool_file
3482 
3483 
3484 # func_convert_file_noop ARG
3485 # Copy ARG to func_to_host_file_result.
3486 func_convert_file_noop ()
3487 {
3488   func_to_host_file_result=$1
3489 }
3490 # end func_convert_file_noop
3491 
3492 
3493 # func_convert_file_msys_to_w32 ARG
3494 # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
3495 # conversion to w32 is not available inside the cwrapper.  Returns result in
3496 # func_to_host_file_result.
3497 func_convert_file_msys_to_w32 ()
3498 {
3499   $debug_cmd
3500 
3501   func_to_host_file_result=$1
3502   if test -n "$1"; then
3503     func_convert_core_msys_to_w32 "$1"
3504     func_to_host_file_result=$func_convert_core_msys_to_w32_result
3505   fi
3506   func_convert_file_check "$1" "$func_to_host_file_result"
3507 }
3508 # end func_convert_file_msys_to_w32
3509 
3510 
3511 # func_convert_file_cygwin_to_w32 ARG
3512 # Convert file name ARG from Cygwin to w32 format.  Returns result in
3513 # func_to_host_file_result.
3514 func_convert_file_cygwin_to_w32 ()
3515 {
3516   $debug_cmd
3517 
3518   func_to_host_file_result=$1
3519   if test -n "$1"; then
3520     # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
3521     # LT_CYGPATH in this case.
3522     func_to_host_file_result=`cygpath -m "$1"`
3523   fi
3524   func_convert_file_check "$1" "$func_to_host_file_result"
3525 }
3526 # end func_convert_file_cygwin_to_w32
3527 
3528 
3529 # func_convert_file_nix_to_w32 ARG
3530 # Convert file name ARG from *nix to w32 format.  Requires a wine environment
3531 # and a working winepath. Returns result in func_to_host_file_result.
3532 func_convert_file_nix_to_w32 ()
3533 {
3534   $debug_cmd
3535 
3536   func_to_host_file_result=$1
3537   if test -n "$1"; then
3538     func_convert_core_file_wine_to_w32 "$1"
3539     func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
3540   fi
3541   func_convert_file_check "$1" "$func_to_host_file_result"
3542 }
3543 # end func_convert_file_nix_to_w32
3544 
3545 
3546 # func_convert_file_msys_to_cygwin ARG
3547 # Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
3548 # Returns result in func_to_host_file_result.
3549 func_convert_file_msys_to_cygwin ()
3550 {
3551   $debug_cmd
3552 
3553   func_to_host_file_result=$1
3554   if test -n "$1"; then
3555     func_convert_core_msys_to_w32 "$1"
3556     func_cygpath -u "$func_convert_core_msys_to_w32_result"
3557     func_to_host_file_result=$func_cygpath_result
3558   fi
3559   func_convert_file_check "$1" "$func_to_host_file_result"
3560 }
3561 # end func_convert_file_msys_to_cygwin
3562 
3563 
3564 # func_convert_file_nix_to_cygwin ARG
3565 # Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
3566 # in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
3567 # in func_to_host_file_result.
3568 func_convert_file_nix_to_cygwin ()
3569 {
3570   $debug_cmd
3571 
3572   func_to_host_file_result=$1
3573   if test -n "$1"; then
3574     # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
3575     func_convert_core_file_wine_to_w32 "$1"
3576     func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
3577     func_to_host_file_result=$func_cygpath_result
3578   fi
3579   func_convert_file_check "$1" "$func_to_host_file_result"
3580 }
3581 # end func_convert_file_nix_to_cygwin
3582 
3583 
3584 #############################################
3585 # $build to $host PATH CONVERSION FUNCTIONS #
3586 #############################################
3587 # invoked via '$to_host_path_cmd ARG'
3588 #
3589 # In each case, ARG is the path to be converted from $build to $host format.
3590 # The result will be available in $func_to_host_path_result.
3591 #
3592 # Path separators are also converted from $build format to $host format.  If
3593 # ARG begins or ends with a path separator character, it is preserved (but
3594 # converted to $host format) on output.
3595 #
3596 # All path conversion functions are named using the following convention:
3597 #   file name conversion function    : func_convert_file_X_to_Y ()
3598 #   path conversion function         : func_convert_path_X_to_Y ()
3599 # where, for any given $build/$host combination the 'X_to_Y' value is the
3600 # same.  If conversion functions are added for new $build/$host combinations,
3601 # the two new functions must follow this pattern, or func_init_to_host_path_cmd
3602 # will break.
3603 
3604 
3605 # func_init_to_host_path_cmd
3606 # Ensures that function "pointer" variable $to_host_path_cmd is set to the
3607 # appropriate value, based on the value of $to_host_file_cmd.
3608 to_host_path_cmd=
3609 func_init_to_host_path_cmd ()
3610 {
3611   $debug_cmd
3612 
3613   if test -z "$to_host_path_cmd"; then
3614     func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
3615     to_host_path_cmd=func_convert_path_$func_stripname_result
3616   fi
3617 }
3618 
3619 
3620 # func_to_host_path ARG
3621 # Converts the path ARG from $build format to $host format. Return result
3622 # in func_to_host_path_result.
3623 func_to_host_path ()
3624 {
3625   $debug_cmd
3626 
3627   func_init_to_host_path_cmd
3628   $to_host_path_cmd "$1"
3629 }
3630 # end func_to_host_path
3631 
3632 
3633 # func_convert_path_noop ARG
3634 # Copy ARG to func_to_host_path_result.
3635 func_convert_path_noop ()
3636 {
3637   func_to_host_path_result=$1
3638 }
3639 # end func_convert_path_noop
3640 
3641 
3642 # func_convert_path_msys_to_w32 ARG
3643 # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
3644 # conversion to w32 is not available inside the cwrapper.  Returns result in
3645 # func_to_host_path_result.
3646 func_convert_path_msys_to_w32 ()
3647 {
3648   $debug_cmd
3649 
3650   func_to_host_path_result=$1
3651   if test -n "$1"; then
3652     # Remove leading and trailing path separator characters from ARG.  MSYS
3653     # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
3654     # and winepath ignores them completely.
3655     func_stripname : : "$1"
3656     func_to_host_path_tmp1=$func_stripname_result
3657     func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
3658     func_to_host_path_result=$func_convert_core_msys_to_w32_result
3659     func_convert_path_check : ";" \
3660       "$func_to_host_path_tmp1" "$func_to_host_path_result"
3661     func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
3662   fi
3663 }
3664 # end func_convert_path_msys_to_w32
3665 
3666 
3667 # func_convert_path_cygwin_to_w32 ARG
3668 # Convert path ARG from Cygwin to w32 format.  Returns result in
3669 # func_to_host_file_result.
3670 func_convert_path_cygwin_to_w32 ()
3671 {
3672   $debug_cmd
3673 
3674   func_to_host_path_result=$1
3675   if test -n "$1"; then
3676     # See func_convert_path_msys_to_w32:
3677     func_stripname : : "$1"
3678     func_to_host_path_tmp1=$func_stripname_result
3679     func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
3680     func_convert_path_check : ";" \
3681       "$func_to_host_path_tmp1" "$func_to_host_path_result"
3682     func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
3683   fi
3684 }
3685 # end func_convert_path_cygwin_to_w32
3686 
3687 
3688 # func_convert_path_nix_to_w32 ARG
3689 # Convert path ARG from *nix to w32 format.  Requires a wine environment and
3690 # a working winepath.  Returns result in func_to_host_file_result.
3691 func_convert_path_nix_to_w32 ()
3692 {
3693   $debug_cmd
3694 
3695   func_to_host_path_result=$1
3696   if test -n "$1"; then
3697     # See func_convert_path_msys_to_w32:
3698     func_stripname : : "$1"
3699     func_to_host_path_tmp1=$func_stripname_result
3700     func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
3701     func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
3702     func_convert_path_check : ";" \
3703       "$func_to_host_path_tmp1" "$func_to_host_path_result"
3704     func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
3705   fi
3706 }
3707 # end func_convert_path_nix_to_w32
3708 
3709 
3710 # func_convert_path_msys_to_cygwin ARG
3711 # Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
3712 # Returns result in func_to_host_file_result.
3713 func_convert_path_msys_to_cygwin ()
3714 {
3715   $debug_cmd
3716 
3717   func_to_host_path_result=$1
3718   if test -n "$1"; then
3719     # See func_convert_path_msys_to_w32:
3720     func_stripname : : "$1"
3721     func_to_host_path_tmp1=$func_stripname_result
3722     func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
3723     func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
3724     func_to_host_path_result=$func_cygpath_result
3725     func_convert_path_check : : \
3726       "$func_to_host_path_tmp1" "$func_to_host_path_result"
3727     func_convert_path_front_back_pathsep ":*" "*:" : "$1"
3728   fi
3729 }
3730 # end func_convert_path_msys_to_cygwin
3731 
3732 
3733 # func_convert_path_nix_to_cygwin ARG
3734 # Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
3735 # a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
3736 # func_to_host_file_result.
3737 func_convert_path_nix_to_cygwin ()
3738 {
3739   $debug_cmd
3740 
3741   func_to_host_path_result=$1
3742   if test -n "$1"; then
3743     # Remove leading and trailing path separator characters from
3744     # ARG. msys behavior is inconsistent here, cygpath turns them
3745     # into '.;' and ';.', and winepath ignores them completely.
3746     func_stripname : : "$1"
3747     func_to_host_path_tmp1=$func_stripname_result
3748     func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
3749     func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
3750     func_to_host_path_result=$func_cygpath_result
3751     func_convert_path_check : : \
3752       "$func_to_host_path_tmp1" "$func_to_host_path_result"
3753     func_convert_path_front_back_pathsep ":*" "*:" : "$1"
3754   fi
3755 }
3756 # end func_convert_path_nix_to_cygwin
3757 
3758 
3759 # func_dll_def_p FILE
3760 # True iff FILE is a Windows DLL '.def' file.
3761 # Keep in sync with _LT_DLL_DEF_P in libtool.m4
3762 func_dll_def_p ()
3763 {
3764   $debug_cmd
3765 
3766   func_dll_def_p_tmp=`$SED -n \
3767     -e 's/^[     ]*//' \
3768     -e '/^\(;.*\)*$/d' \
3769     -e 's/^\(EXPORTS\|LIBRARY\)\([       ].*\)*$/DEF/p' \
3770     -e q \
3771     "$1"`
3772   test DEF = "$func_dll_def_p_tmp"
3773 }
3774 
3775 
3776 # func_mode_compile arg...
3777 func_mode_compile ()
3778 {
3779     $debug_cmd
3780 
3781     # Get the compilation command and the source file.
3782     base_compile=
3783     srcfile=$nonopt  #  always keep a non-empty value in "srcfile"
3784     suppress_opt=yes
3785     suppress_output=
3786     arg_mode=normal
3787     libobj=
3788     later=
3789     pie_flag=
3790 
3791     for arg
3792     do
3793       case $arg_mode in
3794       arg  )
3795         # do not "continue".  Instead, add this to base_compile
3796         lastarg=$arg
3797         arg_mode=normal
3798         ;;
3799 
3800       target )
3801         libobj=$arg
3802         arg_mode=normal
3803         continue
3804         ;;
3805 
3806       normal )
3807         # Accept any command-line options.
3808         case $arg in
3809         -o)
3810           test -n "$libobj" && \
3811             func_fatal_error "you cannot specify '-o' more than once"
3812           arg_mode=target
3813           continue
3814           ;;
3815 
3816         -pie | -fpie | -fPIE)
3817           func_append pie_flag " $arg"
3818           continue
3819           ;;
3820 
3821         -shared | -static | -prefer-pic | -prefer-non-pic)
3822           func_append later " $arg"
3823           continue
3824           ;;
3825 
3826         -no-suppress)
3827           suppress_opt=no
3828           continue
3829           ;;
3830 
3831         -Xcompiler)
3832           arg_mode=arg  #  the next one goes into the "base_compile" arg list
3833           continue      #  The current "srcfile" will either be retained or
3834           ;;            #  replaced later.  I would guess that would be a bug.
3835 
3836         -Wc,*)
3837           func_stripname '-Wc,' '' "$arg"
3838           args=$func_stripname_result
3839           lastarg=
3840           save_ifs=$IFS; IFS=,
3841           for arg in $args; do
3842             IFS=$save_ifs
3843             func_append_quoted lastarg "$arg"
3844           done
3845           IFS=$save_ifs
3846           func_stripname ' ' '' "$lastarg"
3847           lastarg=$func_stripname_result
3848 
3849           # Add the arguments to base_compile.
3850           func_append base_compile " $lastarg"
3851           continue
3852           ;;
3853 
3854         *)
3855           # Accept the current argument as the source file.
3856           # The previous "srcfile" becomes the current argument.
3857           #
3858           lastarg=$srcfile
3859           srcfile=$arg
3860           ;;
3861         esac  #  case $arg
3862         ;;
3863       esac    #  case $arg_mode
3864 
3865       # Aesthetically quote the previous argument.
3866       func_append_quoted base_compile "$lastarg"
3867     done # for arg
3868 
3869     case $arg_mode in
3870     arg)
3871       func_fatal_error "you must specify an argument for -Xcompile"
3872       ;;
3873     target)
3874       func_fatal_error "you must specify a target with '-o'"
3875       ;;
3876     *)
3877       # Get the name of the library object.
3878       test -z "$libobj" && {
3879         func_basename "$srcfile"
3880         libobj=$func_basename_result
3881       }
3882       ;;
3883     esac
3884 
3885     # Recognize several different file suffixes.
3886     # If the user specifies -o file.o, it is replaced with file.lo
3887     case $libobj in
3888     *.[cCFSifmso] | \
3889     *.ada | *.adb | *.ads | *.asm | \
3890     *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
3891     *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
3892       func_xform "$libobj"
3893       libobj=$func_xform_result
3894       ;;
3895     esac
3896 
3897     case $libobj in
3898     *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
3899     *)
3900       func_fatal_error "cannot determine name of library object from '$libobj'"
3901       ;;
3902     esac
3903 
3904     func_infer_tag $base_compile
3905 
3906     for arg in $later; do
3907       case $arg in
3908       -shared)
3909         test yes = "$build_libtool_libs" \
3910           || func_fatal_configuration "cannot build a shared library"
3911         build_old_libs=no
3912         continue
3913         ;;
3914 
3915       -static)
3916         build_libtool_libs=no
3917         build_old_libs=yes
3918         continue
3919         ;;
3920 
3921       -prefer-pic)
3922         pic_mode=yes
3923         continue
3924         ;;
3925 
3926       -prefer-non-pic)
3927         pic_mode=no
3928         continue
3929         ;;
3930       esac
3931     done
3932 
3933     func_quote_for_eval "$libobj"
3934     test "X$libobj" != "X$func_quote_for_eval_result" \
3935       && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'    &()|`$[]' \
3936       && func_warning "libobj name '$libobj' may not contain shell special characters."
3937     func_dirname_and_basename "$obj" "/" ""
3938     objname=$func_basename_result
3939     xdir=$func_dirname_result
3940     lobj=$xdir$objdir/$objname
3941 
3942     test -z "$base_compile" && \
3943       func_fatal_help "you must specify a compilation command"
3944 
3945     # Delete any leftover library objects.
3946     if test yes = "$build_old_libs"; then
3947       removelist="$obj $lobj $libobj ${libobj}T"
3948     else
3949       removelist="$lobj $libobj ${libobj}T"
3950     fi
3951 
3952     # On Cygwin there's no "real" PIC flag so we must build both object types
3953     case $host_os in
3954     cygwin* | mingw* | pw32* | os2* | cegcc*)
3955       pic_mode=default
3956       ;;
3957     esac
3958     if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
3959       # non-PIC code in shared libraries is not supported
3960       pic_mode=default
3961     fi
3962 
3963     # Calculate the filename of the output object if compiler does
3964     # not support -o with -c
3965     if test no = "$compiler_c_o"; then
3966       output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
3967       lockfile=$output_obj.lock
3968     else
3969       output_obj=
3970       need_locks=no
3971       lockfile=
3972     fi
3973 
3974     # Lock this critical section if it is needed
3975     # We use this script file to make the link, it avoids creating a new file
3976     if test yes = "$need_locks"; then
3977       until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
3978         func_echo "Waiting for $lockfile to be removed"
3979         sleep 2
3980       done
3981     elif test warn = "$need_locks"; then
3982       if test -f "$lockfile"; then
3983         $ECHO "\
3984 *** ERROR, $lockfile exists and contains:
3985 `cat $lockfile 2>/dev/null`
3986 
3987 This indicates that another process is trying to use the same
3988 temporary object file, and libtool could not work around it because
3989 your compiler does not support '-c' and '-o' together.  If you
3990 repeat this compilation, it may succeed, by chance, but you had better
3991 avoid parallel builds (make -j) in this platform, or get a better
3992 compiler."
3993 
3994         $opt_dry_run || $RM $removelist
3995         exit $EXIT_FAILURE
3996       fi
3997       func_append removelist " $output_obj"
3998       $ECHO "$srcfile" > "$lockfile"
3999     fi
4000 
4001     $opt_dry_run || $RM $removelist
4002     func_append removelist " $lockfile"
4003     trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
4004 
4005     func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
4006     srcfile=$func_to_tool_file_result
4007     func_quote_for_eval "$srcfile"
4008     qsrcfile=$func_quote_for_eval_result
4009 
4010     # Only build a PIC object if we are building libtool libraries.
4011     if test yes = "$build_libtool_libs"; then
4012       # Without this assignment, base_compile gets emptied.
4013       fbsd_hideous_sh_bug=$base_compile
4014 
4015       if test no != "$pic_mode"; then
4016         command="$base_compile $qsrcfile $pic_flag"
4017       else
4018         # Don't build PIC code
4019         command="$base_compile $qsrcfile"
4020       fi
4021 
4022       func_mkdir_p "$xdir$objdir"
4023 
4024       if test -z "$output_obj"; then
4025         # Place PIC objects in $objdir
4026         func_append command " -o $lobj"
4027       fi
4028 
4029       func_show_eval_locale "$command"  \
4030           'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
4031 
4032       if test warn = "$need_locks" &&
4033          test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
4034         $ECHO "\
4035 *** ERROR, $lockfile contains:
4036 `cat $lockfile 2>/dev/null`
4037 
4038 but it should contain:
4039 $srcfile
4040 
4041 This indicates that another process is trying to use the same
4042 temporary object file, and libtool could not work around it because
4043 your compiler does not support '-c' and '-o' together.  If you
4044 repeat this compilation, it may succeed, by chance, but you had better
4045 avoid parallel builds (make -j) in this platform, or get a better
4046 compiler."
4047 
4048         $opt_dry_run || $RM $removelist
4049         exit $EXIT_FAILURE
4050       fi
4051 
4052       # Just move the object if needed, then go on to compile the next one
4053       if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
4054         func_show_eval '$MV "$output_obj" "$lobj"' \
4055           'error=$?; $opt_dry_run || $RM $removelist; exit $error'
4056       fi
4057 
4058       # Allow error messages only from the first compilation.
4059       if test yes = "$suppress_opt"; then
4060         suppress_output=' >/dev/null 2>&1'
4061       fi
4062     fi
4063 
4064     # Only build a position-dependent object if we build old libraries.
4065     if test yes = "$build_old_libs"; then
4066       if test yes != "$pic_mode"; then
4067         # Don't build PIC code
4068         command="$base_compile $qsrcfile$pie_flag"
4069       else
4070         command="$base_compile $qsrcfile $pic_flag"
4071       fi
4072       if test yes = "$compiler_c_o"; then
4073         func_append command " -o $obj"
4074       fi
4075 
4076       # Suppress compiler output if we already did a PIC compilation.
4077       func_append command "$suppress_output"
4078       func_show_eval_locale "$command" \
4079         '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
4080 
4081       if test warn = "$need_locks" &&
4082          test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
4083         $ECHO "\
4084 *** ERROR, $lockfile contains:
4085 `cat $lockfile 2>/dev/null`
4086 
4087 but it should contain:
4088 $srcfile
4089 
4090 This indicates that another process is trying to use the same
4091 temporary object file, and libtool could not work around it because
4092 your compiler does not support '-c' and '-o' together.  If you
4093 repeat this compilation, it may succeed, by chance, but you had better
4094 avoid parallel builds (make -j) in this platform, or get a better
4095 compiler."
4096 
4097         $opt_dry_run || $RM $removelist
4098         exit $EXIT_FAILURE
4099       fi
4100 
4101       # Just move the object if needed
4102       if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
4103         func_show_eval '$MV "$output_obj" "$obj"' \
4104           'error=$?; $opt_dry_run || $RM $removelist; exit $error'
4105       fi
4106     fi
4107 
4108     $opt_dry_run || {
4109       func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
4110 
4111       # Unlock the critical section if it was locked
4112       if test no != "$need_locks"; then
4113         removelist=$lockfile
4114         $RM "$lockfile"
4115       fi
4116     }
4117 
4118     exit $EXIT_SUCCESS
4119 }
4120 
4121 $opt_help || {
4122   test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
4123 }
4124 
4125 func_mode_help ()
4126 {
4127     # We need to display help for each of the modes.
4128     case $opt_mode in
4129       "")
4130         # Generic help is extracted from the usage comments
4131         # at the start of this file.
4132         func_help
4133         ;;
4134 
4135       clean)
4136         $ECHO \
4137 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
4138 
4139 Remove files from the build directory.
4140 
4141 RM is the name of the program to use to delete files associated with each FILE
4142 (typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
4143 to RM.
4144 
4145 If FILE is a libtool library, object or program, all the files associated
4146 with it are deleted. Otherwise, only FILE itself is deleted using RM."
4147         ;;
4148 
4149       compile)
4150       $ECHO \
4151 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
4152 
4153 Compile a source file into a libtool library object.
4154 
4155 This mode accepts the following additional options:
4156 
4157   -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
4158   -no-suppress      do not suppress compiler output for multiple passes
4159   -prefer-pic       try to build PIC objects only
4160   -prefer-non-pic   try to build non-PIC objects only
4161   -shared           do not build a '.o' file suitable for static linking
4162   -static           only build a '.o' file suitable for static linking
4163   -Wc,FLAG          pass FLAG directly to the compiler
4164 
4165 COMPILE-COMMAND is a command to be used in creating a 'standard' object file
4166 from the given SOURCEFILE.
4167 
4168 The output file name is determined by removing the directory component from
4169 SOURCEFILE, then substituting the C source code suffix '.c' with the
4170 library object suffix, '.lo'."
4171         ;;
4172 
4173       execute)
4174         $ECHO \
4175 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
4176 
4177 Automatically set library path, then run a program.
4178 
4179 This mode accepts the following additional options:
4180 
4181   -dlopen FILE      add the directory containing FILE to the library path
4182 
4183 This mode sets the library path environment variable according to '-dlopen'
4184 flags.
4185 
4186 If any of the ARGS are libtool executable wrappers, then they are translated
4187 into their corresponding uninstalled binary, and any of their required library
4188 directories are added to the library path.
4189 
4190 Then, COMMAND is executed, with ARGS as arguments."
4191         ;;
4192 
4193       finish)
4194         $ECHO \
4195 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
4196 
4197 Complete the installation of libtool libraries.
4198 
4199 Each LIBDIR is a directory that contains libtool libraries.
4200 
4201 The commands that this mode executes may require superuser privileges.  Use
4202 the '--dry-run' option if you just want to see what would be executed."
4203         ;;
4204 
4205       install)
4206         $ECHO \
4207 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
4208 
4209 Install executables or libraries.
4210 
4211 INSTALL-COMMAND is the installation command.  The first component should be
4212 either the 'install' or 'cp' program.
4213 
4214 The following components of INSTALL-COMMAND are treated specially:
4215 
4216   -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
4217 
4218 The rest of the components are interpreted as arguments to that command (only
4219 BSD-compatible install options are recognized)."
4220         ;;
4221 
4222       link)
4223         $ECHO \
4224 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
4225 
4226 Link object files or libraries together to form another library, or to
4227 create an executable program.
4228 
4229 LINK-COMMAND is a command using the C compiler that you would use to create
4230 a program from several object files.
4231 
4232 The following components of LINK-COMMAND are treated specially:
4233 
4234   -all-static       do not do any dynamic linking at all
4235   -avoid-version    do not add a version suffix if possible
4236   -bindir BINDIR    specify path to binaries directory (for systems where
4237                     libraries must be found in the PATH setting at runtime)
4238   -dlopen FILE      '-dlpreopen' FILE if it cannot be dlopened at runtime
4239   -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
4240   -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
4241   -export-symbols SYMFILE
4242                     try to export only the symbols listed in SYMFILE
4243   -export-symbols-regex REGEX
4244                     try to export only the symbols matching REGEX
4245   -LLIBDIR          search LIBDIR for required installed libraries
4246   -lNAME            OUTPUT-FILE requires the installed library libNAME
4247   -module           build a library that can dlopened
4248   -no-fast-install  disable the fast-install mode
4249   -no-install       link a not-installable executable
4250   -no-undefined     declare that a library does not refer to external symbols
4251   -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
4252   -objectlist FILE  use a list of object files found in FILE to specify objects
4253   -os2dllname NAME  force a short DLL name on OS/2 (no effect on other OSes)
4254   -precious-files-regex REGEX
4255                     don't remove output files matching REGEX
4256   -release RELEASE  specify package release information
4257   -rpath LIBDIR     the created library will eventually be installed in LIBDIR
4258   -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
4259   -shared           only do dynamic linking of libtool libraries
4260   -shrext SUFFIX    override the standard shared library file extension
4261   -static           do not do any dynamic linking of uninstalled libtool libraries
4262   -static-libtool-libs
4263                     do not do any dynamic linking of libtool libraries
4264   -version-info CURRENT[:REVISION[:AGE]]
4265                     specify library version info [each variable defaults to 0]
4266   -weak LIBNAME     declare that the target provides the LIBNAME interface
4267   -Wc,FLAG
4268   -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
4269   -Wl,FLAG
4270   -Xlinker FLAG     pass linker-specific FLAG directly to the linker
4271   -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
4272 
4273 All other options (arguments beginning with '-') are ignored.
4274 
4275 Every other argument is treated as a filename.  Files ending in '.la' are
4276 treated as uninstalled libtool libraries, other files are standard or library
4277 object files.
4278 
4279 If the OUTPUT-FILE ends in '.la', then a libtool library is created,
4280 only library objects ('.lo' files) may be specified, and '-rpath' is
4281 required, except when creating a convenience library.
4282 
4283 If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
4284 using 'ar' and 'ranlib', or on Windows using 'lib'.
4285 
4286 If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
4287 is created, otherwise an executable program is created."
4288         ;;
4289 
4290       uninstall)
4291         $ECHO \
4292 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
4293 
4294 Remove libraries from an installation directory.
4295 
4296 RM is the name of the program to use to delete files associated with each FILE
4297 (typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
4298 to RM.
4299 
4300 If FILE is a libtool library, all the files associated with it are deleted.
4301 Otherwise, only FILE itself is deleted using RM."
4302         ;;
4303 
4304       *)
4305         func_fatal_help "invalid operation mode '$opt_mode'"
4306         ;;
4307     esac
4308 
4309     echo
4310     $ECHO "Try '$progname --help' for more information about other modes."
4311 }
4312 
4313 # Now that we've collected a possible --mode arg, show help if necessary
4314 if $opt_help; then
4315   if test : = "$opt_help"; then
4316     func_mode_help
4317   else
4318     {
4319       func_help noexit
4320       for opt_mode in compile link execute install finish uninstall clean; do
4321         func_mode_help
4322       done
4323     } | $SED -n '1p; 2,$s/^Usage:/  or: /p'
4324     {
4325       func_help noexit
4326       for opt_mode in compile link execute install finish uninstall clean; do
4327         echo
4328         func_mode_help
4329       done
4330     } |
4331     $SED '1d
4332       /^When reporting/,/^Report/{
4333         H
4334         d
4335       }
4336       $x
4337       /information about other modes/d
4338       /more detailed .*MODE/d
4339       s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
4340   fi
4341   exit $?
4342 fi
4343 
4344 
4345 # func_mode_execute arg...
4346 func_mode_execute ()
4347 {
4348     $debug_cmd
4349 
4350     # The first argument is the command name.
4351     cmd=$nonopt
4352     test -z "$cmd" && \
4353       func_fatal_help "you must specify a COMMAND"
4354 
4355     # Handle -dlopen flags immediately.
4356     for file in $opt_dlopen; do
4357       test -f "$file" \
4358         || func_fatal_help "'$file' is not a file"
4359 
4360       dir=
4361       case $file in
4362       *.la)
4363         func_resolve_sysroot "$file"
4364         file=$func_resolve_sysroot_result
4365 
4366         # Check to see that this really is a libtool archive.
4367         func_lalib_unsafe_p "$file" \
4368           || func_fatal_help "'$lib' is not a valid libtool archive"
4369 
4370         # Read the libtool library.
4371         dlname=
4372         library_names=
4373         func_source "$file"
4374 
4375         # Skip this library if it cannot be dlopened.
4376         if test -z "$dlname"; then
4377           # Warn if it was a shared library.
4378           test -n "$library_names" && \
4379             func_warning "'$file' was not linked with '-export-dynamic'"
4380           continue
4381         fi
4382 
4383         func_dirname "$file" "" "."
4384         dir=$func_dirname_result
4385 
4386         if test -f "$dir/$objdir/$dlname"; then
4387           func_append dir "/$objdir"
4388         else
4389           if test ! -f "$dir/$dlname"; then
4390             func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
4391           fi
4392         fi
4393         ;;
4394 
4395       *.lo)
4396         # Just add the directory containing the .lo file.
4397         func_dirname "$file" "" "."
4398         dir=$func_dirname_result
4399         ;;
4400 
4401       *)
4402         func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
4403         continue
4404         ;;
4405       esac
4406 
4407       # Get the absolute pathname.
4408       absdir=`cd "$dir" && pwd`
4409       test -n "$absdir" && dir=$absdir
4410 
4411       # Now add the directory to shlibpath_var.
4412       if eval "test -z \"\$$shlibpath_var\""; then
4413         eval "$shlibpath_var=\"\$dir\""
4414       else
4415         eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4416       fi
4417     done
4418 
4419     # This variable tells wrapper scripts just to set shlibpath_var
4420     # rather than running their programs.
4421     libtool_execute_magic=$magic
4422 
4423     # Check if any of the arguments is a wrapper script.
4424     args=
4425     for file
4426     do
4427       case $file in
4428       -* | *.la | *.lo ) ;;
4429       *)
4430         # Do a test to see if this is really a libtool program.
4431         if func_ltwrapper_script_p "$file"; then
4432           func_source "$file"
4433           # Transform arg to wrapped name.
4434           file=$progdir/$program
4435         elif func_ltwrapper_executable_p "$file"; then
4436           func_ltwrapper_scriptname "$file"
4437           func_source "$func_ltwrapper_scriptname_result"
4438           # Transform arg to wrapped name.
4439           file=$progdir/$program
4440         fi
4441         ;;
4442       esac
4443       # Quote arguments (to preserve shell metacharacters).
4444       func_append_quoted args "$file"
4445     done
4446 
4447     if $opt_dry_run; then
4448       # Display what would be done.
4449       if test -n "$shlibpath_var"; then
4450         eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
4451         echo "export $shlibpath_var"
4452       fi
4453       $ECHO "$cmd$args"
4454       exit $EXIT_SUCCESS
4455     else
4456       if test -n "$shlibpath_var"; then
4457         # Export the shlibpath_var.
4458         eval "export $shlibpath_var"
4459       fi
4460 
4461       # Restore saved environment variables
4462       for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
4463       do
4464         eval "if test \"\${save_$lt_var+set}\" = set; then
4465                 $lt_var=\$save_$lt_var; export $lt_var
4466               else
4467                 $lt_unset $lt_var
4468               fi"
4469       done
4470 
4471       # Now prepare to actually exec the command.
4472       exec_cmd=\$cmd$args
4473     fi
4474 }
4475 
4476 test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
4477 
4478 
4479 # func_mode_finish arg...
4480 func_mode_finish ()
4481 {
4482     $debug_cmd
4483 
4484     libs=
4485     libdirs=
4486     admincmds=
4487 
4488     for opt in "$nonopt" ${1+"$@"}
4489     do
4490       if test -d "$opt"; then
4491         func_append libdirs " $opt"
4492 
4493       elif test -f "$opt"; then
4494         if func_lalib_unsafe_p "$opt"; then
4495           func_append libs " $opt"
4496         else
4497           func_warning "'$opt' is not a valid libtool archive"
4498         fi
4499 
4500       else
4501         func_fatal_error "invalid argument '$opt'"
4502       fi
4503     done
4504 
4505     if test -n "$libs"; then
4506       if test -n "$lt_sysroot"; then
4507         sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
4508         sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
4509       else
4510         sysroot_cmd=
4511       fi
4512 
4513       # Remove sysroot references
4514       if $opt_dry_run; then
4515         for lib in $libs; do
4516           echo "removing references to $lt_sysroot and '=' prefixes from $lib"
4517         done
4518       else
4519         tmpdir=`func_mktempdir`
4520         for lib in $libs; do
4521           $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
4522             > $tmpdir/tmp-la
4523           mv -f $tmpdir/tmp-la $lib
4524         done
4525         ${RM}r "$tmpdir"
4526       fi
4527     fi
4528 
4529     if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4530       for libdir in $libdirs; do
4531         if test -n "$finish_cmds"; then
4532           # Do each command in the finish commands.
4533           func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
4534 '"$cmd"'"'
4535         fi
4536         if test -n "$finish_eval"; then
4537           # Do the single finish_eval.
4538           eval cmds=\"$finish_eval\"
4539           $opt_dry_run || eval "$cmds" || func_append admincmds "
4540        $cmds"
4541         fi
4542       done
4543     fi
4544 
4545     # Exit here if they wanted silent mode.
4546     $opt_quiet && exit $EXIT_SUCCESS
4547 
4548     if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4549       echo "----------------------------------------------------------------------"
4550       echo "Libraries have been installed in:"
4551       for libdir in $libdirs; do
4552         $ECHO "   $libdir"
4553       done
4554       echo
4555       echo "If you ever happen to want to link against installed libraries"
4556       echo "in a given directory, LIBDIR, you must either use libtool, and"
4557       echo "specify the full pathname of the library, or use the '-LLIBDIR'"
4558       echo "flag during linking and do at least one of the following:"
4559       if test -n "$shlibpath_var"; then
4560         echo "   - add LIBDIR to the '$shlibpath_var' environment variable"
4561         echo "     during execution"
4562       fi
4563       if test -n "$runpath_var"; then
4564         echo "   - add LIBDIR to the '$runpath_var' environment variable"
4565         echo "     during linking"
4566       fi
4567       if test -n "$hardcode_libdir_flag_spec"; then
4568         libdir=LIBDIR
4569         eval flag=\"$hardcode_libdir_flag_spec\"
4570 
4571         $ECHO "   - use the '$flag' linker flag"
4572       fi
4573       if test -n "$admincmds"; then
4574         $ECHO "   - have your system administrator run these commands:$admincmds"
4575       fi
4576       if test -f /etc/ld.so.conf; then
4577         echo "   - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
4578       fi
4579       echo
4580 
4581       echo "See any operating system documentation about shared libraries for"
4582       case $host in
4583         solaris2.[6789]|solaris2.1[0-9])
4584           echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
4585           echo "pages."
4586           ;;
4587         *)
4588           echo "more information, such as the ld(1) and ld.so(8) manual pages."
4589           ;;
4590       esac
4591       echo "----------------------------------------------------------------------"
4592     fi
4593     exit $EXIT_SUCCESS
4594 }
4595 
4596 test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
4597 
4598 
4599 # func_mode_install arg...
4600 func_mode_install ()
4601 {
4602     $debug_cmd
4603 
4604     # There may be an optional sh(1) argument at the beginning of
4605     # install_prog (especially on Windows NT).
4606     if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
4607        # Allow the use of GNU shtool's install command.
4608        case $nonopt in *shtool*) :;; *) false;; esac
4609     then
4610       # Aesthetically quote it.
4611       func_quote_for_eval "$nonopt"
4612       install_prog="$func_quote_for_eval_result "
4613       arg=$1
4614       shift
4615     else
4616       install_prog=
4617       arg=$nonopt
4618     fi
4619 
4620     # The real first argument should be the name of the installation program.
4621     # Aesthetically quote it.
4622     func_quote_for_eval "$arg"
4623     func_append install_prog "$func_quote_for_eval_result"
4624     install_shared_prog=$install_prog
4625     case " $install_prog " in
4626       *[\\\ /]cp\ *) install_cp=: ;;
4627       *) install_cp=false ;;
4628     esac
4629 
4630     # We need to accept at least all the BSD install flags.
4631     dest=
4632     files=
4633     opts=
4634     prev=
4635     install_type=
4636     isdir=false
4637     stripme=
4638     no_mode=:
4639     for arg
4640     do
4641       arg2=
4642       if test -n "$dest"; then
4643         func_append files " $dest"
4644         dest=$arg
4645         continue
4646       fi
4647 
4648       case $arg in
4649       -d) isdir=: ;;
4650       -f)
4651         if $install_cp; then :; else
4652           prev=$arg
4653         fi
4654         ;;
4655       -g | -m | -o)
4656         prev=$arg
4657         ;;
4658       -s)
4659         stripme=" -s"
4660         continue
4661         ;;
4662       -*)
4663         ;;
4664       *)
4665         # If the previous option needed an argument, then skip it.
4666         if test -n "$prev"; then
4667           if test X-m = "X$prev" && test -n "$install_override_mode"; then
4668             arg2=$install_override_mode
4669             no_mode=false
4670           fi
4671           prev=
4672         else
4673           dest=$arg
4674           continue
4675         fi
4676         ;;
4677       esac
4678 
4679       # Aesthetically quote the argument.
4680       func_quote_for_eval "$arg"
4681       func_append install_prog " $func_quote_for_eval_result"
4682       if test -n "$arg2"; then
4683         func_quote_for_eval "$arg2"
4684       fi
4685       func_append install_shared_prog " $func_quote_for_eval_result"
4686     done
4687 
4688     test -z "$install_prog" && \
4689       func_fatal_help "you must specify an install program"
4690 
4691     test -n "$prev" && \
4692       func_fatal_help "the '$prev' option requires an argument"
4693 
4694     if test -n "$install_override_mode" && $no_mode; then
4695       if $install_cp; then :; else
4696         func_quote_for_eval "$install_override_mode"
4697         func_append install_shared_prog " -m $func_quote_for_eval_result"
4698       fi
4699     fi
4700 
4701     if test -z "$files"; then
4702       if test -z "$dest"; then
4703         func_fatal_help "no file or destination specified"
4704       else
4705         func_fatal_help "you must specify a destination"
4706       fi
4707     fi
4708 
4709     # Strip any trailing slash from the destination.
4710     func_stripname '' '/' "$dest"
4711     dest=$func_stripname_result
4712 
4713     # Check to see that the destination is a directory.
4714     test -d "$dest" && isdir=:
4715     if $isdir; then
4716       destdir=$dest
4717       destname=
4718     else
4719       func_dirname_and_basename "$dest" "" "."
4720       destdir=$func_dirname_result
4721       destname=$func_basename_result
4722 
4723       # Not a directory, so check to see that there is only one file specified.
4724       set dummy $files; shift
4725       test "$#" -gt 1 && \
4726         func_fatal_help "'$dest' is not a directory"
4727     fi
4728     case $destdir in
4729     [\\/]* | [A-Za-z]:[\\/]*) ;;
4730     *)
4731       for file in $files; do
4732         case $file in
4733         *.lo) ;;
4734         *)
4735           func_fatal_help "'$destdir' must be an absolute directory name"
4736           ;;
4737         esac
4738       done
4739       ;;
4740     esac
4741 
4742     # This variable tells wrapper scripts just to set variables rather
4743     # than running their programs.
4744     libtool_install_magic=$magic
4745 
4746     staticlibs=
4747     future_libdirs=
4748     current_libdirs=
4749     for file in $files; do
4750 
4751       # Do each installation.
4752       case $file in
4753       *.$libext)
4754         # Do the static libraries later.
4755         func_append staticlibs " $file"
4756         ;;
4757 
4758       *.la)
4759         func_resolve_sysroot "$file"
4760         file=$func_resolve_sysroot_result
4761 
4762         # Check to see that this really is a libtool archive.
4763         func_lalib_unsafe_p "$file" \
4764           || func_fatal_help "'$file' is not a valid libtool archive"
4765 
4766         library_names=
4767         old_library=
4768         relink_command=
4769         func_source "$file"
4770 
4771         # Add the libdir to current_libdirs if it is the destination.
4772         if test "X$destdir" = "X$libdir"; then
4773           case "$current_libdirs " in
4774           *" $libdir "*) ;;
4775           *) func_append current_libdirs " $libdir" ;;
4776           esac
4777         else
4778           # Note the libdir as a future libdir.
4779           case "$future_libdirs " in
4780           *" $libdir "*) ;;
4781           *) func_append future_libdirs " $libdir" ;;
4782           esac
4783         fi
4784 
4785         func_dirname "$file" "/" ""
4786         dir=$func_dirname_result
4787         func_append dir "$objdir"
4788 
4789         if test -n "$relink_command"; then
4790           # Determine the prefix the user has applied to our future dir.
4791           inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
4792 
4793           # Don't allow the user to place us outside of our expected
4794           # location b/c this prevents finding dependent libraries that
4795           # are installed to the same prefix.
4796           # At present, this check doesn't affect windows .dll's that
4797           # are installed into $libdir/../bin (currently, that works fine)
4798           # but it's something to keep an eye on.
4799           test "$inst_prefix_dir" = "$destdir" && \
4800             func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
4801 
4802           if test -n "$inst_prefix_dir"; then
4803             # Stick the inst_prefix_dir data into the link command.
4804             relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
4805           else
4806             relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
4807           fi
4808 
4809           func_warning "relinking '$file'"
4810           func_show_eval "$relink_command" \
4811             'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
4812         fi
4813 
4814         # See the names of the shared library.
4815         set dummy $library_names; shift
4816         if test -n "$1"; then
4817           realname=$1
4818           shift
4819 
4820           srcname=$realname
4821           test -n "$relink_command" && srcname=${realname}T
4822 
4823           # Install the shared library and build the symlinks.
4824           func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
4825               'exit $?'
4826           tstripme=$stripme
4827           case $host_os in
4828           cygwin* | mingw* | pw32* | cegcc*)
4829             case $realname in
4830             *.dll.a)
4831               tstripme=
4832               ;;
4833             esac
4834             ;;
4835           os2*)
4836             case $realname in
4837             *_dll.a)
4838               tstripme=
4839               ;;
4840             esac
4841             ;;
4842           esac
4843           if test -n "$tstripme" && test -n "$striplib"; then
4844             func_show_eval "$striplib $destdir/$realname" 'exit $?'
4845           fi
4846 
4847           if test "$#" -gt 0; then
4848             # Delete the old symlinks, and create new ones.
4849             # Try 'ln -sf' first, because the 'ln' binary might depend on
4850             # the symlink we replace!  Solaris /bin/ln does not understand -f,
4851             # so we also need to try rm && ln -s.
4852             for linkname
4853             do
4854               test "$linkname" != "$realname" \
4855                 && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
4856             done
4857           fi
4858 
4859           # Do each command in the postinstall commands.
4860           lib=$destdir/$realname
4861           func_execute_cmds "$postinstall_cmds" 'exit $?'
4862         fi
4863 
4864         # Install the pseudo-library for information purposes.
4865         func_basename "$file"
4866         name=$func_basename_result
4867         instname=$dir/${name}i
4868         func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
4869 
4870         # Maybe install the static library, too.
4871         test -n "$old_library" && func_append staticlibs " $dir/$old_library"
4872         ;;
4873 
4874       *.lo)
4875         # Install (i.e. copy) a libtool object.
4876 
4877         # Figure out destination file name, if it wasn't already specified.
4878         if test -n "$destname"; then
4879           destfile=$destdir/$destname
4880         else
4881           func_basename "$file"
4882           destfile=$func_basename_result
4883           destfile=$destdir/$destfile
4884         fi
4885 
4886         # Deduce the name of the destination old-style object file.
4887         case $destfile in
4888         *.lo)
4889           func_lo2o "$destfile"
4890           staticdest=$func_lo2o_result
4891           ;;
4892         *.$objext)
4893           staticdest=$destfile
4894           destfile=
4895           ;;
4896         *)
4897           func_fatal_help "cannot copy a libtool object to '$destfile'"
4898           ;;
4899         esac
4900 
4901         # Install the libtool object if requested.
4902         test -n "$destfile" && \
4903           func_show_eval "$install_prog $file $destfile" 'exit $?'
4904 
4905         # Install the old object if enabled.
4906         if test yes = "$build_old_libs"; then
4907           # Deduce the name of the old-style object file.
4908           func_lo2o "$file"
4909           staticobj=$func_lo2o_result
4910           func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
4911         fi
4912         exit $EXIT_SUCCESS
4913         ;;
4914 
4915       *)
4916         # Figure out destination file name, if it wasn't already specified.
4917         if test -n "$destname"; then
4918           destfile=$destdir/$destname
4919         else
4920           func_basename "$file"
4921           destfile=$func_basename_result
4922           destfile=$destdir/$destfile
4923         fi
4924 
4925         # If the file is missing, and there is a .exe on the end, strip it
4926         # because it is most likely a libtool script we actually want to
4927         # install
4928         stripped_ext=
4929         case $file in
4930           *.exe)
4931             if test ! -f "$file"; then
4932               func_stripname '' '.exe' "$file"
4933               file=$func_stripname_result
4934               stripped_ext=.exe
4935             fi
4936             ;;
4937         esac
4938 
4939         # Do a test to see if this is really a libtool program.
4940         case $host in
4941         *cygwin* | *mingw*)
4942             if func_ltwrapper_executable_p "$file"; then
4943               func_ltwrapper_scriptname "$file"
4944               wrapper=$func_ltwrapper_scriptname_result
4945             else
4946               func_stripname '' '.exe' "$file"
4947               wrapper=$func_stripname_result
4948             fi
4949             ;;
4950         *)
4951             wrapper=$file
4952             ;;
4953         esac
4954         if func_ltwrapper_script_p "$wrapper"; then
4955           notinst_deplibs=
4956           relink_command=
4957 
4958           func_source "$wrapper"
4959 
4960           # Check the variables that should have been set.
4961           test -z "$generated_by_libtool_version" && \
4962             func_fatal_error "invalid libtool wrapper script '$wrapper'"
4963 
4964           finalize=:
4965           for lib in $notinst_deplibs; do
4966             # Check to see that each library is installed.
4967             libdir=
4968             if test -f "$lib"; then
4969               func_source "$lib"
4970             fi
4971             libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
4972             if test -n "$libdir" && test ! -f "$libfile"; then
4973               func_warning "'$lib' has not been installed in '$libdir'"
4974               finalize=false
4975             fi
4976           done
4977 
4978           relink_command=
4979           func_source "$wrapper"
4980 
4981           outputname=
4982           if test no = "$fast_install" && test -n "$relink_command"; then
4983             $opt_dry_run || {
4984               if $finalize; then
4985                 tmpdir=`func_mktempdir`
4986                 func_basename "$file$stripped_ext"
4987                 file=$func_basename_result
4988                 outputname=$tmpdir/$file
4989                 # Replace the output file specification.
4990                 relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
4991 
4992                 $opt_quiet || {
4993                   func_quote_for_expand "$relink_command"
4994                   eval "func_echo $func_quote_for_expand_result"
4995                 }
4996                 if eval "$relink_command"; then :
4997                   else
4998                   func_error "error: relink '$file' with the above command before installing it"
4999                   $opt_dry_run || ${RM}r "$tmpdir"
5000                   continue
5001                 fi
5002                 file=$outputname
5003               else
5004                 func_warning "cannot relink '$file'"
5005               fi
5006             }
5007           else
5008             # Install the binary that we compiled earlier.
5009             file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
5010           fi
5011         fi
5012 
5013         # remove .exe since cygwin /usr/bin/install will append another
5014         # one anyway
5015         case $install_prog,$host in
5016         */usr/bin/install*,*cygwin*)
5017           case $file:$destfile in
5018           *.exe:*.exe)
5019             # this is ok
5020             ;;
5021           *.exe:*)
5022             destfile=$destfile.exe
5023             ;;
5024           *:*.exe)
5025             func_stripname '' '.exe' "$destfile"
5026             destfile=$func_stripname_result
5027             ;;
5028           esac
5029           ;;
5030         esac
5031         func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
5032         $opt_dry_run || if test -n "$outputname"; then
5033           ${RM}r "$tmpdir"
5034         fi
5035         ;;
5036       esac
5037     done
5038 
5039     for file in $staticlibs; do
5040       func_basename "$file"
5041       name=$func_basename_result
5042 
5043       # Set up the ranlib parameters.
5044       oldlib=$destdir/$name
5045       func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
5046       tool_oldlib=$func_to_tool_file_result
5047 
5048       func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
5049 
5050       if test -n "$stripme" && test -n "$old_striplib"; then
5051         func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
5052       fi
5053 
5054       # Do each command in the postinstall commands.
5055       func_execute_cmds "$old_postinstall_cmds" 'exit $?'
5056     done
5057 
5058     test -n "$future_libdirs" && \
5059       func_warning "remember to run '$progname --finish$future_libdirs'"
5060 
5061     if test -n "$current_libdirs"; then
5062       # Maybe just do a dry run.
5063       $opt_dry_run && current_libdirs=" -n$current_libdirs"
5064       exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
5065     else
5066       exit $EXIT_SUCCESS
5067     fi
5068 }
5069 
5070 test install = "$opt_mode" && func_mode_install ${1+"$@"}
5071 
5072 
5073 # func_generate_dlsyms outputname originator pic_p
5074 # Extract symbols from dlprefiles and create ${outputname}S.o with
5075 # a dlpreopen symbol table.
5076 func_generate_dlsyms ()
5077 {
5078     $debug_cmd
5079 
5080     my_outputname=$1
5081     my_originator=$2
5082     my_pic_p=${3-false}
5083     my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
5084     my_dlsyms=
5085 
5086     if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
5087       if test -n "$NM" && test -n "$global_symbol_pipe"; then
5088         my_dlsyms=${my_outputname}S.c
5089       else
5090         func_error "not configured to extract global symbols from dlpreopened files"
5091       fi
5092     fi
5093 
5094     if test -n "$my_dlsyms"; then
5095       case $my_dlsyms in
5096       "") ;;
5097       *.c)
5098         # Discover the nlist of each of the dlfiles.
5099         nlist=$output_objdir/$my_outputname.nm
5100 
5101         func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
5102 
5103         # Parse the name list into a source file.
5104         func_verbose "creating $output_objdir/$my_dlsyms"
5105 
5106         $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
5107 /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
5108 /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
5109 
5110 #ifdef __cplusplus
5111 extern \"C\" {
5112 #endif
5113 
5114 #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
5115 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
5116 #endif
5117 
5118 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
5119 #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
5120 /* DATA imports from DLLs on WIN32 can't be const, because runtime
5121    relocations are performed -- see ld's documentation on pseudo-relocs.  */
5122 # define LT_DLSYM_CONST
5123 #elif defined __osf__
5124 /* This system does not cope well with relocations in const data.  */
5125 # define LT_DLSYM_CONST
5126 #else
5127 # define LT_DLSYM_CONST const
5128 #endif
5129 
5130 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
5131 
5132 /* External symbol declarations for the compiler. */\
5133 "
5134 
5135         if test yes = "$dlself"; then
5136           func_verbose "generating symbol list for '$output'"
5137 
5138           $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
5139 
5140           # Add our own program objects to the symbol list.
5141           progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
5142           for progfile in $progfiles; do
5143             func_to_tool_file "$progfile" func_convert_file_msys_to_w32
5144             func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
5145             $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
5146           done
5147 
5148           if test -n "$exclude_expsyms"; then
5149             $opt_dry_run || {
5150               eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
5151               eval '$MV "$nlist"T "$nlist"'
5152             }
5153           fi
5154 
5155           if test -n "$export_symbols_regex"; then
5156             $opt_dry_run || {
5157               eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
5158               eval '$MV "$nlist"T "$nlist"'
5159             }
5160           fi
5161 
5162           # Prepare the list of exported symbols
5163           if test -z "$export_symbols"; then
5164             export_symbols=$output_objdir/$outputname.exp
5165             $opt_dry_run || {
5166               $RM $export_symbols
5167               eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
5168               case $host in
5169               *cygwin* | *mingw* | *cegcc* )
5170                 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
5171                 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
5172                 ;;
5173               esac
5174             }
5175           else
5176             $opt_dry_run || {
5177               eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
5178               eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
5179               eval '$MV "$nlist"T "$nlist"'
5180               case $host in
5181                 *cygwin* | *mingw* | *cegcc* )
5182                   eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
5183                   eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
5184                   ;;
5185               esac
5186             }
5187           fi
5188         fi
5189 
5190         for dlprefile in $dlprefiles; do
5191           func_verbose "extracting global C symbols from '$dlprefile'"
5192           func_basename "$dlprefile"
5193           name=$func_basename_result
5194           case $host in
5195             *cygwin* | *mingw* | *cegcc* )
5196               # if an import library, we need to obtain dlname
5197               if func_win32_import_lib_p "$dlprefile"; then
5198                 func_tr_sh "$dlprefile"
5199                 eval "curr_lafile=\$libfile_$func_tr_sh_result"
5200                 dlprefile_dlbasename=
5201                 if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
5202                   # Use subshell, to avoid clobbering current variable values
5203                   dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
5204                   if test -n "$dlprefile_dlname"; then
5205                     func_basename "$dlprefile_dlname"
5206                     dlprefile_dlbasename=$func_basename_result
5207                   else
5208                     # no lafile. user explicitly requested -dlpreopen <import library>.
5209                     $sharedlib_from_linklib_cmd "$dlprefile"
5210                     dlprefile_dlbasename=$sharedlib_from_linklib_result
5211                   fi
5212                 fi
5213                 $opt_dry_run || {
5214                   if test -n "$dlprefile_dlbasename"; then
5215                     eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
5216                   else
5217                     func_warning "Could not compute DLL name from $name"
5218                     eval '$ECHO ": $name " >> "$nlist"'
5219                   fi
5220                   func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
5221                   eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
5222                     $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
5223                 }
5224               else # not an import lib
5225                 $opt_dry_run || {
5226                   eval '$ECHO ": $name " >> "$nlist"'
5227                   func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
5228                   eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
5229                 }
5230               fi
5231             ;;
5232             *)
5233               $opt_dry_run || {
5234                 eval '$ECHO ": $name " >> "$nlist"'
5235                 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
5236                 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
5237               }
5238             ;;
5239           esac
5240         done
5241 
5242         $opt_dry_run || {
5243           # Make sure we have at least an empty file.
5244           test -f "$nlist" || : > "$nlist"
5245 
5246           if test -n "$exclude_expsyms"; then
5247             $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
5248             $MV "$nlist"T "$nlist"
5249           fi
5250 
5251           # Try sorting and uniquifying the output.
5252           if $GREP -v "^: " < "$nlist" |
5253               if sort -k 3 </dev/null >/dev/null 2>&1; then
5254                 sort -k 3
5255               else
5256                 sort +2
5257               fi |
5258               uniq > "$nlist"S; then
5259             :
5260           else
5261             $GREP -v "^: " < "$nlist" > "$nlist"S
5262           fi
5263 
5264           if test -f "$nlist"S; then
5265             eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
5266           else
5267             echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
5268           fi
5269 
5270           func_show_eval '$RM "${nlist}I"'
5271           if test -n "$global_symbol_to_import"; then
5272             eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
5273           fi
5274 
5275           echo >> "$output_objdir/$my_dlsyms" "\
5276 
5277 /* The mapping between symbol names and symbols.  */
5278 typedef struct {
5279   const char *name;
5280   void *address;
5281 } lt_dlsymlist;
5282 extern LT_DLSYM_CONST lt_dlsymlist
5283 lt_${my_prefix}_LTX_preloaded_symbols[];\
5284 "
5285 
5286           if test -s "$nlist"I; then
5287             echo >> "$output_objdir/$my_dlsyms" "\
5288 static void lt_syminit(void)
5289 {
5290   LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
5291   for (; symbol->name; ++symbol)
5292     {"
5293             $SED 's/.*/      if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
5294             echo >> "$output_objdir/$my_dlsyms" "\
5295     }
5296 }"
5297           fi
5298           echo >> "$output_objdir/$my_dlsyms" "\
5299 LT_DLSYM_CONST lt_dlsymlist
5300 lt_${my_prefix}_LTX_preloaded_symbols[] =
5301 { {\"$my_originator\", (void *) 0},"
5302 
5303           if test -s "$nlist"I; then
5304             echo >> "$output_objdir/$my_dlsyms" "\
5305   {\"@INIT@\", (void *) &lt_syminit},"
5306           fi
5307 
5308           case $need_lib_prefix in
5309           no)
5310             eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
5311             ;;
5312           *)
5313             eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
5314             ;;
5315           esac
5316           echo >> "$output_objdir/$my_dlsyms" "\
5317   {0, (void *) 0}
5318 };
5319 
5320 /* This works around a problem in FreeBSD linker */
5321 #ifdef FREEBSD_WORKAROUND
5322 static const void *lt_preloaded_setup() {
5323   return lt_${my_prefix}_LTX_preloaded_symbols;
5324 }
5325 #endif
5326 
5327 #ifdef __cplusplus
5328 }
5329 #endif\
5330 "
5331         } # !$opt_dry_run
5332 
5333         pic_flag_for_symtable=
5334         case "$compile_command " in
5335         *" -static "*) ;;
5336         *)
5337           case $host in
5338           # compiling the symbol table file with pic_flag works around
5339           # a FreeBSD bug that causes programs to crash when -lm is
5340           # linked before any other PIC object.  But we must not use
5341           # pic_flag when linking with -static.  The problem exists in
5342           # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
5343           *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
5344             pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
5345           *-*-hpux*)
5346             pic_flag_for_symtable=" $pic_flag"  ;;
5347           *)
5348             $my_pic_p && pic_flag_for_symtable=" $pic_flag"
5349             ;;
5350           esac
5351           ;;
5352         esac
5353         symtab_cflags=
5354         for arg in $LTCFLAGS; do
5355           case $arg in
5356           -pie | -fpie | -fPIE) ;;
5357           *) func_append symtab_cflags " $arg" ;;
5358           esac
5359         done
5360 
5361         # Now compile the dynamic symbol file.
5362         func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
5363 
5364         # Clean up the generated files.
5365         func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
5366 
5367         # Transform the symbol file into the correct name.
5368         symfileobj=$output_objdir/${my_outputname}S.$objext
5369         case $host in
5370         *cygwin* | *mingw* | *cegcc* )
5371           if test -f "$output_objdir/$my_outputname.def"; then
5372             compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
5373             finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
5374           else
5375             compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
5376             finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
5377           fi
5378           ;;
5379         *)
5380           compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
5381           finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
5382           ;;
5383         esac
5384         ;;
5385       *)
5386         func_fatal_error "unknown suffix for '$my_dlsyms'"
5387         ;;
5388       esac
5389     else
5390       # We keep going just in case the user didn't refer to
5391       # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
5392       # really was required.
5393 
5394       # Nullify the symbol file.
5395       compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
5396       finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
5397     fi
5398 }
5399 
5400 # func_cygming_gnu_implib_p ARG
5401 # This predicate returns with zero status (TRUE) if
5402 # ARG is a GNU/binutils-style import library. Returns
5403 # with nonzero status (FALSE) otherwise.
5404 func_cygming_gnu_implib_p ()
5405 {
5406   $debug_cmd
5407 
5408   func_to_tool_file "$1" func_convert_file_msys_to_w32
5409   func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
5410   test -n "$func_cygming_gnu_implib_tmp"
5411 }
5412 
5413 # func_cygming_ms_implib_p ARG
5414 # This predicate returns with zero status (TRUE) if
5415 # ARG is an MS-style import library. Returns
5416 # with nonzero status (FALSE) otherwise.
5417 func_cygming_ms_implib_p ()
5418 {
5419   $debug_cmd
5420 
5421   func_to_tool_file "$1" func_convert_file_msys_to_w32
5422   func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
5423   test -n "$func_cygming_ms_implib_tmp"
5424 }
5425 
5426 # func_win32_libid arg
5427 # return the library type of file 'arg'
5428 #
5429 # Need a lot of goo to handle *both* DLLs and import libs
5430 # Has to be a shell function in order to 'eat' the argument
5431 # that is supplied when $file_magic_command is called.
5432 # Despite the name, also deal with 64 bit binaries.
5433 func_win32_libid ()
5434 {
5435   $debug_cmd
5436 
5437   win32_libid_type=unknown
5438   win32_fileres=`file -L $1 2>/dev/null`
5439   case $win32_fileres in
5440   *ar\ archive\ import\ library*) # definitely import
5441     win32_libid_type="x86 archive import"
5442     ;;
5443   *ar\ archive*) # could be an import, or static
5444     # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
5445     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
5446        $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
5447       case $nm_interface in
5448       "MS dumpbin")
5449         if func_cygming_ms_implib_p "$1" ||
5450            func_cygming_gnu_implib_p "$1"
5451         then
5452           win32_nmres=import
5453         else
5454           win32_nmres=
5455         fi
5456         ;;
5457       *)
5458         func_to_tool_file "$1" func_convert_file_msys_to_w32
5459         win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
5460           $SED -n -e '
5461             1,100{
5462                 / I /{
5463                     s|.*|import|
5464                     p
5465                     q
5466                 }
5467             }'`
5468         ;;
5469       esac
5470       case $win32_nmres in
5471       import*)  win32_libid_type="x86 archive import";;
5472       *)        win32_libid_type="x86 archive static";;
5473       esac
5474     fi
5475     ;;
5476   *DLL*)
5477     win32_libid_type="x86 DLL"
5478     ;;
5479   *executable*) # but shell scripts are "executable" too...
5480     case $win32_fileres in
5481     *MS\ Windows\ PE\ Intel*)
5482       win32_libid_type="x86 DLL"
5483       ;;
5484     esac
5485     ;;
5486   esac
5487   $ECHO "$win32_libid_type"
5488 }
5489 
5490 # func_cygming_dll_for_implib ARG
5491 #
5492 # Platform-specific function to extract the
5493 # name of the DLL associated with the specified
5494 # import library ARG.
5495 # Invoked by eval'ing the libtool variable
5496 #    $sharedlib_from_linklib_cmd
5497 # Result is available in the variable
5498 #    $sharedlib_from_linklib_result
5499 func_cygming_dll_for_implib ()
5500 {
5501   $debug_cmd
5502 
5503   sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
5504 }
5505 
5506 # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
5507 #
5508 # The is the core of a fallback implementation of a
5509 # platform-specific function to extract the name of the
5510 # DLL associated with the specified import library LIBNAME.
5511 #
5512 # SECTION_NAME is either .idata$6 or .idata$7, depending
5513 # on the platform and compiler that created the implib.
5514 #
5515 # Echos the name of the DLL associated with the
5516 # specified import library.
5517 func_cygming_dll_for_implib_fallback_core ()
5518 {
5519   $debug_cmd
5520 
5521   match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
5522   $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
5523     $SED '/^Contents of section '"$match_literal"':/{
5524       # Place marker at beginning of archive member dllname section
5525       s/.*/====MARK====/
5526       p
5527       d
5528     }
5529     # These lines can sometimes be longer than 43 characters, but
5530     # are always uninteresting
5531     /:[  ]*file format pe[i]\{,1\}-/d
5532     /^In archive [^:]*:/d
5533     # Ensure marker is printed
5534     /^====MARK====/p
5535     # Remove all lines with less than 43 characters
5536     /^.\{43\}/!d
5537     # From remaining lines, remove first 43 characters
5538     s/^.\{43\}//' |
5539     $SED -n '
5540       # Join marker and all lines until next marker into a single line
5541       /^====MARK====/ b para
5542       H
5543       $ b para
5544       b
5545       :para
5546       x
5547       s/\n//g
5548       # Remove the marker
5549       s/^====MARK====//
5550       # Remove trailing dots and whitespace
5551       s/[\. \t]*$//
5552       # Print
5553       /./p' |
5554     # we now have a list, one entry per line, of the stringified
5555     # contents of the appropriate section of all members of the
5556     # archive that possess that section. Heuristic: eliminate
5557     # all those that have a first or second character that is
5558     # a '.' (that is, objdump's representation of an unprintable
5559     # character.) This should work for all archives with less than
5560     # 0x302f exports -- but will fail for DLLs whose name actually
5561     # begins with a literal '.' or a single character followed by
5562     # a '.'.
5563     #
5564     # Of those that remain, print the first one.
5565     $SED -e '/^\./d;/^.\./d;q'
5566 }
5567 
5568 # func_cygming_dll_for_implib_fallback ARG
5569 # Platform-specific function to extract the
5570 # name of the DLL associated with the specified
5571 # import library ARG.
5572 #
5573 # This fallback implementation is for use when $DLLTOOL
5574 # does not support the --identify-strict option.
5575 # Invoked by eval'ing the libtool variable
5576 #    $sharedlib_from_linklib_cmd
5577 # Result is available in the variable
5578 #    $sharedlib_from_linklib_result
5579 func_cygming_dll_for_implib_fallback ()
5580 {
5581   $debug_cmd
5582 
5583   if func_cygming_gnu_implib_p "$1"; then
5584     # binutils import library
5585     sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
5586   elif func_cygming_ms_implib_p "$1"; then
5587     # ms-generated import library
5588     sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
5589   else
5590     # unknown
5591     sharedlib_from_linklib_result=
5592   fi
5593 }
5594 
5595 
5596 # func_extract_an_archive dir oldlib
5597 func_extract_an_archive ()
5598 {
5599     $debug_cmd
5600 
5601     f_ex_an_ar_dir=$1; shift
5602     f_ex_an_ar_oldlib=$1
5603     if test yes = "$lock_old_archive_extraction"; then
5604       lockfile=$f_ex_an_ar_oldlib.lock
5605       until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
5606         func_echo "Waiting for $lockfile to be removed"
5607         sleep 2
5608       done
5609     fi
5610     func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
5611                    'stat=$?; rm -f "$lockfile"; exit $stat'
5612     if test yes = "$lock_old_archive_extraction"; then
5613       $opt_dry_run || rm -f "$lockfile"
5614     fi
5615     if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
5616      :
5617     else
5618       func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
5619     fi
5620 }
5621 
5622 
5623 # func_extract_archives gentop oldlib ...
5624 func_extract_archives ()
5625 {
5626     $debug_cmd
5627 
5628     my_gentop=$1; shift
5629     my_oldlibs=${1+"$@"}
5630     my_oldobjs=
5631     my_xlib=
5632     my_xabs=
5633     my_xdir=
5634 
5635     for my_xlib in $my_oldlibs; do
5636       # Extract the objects.
5637       case $my_xlib in
5638         [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
5639         *) my_xabs=`pwd`"/$my_xlib" ;;
5640       esac
5641       func_basename "$my_xlib"
5642       my_xlib=$func_basename_result
5643       my_xlib_u=$my_xlib
5644       while :; do
5645         case " $extracted_archives " in
5646         *" $my_xlib_u "*)
5647           func_arith $extracted_serial + 1
5648           extracted_serial=$func_arith_result
5649           my_xlib_u=lt$extracted_serial-$my_xlib ;;
5650         *) break ;;
5651         esac
5652       done
5653       extracted_archives="$extracted_archives $my_xlib_u"
5654       my_xdir=$my_gentop/$my_xlib_u
5655 
5656       func_mkdir_p "$my_xdir"
5657 
5658       case $host in
5659       *-darwin*)
5660         func_verbose "Extracting $my_xabs"
5661         # Do not bother doing anything if just a dry run
5662         $opt_dry_run || {
5663           darwin_orig_dir=`pwd`
5664           cd $my_xdir || exit $?
5665           darwin_archive=$my_xabs
5666           darwin_curdir=`pwd`
5667           func_basename "$darwin_archive"
5668           darwin_base_archive=$func_basename_result
5669           darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
5670           if test -n "$darwin_arches"; then
5671             darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
5672             darwin_arch=
5673             func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
5674             for darwin_arch in  $darwin_arches; do
5675               func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
5676               $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
5677               cd "unfat-$$/$darwin_base_archive-$darwin_arch"
5678               func_extract_an_archive "`pwd`" "$darwin_base_archive"
5679               cd "$darwin_curdir"
5680               $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
5681             done # $darwin_arches
5682             ## Okay now we've a bunch of thin objects, gotta fatten them up :)
5683             darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
5684             darwin_file=
5685             darwin_files=
5686             for darwin_file in $darwin_filelist; do
5687               darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
5688               $LIPO -create -output "$darwin_file" $darwin_files
5689             done # $darwin_filelist
5690             $RM -rf unfat-$$
5691             cd "$darwin_orig_dir"
5692           else
5693             cd $darwin_orig_dir
5694             func_extract_an_archive "$my_xdir" "$my_xabs"
5695           fi # $darwin_arches
5696         } # !$opt_dry_run
5697         ;;
5698       *)
5699         func_extract_an_archive "$my_xdir" "$my_xabs"
5700         ;;
5701       esac
5702       my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
5703     done
5704 
5705     func_extract_archives_result=$my_oldobjs
5706 }
5707 
5708 
5709 # func_emit_wrapper [arg=no]
5710 #
5711 # Emit a libtool wrapper script on stdout.
5712 # Don't directly open a file because we may want to
5713 # incorporate the script contents within a cygwin/mingw
5714 # wrapper executable.  Must ONLY be called from within
5715 # func_mode_link because it depends on a number of variables
5716 # set therein.
5717 #
5718 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
5719 # variable will take.  If 'yes', then the emitted script
5720 # will assume that the directory where it is stored is
5721 # the $objdir directory.  This is a cygwin/mingw-specific
5722 # behavior.
5723 func_emit_wrapper ()
5724 {
5725         func_emit_wrapper_arg1=${1-no}
5726 
5727         $ECHO "\
5728 #! $SHELL
5729 
5730 # $output - temporary wrapper script for $objdir/$outputname
5731 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
5732 #
5733 # The $output program cannot be directly executed until all the libtool
5734 # libraries that it depends on are installed.
5735 #
5736 # This wrapper script should never be moved out of the build directory.
5737 # If it is, it will not operate correctly.
5738 
5739 # Sed substitution that helps us do robust quoting.  It backslashifies
5740 # metacharacters that are still active within double-quoted strings.
5741 sed_quote_subst='$sed_quote_subst'
5742 
5743 # Be Bourne compatible
5744 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
5745   emulate sh
5746   NULLCMD=:
5747   # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
5748   # is contrary to our usage.  Disable this feature.
5749   alias -g '\${1+\"\$@\"}'='\"\$@\"'
5750   setopt NO_GLOB_SUBST
5751 else
5752   case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
5753 fi
5754 BIN_SH=xpg4; export BIN_SH # for Tru64
5755 DUALCASE=1; export DUALCASE # for MKS sh
5756 
5757 # The HP-UX ksh and POSIX shell print the target directory to stdout
5758 # if CDPATH is set.
5759 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5760 
5761 relink_command=\"$relink_command\"
5762 
5763 # This environment variable determines our operation mode.
5764 if test \"\$libtool_install_magic\" = \"$magic\"; then
5765   # install mode needs the following variables:
5766   generated_by_libtool_version='$macro_version'
5767   notinst_deplibs='$notinst_deplibs'
5768 else
5769   # When we are sourced in execute mode, \$file and \$ECHO are already set.
5770   if test \"\$libtool_execute_magic\" != \"$magic\"; then
5771     file=\"\$0\""
5772 
5773     qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
5774     $ECHO "\
5775 
5776 # A function that is used when there is no print builtin or printf.
5777 func_fallback_echo ()
5778 {
5779   eval 'cat <<_LTECHO_EOF
5780 \$1
5781 _LTECHO_EOF'
5782 }
5783     ECHO=\"$qECHO\"
5784   fi
5785 
5786 # Very basic option parsing. These options are (a) specific to
5787 # the libtool wrapper, (b) are identical between the wrapper
5788 # /script/ and the wrapper /executable/ that is used only on
5789 # windows platforms, and (c) all begin with the string "--lt-"
5790 # (application programs are unlikely to have options that match
5791 # this pattern).
5792 #
5793 # There are only two supported options: --lt-debug and
5794 # --lt-dump-script. There is, deliberately, no --lt-help.
5795 #
5796 # The first argument to this parsing function should be the
5797 # script's $0 value, followed by "$@".
5798 lt_option_debug=
5799 func_parse_lt_options ()
5800 {
5801   lt_script_arg0=\$0
5802   shift
5803   for lt_opt
5804   do
5805     case \"\$lt_opt\" in
5806     --lt-debug) lt_option_debug=1 ;;
5807     --lt-dump-script)
5808         lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
5809         test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
5810         lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
5811         cat \"\$lt_dump_D/\$lt_dump_F\"
5812         exit 0
5813       ;;
5814     --lt-*)
5815         \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
5816         exit 1
5817       ;;
5818     esac
5819   done
5820 
5821   # Print the debug banner immediately:
5822   if test -n \"\$lt_option_debug\"; then
5823     echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
5824   fi
5825 }
5826 
5827 # Used when --lt-debug. Prints its arguments to stdout
5828 # (redirection is the responsibility of the caller)
5829 func_lt_dump_args ()
5830 {
5831   lt_dump_args_N=1;
5832   for lt_arg
5833   do
5834     \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
5835     lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
5836   done
5837 }
5838 
5839 # Core function for launching the target application
5840 func_exec_program_core ()
5841 {
5842 "
5843   case $host in
5844   # Backslashes separate directories on plain windows
5845   *-*-mingw | *-*-os2* | *-cegcc*)
5846     $ECHO "\
5847       if test -n \"\$lt_option_debug\"; then
5848         \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
5849         func_lt_dump_args \${1+\"\$@\"} 1>&2
5850       fi
5851       exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5852 "
5853     ;;
5854 
5855   *)
5856     $ECHO "\
5857       if test -n \"\$lt_option_debug\"; then
5858         \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
5859         func_lt_dump_args \${1+\"\$@\"} 1>&2
5860       fi
5861       exec \"\$progdir/\$program\" \${1+\"\$@\"}
5862 "
5863     ;;
5864   esac
5865   $ECHO "\
5866       \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
5867       exit 1
5868 }
5869 
5870 # A function to encapsulate launching the target application
5871 # Strips options in the --lt-* namespace from \$@ and
5872 # launches target application with the remaining arguments.
5873 func_exec_program ()
5874 {
5875   case \" \$* \" in
5876   *\\ --lt-*)
5877     for lt_wr_arg
5878     do
5879       case \$lt_wr_arg in
5880       --lt-*) ;;
5881       *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
5882       esac
5883       shift
5884     done ;;
5885   esac
5886   func_exec_program_core \${1+\"\$@\"}
5887 }
5888 
5889   # Parse options
5890   func_parse_lt_options \"\$0\" \${1+\"\$@\"}
5891 
5892   # Find the directory that this script lives in.
5893   thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
5894   test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5895 
5896   # Follow symbolic links until we get to the real thisdir.
5897   file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
5898   while test -n \"\$file\"; do
5899     destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
5900 
5901     # If there was a directory component, then change thisdir.
5902     if test \"x\$destdir\" != \"x\$file\"; then
5903       case \"\$destdir\" in
5904       [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5905       *) thisdir=\"\$thisdir/\$destdir\" ;;
5906       esac
5907     fi
5908 
5909     file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
5910     file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
5911   done
5912 
5913   # Usually 'no', except on cygwin/mingw when embedded into
5914   # the cwrapper.
5915   WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
5916   if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
5917     # special case for '.'
5918     if test \"\$thisdir\" = \".\"; then
5919       thisdir=\`pwd\`
5920     fi
5921     # remove .libs from thisdir
5922     case \"\$thisdir\" in
5923     *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
5924     $objdir )   thisdir=. ;;
5925     esac
5926   fi
5927 
5928   # Try to get the absolute directory name.
5929   absdir=\`cd \"\$thisdir\" && pwd\`
5930   test -n \"\$absdir\" && thisdir=\"\$absdir\"
5931 "
5932 
5933         if test yes = "$fast_install"; then
5934           $ECHO "\
5935   program=lt-'$outputname'$exeext
5936   progdir=\"\$thisdir/$objdir\"
5937 
5938   if test ! -f \"\$progdir/\$program\" ||
5939      { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
5940        test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5941 
5942     file=\"\$\$-\$program\"
5943 
5944     if test ! -d \"\$progdir\"; then
5945       $MKDIR \"\$progdir\"
5946     else
5947       $RM \"\$progdir/\$file\"
5948     fi"
5949 
5950           $ECHO "\
5951 
5952     # relink executable if necessary
5953     if test -n \"\$relink_command\"; then
5954       if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5955       else
5956         \$ECHO \"\$relink_command_output\" >&2
5957         $RM \"\$progdir/\$file\"
5958         exit 1
5959       fi
5960     fi
5961 
5962     $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5963     { $RM \"\$progdir/\$program\";
5964       $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5965     $RM \"\$progdir/\$file\"
5966   fi"
5967         else
5968           $ECHO "\
5969   program='$outputname'
5970   progdir=\"\$thisdir/$objdir\"
5971 "
5972         fi
5973 
5974         $ECHO "\
5975 
5976   if test -f \"\$progdir/\$program\"; then"
5977 
5978         # fixup the dll searchpath if we need to.
5979         #
5980         # Fix the DLL searchpath if we need to.  Do this before prepending
5981         # to shlibpath, because on Windows, both are PATH and uninstalled
5982         # libraries must come first.
5983         if test -n "$dllsearchpath"; then
5984           $ECHO "\
5985     # Add the dll search path components to the executable PATH
5986     PATH=$dllsearchpath:\$PATH
5987 "
5988         fi
5989 
5990         # Export our shlibpath_var if we have one.
5991         if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5992           $ECHO "\
5993     # Add our own library path to $shlibpath_var
5994     $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5995 
5996     # Some systems cannot cope with colon-terminated $shlibpath_var
5997     # The second colon is a workaround for a bug in BeOS R4 sed
5998     $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
5999 
6000     export $shlibpath_var
6001 "
6002         fi
6003 
6004         $ECHO "\
6005     if test \"\$libtool_execute_magic\" != \"$magic\"; then
6006       # Run the actual program with our arguments.
6007       func_exec_program \${1+\"\$@\"}
6008     fi
6009   else
6010     # The program doesn't exist.
6011     \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
6012     \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
6013     \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
6014     exit 1
6015   fi
6016 fi\
6017 "
6018 }
6019 
6020 
6021 # func_emit_cwrapperexe_src
6022 # emit the source code for a wrapper executable on stdout
6023 # Must ONLY be called from within func_mode_link because
6024 # it depends on a number of variable set therein.
6025 func_emit_cwrapperexe_src ()
6026 {
6027         cat <<EOF
6028 
6029 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
6030    Generated by $PROGRAM (GNU $PACKAGE) $VERSION
6031 
6032    The $output program cannot be directly executed until all the libtool
6033    libraries that it depends on are installed.
6034 
6035    This wrapper executable should never be moved out of the build directory.
6036    If it is, it will not operate correctly.
6037 */
6038 EOF
6039             cat <<"EOF"
6040 #ifdef _MSC_VER
6041 # define _CRT_SECURE_NO_DEPRECATE 1
6042 #endif
6043 #include <stdio.h>
6044 #include <stdlib.h>
6045 #ifdef _MSC_VER
6046 # include <direct.h>
6047 # include <process.h>
6048 # include <io.h>
6049 #else
6050 # include <unistd.h>
6051 # include <stdint.h>
6052 # ifdef __CYGWIN__
6053 #  include <io.h>
6054 # endif
6055 #endif
6056 #include <malloc.h>
6057 #include <stdarg.h>
6058 #include <assert.h>
6059 #include <string.h>
6060 #include <ctype.h>
6061 #include <errno.h>
6062 #include <fcntl.h>
6063 #include <sys/stat.h>
6064 
6065 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
6066 
6067 /* declarations of non-ANSI functions */
6068 #if defined __MINGW32__
6069 # ifdef __STRICT_ANSI__
6070 int _putenv (const char *);
6071 # endif
6072 #elif defined __CYGWIN__
6073 # ifdef __STRICT_ANSI__
6074 char *realpath (const char *, char *);
6075 int putenv (char *);
6076 int setenv (const char *, const char *, int);
6077 # endif
6078 /* #elif defined other_platform || defined ... */
6079 #endif
6080 
6081 /* portability defines, excluding path handling macros */
6082 #if defined _MSC_VER
6083 # define setmode _setmode
6084 # define stat    _stat
6085 # define chmod   _chmod
6086 # define getcwd  _getcwd
6087 # define putenv  _putenv
6088 # define S_IXUSR _S_IEXEC
6089 #elif defined __MINGW32__
6090 # define setmode _setmode
6091 # define stat    _stat
6092 # define chmod   _chmod
6093 # define getcwd  _getcwd
6094 # define putenv  _putenv
6095 #elif defined __CYGWIN__
6096 # define HAVE_SETENV
6097 # define FOPEN_WB "wb"
6098 /* #elif defined other platforms ... */
6099 #endif
6100 
6101 #if defined PATH_MAX
6102 # define LT_PATHMAX PATH_MAX
6103 #elif defined MAXPATHLEN
6104 # define LT_PATHMAX MAXPATHLEN
6105 #else
6106 # define LT_PATHMAX 1024
6107 #endif
6108 
6109 #ifndef S_IXOTH
6110 # define S_IXOTH 0
6111 #endif
6112 #ifndef S_IXGRP
6113 # define S_IXGRP 0
6114 #endif
6115 
6116 /* path handling portability macros */
6117 #ifndef DIR_SEPARATOR
6118 # define DIR_SEPARATOR '/'
6119 # define PATH_SEPARATOR ':'
6120 #endif
6121 
6122 #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
6123   defined __OS2__
6124 # define HAVE_DOS_BASED_FILE_SYSTEM
6125 # define FOPEN_WB "wb"
6126 # ifndef DIR_SEPARATOR_2
6127 #  define DIR_SEPARATOR_2 '\\'
6128 # endif
6129 # ifndef PATH_SEPARATOR_2
6130 #  define PATH_SEPARATOR_2 ';'
6131 # endif
6132 #endif
6133 
6134 #ifndef DIR_SEPARATOR_2
6135 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
6136 #else /* DIR_SEPARATOR_2 */
6137 # define IS_DIR_SEPARATOR(ch) \
6138         (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
6139 #endif /* DIR_SEPARATOR_2 */
6140 
6141 #ifndef PATH_SEPARATOR_2
6142 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
6143 #else /* PATH_SEPARATOR_2 */
6144 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
6145 #endif /* PATH_SEPARATOR_2 */
6146 
6147 #ifndef FOPEN_WB
6148 # define FOPEN_WB "w"
6149 #endif
6150 #ifndef _O_BINARY
6151 # define _O_BINARY 0
6152 #endif
6153 
6154 #define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
6155 #define XFREE(stale) do { \
6156   if (stale) { free (stale); stale = 0; } \
6157 } while (0)
6158 
6159 #if defined LT_DEBUGWRAPPER
6160 static int lt_debug = 1;
6161 #else
6162 static int lt_debug = 0;
6163 #endif
6164 
6165 const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
6166 
6167 void *xmalloc (size_t num);
6168 char *xstrdup (const char *string);
6169 const char *base_name (const char *name);
6170 char *find_executable (const char *wrapper);
6171 char *chase_symlinks (const char *pathspec);
6172 int make_executable (const char *path);
6173 int check_executable (const char *path);
6174 char *strendzap (char *str, const char *pat);
6175 void lt_debugprintf (const char *file, int line, const char *fmt, ...);
6176 void lt_fatal (const char *file, int line, const char *message, ...);
6177 static const char *nonnull (const char *s);
6178 static const char *nonempty (const char *s);
6179 void lt_setenv (const char *name, const char *value);
6180 char *lt_extend_str (const char *orig_value, const char *add, int to_end);
6181 void lt_update_exe_path (const char *name, const char *value);
6182 void lt_update_lib_path (const char *name, const char *value);
6183 char **prepare_spawn (char **argv);
6184 void lt_dump_script (FILE *f);
6185 EOF
6186 
6187             cat <<EOF
6188 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
6189 # define externally_visible volatile
6190 #else
6191 # define externally_visible __attribute__((externally_visible)) volatile
6192 #endif
6193 externally_visible const char * MAGIC_EXE = "$magic_exe";
6194 const char * LIB_PATH_VARNAME = "$shlibpath_var";
6195 EOF
6196 
6197             if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
6198               func_to_host_path "$temp_rpath"
6199               cat <<EOF
6200 const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
6201 EOF
6202             else
6203               cat <<"EOF"
6204 const char * LIB_PATH_VALUE   = "";
6205 EOF
6206             fi
6207 
6208             if test -n "$dllsearchpath"; then
6209               func_to_host_path "$dllsearchpath:"
6210               cat <<EOF
6211 const char * EXE_PATH_VARNAME = "PATH";
6212 const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
6213 EOF
6214             else
6215               cat <<"EOF"
6216 const char * EXE_PATH_VARNAME = "";
6217 const char * EXE_PATH_VALUE   = "";
6218 EOF
6219             fi
6220 
6221             if test yes = "$fast_install"; then
6222               cat <<EOF
6223 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
6224 EOF
6225             else
6226               cat <<EOF
6227 const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
6228 EOF
6229             fi
6230 
6231 
6232             cat <<"EOF"
6233 
6234 #define LTWRAPPER_OPTION_PREFIX         "--lt-"
6235 
6236 static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
6237 static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
6238 static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
6239 
6240 int
6241 main (int argc, char *argv[])
6242 {
6243   char **newargz;
6244   int  newargc;
6245   char *tmp_pathspec;
6246   char *actual_cwrapper_path;
6247   char *actual_cwrapper_name;
6248   char *target_name;
6249   char *lt_argv_zero;
6250   int rval = 127;
6251 
6252   int i;
6253 
6254   program_name = (char *) xstrdup (base_name (argv[0]));
6255   newargz = XMALLOC (char *, (size_t) argc + 1);
6256 
6257   /* very simple arg parsing; don't want to rely on getopt
6258    * also, copy all non cwrapper options to newargz, except
6259    * argz[0], which is handled differently
6260    */
6261   newargc=0;
6262   for (i = 1; i < argc; i++)
6263     {
6264       if (STREQ (argv[i], dumpscript_opt))
6265         {
6266 EOF
6267             case $host in
6268               *mingw* | *cygwin* )
6269                 # make stdout use "unix" line endings
6270                 echo "          setmode(1,_O_BINARY);"
6271                 ;;
6272               esac
6273 
6274             cat <<"EOF"
6275           lt_dump_script (stdout);
6276           return 0;
6277         }
6278       if (STREQ (argv[i], debug_opt))
6279         {
6280           lt_debug = 1;
6281           continue;
6282         }
6283       if (STREQ (argv[i], ltwrapper_option_prefix))
6284         {
6285           /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
6286              namespace, but it is not one of the ones we know about and
6287              have already dealt with, above (inluding dump-script), then
6288              report an error. Otherwise, targets might begin to believe
6289              they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
6290              namespace. The first time any user complains about this, we'll
6291              need to make LTWRAPPER_OPTION_PREFIX a configure-time option
6292              or a configure.ac-settable value.
6293            */
6294           lt_fatal (__FILE__, __LINE__,
6295                     "unrecognized %s option: '%s'",
6296                     ltwrapper_option_prefix, argv[i]);
6297         }
6298       /* otherwise ... */
6299       newargz[++newargc] = xstrdup (argv[i]);
6300     }
6301   newargz[++newargc] = NULL;
6302 
6303 EOF
6304             cat <<EOF
6305   /* The GNU banner must be the first non-error debug message */
6306   lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
6307 EOF
6308             cat <<"EOF"
6309   lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
6310   lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
6311 
6312   tmp_pathspec = find_executable (argv[0]);
6313   if (tmp_pathspec == NULL)
6314     lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
6315   lt_debugprintf (__FILE__, __LINE__,
6316                   "(main) found exe (before symlink chase) at: %s\n",
6317                   tmp_pathspec);
6318 
6319   actual_cwrapper_path = chase_symlinks (tmp_pathspec);
6320   lt_debugprintf (__FILE__, __LINE__,
6321                   "(main) found exe (after symlink chase) at: %s\n",
6322                   actual_cwrapper_path);
6323   XFREE (tmp_pathspec);
6324 
6325   actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
6326   strendzap (actual_cwrapper_path, actual_cwrapper_name);
6327 
6328   /* wrapper name transforms */
6329   strendzap (actual_cwrapper_name, ".exe");
6330   tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
6331   XFREE (actual_cwrapper_name);
6332   actual_cwrapper_name = tmp_pathspec;
6333   tmp_pathspec = 0;
6334 
6335   /* target_name transforms -- use actual target program name; might have lt- prefix */
6336   target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
6337   strendzap (target_name, ".exe");
6338   tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
6339   XFREE (target_name);
6340   target_name = tmp_pathspec;
6341   tmp_pathspec = 0;
6342 
6343   lt_debugprintf (__FILE__, __LINE__,
6344                   "(main) libtool target name: %s\n",
6345                   target_name);
6346 EOF
6347 
6348             cat <<EOF
6349   newargz[0] =
6350     XMALLOC (char, (strlen (actual_cwrapper_path) +
6351                     strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
6352   strcpy (newargz[0], actual_cwrapper_path);
6353   strcat (newargz[0], "$objdir");
6354   strcat (newargz[0], "/");
6355 EOF
6356 
6357             cat <<"EOF"
6358   /* stop here, and copy so we don't have to do this twice */
6359   tmp_pathspec = xstrdup (newargz[0]);
6360 
6361   /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
6362   strcat (newargz[0], actual_cwrapper_name);
6363 
6364   /* DO want the lt- prefix here if it exists, so use target_name */
6365   lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
6366   XFREE (tmp_pathspec);
6367   tmp_pathspec = NULL;
6368 EOF
6369 
6370             case $host_os in
6371               mingw*)
6372             cat <<"EOF"
6373   {
6374     char* p;
6375     while ((p = strchr (newargz[0], '\\')) != NULL)
6376       {
6377         *p = '/';
6378       }
6379     while ((p = strchr (lt_argv_zero, '\\')) != NULL)
6380       {
6381         *p = '/';
6382       }
6383   }
6384 EOF
6385             ;;
6386             esac
6387 
6388             cat <<"EOF"
6389   XFREE (target_name);
6390   XFREE (actual_cwrapper_path);
6391   XFREE (actual_cwrapper_name);
6392 
6393   lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
6394   lt_setenv ("DUALCASE", "1");  /* for MSK sh */
6395   /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
6396      be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
6397      because on Windows, both *_VARNAMEs are PATH but uninstalled
6398      libraries must come first. */
6399   lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
6400   lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
6401 
6402   lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
6403                   nonnull (lt_argv_zero));
6404   for (i = 0; i < newargc; i++)
6405     {
6406       lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
6407                       i, nonnull (newargz[i]));
6408     }
6409 
6410 EOF
6411 
6412             case $host_os in
6413               mingw*)
6414                 cat <<"EOF"
6415   /* execv doesn't actually work on mingw as expected on unix */
6416   newargz = prepare_spawn (newargz);
6417   rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
6418   if (rval == -1)
6419     {
6420       /* failed to start process */
6421       lt_debugprintf (__FILE__, __LINE__,
6422                       "(main) failed to launch target \"%s\": %s\n",
6423                       lt_argv_zero, nonnull (strerror (errno)));
6424       return 127;
6425     }
6426   return rval;
6427 EOF
6428                 ;;
6429               *)
6430                 cat <<"EOF"
6431   execv (lt_argv_zero, newargz);
6432   return rval; /* =127, but avoids unused variable warning */
6433 EOF
6434                 ;;
6435             esac
6436 
6437             cat <<"EOF"
6438 }
6439 
6440 void *
6441 xmalloc (size_t num)
6442 {
6443   void *p = (void *) malloc (num);
6444   if (!p)
6445     lt_fatal (__FILE__, __LINE__, "memory exhausted");
6446 
6447   return p;
6448 }
6449 
6450 char *
6451 xstrdup (const char *string)
6452 {
6453   return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
6454                           string) : NULL;
6455 }
6456 
6457 const char *
6458 base_name (const char *name)
6459 {
6460   const char *base;
6461 
6462 #if defined HAVE_DOS_BASED_FILE_SYSTEM
6463   /* Skip over the disk name in MSDOS pathnames. */
6464   if (isalpha ((unsigned char) name[0]) && name[1] == ':')
6465     name += 2;
6466 #endif
6467 
6468   for (base = name; *name; name++)
6469     if (IS_DIR_SEPARATOR (*name))
6470       base = name + 1;
6471   return base;
6472 }
6473 
6474 int
6475 check_executable (const char *path)
6476 {
6477   struct stat st;
6478 
6479   lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
6480                   nonempty (path));
6481   if ((!path) || (!*path))
6482     return 0;
6483 
6484   if ((stat (path, &st) >= 0)
6485       && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
6486     return 1;
6487   else
6488     return 0;
6489 }
6490 
6491 int
6492 make_executable (const char *path)
6493 {
6494   int rval = 0;
6495   struct stat st;
6496 
6497   lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
6498                   nonempty (path));
6499   if ((!path) || (!*path))
6500     return 0;
6501 
6502   if (stat (path, &st) >= 0)
6503     {
6504       rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
6505     }
6506   return rval;
6507 }
6508 
6509 /* Searches for the full path of the wrapper.  Returns
6510    newly allocated full path name if found, NULL otherwise
6511    Does not chase symlinks, even on platforms that support them.
6512 */
6513 char *
6514 find_executable (const char *wrapper)
6515 {
6516   int has_slash = 0;
6517   const char *p;
6518   const char *p_next;
6519   /* static buffer for getcwd */
6520   char tmp[LT_PATHMAX + 1];
6521   size_t tmp_len;
6522   char *concat_name;
6523 
6524   lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
6525                   nonempty (wrapper));
6526 
6527   if ((wrapper == NULL) || (*wrapper == '\0'))
6528     return NULL;
6529 
6530   /* Absolute path? */
6531 #if defined HAVE_DOS_BASED_FILE_SYSTEM
6532   if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
6533     {
6534       concat_name = xstrdup (wrapper);
6535       if (check_executable (concat_name))
6536         return concat_name;
6537       XFREE (concat_name);
6538     }
6539   else
6540     {
6541 #endif
6542       if (IS_DIR_SEPARATOR (wrapper[0]))
6543         {
6544           concat_name = xstrdup (wrapper);
6545           if (check_executable (concat_name))
6546             return concat_name;
6547           XFREE (concat_name);
6548         }
6549 #if defined HAVE_DOS_BASED_FILE_SYSTEM
6550     }
6551 #endif
6552 
6553   for (p = wrapper; *p; p++)
6554     if (*p == '/')
6555       {
6556         has_slash = 1;
6557         break;
6558       }
6559   if (!has_slash)
6560     {
6561       /* no slashes; search PATH */
6562       const char *path = getenv ("PATH");
6563       if (path != NULL)
6564         {
6565           for (p = path; *p; p = p_next)
6566             {
6567               const char *q;
6568               size_t p_len;
6569               for (q = p; *q; q++)
6570                 if (IS_PATH_SEPARATOR (*q))
6571                   break;
6572               p_len = (size_t) (q - p);
6573               p_next = (*q == '\0' ? q : q + 1);
6574               if (p_len == 0)
6575                 {
6576                   /* empty path: current directory */
6577                   if (getcwd (tmp, LT_PATHMAX) == NULL)
6578                     lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
6579                               nonnull (strerror (errno)));
6580                   tmp_len = strlen (tmp);
6581                   concat_name =
6582                     XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
6583                   memcpy (concat_name, tmp, tmp_len);
6584                   concat_name[tmp_len] = '/';
6585                   strcpy (concat_name + tmp_len + 1, wrapper);
6586                 }
6587               else
6588                 {
6589                   concat_name =
6590                     XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
6591                   memcpy (concat_name, p, p_len);
6592                   concat_name[p_len] = '/';
6593                   strcpy (concat_name + p_len + 1, wrapper);
6594                 }
6595               if (check_executable (concat_name))
6596                 return concat_name;
6597               XFREE (concat_name);
6598             }
6599         }
6600       /* not found in PATH; assume curdir */
6601     }
6602   /* Relative path | not found in path: prepend cwd */
6603   if (getcwd (tmp, LT_PATHMAX) == NULL)
6604     lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
6605               nonnull (strerror (errno)));
6606   tmp_len = strlen (tmp);
6607   concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
6608   memcpy (concat_name, tmp, tmp_len);
6609   concat_name[tmp_len] = '/';
6610   strcpy (concat_name + tmp_len + 1, wrapper);
6611 
6612   if (check_executable (concat_name))
6613     return concat_name;
6614   XFREE (concat_name);
6615   return NULL;
6616 }
6617 
6618 char *
6619 chase_symlinks (const char *pathspec)
6620 {
6621 #ifndef S_ISLNK
6622   return xstrdup (pathspec);
6623 #else
6624   char buf[LT_PATHMAX];
6625   struct stat s;
6626   char *tmp_pathspec = xstrdup (pathspec);
6627   char *p;
6628   int has_symlinks = 0;
6629   while (strlen (tmp_pathspec) && !has_symlinks)
6630     {
6631       lt_debugprintf (__FILE__, __LINE__,
6632                       "checking path component for symlinks: %s\n",
6633                       tmp_pathspec);
6634       if (lstat (tmp_pathspec, &s) == 0)
6635         {
6636           if (S_ISLNK (s.st_mode) != 0)
6637             {
6638               has_symlinks = 1;
6639               break;
6640             }
6641 
6642           /* search backwards for last DIR_SEPARATOR */
6643           p = tmp_pathspec + strlen (tmp_pathspec) - 1;
6644           while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
6645             p--;
6646           if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
6647             {
6648               /* no more DIR_SEPARATORS left */
6649               break;
6650             }
6651           *p = '\0';
6652         }
6653       else
6654         {
6655           lt_fatal (__FILE__, __LINE__,
6656                     "error accessing file \"%s\": %s",
6657                     tmp_pathspec, nonnull (strerror (errno)));
6658         }
6659     }
6660   XFREE (tmp_pathspec);
6661 
6662   if (!has_symlinks)
6663     {
6664       return xstrdup (pathspec);
6665     }
6666 
6667   tmp_pathspec = realpath (pathspec, buf);
6668   if (tmp_pathspec == 0)
6669     {
6670       lt_fatal (__FILE__, __LINE__,
6671                 "could not follow symlinks for %s", pathspec);
6672     }
6673   return xstrdup (tmp_pathspec);
6674 #endif
6675 }
6676 
6677 char *
6678 strendzap (char *str, const char *pat)
6679 {
6680   size_t len, patlen;
6681 
6682   assert (str != NULL);
6683   assert (pat != NULL);
6684 
6685   len = strlen (str);
6686   patlen = strlen (pat);
6687 
6688   if (patlen <= len)
6689     {
6690       str += len - patlen;
6691       if (STREQ (str, pat))
6692         *str = '\0';
6693     }
6694   return str;
6695 }
6696 
6697 void
6698 lt_debugprintf (const char *file, int line, const char *fmt, ...)
6699 {
6700   va_list args;
6701   if (lt_debug)
6702     {
6703       (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
6704       va_start (args, fmt);
6705       (void) vfprintf (stderr, fmt, args);
6706       va_end (args);
6707     }
6708 }
6709 
6710 static void
6711 lt_error_core (int exit_status, const char *file,
6712                int line, const char *mode,
6713                const char *message, va_list ap)
6714 {
6715   fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
6716   vfprintf (stderr, message, ap);
6717   fprintf (stderr, ".\n");
6718 
6719   if (exit_status >= 0)
6720     exit (exit_status);
6721 }
6722 
6723 void
6724 lt_fatal (const char *file, int line, const char *message, ...)
6725 {
6726   va_list ap;
6727   va_start (ap, message);
6728   lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
6729   va_end (ap);
6730 }
6731 
6732 static const char *
6733 nonnull (const char *s)
6734 {
6735   return s ? s : "(null)";
6736 }
6737 
6738 static const char *
6739 nonempty (const char *s)
6740 {
6741   return (s && !*s) ? "(empty)" : nonnull (s);
6742 }
6743 
6744 void
6745 lt_setenv (const char *name, const char *value)
6746 {
6747   lt_debugprintf (__FILE__, __LINE__,
6748                   "(lt_setenv) setting '%s' to '%s'\n",
6749                   nonnull (name), nonnull (value));
6750   {
6751 #ifdef HAVE_SETENV
6752     /* always make a copy, for consistency with !HAVE_SETENV */
6753     char *str = xstrdup (value);
6754     setenv (name, str, 1);
6755 #else
6756     size_t len = strlen (name) + 1 + strlen (value) + 1;
6757     char *str = XMALLOC (char, len);
6758     sprintf (str, "%s=%s", name, value);
6759     if (putenv (str) != EXIT_SUCCESS)
6760       {
6761         XFREE (str);
6762       }
6763 #endif
6764   }
6765 }
6766 
6767 char *
6768 lt_extend_str (const char *orig_value, const char *add, int to_end)
6769 {
6770   char *new_value;
6771   if (orig_value && *orig_value)
6772     {
6773       size_t orig_value_len = strlen (orig_value);
6774       size_t add_len = strlen (add);
6775       new_value = XMALLOC (char, add_len + orig_value_len + 1);
6776       if (to_end)
6777         {
6778           strcpy (new_value, orig_value);
6779           strcpy (new_value + orig_value_len, add);
6780         }
6781       else
6782         {
6783           strcpy (new_value, add);
6784           strcpy (new_value + add_len, orig_value);
6785         }
6786     }
6787   else
6788     {
6789       new_value = xstrdup (add);
6790     }
6791   return new_value;
6792 }
6793 
6794 void
6795 lt_update_exe_path (const char *name, const char *value)
6796 {
6797   lt_debugprintf (__FILE__, __LINE__,
6798                   "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
6799                   nonnull (name), nonnull (value));
6800 
6801   if (name && *name && value && *value)
6802     {
6803       char *new_value = lt_extend_str (getenv (name), value, 0);
6804       /* some systems can't cope with a ':'-terminated path #' */
6805       size_t len = strlen (new_value);
6806       while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
6807         {
6808           new_value[--len] = '\0';
6809         }
6810       lt_setenv (name, new_value);
6811       XFREE (new_value);
6812     }
6813 }
6814 
6815 void
6816 lt_update_lib_path (const char *name, const char *value)
6817 {
6818   lt_debugprintf (__FILE__, __LINE__,
6819                   "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
6820                   nonnull (name), nonnull (value));
6821 
6822   if (name && *name && value && *value)
6823     {
6824       char *new_value = lt_extend_str (getenv (name), value, 0);
6825       lt_setenv (name, new_value);
6826       XFREE (new_value);
6827     }
6828 }
6829 
6830 EOF
6831             case $host_os in
6832               mingw*)
6833                 cat <<"EOF"
6834 
6835 /* Prepares an argument vector before calling spawn().
6836    Note that spawn() does not by itself call the command interpreter
6837      (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
6838       ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
6839          GetVersionEx(&v);
6840          v.dwPlatformId == VER_PLATFORM_WIN32_NT;
6841       }) ? "cmd.exe" : "command.com").
6842    Instead it simply concatenates the arguments, separated by ' ', and calls
6843    CreateProcess().  We must quote the arguments since Win32 CreateProcess()
6844    interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
6845    special way:
6846    - Space and tab are interpreted as delimiters. They are not treated as
6847      delimiters if they are surrounded by double quotes: "...".
6848    - Unescaped double quotes are removed from the input. Their only effect is
6849      that within double quotes, space and tab are treated like normal
6850      characters.
6851    - Backslashes not followed by double quotes are not special.
6852    - But 2*n+1 backslashes followed by a double quote become
6853      n backslashes followed by a double quote (n >= 0):
6854        \" -> "
6855        \\\" -> \"
6856        \\\\\" -> \\"
6857  */
6858 #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
6859 #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
6860 char **
6861 prepare_spawn (char **argv)
6862 {
6863   size_t argc;
6864   char **new_argv;
6865   size_t i;
6866 
6867   /* Count number of arguments.  */
6868   for (argc = 0; argv[argc] != NULL; argc++)
6869     ;
6870 
6871   /* Allocate new argument vector.  */
6872   new_argv = XMALLOC (char *, argc + 1);
6873 
6874   /* Put quoted arguments into the new argument vector.  */
6875   for (i = 0; i < argc; i++)
6876     {
6877       const char *string = argv[i];
6878 
6879       if (string[0] == '\0')
6880         new_argv[i] = xstrdup ("\"\"");
6881       else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
6882         {
6883           int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
6884           size_t length;
6885           unsigned int backslashes;
6886           const char *s;
6887           char *quoted_string;
6888           char *p;
6889 
6890           length = 0;
6891           backslashes = 0;
6892           if (quote_around)
6893             length++;
6894           for (s = string; *s != '\0'; s++)
6895             {
6896               char c = *s;
6897               if (c == '"')
6898                 length += backslashes + 1;
6899               length++;
6900               if (c == '\\')
6901                 backslashes++;
6902               else
6903                 backslashes = 0;
6904             }
6905           if (quote_around)
6906             length += backslashes + 1;
6907 
6908           quoted_string = XMALLOC (char, length + 1);
6909 
6910           p = quoted_string;
6911           backslashes = 0;
6912           if (quote_around)
6913             *p++ = '"';
6914           for (s = string; *s != '\0'; s++)
6915             {
6916               char c = *s;
6917               if (c == '"')
6918                 {
6919                   unsigned int j;
6920                   for (j = backslashes + 1; j > 0; j--)
6921                     *p++ = '\\';
6922                 }
6923               *p++ = c;
6924               if (c == '\\')
6925                 backslashes++;
6926               else
6927                 backslashes = 0;
6928             }
6929           if (quote_around)
6930             {
6931               unsigned int j;
6932               for (j = backslashes; j > 0; j--)
6933                 *p++ = '\\';
6934               *p++ = '"';
6935             }
6936           *p = '\0';
6937 
6938           new_argv[i] = quoted_string;
6939         }
6940       else
6941         new_argv[i] = (char *) string;
6942     }
6943   new_argv[argc] = NULL;
6944 
6945   return new_argv;
6946 }
6947 EOF
6948                 ;;
6949             esac
6950 
6951             cat <<"EOF"
6952 void lt_dump_script (FILE* f)
6953 {
6954 EOF
6955             func_emit_wrapper yes |
6956               $SED -n -e '
6957 s/^\(.\{79\}\)\(..*\)/\1\
6958 \2/
6959 h
6960 s/\([\\"]\)/\\\1/g
6961 s/$/\\n/
6962 s/\([^\n]*\).*/  fputs ("\1", f);/p
6963 g
6964 D'
6965             cat <<"EOF"
6966 }
6967 EOF
6968 }
6969 # end: func_emit_cwrapperexe_src
6970 
6971 # func_win32_import_lib_p ARG
6972 # True if ARG is an import lib, as indicated by $file_magic_cmd
6973 func_win32_import_lib_p ()
6974 {
6975     $debug_cmd
6976 
6977     case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
6978     *import*) : ;;
6979     *) false ;;
6980     esac
6981 }
6982 
6983 # func_suncc_cstd_abi
6984 # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
6985 # Several compiler flags select an ABI that is incompatible with the
6986 # Cstd library. Avoid specifying it if any are in CXXFLAGS.
6987 func_suncc_cstd_abi ()
6988 {
6989     $debug_cmd
6990 
6991     case " $compile_command " in
6992     *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
6993       suncc_use_cstd_abi=no
6994       ;;
6995     *)
6996       suncc_use_cstd_abi=yes
6997       ;;
6998     esac
6999 }
7000 
7001 # func_mode_link arg...
7002 func_mode_link ()
7003 {
7004     $debug_cmd
7005 
7006     case $host in
7007     *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
7008       # It is impossible to link a dll without this setting, and
7009       # we shouldn't force the makefile maintainer to figure out
7010       # what system we are compiling for in order to pass an extra
7011       # flag for every libtool invocation.
7012       # allow_undefined=no
7013 
7014       # FIXME: Unfortunately, there are problems with the above when trying
7015       # to make a dll that has undefined symbols, in which case not
7016       # even a static library is built.  For now, we need to specify
7017       # -no-undefined on the libtool link line when we can be certain
7018       # that all symbols are satisfied, otherwise we get a static library.
7019       allow_undefined=yes
7020       ;;
7021     *)
7022       allow_undefined=yes
7023       ;;
7024     esac
7025     libtool_args=$nonopt
7026     base_compile="$nonopt $@"
7027     compile_command=$nonopt
7028     finalize_command=$nonopt
7029 
7030     compile_rpath=
7031     finalize_rpath=
7032     compile_shlibpath=
7033     finalize_shlibpath=
7034     convenience=
7035     old_convenience=
7036     deplibs=
7037     old_deplibs=
7038     compiler_flags=
7039     linker_flags=
7040     dllsearchpath=
7041     lib_search_path=`pwd`
7042     inst_prefix_dir=
7043     new_inherited_linker_flags=
7044 
7045     avoid_version=no
7046     bindir=
7047     dlfiles=
7048     dlprefiles=
7049     dlself=no
7050     export_dynamic=no
7051     export_symbols=
7052     export_symbols_regex=
7053     generated=
7054     libobjs=
7055     ltlibs=
7056     module=no
7057     no_install=no
7058     objs=
7059     os2dllname=
7060     non_pic_objects=
7061     precious_files_regex=
7062     prefer_static_libs=no
7063     preload=false
7064     prev=
7065     prevarg=
7066     release=
7067     rpath=
7068     xrpath=
7069     perm_rpath=
7070     temp_rpath=
7071     thread_safe=no
7072     vinfo=
7073     vinfo_number=no
7074     weak_libs=
7075     single_module=$wl-single_module
7076     func_infer_tag $base_compile
7077 
7078     # We need to know -static, to get the right output filenames.
7079     for arg
7080     do
7081       case $arg in
7082       -shared)
7083         test yes != "$build_libtool_libs" \
7084           && func_fatal_configuration "cannot build a shared library"
7085         build_old_libs=no
7086         break
7087         ;;
7088       -all-static | -static | -static-libtool-libs)
7089         case $arg in
7090         -all-static)
7091           if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
7092             func_warning "complete static linking is impossible in this configuration"
7093           fi
7094           if test -n "$link_static_flag"; then
7095             dlopen_self=$dlopen_self_static
7096           fi
7097           prefer_static_libs=yes
7098           ;;
7099         -static)
7100           if test -z "$pic_flag" && test -n "$link_static_flag"; then
7101             dlopen_self=$dlopen_self_static
7102           fi
7103           prefer_static_libs=built
7104           ;;
7105         -static-libtool-libs)
7106           if test -z "$pic_flag" && test -n "$link_static_flag"; then
7107             dlopen_self=$dlopen_self_static
7108           fi
7109           prefer_static_libs=yes
7110           ;;
7111         esac
7112         build_libtool_libs=no
7113         build_old_libs=yes
7114         break
7115         ;;
7116       esac
7117     done
7118 
7119     # See if our shared archives depend on static archives.
7120     test -n "$old_archive_from_new_cmds" && build_old_libs=yes
7121 
7122     # Go through the arguments, transforming them on the way.
7123     while test "$#" -gt 0; do
7124       arg=$1
7125       shift
7126       func_quote_for_eval "$arg"
7127       qarg=$func_quote_for_eval_unquoted_result
7128       func_append libtool_args " $func_quote_for_eval_result"
7129 
7130       # If the previous option needs an argument, assign it.
7131       if test -n "$prev"; then
7132         case $prev in
7133         output)
7134           func_append compile_command " @OUTPUT@"
7135           func_append finalize_command " @OUTPUT@"
7136           ;;
7137         esac
7138 
7139         case $prev in
7140         bindir)
7141           bindir=$arg
7142           prev=
7143           continue
7144           ;;
7145         dlfiles|dlprefiles)
7146           $preload || {
7147             # Add the symbol object into the linking commands.
7148             func_append compile_command " @SYMFILE@"
7149             func_append finalize_command " @SYMFILE@"
7150             preload=:
7151           }
7152           case $arg in
7153           *.la | *.lo) ;;  # We handle these cases below.
7154           force)
7155             if test no = "$dlself"; then
7156               dlself=needless
7157               export_dynamic=yes
7158             fi
7159             prev=
7160             continue
7161             ;;
7162           self)
7163             if test dlprefiles = "$prev"; then
7164               dlself=yes
7165             elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
7166               dlself=yes
7167             else
7168               dlself=needless
7169               export_dynamic=yes
7170             fi
7171             prev=
7172             continue
7173             ;;
7174           *)
7175             if test dlfiles = "$prev"; then
7176               func_append dlfiles " $arg"
7177             else
7178               func_append dlprefiles " $arg"
7179             fi
7180             prev=
7181             continue
7182             ;;
7183           esac
7184           ;;
7185         expsyms)
7186           export_symbols=$arg
7187           test -f "$arg" \
7188             || func_fatal_error "symbol file '$arg' does not exist"
7189           prev=
7190           continue
7191           ;;
7192         expsyms_regex)
7193           export_symbols_regex=$arg
7194           prev=
7195           continue
7196           ;;
7197         framework)
7198           case $host in
7199             *-*-darwin*)
7200               case "$deplibs " in
7201                 *" $qarg.ltframework "*) ;;
7202                 *) func_append deplibs " $qarg.ltframework" # this is fixed later
7203                    ;;
7204               esac
7205               ;;
7206           esac
7207           prev=
7208           continue
7209           ;;
7210         inst_prefix)
7211           inst_prefix_dir=$arg
7212           prev=
7213           continue
7214           ;;
7215         mllvm)
7216           # Clang does not use LLVM to link, so we can simply discard any
7217           # '-mllvm $arg' options when doing the link step.
7218           prev=
7219           continue
7220           ;;
7221         objectlist)
7222           if test -f "$arg"; then
7223             save_arg=$arg
7224             moreargs=
7225             for fil in `cat "$save_arg"`
7226             do
7227 #             func_append moreargs " $fil"
7228               arg=$fil
7229               # A libtool-controlled object.
7230 
7231               # Check to see that this really is a libtool object.
7232               if func_lalib_unsafe_p "$arg"; then
7233                 pic_object=
7234                 non_pic_object=
7235 
7236                 # Read the .lo file
7237                 func_source "$arg"
7238 
7239                 if test -z "$pic_object" ||
7240                    test -z "$non_pic_object" ||
7241                    test none = "$pic_object" &&
7242                    test none = "$non_pic_object"; then
7243                   func_fatal_error "cannot find name of object for '$arg'"
7244                 fi
7245 
7246                 # Extract subdirectory from the argument.
7247                 func_dirname "$arg" "/" ""
7248                 xdir=$func_dirname_result
7249 
7250                 if test none != "$pic_object"; then
7251                   # Prepend the subdirectory the object is found in.
7252                   pic_object=$xdir$pic_object
7253 
7254                   if test dlfiles = "$prev"; then
7255                     if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
7256                       func_append dlfiles " $pic_object"
7257                       prev=
7258                       continue
7259                     else
7260                       # If libtool objects are unsupported, then we need to preload.
7261                       prev=dlprefiles
7262                     fi
7263                   fi
7264 
7265                   # CHECK ME:  I think I busted this.  -Ossama
7266                   if test dlprefiles = "$prev"; then
7267                     # Preload the old-style object.
7268                     func_append dlprefiles " $pic_object"
7269                     prev=
7270                   fi
7271 
7272                   # A PIC object.
7273                   func_append libobjs " $pic_object"
7274                   arg=$pic_object
7275                 fi
7276 
7277                 # Non-PIC object.
7278                 if test none != "$non_pic_object"; then
7279                   # Prepend the subdirectory the object is found in.
7280                   non_pic_object=$xdir$non_pic_object
7281 
7282                   # A standard non-PIC object
7283                   func_append non_pic_objects " $non_pic_object"
7284                   if test -z "$pic_object" || test none = "$pic_object"; then
7285                     arg=$non_pic_object
7286                   fi
7287                 else
7288                   # If the PIC object exists, use it instead.
7289                   # $xdir was prepended to $pic_object above.
7290                   non_pic_object=$pic_object
7291                   func_append non_pic_objects " $non_pic_object"
7292                 fi
7293               else
7294                 # Only an error if not doing a dry-run.
7295                 if $opt_dry_run; then
7296                   # Extract subdirectory from the argument.
7297                   func_dirname "$arg" "/" ""
7298                   xdir=$func_dirname_result
7299 
7300                   func_lo2o "$arg"
7301                   pic_object=$xdir$objdir/$func_lo2o_result
7302                   non_pic_object=$xdir$func_lo2o_result
7303                   func_append libobjs " $pic_object"
7304                   func_append non_pic_objects " $non_pic_object"
7305                 else
7306                   func_fatal_error "'$arg' is not a valid libtool object"
7307                 fi
7308               fi
7309             done
7310           else
7311             func_fatal_error "link input file '$arg' does not exist"
7312           fi
7313           arg=$save_arg
7314           prev=
7315           continue
7316           ;;
7317         os2dllname)
7318           os2dllname=$arg
7319           prev=
7320           continue
7321           ;;
7322         precious_regex)
7323           precious_files_regex=$arg
7324           prev=
7325           continue
7326           ;;
7327         release)
7328           release=-$arg
7329           prev=
7330           continue
7331           ;;
7332         rpath | xrpath)
7333           # We need an absolute path.
7334           case $arg in
7335           [\\/]* | [A-Za-z]:[\\/]*) ;;
7336           *)
7337             func_fatal_error "only absolute run-paths are allowed"
7338             ;;
7339           esac
7340           if test rpath = "$prev"; then
7341             case "$rpath " in
7342             *" $arg "*) ;;
7343             *) func_append rpath " $arg" ;;
7344             esac
7345           else
7346             case "$xrpath " in
7347             *" $arg "*) ;;
7348             *) func_append xrpath " $arg" ;;
7349             esac
7350           fi
7351           prev=
7352           continue
7353           ;;
7354         shrext)
7355           shrext_cmds=$arg
7356           prev=
7357           continue
7358           ;;
7359         weak)
7360           func_append weak_libs " $arg"
7361           prev=
7362           continue
7363           ;;
7364         xcclinker)
7365           func_append linker_flags " $qarg"
7366           func_append compiler_flags " $qarg"
7367           prev=
7368           func_append compile_command " $qarg"
7369           func_append finalize_command " $qarg"
7370           continue
7371           ;;
7372         xcompiler)
7373           func_append compiler_flags " $qarg"
7374           prev=
7375           func_append compile_command " $qarg"
7376           func_append finalize_command " $qarg"
7377           continue
7378           ;;
7379         xlinker)
7380           func_append linker_flags " $qarg"
7381           func_append compiler_flags " $wl$qarg"
7382           prev=
7383           func_append compile_command " $wl$qarg"
7384           func_append finalize_command " $wl$qarg"
7385           continue
7386           ;;
7387         *)
7388           eval "$prev=\"\$arg\""
7389           prev=
7390           continue
7391           ;;
7392         esac
7393       fi # test -n "$prev"
7394 
7395       prevarg=$arg
7396 
7397       case $arg in
7398       -all-static)
7399         if test -n "$link_static_flag"; then
7400           # See comment for -static flag below, for more details.
7401           func_append compile_command " $link_static_flag"
7402           func_append finalize_command " $link_static_flag"
7403         fi
7404         continue
7405         ;;
7406 
7407       -allow-undefined)
7408         # FIXME: remove this flag sometime in the future.
7409         func_fatal_error "'-allow-undefined' must not be used because it is the default"
7410         ;;
7411 
7412       -avoid-version)
7413         avoid_version=yes
7414         continue
7415         ;;
7416 
7417       -bindir)
7418         prev=bindir
7419         continue
7420         ;;
7421 
7422       -dlopen)
7423         prev=dlfiles
7424         continue
7425         ;;
7426 
7427       -dlpreopen)
7428         prev=dlprefiles
7429         continue
7430         ;;
7431 
7432       -export-dynamic)
7433         export_dynamic=yes
7434         continue
7435         ;;
7436 
7437       -export-symbols | -export-symbols-regex)
7438         if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
7439           func_fatal_error "more than one -exported-symbols argument is not allowed"
7440         fi
7441         if test X-export-symbols = "X$arg"; then
7442           prev=expsyms
7443         else
7444           prev=expsyms_regex
7445         fi
7446         continue
7447         ;;
7448 
7449       -framework)
7450         prev=framework
7451         continue
7452         ;;
7453 
7454       -inst-prefix-dir)
7455         prev=inst_prefix
7456         continue
7457         ;;
7458 
7459       # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
7460       # so, if we see these flags be careful not to treat them like -L
7461       -L[A-Z][A-Z]*:*)
7462         case $with_gcc/$host in
7463         no/*-*-irix* | /*-*-irix*)
7464           func_append compile_command " $arg"
7465           func_append finalize_command " $arg"
7466           ;;
7467         esac
7468         continue
7469         ;;
7470 
7471       -L*)
7472         func_stripname "-L" '' "$arg"
7473         if test -z "$func_stripname_result"; then
7474           if test "$#" -gt 0; then
7475             func_fatal_error "require no space between '-L' and '$1'"
7476           else
7477             func_fatal_error "need path for '-L' option"
7478           fi
7479         fi
7480         func_resolve_sysroot "$func_stripname_result"
7481         dir=$func_resolve_sysroot_result
7482         # We need an absolute path.
7483         case $dir in
7484         [\\/]* | [A-Za-z]:[\\/]*) ;;
7485         *)
7486           absdir=`cd "$dir" && pwd`
7487           test -z "$absdir" && \
7488             func_fatal_error "cannot determine absolute directory name of '$dir'"
7489           dir=$absdir
7490           ;;
7491         esac
7492         case "$deplibs " in
7493         *" -L$dir "* | *" $arg "*)
7494           # Will only happen for absolute or sysroot arguments
7495           ;;
7496         *)
7497           # Preserve sysroot, but never include relative directories
7498           case $dir in
7499             [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
7500             *) func_append deplibs " -L$dir" ;;
7501           esac
7502           func_append lib_search_path " $dir"
7503           ;;
7504         esac
7505         case $host in
7506         *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
7507           testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
7508           case :$dllsearchpath: in
7509           *":$dir:"*) ;;
7510           ::) dllsearchpath=$dir;;
7511           *) func_append dllsearchpath ":$dir";;
7512           esac
7513           case :$dllsearchpath: in
7514           *":$testbindir:"*) ;;
7515           ::) dllsearchpath=$testbindir;;
7516           *) func_append dllsearchpath ":$testbindir";;
7517           esac
7518           ;;
7519         esac
7520         continue
7521         ;;
7522 
7523       -l*)
7524         if test X-lc = "X$arg" || test X-lm = "X$arg"; then
7525           case $host in
7526           *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
7527             # These systems don't actually have a C or math library (as such)
7528             continue
7529             ;;
7530           *-*-os2*)
7531             # These systems don't actually have a C library (as such)
7532             test X-lc = "X$arg" && continue
7533             ;;
7534           *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
7535             # Do not include libc due to us having libc/libc_r.
7536             test X-lc = "X$arg" && continue
7537             ;;
7538           *-*-rhapsody* | *-*-darwin1.[012])
7539             # Rhapsody C and math libraries are in the System framework
7540             func_append deplibs " System.ltframework"
7541             continue
7542             ;;
7543           *-*-sco3.2v5* | *-*-sco5v6*)
7544             # Causes problems with __ctype
7545             test X-lc = "X$arg" && continue
7546             ;;
7547           *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
7548             # Compiler inserts libc in the correct place for threads to work
7549             test X-lc = "X$arg" && continue
7550             ;;
7551           esac
7552         elif test X-lc_r = "X$arg"; then
7553          case $host in
7554          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
7555            # Do not include libc_r directly, use -pthread flag.
7556            continue
7557            ;;
7558          esac
7559         fi
7560         func_append deplibs " $arg"
7561         continue
7562         ;;
7563 
7564       -mllvm)
7565         prev=mllvm
7566         continue
7567         ;;
7568 
7569       -module)
7570         module=yes
7571         continue
7572         ;;
7573 
7574       # Tru64 UNIX uses -model [arg] to determine the layout of C++
7575       # classes, name mangling, and exception handling.
7576       # Darwin uses the -arch flag to determine output architecture.
7577       -model|-arch|-isysroot|--sysroot)
7578         func_append compiler_flags " $arg"
7579         func_append compile_command " $arg"
7580         func_append finalize_command " $arg"
7581         prev=xcompiler
7582         continue
7583         ;;
7584 
7585       -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
7586       |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
7587         func_append compiler_flags " $arg"
7588         func_append compile_command " $arg"
7589         func_append finalize_command " $arg"
7590         case "$new_inherited_linker_flags " in
7591             *" $arg "*) ;;
7592             * ) func_append new_inherited_linker_flags " $arg" ;;
7593         esac
7594         continue
7595         ;;
7596 
7597       -multi_module)
7598         single_module=$wl-multi_module
7599         continue
7600         ;;
7601 
7602       -no-fast-install)
7603         fast_install=no
7604         continue
7605         ;;
7606 
7607       -no-install)
7608         case $host in
7609         *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
7610           # The PATH hackery in wrapper scripts is required on Windows
7611           # and Darwin in order for the loader to find any dlls it needs.
7612           func_warning "'-no-install' is ignored for $host"
7613           func_warning "assuming '-no-fast-install' instead"
7614           fast_install=no
7615           ;;
7616         *) no_install=yes ;;
7617         esac
7618         continue
7619         ;;
7620 
7621       -no-undefined)
7622         allow_undefined=no
7623         continue
7624         ;;
7625 
7626       -objectlist)
7627         prev=objectlist
7628         continue
7629         ;;
7630 
7631       -os2dllname)
7632         prev=os2dllname
7633         continue
7634         ;;
7635 
7636       -o) prev=output ;;
7637 
7638       -precious-files-regex)
7639         prev=precious_regex
7640         continue
7641         ;;
7642 
7643       -release)
7644         prev=release
7645         continue
7646         ;;
7647 
7648       -rpath)
7649         prev=rpath
7650         continue
7651         ;;
7652 
7653       -R)
7654         prev=xrpath
7655         continue
7656         ;;
7657 
7658       -R*)
7659         func_stripname '-R' '' "$arg"
7660         dir=$func_stripname_result
7661         # We need an absolute path.
7662         case $dir in
7663         [\\/]* | [A-Za-z]:[\\/]*) ;;
7664         =*)
7665           func_stripname '=' '' "$dir"
7666           dir=$lt_sysroot$func_stripname_result
7667           ;;
7668         *)
7669           func_fatal_error "only absolute run-paths are allowed"
7670           ;;
7671         esac
7672         case "$xrpath " in
7673         *" $dir "*) ;;
7674         *) func_append xrpath " $dir" ;;
7675         esac
7676         continue
7677         ;;
7678 
7679       -shared)
7680         # The effects of -shared are defined in a previous loop.
7681         continue
7682         ;;
7683 
7684       -shrext)
7685         prev=shrext
7686         continue
7687         ;;
7688 
7689       -static | -static-libtool-libs)
7690         # The effects of -static are defined in a previous loop.
7691         # We used to do the same as -all-static on platforms that
7692         # didn't have a PIC flag, but the assumption that the effects
7693         # would be equivalent was wrong.  It would break on at least
7694         # Digital Unix and AIX.
7695         continue
7696         ;;
7697 
7698       -thread-safe)
7699         thread_safe=yes
7700         continue
7701         ;;
7702 
7703       -version-info)
7704         prev=vinfo
7705         continue
7706         ;;
7707 
7708       -version-number)
7709         prev=vinfo
7710         vinfo_number=yes
7711         continue
7712         ;;
7713 
7714       -weak)
7715         prev=weak
7716         continue
7717         ;;
7718 
7719       -Wc,*)
7720         func_stripname '-Wc,' '' "$arg"
7721         args=$func_stripname_result
7722         arg=
7723         save_ifs=$IFS; IFS=,
7724         for flag in $args; do
7725           IFS=$save_ifs
7726           func_quote_for_eval "$flag"
7727           func_append arg " $func_quote_for_eval_result"
7728           func_append compiler_flags " $func_quote_for_eval_result"
7729         done
7730         IFS=$save_ifs
7731         func_stripname ' ' '' "$arg"
7732         arg=$func_stripname_result
7733         ;;
7734 
7735       -Wl,*)
7736         func_stripname '-Wl,' '' "$arg"
7737         args=$func_stripname_result
7738         arg=
7739         save_ifs=$IFS; IFS=,
7740         for flag in $args; do
7741           IFS=$save_ifs
7742           func_quote_for_eval "$flag"
7743           func_append arg " $wl$func_quote_for_eval_result"
7744           func_append compiler_flags " $wl$func_quote_for_eval_result"
7745           func_append linker_flags " $func_quote_for_eval_result"
7746         done
7747         IFS=$save_ifs
7748         func_stripname ' ' '' "$arg"
7749         arg=$func_stripname_result
7750         ;;
7751 
7752       -Xcompiler)
7753         prev=xcompiler
7754         continue
7755         ;;
7756 
7757       -Xlinker)
7758         prev=xlinker
7759         continue
7760         ;;
7761 
7762       -XCClinker)
7763         prev=xcclinker
7764         continue
7765         ;;
7766 
7767       # -msg_* for osf cc
7768       -msg_*)
7769         func_quote_for_eval "$arg"
7770         arg=$func_quote_for_eval_result
7771         ;;
7772 
7773       # Flags to be passed through unchanged, with rationale:
7774       # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
7775       # -r[0-9][0-9]*        specify processor for the SGI compiler
7776       # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
7777       # +DA*, +DD*           enable 64-bit mode for the HP compiler
7778       # -q*                  compiler args for the IBM compiler
7779       # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
7780       # -F/path              path to uninstalled frameworks, gcc on darwin
7781       # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
7782       # -fstack-protector*   stack protector flags for GCC
7783       # @file                GCC response files
7784       # -tp=*                Portland pgcc target processor selection
7785       # --sysroot=*          for sysroot support
7786       # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
7787       # -specs=*             GCC specs files
7788       # -stdlib=*            select c++ std lib with clang
7789       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
7790       -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
7791       -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
7792       -specs=*)
7793         func_quote_for_eval "$arg"
7794         arg=$func_quote_for_eval_result
7795         func_append compile_command " $arg"
7796         func_append finalize_command " $arg"
7797         func_append compiler_flags " $arg"
7798         continue
7799         ;;
7800 
7801       -Z*)
7802         if test os2 = "`expr $host : '.*\(os2\)'`"; then
7803           # OS/2 uses -Zxxx to specify OS/2-specific options
7804           compiler_flags="$compiler_flags $arg"
7805           func_append compile_command " $arg"
7806           func_append finalize_command " $arg"
7807           case $arg in
7808           -Zlinker | -Zstack)
7809             prev=xcompiler
7810             ;;
7811           esac
7812           continue
7813         else
7814           # Otherwise treat like 'Some other compiler flag' below
7815           func_quote_for_eval "$arg"
7816           arg=$func_quote_for_eval_result
7817         fi
7818         ;;
7819 
7820       # Some other compiler flag.
7821       -* | +*)
7822         func_quote_for_eval "$arg"
7823         arg=$func_quote_for_eval_result
7824         ;;
7825 
7826       *.$objext)
7827         # A standard object.
7828         func_append objs " $arg"
7829         ;;
7830 
7831       *.lo)
7832         # A libtool-controlled object.
7833 
7834         # Check to see that this really is a libtool object.
7835         if func_lalib_unsafe_p "$arg"; then
7836           pic_object=
7837           non_pic_object=
7838 
7839           # Read the .lo file
7840           func_source "$arg"
7841 
7842           if test -z "$pic_object" ||
7843              test -z "$non_pic_object" ||
7844              test none = "$pic_object" &&
7845              test none = "$non_pic_object"; then
7846             func_fatal_error "cannot find name of object for '$arg'"
7847           fi
7848 
7849           # Extract subdirectory from the argument.
7850           func_dirname "$arg" "/" ""
7851           xdir=$func_dirname_result
7852 
7853           test none = "$pic_object" || {
7854             # Prepend the subdirectory the object is found in.
7855             pic_object=$xdir$pic_object
7856 
7857             if test dlfiles = "$prev"; then
7858               if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
7859                 func_append dlfiles " $pic_object"
7860                 prev=
7861                 continue
7862               else
7863                 # If libtool objects are unsupported, then we need to preload.
7864                 prev=dlprefiles
7865               fi
7866             fi
7867 
7868             # CHECK ME:  I think I busted this.  -Ossama
7869             if test dlprefiles = "$prev"; then
7870               # Preload the old-style object.
7871               func_append dlprefiles " $pic_object"
7872               prev=
7873             fi
7874 
7875             # A PIC object.
7876             func_append libobjs " $pic_object"
7877             arg=$pic_object
7878           }
7879 
7880           # Non-PIC object.
7881           if test none != "$non_pic_object"; then
7882             # Prepend the subdirectory the object is found in.
7883             non_pic_object=$xdir$non_pic_object
7884 
7885             # A standard non-PIC object
7886             func_append non_pic_objects " $non_pic_object"
7887             if test -z "$pic_object" || test none = "$pic_object"; then
7888               arg=$non_pic_object
7889             fi
7890           else
7891             # If the PIC object exists, use it instead.
7892             # $xdir was prepended to $pic_object above.
7893             non_pic_object=$pic_object
7894             func_append non_pic_objects " $non_pic_object"
7895           fi
7896         else
7897           # Only an error if not doing a dry-run.
7898           if $opt_dry_run; then
7899             # Extract subdirectory from the argument.
7900             func_dirname "$arg" "/" ""
7901             xdir=$func_dirname_result
7902 
7903             func_lo2o "$arg"
7904             pic_object=$xdir$objdir/$func_lo2o_result
7905             non_pic_object=$xdir$func_lo2o_result
7906             func_append libobjs " $pic_object"
7907             func_append non_pic_objects " $non_pic_object"
7908           else
7909             func_fatal_error "'$arg' is not a valid libtool object"
7910           fi
7911         fi
7912         ;;
7913 
7914       *.$libext)
7915         # An archive.
7916         func_append deplibs " $arg"
7917         func_append old_deplibs " $arg"
7918         continue
7919         ;;
7920 
7921       *.la)
7922         # A libtool-controlled library.
7923 
7924         func_resolve_sysroot "$arg"
7925         if test dlfiles = "$prev"; then
7926           # This library was specified with -dlopen.
7927           func_append dlfiles " $func_resolve_sysroot_result"
7928           prev=
7929         elif test dlprefiles = "$prev"; then
7930           # The library was specified with -dlpreopen.
7931           func_append dlprefiles " $func_resolve_sysroot_result"
7932           prev=
7933         else
7934           func_append deplibs " $func_resolve_sysroot_result"
7935         fi
7936         continue
7937         ;;
7938 
7939       # Some other compiler argument.
7940       *)
7941         # Unknown arguments in both finalize_command and compile_command need
7942         # to be aesthetically quoted because they are evaled later.
7943         func_quote_for_eval "$arg"
7944         arg=$func_quote_for_eval_result
7945         ;;
7946       esac # arg
7947 
7948       # Now actually substitute the argument into the commands.
7949       if test -n "$arg"; then
7950         func_append compile_command " $arg"
7951         func_append finalize_command " $arg"
7952       fi
7953     done # argument parsing loop
7954 
7955     test -n "$prev" && \
7956       func_fatal_help "the '$prevarg' option requires an argument"
7957 
7958     if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
7959       eval arg=\"$export_dynamic_flag_spec\"
7960       func_append compile_command " $arg"
7961       func_append finalize_command " $arg"
7962     fi
7963 
7964     oldlibs=
7965     # calculate the name of the file, without its directory
7966     func_basename "$output"
7967     outputname=$func_basename_result
7968     libobjs_save=$libobjs
7969 
7970     if test -n "$shlibpath_var"; then
7971       # get the directories listed in $shlibpath_var
7972       eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
7973     else
7974       shlib_search_path=
7975     fi
7976     eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
7977     eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
7978 
7979     # Definition is injected by LT_CONFIG during libtool generation.
7980     func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
7981 
7982     func_dirname "$output" "/" ""
7983     output_objdir=$func_dirname_result$objdir
7984     func_to_tool_file "$output_objdir/"
7985     tool_output_objdir=$func_to_tool_file_result
7986     # Create the object directory.
7987     func_mkdir_p "$output_objdir"
7988 
7989     # Determine the type of output
7990     case $output in
7991     "")
7992       func_fatal_help "you must specify an output file"
7993       ;;
7994     *.$libext) linkmode=oldlib ;;
7995     *.lo | *.$objext) linkmode=obj ;;
7996     *.la) linkmode=lib ;;
7997     *) linkmode=prog ;; # Anything else should be a program.
7998     esac
7999 
8000     specialdeplibs=
8001 
8002     libs=
8003     # Find all interdependent deplibs by searching for libraries
8004     # that are linked more than once (e.g. -la -lb -la)
8005     for deplib in $deplibs; do
8006       if $opt_preserve_dup_deps; then
8007         case "$libs " in
8008         *" $deplib "*) func_append specialdeplibs " $deplib" ;;
8009         esac
8010       fi
8011       func_append libs " $deplib"
8012     done
8013 
8014     if test lib = "$linkmode"; then
8015       libs="$predeps $libs $compiler_lib_search_path $postdeps"
8016 
8017       # Compute libraries that are listed more than once in $predeps
8018       # $postdeps and mark them as special (i.e., whose duplicates are
8019       # not to be eliminated).
8020       pre_post_deps=
8021       if $opt_duplicate_compiler_generated_deps; then
8022         for pre_post_dep in $predeps $postdeps; do
8023           case "$pre_post_deps " in
8024           *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
8025           esac
8026           func_append pre_post_deps " $pre_post_dep"
8027         done
8028       fi
8029       pre_post_deps=
8030     fi
8031 
8032     deplibs=
8033     newdependency_libs=
8034     newlib_search_path=
8035     need_relink=no # whether we're linking any uninstalled libtool libraries
8036     notinst_deplibs= # not-installed libtool libraries
8037     notinst_path= # paths that contain not-installed libtool libraries
8038 
8039     case $linkmode in
8040     lib)
8041         passes="conv dlpreopen link"
8042         for file in $dlfiles $dlprefiles; do
8043           case $file in
8044           *.la) ;;
8045           *)
8046             func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
8047             ;;
8048           esac
8049         done
8050         ;;
8051     prog)
8052         compile_deplibs=
8053         finalize_deplibs=
8054         alldeplibs=false
8055         newdlfiles=
8056         newdlprefiles=
8057         passes="conv scan dlopen dlpreopen link"
8058         ;;
8059     *)  passes="conv"
8060         ;;
8061     esac
8062 
8063     for pass in $passes; do
8064       # The preopen pass in lib mode reverses $deplibs; put it back here
8065       # so that -L comes before libs that need it for instance...
8066       if test lib,link = "$linkmode,$pass"; then
8067         ## FIXME: Find the place where the list is rebuilt in the wrong
8068         ##        order, and fix it there properly
8069         tmp_deplibs=
8070         for deplib in $deplibs; do
8071           tmp_deplibs="$deplib $tmp_deplibs"
8072         done
8073         deplibs=$tmp_deplibs
8074       fi
8075 
8076       if test lib,link = "$linkmode,$pass" ||
8077          test prog,scan = "$linkmode,$pass"; then
8078         libs=$deplibs
8079         deplibs=
8080       fi
8081       if test prog = "$linkmode"; then
8082         case $pass in
8083         dlopen) libs=$dlfiles ;;
8084         dlpreopen) libs=$dlprefiles ;;
8085         link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
8086         esac
8087       fi
8088       if test lib,dlpreopen = "$linkmode,$pass"; then
8089         # Collect and forward deplibs of preopened libtool libs
8090         for lib in $dlprefiles; do
8091           # Ignore non-libtool-libs
8092           dependency_libs=
8093           func_resolve_sysroot "$lib"
8094           case $lib in
8095           *.la) func_source "$func_resolve_sysroot_result" ;;
8096           esac
8097 
8098           # Collect preopened libtool deplibs, except any this library
8099           # has declared as weak libs
8100           for deplib in $dependency_libs; do
8101             func_basename "$deplib"
8102             deplib_base=$func_basename_result
8103             case " $weak_libs " in
8104             *" $deplib_base "*) ;;
8105             *) func_append deplibs " $deplib" ;;
8106             esac
8107           done
8108         done
8109         libs=$dlprefiles
8110       fi
8111       if test dlopen = "$pass"; then
8112         # Collect dlpreopened libraries
8113         save_deplibs=$deplibs
8114         deplibs=
8115       fi
8116 
8117       for deplib in $libs; do
8118         lib=
8119         found=false
8120         case $deplib in
8121         -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
8122         |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
8123           if test prog,link = "$linkmode,$pass"; then
8124             compile_deplibs="$deplib $compile_deplibs"
8125             finalize_deplibs="$deplib $finalize_deplibs"
8126           else
8127             func_append compiler_flags " $deplib"
8128             if test lib = "$linkmode"; then
8129                 case "$new_inherited_linker_flags " in
8130                     *" $deplib "*) ;;
8131                     * ) func_append new_inherited_linker_flags " $deplib" ;;
8132                 esac
8133             fi
8134           fi
8135           continue
8136           ;;
8137         -l*)
8138           if test lib != "$linkmode" && test prog != "$linkmode"; then
8139             func_warning "'-l' is ignored for archives/objects"
8140             continue
8141           fi
8142           func_stripname '-l' '' "$deplib"
8143           name=$func_stripname_result
8144           if test lib = "$linkmode"; then
8145             searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
8146           else
8147             searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
8148           fi
8149           for searchdir in $searchdirs; do
8150             for search_ext in .la $std_shrext .so .a; do
8151               # Search the libtool library
8152               lib=$searchdir/lib$name$search_ext
8153               if test -f "$lib"; then
8154                 if test .la = "$search_ext"; then
8155                   found=:
8156                 else
8157                   found=false
8158                 fi
8159                 break 2
8160               fi
8161             done
8162           done
8163           if $found; then
8164             # deplib is a libtool library
8165             # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
8166             # We need to do some special things here, and not later.
8167             if test yes = "$allow_libtool_libs_with_static_runtimes"; then
8168               case " $predeps $postdeps " in
8169               *" $deplib "*)
8170                 if func_lalib_p "$lib"; then
8171                   library_names=
8172                   old_library=
8173                   func_source "$lib"
8174                   for l in $old_library $library_names; do
8175                     ll=$l
8176                   done
8177                   if test "X$ll" = "X$old_library"; then # only static version available
8178                     found=false
8179                     func_dirname "$lib" "" "."
8180                     ladir=$func_dirname_result
8181                     lib=$ladir/$old_library
8182                     if test prog,link = "$linkmode,$pass"; then
8183                       compile_deplibs="$deplib $compile_deplibs"
8184                       finalize_deplibs="$deplib $finalize_deplibs"
8185                     else
8186                       deplibs="$deplib $deplibs"
8187                       test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
8188                     fi
8189                     continue
8190                   fi
8191                 fi
8192                 ;;
8193               *) ;;
8194               esac
8195             fi
8196           else
8197             # deplib doesn't seem to be a libtool library
8198             if test prog,link = "$linkmode,$pass"; then
8199               compile_deplibs="$deplib $compile_deplibs"
8200               finalize_deplibs="$deplib $finalize_deplibs"
8201             else
8202               deplibs="$deplib $deplibs"
8203               test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
8204             fi
8205             continue
8206           fi
8207           ;; # -l
8208         *.ltframework)
8209           if test prog,link = "$linkmode,$pass"; then
8210             compile_deplibs="$deplib $compile_deplibs"
8211             finalize_deplibs="$deplib $finalize_deplibs"
8212           else
8213             deplibs="$deplib $deplibs"
8214             if test lib = "$linkmode"; then
8215                 case "$new_inherited_linker_flags " in
8216                     *" $deplib "*) ;;
8217                     * ) func_append new_inherited_linker_flags " $deplib" ;;
8218                 esac
8219             fi
8220           fi
8221           continue
8222           ;;
8223         -L*)
8224           case $linkmode in
8225           lib)
8226             deplibs="$deplib $deplibs"
8227             test conv = "$pass" && continue
8228             newdependency_libs="$deplib $newdependency_libs"
8229             func_stripname '-L' '' "$deplib"
8230             func_resolve_sysroot "$func_stripname_result"
8231             func_append newlib_search_path " $func_resolve_sysroot_result"
8232             ;;
8233           prog)
8234             if test conv = "$pass"; then
8235               deplibs="$deplib $deplibs"
8236               continue
8237             fi
8238             if test scan = "$pass"; then
8239               deplibs="$deplib $deplibs"
8240             else
8241               compile_deplibs="$deplib $compile_deplibs"
8242               finalize_deplibs="$deplib $finalize_deplibs"
8243             fi
8244             func_stripname '-L' '' "$deplib"
8245             func_resolve_sysroot "$func_stripname_result"
8246             func_append newlib_search_path " $func_resolve_sysroot_result"
8247             ;;
8248           *)
8249             func_warning "'-L' is ignored for archives/objects"
8250             ;;
8251           esac # linkmode
8252           continue
8253           ;; # -L
8254         -R*)
8255           if test link = "$pass"; then
8256             func_stripname '-R' '' "$deplib"
8257             func_resolve_sysroot "$func_stripname_result"
8258             dir=$func_resolve_sysroot_result
8259             # Make sure the xrpath contains only unique directories.
8260             case "$xrpath " in
8261             *" $dir "*) ;;
8262             *) func_append xrpath " $dir" ;;
8263             esac
8264           fi
8265           deplibs="$deplib $deplibs"
8266           continue
8267           ;;
8268         *.la)
8269           func_resolve_sysroot "$deplib"
8270           lib=$func_resolve_sysroot_result
8271           ;;
8272         *.$libext)
8273           if test conv = "$pass"; then
8274             deplibs="$deplib $deplibs"
8275             continue
8276           fi
8277           case $linkmode in
8278           lib)
8279             # Linking convenience modules into shared libraries is allowed,
8280             # but linking other static libraries is non-portable.
8281             case " $dlpreconveniencelibs " in
8282             *" $deplib "*) ;;
8283             *)
8284               valid_a_lib=false
8285               case $deplibs_check_method in
8286                 match_pattern*)
8287                   set dummy $deplibs_check_method; shift
8288                   match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
8289                   if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
8290                     | $EGREP "$match_pattern_regex" > /dev/null; then
8291                     valid_a_lib=:
8292                   fi
8293                 ;;
8294                 pass_all)
8295                   valid_a_lib=:
8296                 ;;
8297               esac
8298               if $valid_a_lib; then
8299                 echo
8300                 $ECHO "*** Warning: Linking the shared library $output against the"
8301                 $ECHO "*** static library $deplib is not portable!"
8302                 deplibs="$deplib $deplibs"
8303               else
8304                 echo
8305                 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
8306                 echo "*** I have the capability to make that library automatically link in when"
8307                 echo "*** you link to this library.  But I can only do this if you have a"
8308                 echo "*** shared version of the library, which you do not appear to have"
8309                 echo "*** because the file extensions .$libext of this argument makes me believe"
8310                 echo "*** that it is just a static archive that I should not use here."
8311               fi
8312               ;;
8313             esac
8314             continue
8315             ;;
8316           prog)
8317             if test link != "$pass"; then
8318               deplibs="$deplib $deplibs"
8319             else
8320               compile_deplibs="$deplib $compile_deplibs"
8321               finalize_deplibs="$deplib $finalize_deplibs"
8322             fi
8323             continue
8324             ;;
8325           esac # linkmode
8326           ;; # *.$libext
8327         *.lo | *.$objext)
8328           if test conv = "$pass"; then
8329             deplibs="$deplib $deplibs"
8330           elif test prog = "$linkmode"; then
8331             if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
8332               # If there is no dlopen support or we're linking statically,
8333               # we need to preload.
8334               func_append newdlprefiles " $deplib"
8335               compile_deplibs="$deplib $compile_deplibs"
8336               finalize_deplibs="$deplib $finalize_deplibs"
8337             else
8338               func_append newdlfiles " $deplib"
8339             fi
8340           fi
8341           continue
8342           ;;
8343         %DEPLIBS%)
8344           alldeplibs=:
8345           continue
8346           ;;
8347         esac # case $deplib
8348 
8349         $found || test -f "$lib" \
8350           || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
8351 
8352         # Check to see that this really is a libtool archive.
8353         func_lalib_unsafe_p "$lib" \
8354           || func_fatal_error "'$lib' is not a valid libtool archive"
8355 
8356         func_dirname "$lib" "" "."
8357         ladir=$func_dirname_result
8358 
8359         dlname=
8360         dlopen=
8361         dlpreopen=
8362         libdir=
8363         library_names=
8364         old_library=
8365         inherited_linker_flags=
8366         # If the library was installed with an old release of libtool,
8367         # it will not redefine variables installed, or shouldnotlink
8368         installed=yes
8369         shouldnotlink=no
8370         avoidtemprpath=
8371 
8372 
8373         # Read the .la file
8374         func_source "$lib"
8375 
8376         # Convert "-framework foo" to "foo.ltframework"
8377         if test -n "$inherited_linker_flags"; then
8378           tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
8379           for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
8380             case " $new_inherited_linker_flags " in
8381               *" $tmp_inherited_linker_flag "*) ;;
8382               *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
8383             esac
8384           done
8385         fi
8386         dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8387         if test lib,link = "$linkmode,$pass" ||
8388            test prog,scan = "$linkmode,$pass" ||
8389            { test prog != "$linkmode" && test lib != "$linkmode"; }; then
8390           test -n "$dlopen" && func_append dlfiles " $dlopen"
8391           test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
8392         fi
8393 
8394         if test conv = "$pass"; then
8395           # Only check for convenience libraries
8396           deplibs="$lib $deplibs"
8397           if test -z "$libdir"; then
8398             if test -z "$old_library"; then
8399               func_fatal_error "cannot find name of link library for '$lib'"
8400             fi
8401             # It is a libtool convenience library, so add in its objects.
8402             func_append convenience " $ladir/$objdir/$old_library"
8403             func_append old_convenience " $ladir/$objdir/$old_library"
8404           elif test prog != "$linkmode" && test lib != "$linkmode"; then
8405             func_fatal_error "'$lib' is not a convenience library"
8406           fi
8407           tmp_libs=
8408           for deplib in $dependency_libs; do
8409             deplibs="$deplib $deplibs"
8410             if $opt_preserve_dup_deps; then
8411               case "$tmp_libs " in
8412               *" $deplib "*) func_append specialdeplibs " $deplib" ;;
8413               esac
8414             fi
8415             func_append tmp_libs " $deplib"
8416           done
8417           continue
8418         fi # $pass = conv
8419 
8420 
8421         # Get the name of the library we link against.
8422         linklib=
8423         if test -n "$old_library" &&
8424            { test yes = "$prefer_static_libs" ||
8425              test built,no = "$prefer_static_libs,$installed"; }; then
8426           linklib=$old_library
8427         else
8428           for l in $old_library $library_names; do
8429             linklib=$l
8430           done
8431         fi
8432         if test -z "$linklib"; then
8433           func_fatal_error "cannot find name of link library for '$lib'"
8434         fi
8435 
8436         # This library was specified with -dlopen.
8437         if test dlopen = "$pass"; then
8438           test -z "$libdir" \
8439             && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
8440           if test -z "$dlname" ||
8441              test yes != "$dlopen_support" ||
8442              test no = "$build_libtool_libs"
8443           then
8444             # If there is no dlname, no dlopen support or we're linking
8445             # statically, we need to preload.  We also need to preload any
8446             # dependent libraries so libltdl's deplib preloader doesn't
8447             # bomb out in the load deplibs phase.
8448             func_append dlprefiles " $lib $dependency_libs"
8449           else
8450             func_append newdlfiles " $lib"
8451           fi
8452           continue
8453         fi # $pass = dlopen
8454 
8455         # We need an absolute path.
8456         case $ladir in
8457         [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
8458         *)
8459           abs_ladir=`cd "$ladir" && pwd`
8460           if test -z "$abs_ladir"; then
8461             func_warning "cannot determine absolute directory name of '$ladir'"
8462             func_warning "passing it literally to the linker, although it might fail"
8463             abs_ladir=$ladir
8464           fi
8465           ;;
8466         esac
8467         func_basename "$lib"
8468         laname=$func_basename_result
8469 
8470         # Find the relevant object directory and library name.
8471         if test yes = "$installed"; then
8472           if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
8473             func_warning "library '$lib' was moved."
8474             dir=$ladir
8475             absdir=$abs_ladir
8476             libdir=$abs_ladir
8477           else
8478             dir=$lt_sysroot$libdir
8479             absdir=$lt_sysroot$libdir
8480           fi
8481           test yes = "$hardcode_automatic" && avoidtemprpath=yes
8482         else
8483           if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
8484             dir=$ladir
8485             absdir=$abs_ladir
8486             # Remove this search path later
8487             func_append notinst_path " $abs_ladir"
8488           else
8489             dir=$ladir/$objdir
8490             absdir=$abs_ladir/$objdir
8491             # Remove this search path later
8492             func_append notinst_path " $abs_ladir"
8493           fi
8494         fi # $installed = yes
8495         func_stripname 'lib' '.la' "$laname"
8496         name=$func_stripname_result
8497 
8498         # This library was specified with -dlpreopen.
8499         if test dlpreopen = "$pass"; then
8500           if test -z "$libdir" && test prog = "$linkmode"; then
8501             func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
8502           fi
8503           case $host in
8504             # special handling for platforms with PE-DLLs.
8505             *cygwin* | *mingw* | *cegcc* )
8506               # Linker will automatically link against shared library if both
8507               # static and shared are present.  Therefore, ensure we extract
8508               # symbols from the import library if a shared library is present
8509               # (otherwise, the dlopen module name will be incorrect).  We do
8510               # this by putting the import library name into $newdlprefiles.
8511               # We recover the dlopen module name by 'saving' the la file
8512               # name in a special purpose variable, and (later) extracting the
8513               # dlname from the la file.
8514               if test -n "$dlname"; then
8515                 func_tr_sh "$dir/$linklib"
8516                 eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
8517                 func_append newdlprefiles " $dir/$linklib"
8518               else
8519                 func_append newdlprefiles " $dir/$old_library"
8520                 # Keep a list of preopened convenience libraries to check
8521                 # that they are being used correctly in the link pass.
8522                 test -z "$libdir" && \
8523                   func_append dlpreconveniencelibs " $dir/$old_library"
8524               fi
8525             ;;
8526             * )
8527               # Prefer using a static library (so that no silly _DYNAMIC symbols
8528               # are required to link).
8529               if test -n "$old_library"; then
8530                 func_append newdlprefiles " $dir/$old_library"
8531                 # Keep a list of preopened convenience libraries to check
8532                 # that they are being used correctly in the link pass.
8533                 test -z "$libdir" && \
8534                   func_append dlpreconveniencelibs " $dir/$old_library"
8535               # Otherwise, use the dlname, so that lt_dlopen finds it.
8536               elif test -n "$dlname"; then
8537                 func_append newdlprefiles " $dir/$dlname"
8538               else
8539                 func_append newdlprefiles " $dir/$linklib"
8540               fi
8541             ;;
8542           esac
8543         fi # $pass = dlpreopen
8544 
8545         if test -z "$libdir"; then
8546           # Link the convenience library
8547           if test lib = "$linkmode"; then
8548             deplibs="$dir/$old_library $deplibs"
8549           elif test prog,link = "$linkmode,$pass"; then
8550             compile_deplibs="$dir/$old_library $compile_deplibs"
8551             finalize_deplibs="$dir/$old_library $finalize_deplibs"
8552           else
8553             deplibs="$lib $deplibs" # used for prog,scan pass
8554           fi
8555           continue
8556         fi
8557 
8558 
8559         if test prog = "$linkmode" && test link != "$pass"; then
8560           func_append newlib_search_path " $ladir"
8561           deplibs="$lib $deplibs"
8562 
8563           linkalldeplibs=false
8564           if test no != "$link_all_deplibs" || test -z "$library_names" ||
8565              test no = "$build_libtool_libs"; then
8566             linkalldeplibs=:
8567           fi
8568 
8569           tmp_libs=
8570           for deplib in $dependency_libs; do
8571             case $deplib in
8572             -L*) func_stripname '-L' '' "$deplib"
8573                  func_resolve_sysroot "$func_stripname_result"
8574                  func_append newlib_search_path " $func_resolve_sysroot_result"
8575                  ;;
8576             esac
8577             # Need to link against all dependency_libs?
8578             if $linkalldeplibs; then
8579               deplibs="$deplib $deplibs"
8580             else
8581               # Need to hardcode shared library paths
8582               # or/and link against static libraries
8583               newdependency_libs="$deplib $newdependency_libs"
8584             fi
8585             if $opt_preserve_dup_deps; then
8586               case "$tmp_libs " in
8587               *" $deplib "*) func_append specialdeplibs " $deplib" ;;
8588               esac
8589             fi
8590             func_append tmp_libs " $deplib"
8591           done # for deplib
8592           continue
8593         fi # $linkmode = prog...
8594 
8595         if test prog,link = "$linkmode,$pass"; then
8596           if test -n "$library_names" &&
8597              { { test no = "$prefer_static_libs" ||
8598                  test built,yes = "$prefer_static_libs,$installed"; } ||
8599                test -z "$old_library"; }; then
8600             # We need to hardcode the library path
8601             if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
8602               # Make sure the rpath contains only unique directories.
8603               case $temp_rpath: in
8604               *"$absdir:"*) ;;
8605               *) func_append temp_rpath "$absdir:" ;;
8606               esac
8607             fi
8608 
8609             # Hardcode the library path.
8610             # Skip directories that are in the system default run-time
8611             # search path.
8612             case " $sys_lib_dlsearch_path " in
8613             *" $absdir "*) ;;
8614             *)
8615               case "$compile_rpath " in
8616               *" $absdir "*) ;;
8617               *) func_append compile_rpath " $absdir" ;;
8618               esac
8619               ;;
8620             esac
8621             case " $sys_lib_dlsearch_path " in
8622             *" $libdir "*) ;;
8623             *)
8624               case "$finalize_rpath " in
8625               *" $libdir "*) ;;
8626               *) func_append finalize_rpath " $libdir" ;;
8627               esac
8628               ;;
8629             esac
8630           fi # $linkmode,$pass = prog,link...
8631 
8632           if $alldeplibs &&
8633              { test pass_all = "$deplibs_check_method" ||
8634                { test yes = "$build_libtool_libs" &&
8635                  test -n "$library_names"; }; }; then
8636             # We only need to search for static libraries
8637             continue
8638           fi
8639         fi
8640 
8641         link_static=no # Whether the deplib will be linked statically
8642         use_static_libs=$prefer_static_libs
8643         if test built = "$use_static_libs" && test yes = "$installed"; then
8644           use_static_libs=no
8645         fi
8646         if test -n "$library_names" &&
8647            { test no = "$use_static_libs" || test -z "$old_library"; }; then
8648           case $host in
8649           *cygwin* | *mingw* | *cegcc* | *os2*)
8650               # No point in relinking DLLs because paths are not encoded
8651               func_append notinst_deplibs " $lib"
8652               need_relink=no
8653             ;;
8654           *)
8655             if test no = "$installed"; then
8656               func_append notinst_deplibs " $lib"
8657               need_relink=yes
8658             fi
8659             ;;
8660           esac
8661           # This is a shared library
8662 
8663           # Warn about portability, can't link against -module's on some
8664           # systems (darwin).  Don't bleat about dlopened modules though!
8665           dlopenmodule=
8666           for dlpremoduletest in $dlprefiles; do
8667             if test "X$dlpremoduletest" = "X$lib"; then
8668               dlopenmodule=$dlpremoduletest
8669               break
8670             fi
8671           done
8672           if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
8673             echo
8674             if test prog = "$linkmode"; then
8675               $ECHO "*** Warning: Linking the executable $output against the loadable module"
8676             else
8677               $ECHO "*** Warning: Linking the shared library $output against the loadable module"
8678             fi
8679             $ECHO "*** $linklib is not portable!"
8680           fi
8681           if test lib = "$linkmode" &&
8682              test yes = "$hardcode_into_libs"; then
8683             # Hardcode the library path.
8684             # Skip directories that are in the system default run-time
8685             # search path.
8686             case " $sys_lib_dlsearch_path " in
8687             *" $absdir "*) ;;
8688             *)
8689               case "$compile_rpath " in
8690               *" $absdir "*) ;;
8691               *) func_append compile_rpath " $absdir" ;;
8692               esac
8693               ;;
8694             esac
8695             case " $sys_lib_dlsearch_path " in
8696             *" $libdir "*) ;;
8697             *)
8698               case "$finalize_rpath " in
8699               *" $libdir "*) ;;
8700               *) func_append finalize_rpath " $libdir" ;;
8701               esac
8702               ;;
8703             esac
8704           fi
8705 
8706           if test -n "$old_archive_from_expsyms_cmds"; then
8707             # figure out the soname
8708             set dummy $library_names
8709             shift
8710             realname=$1
8711             shift
8712             libname=`eval "\\$ECHO \"$libname_spec\""`
8713             # use dlname if we got it. it's perfectly good, no?
8714             if test -n "$dlname"; then
8715               soname=$dlname
8716             elif test -n "$soname_spec"; then
8717               # bleh windows
8718               case $host in
8719               *cygwin* | mingw* | *cegcc* | *os2*)
8720                 func_arith $current - $age
8721                 major=$func_arith_result
8722                 versuffix=-$major
8723                 ;;
8724               esac
8725               eval soname=\"$soname_spec\"
8726             else
8727               soname=$realname
8728             fi
8729 
8730             # Make a new name for the extract_expsyms_cmds to use
8731             soroot=$soname
8732             func_basename "$soroot"
8733             soname=$func_basename_result
8734             func_stripname 'lib' '.dll' "$soname"
8735             newlib=libimp-$func_stripname_result.a
8736 
8737             # If the library has no export list, then create one now
8738             if test -f "$output_objdir/$soname-def"; then :
8739             else
8740               func_verbose "extracting exported symbol list from '$soname'"
8741               func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
8742             fi
8743 
8744             # Create $newlib
8745             if test -f "$output_objdir/$newlib"; then :; else
8746               func_verbose "generating import library for '$soname'"
8747               func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
8748             fi
8749             # make sure the library variables are pointing to the new library
8750             dir=$output_objdir
8751             linklib=$newlib
8752           fi # test -n "$old_archive_from_expsyms_cmds"
8753 
8754           if test prog = "$linkmode" || test relink != "$opt_mode"; then
8755             add_shlibpath=
8756             add_dir=
8757             add=
8758             lib_linked=yes
8759             case $hardcode_action in
8760             immediate | unsupported)
8761               if test no = "$hardcode_direct"; then
8762                 add=$dir/$linklib
8763                 case $host in
8764                   *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
8765                   *-*-sysv4*uw2*) add_dir=-L$dir ;;
8766                   *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
8767                     *-*-unixware7*) add_dir=-L$dir ;;
8768                   *-*-darwin* )
8769                     # if the lib is a (non-dlopened) module then we cannot
8770                     # link against it, someone is ignoring the earlier warnings
8771                     if /usr/bin/file -L $add 2> /dev/null |
8772                          $GREP ": [^:]* bundle" >/dev/null; then
8773                       if test "X$dlopenmodule" != "X$lib"; then
8774                         $ECHO "*** Warning: lib $linklib is a module, not a shared library"
8775                         if test -z "$old_library"; then
8776                           echo
8777                           echo "*** And there doesn't seem to be a static archive available"
8778                           echo "*** The link will probably fail, sorry"
8779                         else
8780                           add=$dir/$old_library
8781                         fi
8782                       elif test -n "$old_library"; then
8783                         add=$dir/$old_library
8784                       fi
8785                     fi
8786                 esac
8787               elif test no = "$hardcode_minus_L"; then
8788                 case $host in
8789                 *-*-sunos*) add_shlibpath=$dir ;;
8790                 esac
8791                 add_dir=-L$dir
8792                 add=-l$name
8793               elif test no = "$hardcode_shlibpath_var"; then
8794                 add_shlibpath=$dir
8795                 add=-l$name
8796               else
8797                 lib_linked=no
8798               fi
8799               ;;
8800             relink)
8801               if test yes = "$hardcode_direct" &&
8802                  test no = "$hardcode_direct_absolute"; then
8803                 add=$dir/$linklib
8804               elif test yes = "$hardcode_minus_L"; then
8805                 add_dir=-L$absdir
8806                 # Try looking first in the location we're being installed to.
8807                 if test -n "$inst_prefix_dir"; then
8808                   case $libdir in
8809                     [\\/]*)
8810                       func_append add_dir " -L$inst_prefix_dir$libdir"
8811                       ;;
8812                   esac
8813                 fi
8814                 add=-l$name
8815               elif test yes = "$hardcode_shlibpath_var"; then
8816                 add_shlibpath=$dir
8817                 add=-l$name
8818               else
8819                 lib_linked=no
8820               fi
8821               ;;
8822             *) lib_linked=no ;;
8823             esac
8824 
8825             if test yes != "$lib_linked"; then
8826               func_fatal_configuration "unsupported hardcode properties"
8827             fi
8828 
8829             if test -n "$add_shlibpath"; then
8830               case :$compile_shlibpath: in
8831               *":$add_shlibpath:"*) ;;
8832               *) func_append compile_shlibpath "$add_shlibpath:" ;;
8833               esac
8834             fi
8835             if test prog = "$linkmode"; then
8836               test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
8837               test -n "$add" && compile_deplibs="$add $compile_deplibs"
8838             else
8839               test -n "$add_dir" && deplibs="$add_dir $deplibs"
8840               test -n "$add" && deplibs="$add $deplibs"
8841               if test yes != "$hardcode_direct" &&
8842                  test yes != "$hardcode_minus_L" &&
8843                  test yes = "$hardcode_shlibpath_var"; then
8844                 case :$finalize_shlibpath: in
8845                 *":$libdir:"*) ;;
8846                 *) func_append finalize_shlibpath "$libdir:" ;;
8847                 esac
8848               fi
8849             fi
8850           fi
8851 
8852           if test prog = "$linkmode" || test relink = "$opt_mode"; then
8853             add_shlibpath=
8854             add_dir=
8855             add=
8856             # Finalize command for both is simple: just hardcode it.
8857             if test yes = "$hardcode_direct" &&
8858                test no = "$hardcode_direct_absolute"; then
8859               add=$libdir/$linklib
8860             elif test yes = "$hardcode_minus_L"; then
8861               add_dir=-L$libdir
8862               add=-l$name
8863             elif test yes = "$hardcode_shlibpath_var"; then
8864               case :$finalize_shlibpath: in
8865               *":$libdir:"*) ;;
8866               *) func_append finalize_shlibpath "$libdir:" ;;
8867               esac
8868               add=-l$name
8869             elif test yes = "$hardcode_automatic"; then
8870               if test -n "$inst_prefix_dir" &&
8871                  test -f "$inst_prefix_dir$libdir/$linklib"; then
8872                 add=$inst_prefix_dir$libdir/$linklib
8873               else
8874                 add=$libdir/$linklib
8875               fi
8876             else
8877               # We cannot seem to hardcode it, guess we'll fake it.
8878               add_dir=-L$libdir
8879               # Try looking first in the location we're being installed to.
8880               if test -n "$inst_prefix_dir"; then
8881                 case $libdir in
8882                   [\\/]*)
8883                     func_append add_dir " -L$inst_prefix_dir$libdir"
8884                     ;;
8885                 esac
8886               fi
8887               add=-l$name
8888             fi
8889 
8890             if test prog = "$linkmode"; then
8891               test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
8892               test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
8893             else
8894               test -n "$add_dir" && deplibs="$add_dir $deplibs"
8895               test -n "$add" && deplibs="$add $deplibs"
8896             fi
8897           fi
8898         elif test prog = "$linkmode"; then
8899           # Here we assume that one of hardcode_direct or hardcode_minus_L
8900           # is not unsupported.  This is valid on all known static and
8901           # shared platforms.
8902           if test unsupported != "$hardcode_direct"; then
8903             test -n "$old_library" && linklib=$old_library
8904             compile_deplibs="$dir/$linklib $compile_deplibs"
8905             finalize_deplibs="$dir/$linklib $finalize_deplibs"
8906           else
8907             compile_deplibs="-l$name -L$dir $compile_deplibs"
8908             finalize_deplibs="-l$name -L$dir $finalize_deplibs"
8909           fi
8910         elif test yes = "$build_libtool_libs"; then
8911           # Not a shared library
8912           if test pass_all != "$deplibs_check_method"; then
8913             # We're trying link a shared library against a static one
8914             # but the system doesn't support it.
8915 
8916             # Just print a warning and add the library to dependency_libs so
8917             # that the program can be linked against the static library.
8918             echo
8919             $ECHO "*** Warning: This system cannot link to static lib archive $lib."
8920             echo "*** I have the capability to make that library automatically link in when"
8921             echo "*** you link to this library.  But I can only do this if you have a"
8922             echo "*** shared version of the library, which you do not appear to have."
8923             if test yes = "$module"; then
8924               echo "*** But as you try to build a module library, libtool will still create "
8925               echo "*** a static module, that should work as long as the dlopening application"
8926               echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
8927               if test -z "$global_symbol_pipe"; then
8928                 echo
8929                 echo "*** However, this would only work if libtool was able to extract symbol"
8930                 echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
8931                 echo "*** not find such a program.  So, this module is probably useless."
8932                 echo "*** 'nm' from GNU binutils and a full rebuild may help."
8933               fi
8934               if test no = "$build_old_libs"; then
8935                 build_libtool_libs=module
8936                 build_old_libs=yes
8937               else
8938                 build_libtool_libs=no
8939               fi
8940             fi
8941           else
8942             deplibs="$dir/$old_library $deplibs"
8943             link_static=yes
8944           fi
8945         fi # link shared/static library?
8946 
8947         if test lib = "$linkmode"; then
8948           if test -n "$dependency_libs" &&
8949              { test yes != "$hardcode_into_libs" ||
8950                test yes = "$build_old_libs" ||
8951                test yes = "$link_static"; }; then
8952             # Extract -R from dependency_libs
8953             temp_deplibs=
8954             for libdir in $dependency_libs; do
8955               case $libdir in
8956               -R*) func_stripname '-R' '' "$libdir"
8957                    temp_xrpath=$func_stripname_result
8958                    case " $xrpath " in
8959                    *" $temp_xrpath "*) ;;
8960                    *) func_append xrpath " $temp_xrpath";;
8961                    esac;;
8962               *) func_append temp_deplibs " $libdir";;
8963               esac
8964             done
8965             dependency_libs=$temp_deplibs
8966           fi
8967 
8968           func_append newlib_search_path " $absdir"
8969           # Link against this library
8970           test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
8971           # ... and its dependency_libs
8972           tmp_libs=
8973           for deplib in $dependency_libs; do
8974             newdependency_libs="$deplib $newdependency_libs"
8975             case $deplib in
8976               -L*) func_stripname '-L' '' "$deplib"
8977                    func_resolve_sysroot "$func_stripname_result";;
8978               *) func_resolve_sysroot "$deplib" ;;
8979             esac
8980             if $opt_preserve_dup_deps; then
8981               case "$tmp_libs " in
8982               *" $func_resolve_sysroot_result "*)
8983                 func_append specialdeplibs " $func_resolve_sysroot_result" ;;
8984               esac
8985             fi
8986             func_append tmp_libs " $func_resolve_sysroot_result"
8987           done
8988 
8989           if test no != "$link_all_deplibs"; then
8990             # Add the search paths of all dependency libraries
8991             for deplib in $dependency_libs; do
8992               path=
8993               case $deplib in
8994               -L*) path=$deplib ;;
8995               *.la)
8996                 func_resolve_sysroot "$deplib"
8997                 deplib=$func_resolve_sysroot_result
8998                 func_dirname "$deplib" "" "."
8999                 dir=$func_dirname_result
9000                 # We need an absolute path.
9001                 case $dir in
9002                 [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
9003                 *)
9004                   absdir=`cd "$dir" && pwd`
9005                   if test -z "$absdir"; then
9006                     func_warning "cannot determine absolute directory name of '$dir'"
9007                     absdir=$dir
9008                   fi
9009                   ;;
9010                 esac
9011                 if $GREP "^installed=no" $deplib > /dev/null; then
9012                 case $host in
9013                 *-*-darwin*)
9014                   depdepl=
9015                   eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
9016                   if test -n "$deplibrary_names"; then
9017                     for tmp in $deplibrary_names; do
9018                       depdepl=$tmp
9019                     done
9020                     if test -f "$absdir/$objdir/$depdepl"; then
9021                       depdepl=$absdir/$objdir/$depdepl
9022                       darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
9023                       if test -z "$darwin_install_name"; then
9024                           darwin_install_name=`$OTOOL64 -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
9025                       fi
9026                       func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
9027                       func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
9028                       path=
9029                     fi
9030                   fi
9031                   ;;
9032                 *)
9033                   path=-L$absdir/$objdir
9034                   ;;
9035                 esac
9036                 else
9037                   eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
9038                   test -z "$libdir" && \
9039                     func_fatal_error "'$deplib' is not a valid libtool archive"
9040                   test "$absdir" != "$libdir" && \
9041                     func_warning "'$deplib' seems to be moved"
9042 
9043                   path=-L$absdir
9044                 fi
9045                 ;;
9046               esac
9047               case " $deplibs " in
9048               *" $path "*) ;;
9049               *) deplibs="$path $deplibs" ;;
9050               esac
9051             done
9052           fi # link_all_deplibs != no
9053         fi # linkmode = lib
9054       done # for deplib in $libs
9055       if test link = "$pass"; then
9056         if test prog = "$linkmode"; then
9057           compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
9058           finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
9059         else
9060           compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
9061         fi
9062       fi
9063       dependency_libs=$newdependency_libs
9064       if test dlpreopen = "$pass"; then
9065         # Link the dlpreopened libraries before other libraries
9066         for deplib in $save_deplibs; do
9067           deplibs="$deplib $deplibs"
9068         done
9069       fi
9070       if test dlopen != "$pass"; then
9071         test conv = "$pass" || {
9072           # Make sure lib_search_path contains only unique directories.
9073           lib_search_path=
9074           for dir in $newlib_search_path; do
9075             case "$lib_search_path " in
9076             *" $dir "*) ;;
9077             *) func_append lib_search_path " $dir" ;;
9078             esac
9079           done
9080           newlib_search_path=
9081         }
9082 
9083         if test prog,link = "$linkmode,$pass"; then
9084           vars="compile_deplibs finalize_deplibs"
9085         else
9086           vars=deplibs
9087         fi
9088         for var in $vars dependency_libs; do
9089           # Add libraries to $var in reverse order
9090           eval tmp_libs=\"\$$var\"
9091           new_libs=
9092           for deplib in $tmp_libs; do
9093             # FIXME: Pedantically, this is the right thing to do, so
9094             #        that some nasty dependency loop isn't accidentally
9095             #        broken:
9096             #new_libs="$deplib $new_libs"
9097             # Pragmatically, this seems to cause very few problems in
9098             # practice:
9099             case $deplib in
9100             -L*) new_libs="$deplib $new_libs" ;;
9101             -R*) ;;
9102             *)
9103               # And here is the reason: when a library appears more
9104               # than once as an explicit dependence of a library, or
9105               # is implicitly linked in more than once by the
9106               # compiler, it is considered special, and multiple
9107               # occurrences thereof are not removed.  Compare this
9108               # with having the same library being listed as a
9109               # dependency of multiple other libraries: in this case,
9110               # we know (pedantically, we assume) the library does not
9111               # need to be listed more than once, so we keep only the
9112               # last copy.  This is not always right, but it is rare
9113               # enough that we require users that really mean to play
9114               # such unportable linking tricks to link the library
9115               # using -Wl,-lname, so that libtool does not consider it
9116               # for duplicate removal.
9117               case " $specialdeplibs " in
9118               *" $deplib "*) new_libs="$deplib $new_libs" ;;
9119               *)
9120                 case " $new_libs " in
9121                 *" $deplib "*) ;;
9122                 *) new_libs="$deplib $new_libs" ;;
9123                 esac
9124                 ;;
9125               esac
9126               ;;
9127             esac
9128           done
9129           tmp_libs=
9130           for deplib in $new_libs; do
9131             case $deplib in
9132             -L*)
9133               case " $tmp_libs " in
9134               *" $deplib "*) ;;
9135               *) func_append tmp_libs " $deplib" ;;
9136               esac
9137               ;;
9138             *) func_append tmp_libs " $deplib" ;;
9139             esac
9140           done
9141           eval $var=\"$tmp_libs\"
9142         done # for var
9143       fi
9144 
9145       # Add Sun CC postdeps if required:
9146       test CXX = "$tagname" && {
9147         case $host_os in
9148         linux*)
9149           case `$CC -V 2>&1 | sed 5q` in
9150           *Sun\ C*) # Sun C++ 5.9
9151             func_suncc_cstd_abi
9152 
9153             if test no != "$suncc_use_cstd_abi"; then
9154               func_append postdeps ' -library=Cstd -library=Crun'
9155             fi
9156             ;;
9157           esac
9158           ;;
9159 
9160         solaris*)
9161           func_cc_basename "$CC"
9162           case $func_cc_basename_result in
9163           CC* | sunCC*)
9164             func_suncc_cstd_abi
9165 
9166             if test no != "$suncc_use_cstd_abi"; then
9167               func_append postdeps ' -library=Cstd -library=Crun'
9168             fi
9169             ;;
9170           esac
9171           ;;
9172         esac
9173       }
9174 
9175       # Last step: remove runtime libs from dependency_libs
9176       # (they stay in deplibs)
9177       tmp_libs=
9178       for i in $dependency_libs; do
9179         case " $predeps $postdeps $compiler_lib_search_path " in
9180         *" $i "*)
9181           i=
9182           ;;
9183         esac
9184         if test -n "$i"; then
9185           func_append tmp_libs " $i"
9186         fi
9187       done
9188       dependency_libs=$tmp_libs
9189     done # for pass
9190     if test prog = "$linkmode"; then
9191       dlfiles=$newdlfiles
9192     fi
9193     if test prog = "$linkmode" || test lib = "$linkmode"; then
9194       dlprefiles=$newdlprefiles
9195     fi
9196 
9197     case $linkmode in
9198     oldlib)
9199       if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
9200         func_warning "'-dlopen' is ignored for archives"
9201       fi
9202 
9203       case " $deplibs" in
9204       *\ -l* | *\ -L*)
9205         func_warning "'-l' and '-L' are ignored for archives" ;;
9206       esac
9207 
9208       test -n "$rpath" && \
9209         func_warning "'-rpath' is ignored for archives"
9210 
9211       test -n "$xrpath" && \
9212         func_warning "'-R' is ignored for archives"
9213 
9214       test -n "$vinfo" && \
9215         func_warning "'-version-info/-version-number' is ignored for archives"
9216 
9217       test -n "$release" && \
9218         func_warning "'-release' is ignored for archives"
9219 
9220       test -n "$export_symbols$export_symbols_regex" && \
9221         func_warning "'-export-symbols' is ignored for archives"
9222 
9223       # Now set the variables for building old libraries.
9224       build_libtool_libs=no
9225       oldlibs=$output
9226       func_append objs "$old_deplibs"
9227       ;;
9228 
9229     lib)
9230       # Make sure we only generate libraries of the form 'libNAME.la'.
9231       case $outputname in
9232       lib*)
9233         func_stripname 'lib' '.la' "$outputname"
9234         name=$func_stripname_result
9235         eval shared_ext=\"$shrext_cmds\"
9236         eval libname=\"$libname_spec\"
9237         ;;
9238       *)
9239         test no = "$module" \
9240           && func_fatal_help "libtool library '$output' must begin with 'lib'"
9241 
9242         if test no != "$need_lib_prefix"; then
9243           # Add the "lib" prefix for modules if required
9244           func_stripname '' '.la' "$outputname"
9245           name=$func_stripname_result
9246           eval shared_ext=\"$shrext_cmds\"
9247           eval libname=\"$libname_spec\"
9248         else
9249           func_stripname '' '.la' "$outputname"
9250           libname=$func_stripname_result
9251         fi
9252         ;;
9253       esac
9254 
9255       if test -n "$objs"; then
9256         if test pass_all != "$deplibs_check_method"; then
9257           func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
9258         else
9259           echo
9260           $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
9261           $ECHO "*** objects $objs is not portable!"
9262           func_append libobjs " $objs"
9263         fi
9264       fi
9265 
9266       test no = "$dlself" \
9267         || func_warning "'-dlopen self' is ignored for libtool libraries"
9268 
9269       set dummy $rpath
9270       shift
9271       test 1 -lt "$#" \
9272         && func_warning "ignoring multiple '-rpath's for a libtool library"
9273 
9274       install_libdir=$1
9275 
9276       oldlibs=
9277       if test -z "$rpath"; then
9278         if test yes = "$build_libtool_libs"; then
9279           # Building a libtool convenience library.
9280           # Some compilers have problems with a '.al' extension so
9281           # convenience libraries should have the same extension an
9282           # archive normally would.
9283           oldlibs="$output_objdir/$libname.$libext $oldlibs"
9284           build_libtool_libs=convenience
9285           build_old_libs=yes
9286         fi
9287 
9288         test -n "$vinfo" && \
9289           func_warning "'-version-info/-version-number' is ignored for convenience libraries"
9290 
9291         test -n "$release" && \
9292           func_warning "'-release' is ignored for convenience libraries"
9293       else
9294 
9295         # Parse the version information argument.
9296         save_ifs=$IFS; IFS=:
9297         set dummy $vinfo 0 0 0
9298         shift
9299         IFS=$save_ifs
9300 
9301         test -n "$7" && \
9302           func_fatal_help "too many parameters to '-version-info'"
9303 
9304         # convert absolute version numbers to libtool ages
9305         # this retains compatibility with .la files and attempts
9306         # to make the code below a bit more comprehensible
9307 
9308         case $vinfo_number in
9309         yes)
9310           number_major=$1
9311           number_minor=$2
9312           number_revision=$3
9313           #
9314           # There are really only two kinds -- those that
9315           # use the current revision as the major version
9316           # and those that subtract age and use age as
9317           # a minor version.  But, then there is irix
9318           # that has an extra 1 added just for fun
9319           #
9320           case $version_type in
9321           # correct linux to gnu/linux during the next big refactor
9322           darwin|freebsd-elf|linux|osf|windows|none)
9323             func_arith $number_major + $number_minor
9324             current=$func_arith_result
9325             age=$number_minor
9326             revision=$number_revision
9327             ;;
9328           freebsd-aout|qnx|sunos)
9329             current=$number_major
9330             revision=$number_minor
9331             age=0
9332             ;;
9333           irix|nonstopux)
9334             func_arith $number_major + $number_minor
9335             current=$func_arith_result
9336             age=$number_minor
9337             revision=$number_minor
9338             lt_irix_increment=no
9339             ;;
9340           esac
9341           ;;
9342         no)
9343           current=$1
9344           revision=$2
9345           age=$3
9346           ;;
9347         esac
9348 
9349         # Check that each of the things are valid numbers.
9350         case $current in
9351         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]) ;;
9352         *)
9353           func_error "CURRENT '$current' must be a nonnegative integer"
9354           func_fatal_error "'$vinfo' is not valid version information"
9355           ;;
9356         esac
9357 
9358         case $revision in
9359         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]) ;;
9360         *)
9361           func_error "REVISION '$revision' must be a nonnegative integer"
9362           func_fatal_error "'$vinfo' is not valid version information"
9363           ;;
9364         esac
9365 
9366         case $age in
9367         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]) ;;
9368         *)
9369           func_error "AGE '$age' must be a nonnegative integer"
9370           func_fatal_error "'$vinfo' is not valid version information"
9371           ;;
9372         esac
9373 
9374         if test "$age" -gt "$current"; then
9375           func_error "AGE '$age' is greater than the current interface number '$current'"
9376           func_fatal_error "'$vinfo' is not valid version information"
9377         fi
9378 
9379         # Calculate the version variables.
9380         major=
9381         versuffix=
9382         verstring=
9383         case $version_type in
9384         none) ;;
9385 
9386         darwin)
9387           # Like Linux, but with the current version available in
9388           # verstring for coding it into the library header
9389           func_arith $current - $age
9390           major=.$func_arith_result
9391           versuffix=$major.$age.$revision
9392           # Darwin ld doesn't like 0 for these options...
9393           func_arith $current + 1
9394           minor_current=$func_arith_result
9395           xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
9396           verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
9397           # On Darwin other compilers
9398           case $CC in
9399               nagfor*)
9400                   verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
9401                   ;;
9402               *)
9403                   verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
9404                   ;;
9405           esac
9406           ;;
9407 
9408         freebsd-aout)
9409           major=.$current
9410           versuffix=.$current.$revision
9411           ;;
9412 
9413         freebsd-elf)
9414           func_arith $current - $age
9415           major=.$func_arith_result
9416           versuffix=$major.$age.$revision
9417           ;;
9418 
9419         irix | nonstopux)
9420           if test no = "$lt_irix_increment"; then
9421             func_arith $current - $age
9422           else
9423             func_arith $current - $age + 1
9424           fi
9425           major=$func_arith_result
9426 
9427           case $version_type in
9428             nonstopux) verstring_prefix=nonstopux ;;
9429             *)         verstring_prefix=sgi ;;
9430           esac
9431           verstring=$verstring_prefix$major.$revision
9432 
9433           # Add in all the interfaces that we are compatible with.
9434           loop=$revision
9435           while test 0 -ne "$loop"; do
9436             func_arith $revision - $loop
9437             iface=$func_arith_result
9438             func_arith $loop - 1
9439             loop=$func_arith_result
9440             verstring=$verstring_prefix$major.$iface:$verstring
9441           done
9442 
9443           # Before this point, $major must not contain '.'.
9444           major=.$major
9445           versuffix=$major.$revision
9446           ;;
9447 
9448         linux) # correct to gnu/linux during the next big refactor
9449           func_arith $current - $age
9450           major=.$func_arith_result
9451           versuffix=$major.$age.$revision
9452           ;;
9453 
9454         osf)
9455           func_arith $current - $age
9456           major=.$func_arith_result
9457           versuffix=.$current.$age.$revision
9458           verstring=$current.$age.$revision
9459 
9460           # Add in all the interfaces that we are compatible with.
9461           loop=$age
9462           while test 0 -ne "$loop"; do
9463             func_arith $current - $loop
9464             iface=$func_arith_result
9465             func_arith $loop - 1
9466             loop=$func_arith_result
9467             verstring=$verstring:$iface.0
9468           done
9469 
9470           # Make executables depend on our current version.
9471           func_append verstring ":$current.0"
9472           ;;
9473 
9474         qnx)
9475           major=.$current
9476           versuffix=.$current
9477           ;;
9478 
9479         sco)
9480           major=.$current
9481           versuffix=.$current
9482           ;;
9483 
9484         sunos)
9485           major=.$current
9486           versuffix=.$current.$revision
9487           ;;
9488 
9489         windows)
9490           # Use '-' rather than '.', since we only want one
9491           # extension on DOS 8.3 file systems.
9492           func_arith $current - $age
9493           major=$func_arith_result
9494           versuffix=-$major
9495           ;;
9496 
9497         *)
9498           func_fatal_configuration "unknown library version type '$version_type'"
9499           ;;
9500         esac
9501 
9502         # Clear the version info if we defaulted, and they specified a release.
9503         if test -z "$vinfo" && test -n "$release"; then
9504           major=
9505           case $version_type in
9506           darwin)
9507             # we can't check for "0.0" in archive_cmds due to quoting
9508             # problems, so we reset it completely
9509             verstring=
9510             ;;
9511           *)
9512             verstring=0.0
9513             ;;
9514           esac
9515           if test no = "$need_version"; then
9516             versuffix=
9517           else
9518             versuffix=.0.0
9519           fi
9520         fi
9521 
9522         # Remove version info from name if versioning should be avoided
9523         if test yes,no = "$avoid_version,$need_version"; then
9524           major=
9525           versuffix=
9526           verstring=
9527         fi
9528 
9529         # Check to see if the archive will have undefined symbols.
9530         if test yes = "$allow_undefined"; then
9531           if test unsupported = "$allow_undefined_flag"; then
9532             if test yes = "$build_old_libs"; then
9533               func_warning "undefined symbols not allowed in $host shared libraries; building static only"
9534               build_libtool_libs=no
9535             else
9536               func_fatal_error "can't build $host shared library unless -no-undefined is specified"
9537             fi
9538           fi
9539         else
9540           # Don't allow undefined symbols.
9541           allow_undefined_flag=$no_undefined_flag
9542         fi
9543 
9544       fi
9545 
9546       func_generate_dlsyms "$libname" "$libname" :
9547       func_append libobjs " $symfileobj"
9548       test " " = "$libobjs" && libobjs=
9549 
9550       if test relink != "$opt_mode"; then
9551         # Remove our outputs, but don't remove object files since they
9552         # may have been created when compiling PIC objects.
9553         removelist=
9554         tempremovelist=`$ECHO "$output_objdir/*"`
9555         for p in $tempremovelist; do
9556           case $p in
9557             *.$objext | *.gcno)
9558                ;;
9559             $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
9560                if test -n "$precious_files_regex"; then
9561                  if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
9562                  then
9563                    continue
9564                  fi
9565                fi
9566                func_append removelist " $p"
9567                ;;
9568             *) ;;
9569           esac
9570         done
9571         test -n "$removelist" && \
9572           func_show_eval "${RM}r \$removelist"
9573       fi
9574 
9575       # Now set the variables for building old libraries.
9576       if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
9577         func_append oldlibs " $output_objdir/$libname.$libext"
9578 
9579         # Transform .lo files to .o files.
9580         oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
9581       fi
9582 
9583       # Eliminate all temporary directories.
9584       #for path in $notinst_path; do
9585       # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
9586       # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
9587       # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
9588       #done
9589 
9590       if test -n "$xrpath"; then
9591         # If the user specified any rpath flags, then add them.
9592         temp_xrpath=
9593         for libdir in $xrpath; do
9594           func_replace_sysroot "$libdir"
9595           func_append temp_xrpath " -R$func_replace_sysroot_result"
9596           case "$finalize_rpath " in
9597           *" $libdir "*) ;;
9598           *) func_append finalize_rpath " $libdir" ;;
9599           esac
9600         done
9601         if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
9602           dependency_libs="$temp_xrpath $dependency_libs"
9603         fi
9604       fi
9605 
9606       # Make sure dlfiles contains only unique files that won't be dlpreopened
9607       old_dlfiles=$dlfiles
9608       dlfiles=
9609       for lib in $old_dlfiles; do
9610         case " $dlprefiles $dlfiles " in
9611         *" $lib "*) ;;
9612         *) func_append dlfiles " $lib" ;;
9613         esac
9614       done
9615 
9616       # Make sure dlprefiles contains only unique files
9617       old_dlprefiles=$dlprefiles
9618       dlprefiles=
9619       for lib in $old_dlprefiles; do
9620         case "$dlprefiles " in
9621         *" $lib "*) ;;
9622         *) func_append dlprefiles " $lib" ;;
9623         esac
9624       done
9625 
9626       if test yes = "$build_libtool_libs"; then
9627         if test -n "$rpath"; then
9628           case $host in
9629           *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
9630             # these systems don't actually have a c library (as such)!
9631             ;;
9632           *-*-rhapsody* | *-*-darwin1.[012])
9633             # Rhapsody C library is in the System framework
9634             func_append deplibs " System.ltframework"
9635             ;;
9636           *-*-netbsd*)
9637             # Don't link with libc until the a.out ld.so is fixed.
9638             ;;
9639           *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
9640             # Do not include libc due to us having libc/libc_r.
9641             ;;
9642           *-*-sco3.2v5* | *-*-sco5v6*)
9643             # Causes problems with __ctype
9644             ;;
9645           *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
9646             # Compiler inserts libc in the correct place for threads to work
9647             ;;
9648           *)
9649             # Add libc to deplibs on all other systems if necessary.
9650             if test yes = "$build_libtool_need_lc"; then
9651               func_append deplibs " -lc"
9652             fi
9653             ;;
9654           esac
9655         fi
9656 
9657         # Transform deplibs into only deplibs that can be linked in shared.
9658         name_save=$name
9659         libname_save=$libname
9660         release_save=$release
9661         versuffix_save=$versuffix
9662         major_save=$major
9663         # I'm not sure if I'm treating the release correctly.  I think
9664         # release should show up in the -l (ie -lgmp5) so we don't want to
9665         # add it in twice.  Is that correct?
9666         release=
9667         versuffix=
9668         major=
9669         newdeplibs=
9670         droppeddeps=no
9671         case $deplibs_check_method in
9672         pass_all)
9673           # Don't check for shared/static.  Everything works.
9674           # This might be a little naive.  We might want to check
9675           # whether the library exists or not.  But this is on
9676           # osf3 & osf4 and I'm not really sure... Just
9677           # implementing what was already the behavior.
9678           newdeplibs=$deplibs
9679           ;;
9680         test_compile)
9681           # This code stresses the "libraries are programs" paradigm to its
9682           # limits. Maybe even breaks it.  We compile a program, linking it
9683           # against the deplibs as a proxy for the library.  Then we can check
9684           # whether they linked in statically or dynamically with ldd.
9685           $opt_dry_run || $RM conftest.c
9686           cat > conftest.c <<EOF
9687           int main() { return 0; }
9688 EOF
9689           $opt_dry_run || $RM conftest
9690           if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
9691             ldd_output=`ldd conftest`
9692             for i in $deplibs; do
9693               case $i in
9694               -l*)
9695                 func_stripname -l '' "$i"
9696                 name=$func_stripname_result
9697                 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9698                   case " $predeps $postdeps " in
9699                   *" $i "*)
9700                     func_append newdeplibs " $i"
9701                     i=
9702                     ;;
9703                   esac
9704                 fi
9705                 if test -n "$i"; then
9706                   libname=`eval "\\$ECHO \"$libname_spec\""`
9707                   deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
9708                   set dummy $deplib_matches; shift
9709                   deplib_match=$1
9710                   if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
9711                     func_append newdeplibs " $i"
9712                   else
9713                     droppeddeps=yes
9714                     echo
9715                     $ECHO "*** Warning: dynamic linker does not accept needed library $i."
9716                     echo "*** I have the capability to make that library automatically link in when"
9717                     echo "*** you link to this library.  But I can only do this if you have a"
9718                     echo "*** shared version of the library, which I believe you do not have"
9719                     echo "*** because a test_compile did reveal that the linker did not use it for"
9720                     echo "*** its dynamic dependency list that programs get resolved with at runtime."
9721                   fi
9722                 fi
9723                 ;;
9724               *)
9725                 func_append newdeplibs " $i"
9726                 ;;
9727               esac
9728             done
9729           else
9730             # Error occurred in the first compile.  Let's try to salvage
9731             # the situation: Compile a separate program for each library.
9732             for i in $deplibs; do
9733               case $i in
9734               -l*)
9735                 func_stripname -l '' "$i"
9736                 name=$func_stripname_result
9737                 $opt_dry_run || $RM conftest
9738                 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
9739                   ldd_output=`ldd conftest`
9740                   if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9741                     case " $predeps $postdeps " in
9742                     *" $i "*)
9743                       func_append newdeplibs " $i"
9744                       i=
9745                       ;;
9746                     esac
9747                   fi
9748                   if test -n "$i"; then
9749                     libname=`eval "\\$ECHO \"$libname_spec\""`
9750                     deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
9751                     set dummy $deplib_matches; shift
9752                     deplib_match=$1
9753                     if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
9754                       func_append newdeplibs " $i"
9755                     else
9756                       droppeddeps=yes
9757                       echo
9758                       $ECHO "*** Warning: dynamic linker does not accept needed library $i."
9759                       echo "*** I have the capability to make that library automatically link in when"
9760                       echo "*** you link to this library.  But I can only do this if you have a"
9761                       echo "*** shared version of the library, which you do not appear to have"
9762                       echo "*** because a test_compile did reveal that the linker did not use this one"
9763                       echo "*** as a dynamic dependency that programs can get resolved with at runtime."
9764                     fi
9765                   fi
9766                 else
9767                   droppeddeps=yes
9768                   echo
9769                   $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
9770                   echo "*** make it link in!  You will probably need to install it or some"
9771                   echo "*** library that it depends on before this library will be fully"
9772                   echo "*** functional.  Installing it before continuing would be even better."
9773                 fi
9774                 ;;
9775               *)
9776                 func_append newdeplibs " $i"
9777                 ;;
9778               esac
9779             done
9780           fi
9781           ;;
9782         file_magic*)
9783           set dummy $deplibs_check_method; shift
9784           file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
9785           for a_deplib in $deplibs; do
9786             case $a_deplib in
9787             -l*)
9788               func_stripname -l '' "$a_deplib"
9789               name=$func_stripname_result
9790               if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9791                 case " $predeps $postdeps " in
9792                 *" $a_deplib "*)
9793                   func_append newdeplibs " $a_deplib"
9794                   a_deplib=
9795                   ;;
9796                 esac
9797               fi
9798               if test -n "$a_deplib"; then
9799                 libname=`eval "\\$ECHO \"$libname_spec\""`
9800                 if test -n "$file_magic_glob"; then
9801                   libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
9802                 else
9803                   libnameglob=$libname
9804                 fi
9805                 test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
9806                 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
9807                   if test yes = "$want_nocaseglob"; then
9808                     shopt -s nocaseglob
9809                     potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
9810                     $nocaseglob
9811                   else
9812                     potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
9813                   fi
9814                   for potent_lib in $potential_libs; do
9815                       # Follow soft links.
9816                       if ls -lLd "$potent_lib" 2>/dev/null |
9817                          $GREP " -> " >/dev/null; then
9818                         continue
9819                       fi
9820                       # The statement above tries to avoid entering an
9821                       # endless loop below, in case of cyclic links.
9822                       # We might still enter an endless loop, since a link
9823                       # loop can be closed while we follow links,
9824                       # but so what?
9825                       potlib=$potent_lib
9826                       while test -h "$potlib" 2>/dev/null; do
9827                         potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
9828                         case $potliblink in
9829                         [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
9830                         *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
9831                         esac
9832                       done
9833                       if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
9834                          $SED -e 10q |
9835                          $EGREP "$file_magic_regex" > /dev/null; then
9836                         func_append newdeplibs " $a_deplib"
9837                         a_deplib=
9838                         break 2
9839                       fi
9840                   done
9841                 done
9842               fi
9843               if test -n "$a_deplib"; then
9844                 droppeddeps=yes
9845                 echo
9846                 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
9847                 echo "*** I have the capability to make that library automatically link in when"
9848                 echo "*** you link to this library.  But I can only do this if you have a"
9849                 echo "*** shared version of the library, which you do not appear to have"
9850                 echo "*** because I did check the linker path looking for a file starting"
9851                 if test -z "$potlib"; then
9852                   $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
9853                 else
9854                   $ECHO "*** with $libname and none of the candidates passed a file format test"
9855                   $ECHO "*** using a file magic. Last file checked: $potlib"
9856                 fi
9857               fi
9858               ;;
9859             *)
9860               # Add a -L argument.
9861               func_append newdeplibs " $a_deplib"
9862               ;;
9863             esac
9864           done # Gone through all deplibs.
9865           ;;
9866         match_pattern*)
9867           set dummy $deplibs_check_method; shift
9868           match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
9869           for a_deplib in $deplibs; do
9870             case $a_deplib in
9871             -l*)
9872               func_stripname -l '' "$a_deplib"
9873               name=$func_stripname_result
9874               if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9875                 case " $predeps $postdeps " in
9876                 *" $a_deplib "*)
9877                   func_append newdeplibs " $a_deplib"
9878                   a_deplib=
9879                   ;;
9880                 esac
9881               fi
9882               if test -n "$a_deplib"; then
9883                 libname=`eval "\\$ECHO \"$libname_spec\""`
9884                 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
9885                   potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
9886                   for potent_lib in $potential_libs; do
9887                     potlib=$potent_lib # see symlink-check above in file_magic test
9888                     if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
9889                        $EGREP "$match_pattern_regex" > /dev/null; then
9890                       func_append newdeplibs " $a_deplib"
9891                       a_deplib=
9892                       break 2
9893                     fi
9894                   done
9895                 done
9896               fi
9897               if test -n "$a_deplib"; then
9898                 droppeddeps=yes
9899                 echo
9900                 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
9901                 echo "*** I have the capability to make that library automatically link in when"
9902                 echo "*** you link to this library.  But I can only do this if you have a"
9903                 echo "*** shared version of the library, which you do not appear to have"
9904                 echo "*** because I did check the linker path looking for a file starting"
9905                 if test -z "$potlib"; then
9906                   $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
9907                 else
9908                   $ECHO "*** with $libname and none of the candidates passed a file format test"
9909                   $ECHO "*** using a regex pattern. Last file checked: $potlib"
9910                 fi
9911               fi
9912               ;;
9913             *)
9914               # Add a -L argument.
9915               func_append newdeplibs " $a_deplib"
9916               ;;
9917             esac
9918           done # Gone through all deplibs.
9919           ;;
9920         none | unknown | *)
9921           newdeplibs=
9922           tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
9923           if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9924             for i in $predeps $postdeps; do
9925               # can't use Xsed below, because $i might contain '/'
9926               tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
9927             done
9928           fi
9929           case $tmp_deplibs in
9930           *[!\  \ ]*)
9931             echo
9932             if test none = "$deplibs_check_method"; then
9933               echo "*** Warning: inter-library dependencies are not supported in this platform."
9934             else
9935               echo "*** Warning: inter-library dependencies are not known to be supported."
9936             fi
9937             echo "*** All declared inter-library dependencies are being dropped."
9938             droppeddeps=yes
9939             ;;
9940           esac
9941           ;;
9942         esac
9943         versuffix=$versuffix_save
9944         major=$major_save
9945         release=$release_save
9946         libname=$libname_save
9947         name=$name_save
9948 
9949         case $host in
9950         *-*-rhapsody* | *-*-darwin1.[012])
9951           # On Rhapsody replace the C library with the System framework
9952           newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
9953           ;;
9954         esac
9955 
9956         if test yes = "$droppeddeps"; then
9957           if test yes = "$module"; then
9958             echo
9959             echo "*** Warning: libtool could not satisfy all declared inter-library"
9960             $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
9961             echo "*** a static module, that should work as long as the dlopening"
9962             echo "*** application is linked with the -dlopen flag."
9963             if test -z "$global_symbol_pipe"; then
9964               echo
9965               echo "*** However, this would only work if libtool was able to extract symbol"
9966               echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
9967               echo "*** not find such a program.  So, this module is probably useless."
9968               echo "*** 'nm' from GNU binutils and a full rebuild may help."
9969             fi
9970             if test no = "$build_old_libs"; then
9971               oldlibs=$output_objdir/$libname.$libext
9972               build_libtool_libs=module
9973               build_old_libs=yes
9974             else
9975               build_libtool_libs=no
9976             fi
9977           else
9978             echo "*** The inter-library dependencies that have been dropped here will be"
9979             echo "*** automatically added whenever a program is linked with this library"
9980             echo "*** or is declared to -dlopen it."
9981 
9982             if test no = "$allow_undefined"; then
9983               echo
9984               echo "*** Since this library must not contain undefined symbols,"
9985               echo "*** because either the platform does not support them or"
9986               echo "*** it was explicitly requested with -no-undefined,"
9987               echo "*** libtool will only create a static version of it."
9988               if test no = "$build_old_libs"; then
9989                 oldlibs=$output_objdir/$libname.$libext
9990                 build_libtool_libs=module
9991                 build_old_libs=yes
9992               else
9993                 build_libtool_libs=no
9994               fi
9995             fi
9996           fi
9997         fi
9998         # Done checking deplibs!
9999         deplibs=$newdeplibs
10000       fi
10001       # Time to change all our "foo.ltframework" stuff back to "-framework foo"
10002       case $host in
10003         *-*-darwin*)
10004           newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
10005           new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
10006           deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
10007           ;;
10008       esac
10009 
10010       # move library search paths that coincide with paths to not yet
10011       # installed libraries to the beginning of the library search list
10012       new_libs=
10013       for path in $notinst_path; do
10014         case " $new_libs " in
10015         *" -L$path/$objdir "*) ;;
10016         *)
10017           case " $deplibs " in
10018           *" -L$path/$objdir "*)
10019             func_append new_libs " -L$path/$objdir" ;;
10020           esac
10021           ;;
10022         esac
10023       done
10024       for deplib in $deplibs; do
10025         case $deplib in
10026         -L*)
10027           case " $new_libs " in
10028           *" $deplib "*) ;;
10029           *) func_append new_libs " $deplib" ;;
10030           esac
10031           ;;
10032         *) func_append new_libs " $deplib" ;;
10033         esac
10034       done
10035       deplibs=$new_libs
10036 
10037       # All the library-specific variables (install_libdir is set above).
10038       library_names=
10039       old_library=
10040       dlname=
10041 
10042       # Test again, we may have decided not to build it any more
10043       if test yes = "$build_libtool_libs"; then
10044         # Remove $wl instances when linking with ld.
10045         # FIXME: should test the right _cmds variable.
10046         case $archive_cmds in
10047           *\$LD\ *) wl= ;;
10048         esac
10049         if test yes = "$hardcode_into_libs"; then
10050           # Hardcode the library paths
10051           hardcode_libdirs=
10052           dep_rpath=
10053           rpath=$finalize_rpath
10054           test relink = "$opt_mode" || rpath=$compile_rpath$rpath
10055           for libdir in $rpath; do
10056             if test -n "$hardcode_libdir_flag_spec"; then
10057               if test -n "$hardcode_libdir_separator"; then
10058                 func_replace_sysroot "$libdir"
10059                 libdir=$func_replace_sysroot_result
10060                 if test -z "$hardcode_libdirs"; then
10061                   hardcode_libdirs=$libdir
10062                 else
10063                   # Just accumulate the unique libdirs.
10064                   case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
10065                   *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
10066                     ;;
10067                   *)
10068                     func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
10069                     ;;
10070                   esac
10071                 fi
10072               else
10073                 eval flag=\"$hardcode_libdir_flag_spec\"
10074                 func_append dep_rpath " $flag"
10075               fi
10076             elif test -n "$runpath_var"; then
10077               case "$perm_rpath " in
10078               *" $libdir "*) ;;
10079               *) func_append perm_rpath " $libdir" ;;
10080               esac
10081             fi
10082           done
10083           # Substitute the hardcoded libdirs into the rpath.
10084           if test -n "$hardcode_libdir_separator" &&
10085              test -n "$hardcode_libdirs"; then
10086             libdir=$hardcode_libdirs
10087             eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
10088           fi
10089           if test -n "$runpath_var" && test -n "$perm_rpath"; then
10090             # We should set the runpath_var.
10091             rpath=
10092             for dir in $perm_rpath; do
10093               func_append rpath "$dir:"
10094             done
10095             eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
10096           fi
10097           test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
10098         fi
10099 
10100         shlibpath=$finalize_shlibpath
10101         test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
10102         if test -n "$shlibpath"; then
10103           eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
10104         fi
10105 
10106         # Get the real and link names of the library.
10107         eval shared_ext=\"$shrext_cmds\"
10108         eval library_names=\"$library_names_spec\"
10109         set dummy $library_names
10110         shift
10111         realname=$1
10112         shift
10113 
10114         if test -n "$soname_spec"; then
10115           eval soname=\"$soname_spec\"
10116         else
10117           soname=$realname
10118         fi
10119         if test -z "$dlname"; then
10120           dlname=$soname
10121         fi
10122 
10123         lib=$output_objdir/$realname
10124         linknames=
10125         for link
10126         do
10127           func_append linknames " $link"
10128         done
10129 
10130         # Use standard objects if they are pic
10131         test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
10132         test "X$libobjs" = "X " && libobjs=
10133 
10134         delfiles=
10135         if test -n "$export_symbols" && test -n "$include_expsyms"; then
10136           $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
10137           export_symbols=$output_objdir/$libname.uexp
10138           func_append delfiles " $export_symbols"
10139         fi
10140 
10141         orig_export_symbols=
10142         case $host_os in
10143         cygwin* | mingw* | cegcc*)
10144           if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
10145             # exporting using user supplied symfile
10146             func_dll_def_p "$export_symbols" || {
10147               # and it's NOT already a .def file. Must figure out
10148               # which of the given symbols are data symbols and tag
10149               # them as such. So, trigger use of export_symbols_cmds.
10150               # export_symbols gets reassigned inside the "prepare
10151               # the list of exported symbols" if statement, so the
10152               # include_expsyms logic still works.
10153               orig_export_symbols=$export_symbols
10154               export_symbols=
10155               always_export_symbols=yes
10156             }
10157           fi
10158           ;;
10159         esac
10160 
10161         # Prepare the list of exported symbols
10162         if test -z "$export_symbols"; then
10163           if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
10164             func_verbose "generating symbol list for '$libname.la'"
10165             export_symbols=$output_objdir/$libname.exp
10166             $opt_dry_run || $RM $export_symbols
10167             cmds=$export_symbols_cmds
10168             save_ifs=$IFS; IFS='~'
10169             for cmd1 in $cmds; do
10170               IFS=$save_ifs
10171               # Take the normal branch if the nm_file_list_spec branch
10172               # doesn't work or if tool conversion is not needed.
10173               case $nm_file_list_spec~$to_tool_file_cmd in
10174                 *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
10175                   try_normal_branch=yes
10176                   eval cmd=\"$cmd1\"
10177                   func_len " $cmd"
10178                   len=$func_len_result
10179                   ;;
10180                 *)
10181                   try_normal_branch=no
10182                   ;;
10183               esac
10184               if test yes = "$try_normal_branch" \
10185                  && { test "$len" -lt "$max_cmd_len" \
10186                       || test "$max_cmd_len" -le -1; }
10187               then
10188                 func_show_eval "$cmd" 'exit $?'
10189                 skipped_export=false
10190               elif test -n "$nm_file_list_spec"; then
10191                 func_basename "$output"
10192                 output_la=$func_basename_result
10193                 save_libobjs=$libobjs
10194                 save_output=$output
10195                 output=$output_objdir/$output_la.nm
10196                 func_to_tool_file "$output"
10197                 libobjs=$nm_file_list_spec$func_to_tool_file_result
10198                 func_append delfiles " $output"
10199                 func_verbose "creating $NM input file list: $output"
10200                 for obj in $save_libobjs; do
10201                   func_to_tool_file "$obj"
10202                   $ECHO "$func_to_tool_file_result"
10203                 done > "$output"
10204                 eval cmd=\"$cmd1\"
10205                 func_show_eval "$cmd" 'exit $?'
10206                 output=$save_output
10207                 libobjs=$save_libobjs
10208                 skipped_export=false
10209               else
10210                 # The command line is too long to execute in one step.
10211                 func_verbose "using reloadable object file for export list..."
10212                 skipped_export=:
10213                 # Break out early, otherwise skipped_export may be
10214                 # set to false by a later but shorter cmd.
10215                 break
10216               fi
10217             done
10218             IFS=$save_ifs
10219             if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
10220               func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
10221               func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
10222             fi
10223           fi
10224         fi
10225 
10226         if test -n "$export_symbols" && test -n "$include_expsyms"; then
10227           tmp_export_symbols=$export_symbols
10228           test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
10229           $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
10230         fi
10231 
10232         if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
10233           # The given exports_symbols file has to be filtered, so filter it.
10234           func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
10235           # FIXME: $output_objdir/$libname.filter potentially contains lots of
10236           # 's' commands, which not all seds can handle. GNU sed should be fine
10237           # though. Also, the filter scales superlinearly with the number of
10238           # global variables. join(1) would be nice here, but unfortunately
10239           # isn't a blessed tool.
10240           $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
10241           func_append delfiles " $export_symbols $output_objdir/$libname.filter"
10242           export_symbols=$output_objdir/$libname.def
10243           $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
10244         fi
10245 
10246         tmp_deplibs=
10247         for test_deplib in $deplibs; do
10248           case " $convenience " in
10249           *" $test_deplib "*) ;;
10250           *)
10251             func_append tmp_deplibs " $test_deplib"
10252             ;;
10253           esac
10254         done
10255         deplibs=$tmp_deplibs
10256 
10257         if test -n "$convenience"; then
10258           if test -n "$whole_archive_flag_spec" &&
10259             test yes = "$compiler_needs_object" &&
10260             test -z "$libobjs"; then
10261             # extract the archives, so we have objects to list.
10262             # TODO: could optimize this to just extract one archive.
10263             whole_archive_flag_spec=
10264           fi
10265           if test -n "$whole_archive_flag_spec"; then
10266             save_libobjs=$libobjs
10267             eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
10268             test "X$libobjs" = "X " && libobjs=
10269           else
10270             gentop=$output_objdir/${outputname}x
10271             func_append generated " $gentop"
10272 
10273             func_extract_archives $gentop $convenience
10274             func_append libobjs " $func_extract_archives_result"
10275             test "X$libobjs" = "X " && libobjs=
10276           fi
10277         fi
10278 
10279         if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
10280           eval flag=\"$thread_safe_flag_spec\"
10281           func_append linker_flags " $flag"
10282         fi
10283 
10284         # Make a backup of the uninstalled library when relinking
10285         if test relink = "$opt_mode"; then
10286           $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
10287         fi
10288 
10289         # Do each of the archive commands.
10290         if test yes = "$module" && test -n "$module_cmds"; then
10291           if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
10292             eval test_cmds=\"$module_expsym_cmds\"
10293             cmds=$module_expsym_cmds
10294           else
10295             eval test_cmds=\"$module_cmds\"
10296             cmds=$module_cmds
10297           fi
10298         else
10299           if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
10300             eval test_cmds=\"$archive_expsym_cmds\"
10301             cmds=$archive_expsym_cmds
10302           else
10303             eval test_cmds=\"$archive_cmds\"
10304             cmds=$archive_cmds
10305           fi
10306         fi
10307 
10308         if test : != "$skipped_export" &&
10309            func_len " $test_cmds" &&
10310            len=$func_len_result &&
10311            test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
10312           :
10313         else
10314           # The command line is too long to link in one step, link piecewise
10315           # or, if using GNU ld and skipped_export is not :, use a linker
10316           # script.
10317 
10318           # Save the value of $output and $libobjs because we want to
10319           # use them later.  If we have whole_archive_flag_spec, we
10320           # want to use save_libobjs as it was before
10321           # whole_archive_flag_spec was expanded, because we can't
10322           # assume the linker understands whole_archive_flag_spec.
10323           # This may have to be revisited, in case too many
10324           # convenience libraries get linked in and end up exceeding
10325           # the spec.
10326           if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
10327             save_libobjs=$libobjs
10328           fi
10329           save_output=$output
10330           func_basename "$output"
10331           output_la=$func_basename_result
10332 
10333           # Clear the reloadable object creation command queue and
10334           # initialize k to one.
10335           test_cmds=
10336           concat_cmds=
10337           objlist=
10338           last_robj=
10339           k=1
10340 
10341           if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
10342             output=$output_objdir/$output_la.lnkscript
10343             func_verbose "creating GNU ld script: $output"
10344             echo 'INPUT (' > $output
10345             for obj in $save_libobjs
10346             do
10347               func_to_tool_file "$obj"
10348               $ECHO "$func_to_tool_file_result" >> $output
10349             done
10350             echo ')' >> $output
10351             func_append delfiles " $output"
10352             func_to_tool_file "$output"
10353             output=$func_to_tool_file_result
10354           elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
10355             output=$output_objdir/$output_la.lnk
10356             func_verbose "creating linker input file list: $output"
10357             : > $output
10358             set x $save_libobjs
10359             shift
10360             firstobj=
10361             if test yes = "$compiler_needs_object"; then
10362               firstobj="$1 "
10363               shift
10364             fi
10365             for obj
10366             do
10367               func_to_tool_file "$obj"
10368               $ECHO "$func_to_tool_file_result" >> $output
10369             done
10370             func_append delfiles " $output"
10371             func_to_tool_file "$output"
10372             output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
10373           else
10374             if test -n "$save_libobjs"; then
10375               func_verbose "creating reloadable object files..."
10376               output=$output_objdir/$output_la-$k.$objext
10377               eval test_cmds=\"$reload_cmds\"
10378               func_len " $test_cmds"
10379               len0=$func_len_result
10380               len=$len0
10381 
10382               # Loop over the list of objects to be linked.
10383               for obj in $save_libobjs
10384               do
10385                 func_len " $obj"
10386                 func_arith $len + $func_len_result
10387                 len=$func_arith_result
10388                 if test -z "$objlist" ||
10389                    test "$len" -lt "$max_cmd_len"; then
10390                   func_append objlist " $obj"
10391                 else
10392                   # The command $test_cmds is almost too long, add a
10393                   # command to the queue.
10394                   if test 1 -eq "$k"; then
10395                     # The first file doesn't have a previous command to add.
10396                     reload_objs=$objlist
10397                     eval concat_cmds=\"$reload_cmds\"
10398                   else
10399                     # All subsequent reloadable object files will link in
10400                     # the last one created.
10401                     reload_objs="$objlist $last_robj"
10402                     eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
10403                   fi
10404                   last_robj=$output_objdir/$output_la-$k.$objext
10405                   func_arith $k + 1
10406                   k=$func_arith_result
10407                   output=$output_objdir/$output_la-$k.$objext
10408                   objlist=" $obj"
10409                   func_len " $last_robj"
10410                   func_arith $len0 + $func_len_result
10411                   len=$func_arith_result
10412                 fi
10413               done
10414               # Handle the remaining objects by creating one last
10415               # reloadable object file.  All subsequent reloadable object
10416               # files will link in the last one created.
10417               test -z "$concat_cmds" || concat_cmds=$concat_cmds~
10418               reload_objs="$objlist $last_robj"
10419               eval concat_cmds=\"\$concat_cmds$reload_cmds\"
10420               if test -n "$last_robj"; then
10421                 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
10422               fi
10423               func_append delfiles " $output"
10424 
10425             else
10426               output=
10427             fi
10428 
10429             ${skipped_export-false} && {
10430               func_verbose "generating symbol list for '$libname.la'"
10431               export_symbols=$output_objdir/$libname.exp
10432               $opt_dry_run || $RM $export_symbols
10433               libobjs=$output
10434               # Append the command to create the export file.
10435               test -z "$concat_cmds" || concat_cmds=$concat_cmds~
10436               eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
10437               if test -n "$last_robj"; then
10438                 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
10439               fi
10440             }
10441 
10442             test -n "$save_libobjs" &&
10443               func_verbose "creating a temporary reloadable object file: $output"
10444 
10445             # Loop through the commands generated above and execute them.
10446             save_ifs=$IFS; IFS='~'
10447             for cmd in $concat_cmds; do
10448               IFS=$save_ifs
10449               $opt_quiet || {
10450                   func_quote_for_expand "$cmd"
10451                   eval "func_echo $func_quote_for_expand_result"
10452               }
10453               $opt_dry_run || eval "$cmd" || {
10454                 lt_exit=$?
10455 
10456                 # Restore the uninstalled library and exit
10457                 if test relink = "$opt_mode"; then
10458                   ( cd "$output_objdir" && \
10459                     $RM "${realname}T" && \
10460                     $MV "${realname}U" "$realname" )
10461                 fi
10462 
10463                 exit $lt_exit
10464               }
10465             done
10466             IFS=$save_ifs
10467 
10468             if test -n "$export_symbols_regex" && ${skipped_export-false}; then
10469               func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
10470               func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
10471             fi
10472           fi
10473 
10474           ${skipped_export-false} && {
10475             if test -n "$export_symbols" && test -n "$include_expsyms"; then
10476               tmp_export_symbols=$export_symbols
10477               test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
10478               $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
10479             fi
10480 
10481             if test -n "$orig_export_symbols"; then
10482               # The given exports_symbols file has to be filtered, so filter it.
10483               func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
10484               # FIXME: $output_objdir/$libname.filter potentially contains lots of
10485               # 's' commands, which not all seds can handle. GNU sed should be fine
10486               # though. Also, the filter scales superlinearly with the number of
10487               # global variables. join(1) would be nice here, but unfortunately
10488               # isn't a blessed tool.
10489               $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
10490               func_append delfiles " $export_symbols $output_objdir/$libname.filter"
10491               export_symbols=$output_objdir/$libname.def
10492               $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
10493             fi
10494           }
10495 
10496           libobjs=$output
10497           # Restore the value of output.
10498           output=$save_output
10499 
10500           if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
10501             eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
10502             test "X$libobjs" = "X " && libobjs=
10503           fi
10504           # Expand the library linking commands again to reset the
10505           # value of $libobjs for piecewise linking.
10506 
10507           # Do each of the archive commands.
10508           if test yes = "$module" && test -n "$module_cmds"; then
10509             if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
10510               cmds=$module_expsym_cmds
10511             else
10512               cmds=$module_cmds
10513             fi
10514           else
10515             if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
10516               cmds=$archive_expsym_cmds
10517             else
10518               cmds=$archive_cmds
10519             fi
10520           fi
10521         fi
10522 
10523         if test -n "$delfiles"; then
10524           # Append the command to remove temporary files to $cmds.
10525           eval cmds=\"\$cmds~\$RM $delfiles\"
10526         fi
10527 
10528         # Add any objects from preloaded convenience libraries
10529         if test -n "$dlprefiles"; then
10530           gentop=$output_objdir/${outputname}x
10531           func_append generated " $gentop"
10532 
10533           func_extract_archives $gentop $dlprefiles
10534           func_append libobjs " $func_extract_archives_result"
10535           test "X$libobjs" = "X " && libobjs=
10536         fi
10537 
10538         save_ifs=$IFS; IFS='~'
10539         for cmd in $cmds; do
10540           IFS=$sp$nl
10541           eval cmd=\"$cmd\"
10542           IFS=$save_ifs
10543           $opt_quiet || {
10544             func_quote_for_expand "$cmd"
10545             eval "func_echo $func_quote_for_expand_result"
10546           }
10547           $opt_dry_run || eval "$cmd" || {
10548             lt_exit=$?
10549 
10550             # Restore the uninstalled library and exit
10551             if test relink = "$opt_mode"; then
10552               ( cd "$output_objdir" && \
10553                 $RM "${realname}T" && \
10554                 $MV "${realname}U" "$realname" )
10555             fi
10556 
10557             exit $lt_exit
10558           }
10559         done
10560         IFS=$save_ifs
10561 
10562         # Restore the uninstalled library and exit
10563         if test relink = "$opt_mode"; then
10564           $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
10565 
10566           if test -n "$convenience"; then
10567             if test -z "$whole_archive_flag_spec"; then
10568               func_show_eval '${RM}r "$gentop"'
10569             fi
10570           fi
10571 
10572           exit $EXIT_SUCCESS
10573         fi
10574 
10575         # Create links to the real library.
10576         for linkname in $linknames; do
10577           if test "$realname" != "$linkname"; then
10578             func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
10579           fi
10580         done
10581 
10582         # If -module or -export-dynamic was specified, set the dlname.
10583         if test yes = "$module" || test yes = "$export_dynamic"; then
10584           # On all known operating systems, these are identical.
10585           dlname=$soname
10586         fi
10587       fi
10588       ;;
10589 
10590     obj)
10591       if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
10592         func_warning "'-dlopen' is ignored for objects"
10593       fi
10594 
10595       case " $deplibs" in
10596       *\ -l* | *\ -L*)
10597         func_warning "'-l' and '-L' are ignored for objects" ;;
10598       esac
10599 
10600       test -n "$rpath" && \
10601         func_warning "'-rpath' is ignored for objects"
10602 
10603       test -n "$xrpath" && \
10604         func_warning "'-R' is ignored for objects"
10605 
10606       test -n "$vinfo" && \
10607         func_warning "'-version-info' is ignored for objects"
10608 
10609       test -n "$release" && \
10610         func_warning "'-release' is ignored for objects"
10611 
10612       case $output in
10613       *.lo)
10614         test -n "$objs$old_deplibs" && \
10615           func_fatal_error "cannot build library object '$output' from non-libtool objects"
10616 
10617         libobj=$output
10618         func_lo2o "$libobj"
10619         obj=$func_lo2o_result
10620         ;;
10621       *)
10622         libobj=
10623         obj=$output
10624         ;;
10625       esac
10626 
10627       # Delete the old objects.
10628       $opt_dry_run || $RM $obj $libobj
10629 
10630       # Objects from convenience libraries.  This assumes
10631       # single-version convenience libraries.  Whenever we create
10632       # different ones for PIC/non-PIC, this we'll have to duplicate
10633       # the extraction.
10634       reload_conv_objs=
10635       gentop=
10636       # if reload_cmds runs $LD directly, get rid of -Wl from
10637       # whole_archive_flag_spec and hope we can get by with turning comma
10638       # into space.
10639       case $reload_cmds in
10640         *\$LD[\ \$]*) wl= ;;
10641       esac
10642       if test -n "$convenience"; then
10643         if test -n "$whole_archive_flag_spec"; then
10644           eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
10645           test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
10646           reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
10647         else
10648           gentop=$output_objdir/${obj}x
10649           func_append generated " $gentop"
10650 
10651           func_extract_archives $gentop $convenience
10652           reload_conv_objs="$reload_objs $func_extract_archives_result"
10653         fi
10654       fi
10655 
10656       # If we're not building shared, we need to use non_pic_objs
10657       test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
10658 
10659       # Create the old-style object.
10660       reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
10661 
10662       output=$obj
10663       func_execute_cmds "$reload_cmds" 'exit $?'
10664 
10665       # Exit if we aren't doing a library object file.
10666       if test -z "$libobj"; then
10667         if test -n "$gentop"; then
10668           func_show_eval '${RM}r "$gentop"'
10669         fi
10670 
10671         exit $EXIT_SUCCESS
10672       fi
10673 
10674       test yes = "$build_libtool_libs" || {
10675         if test -n "$gentop"; then
10676           func_show_eval '${RM}r "$gentop"'
10677         fi
10678 
10679         # Create an invalid libtool object if no PIC, so that we don't
10680         # accidentally link it into a program.
10681         # $show "echo timestamp > $libobj"
10682         # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
10683         exit $EXIT_SUCCESS
10684       }
10685 
10686       if test -n "$pic_flag" || test default != "$pic_mode"; then
10687         # Only do commands if we really have different PIC objects.
10688         reload_objs="$libobjs $reload_conv_objs"
10689         output=$libobj
10690         func_execute_cmds "$reload_cmds" 'exit $?'
10691       fi
10692 
10693       if test -n "$gentop"; then
10694         func_show_eval '${RM}r "$gentop"'
10695       fi
10696 
10697       exit $EXIT_SUCCESS
10698       ;;
10699 
10700     prog)
10701       case $host in
10702         *cygwin*) func_stripname '' '.exe' "$output"
10703                   output=$func_stripname_result.exe;;
10704       esac
10705       test -n "$vinfo" && \
10706         func_warning "'-version-info' is ignored for programs"
10707 
10708       test -n "$release" && \
10709         func_warning "'-release' is ignored for programs"
10710 
10711       $preload \
10712         && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
10713         && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
10714 
10715       case $host in
10716       *-*-rhapsody* | *-*-darwin1.[012])
10717         # On Rhapsody replace the C library is the System framework
10718         compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
10719         finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
10720         ;;
10721       esac
10722 
10723       case $host in
10724       *-*-darwin*)
10725         # Don't allow lazy linking, it breaks C++ global constructors
10726         # But is supposedly fixed on 10.4 or later (yay!).
10727         if test CXX = "$tagname"; then
10728           case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
10729             10.[0123])
10730               func_append compile_command " $wl-bind_at_load"
10731               func_append finalize_command " $wl-bind_at_load"
10732             ;;
10733           esac
10734         fi
10735         # Time to change all our "foo.ltframework" stuff back to "-framework foo"
10736         compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
10737         finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
10738         ;;
10739       esac
10740 
10741 
10742       # move library search paths that coincide with paths to not yet
10743       # installed libraries to the beginning of the library search list
10744       new_libs=
10745       for path in $notinst_path; do
10746         case " $new_libs " in
10747         *" -L$path/$objdir "*) ;;
10748         *)
10749           case " $compile_deplibs " in
10750           *" -L$path/$objdir "*)
10751             func_append new_libs " -L$path/$objdir" ;;
10752           esac
10753           ;;
10754         esac
10755       done
10756       for deplib in $compile_deplibs; do
10757         case $deplib in
10758         -L*)
10759           case " $new_libs " in
10760           *" $deplib "*) ;;
10761           *) func_append new_libs " $deplib" ;;
10762           esac
10763           ;;
10764         *) func_append new_libs " $deplib" ;;
10765         esac
10766       done
10767       compile_deplibs=$new_libs
10768 
10769 
10770       func_append compile_command " $compile_deplibs"
10771       func_append finalize_command " $finalize_deplibs"
10772 
10773       if test -n "$rpath$xrpath"; then
10774         # If the user specified any rpath flags, then add them.
10775         for libdir in $rpath $xrpath; do
10776           # This is the magic to use -rpath.
10777           case "$finalize_rpath " in
10778           *" $libdir "*) ;;
10779           *) func_append finalize_rpath " $libdir" ;;
10780           esac
10781         done
10782       fi
10783 
10784       # Now hardcode the library paths
10785       rpath=
10786       hardcode_libdirs=
10787       for libdir in $compile_rpath $finalize_rpath; do
10788         if test -n "$hardcode_libdir_flag_spec"; then
10789           if test -n "$hardcode_libdir_separator"; then
10790             if test -z "$hardcode_libdirs"; then
10791               hardcode_libdirs=$libdir
10792             else
10793               # Just accumulate the unique libdirs.
10794               case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
10795               *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
10796                 ;;
10797               *)
10798                 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
10799                 ;;
10800               esac
10801             fi
10802           else
10803             eval flag=\"$hardcode_libdir_flag_spec\"
10804             func_append rpath " $flag"
10805           fi
10806         elif test -n "$runpath_var"; then
10807           case "$perm_rpath " in
10808           *" $libdir "*) ;;
10809           *) func_append perm_rpath " $libdir" ;;
10810           esac
10811         fi
10812         case $host in
10813         *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
10814           testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
10815           case :$dllsearchpath: in
10816           *":$libdir:"*) ;;
10817           ::) dllsearchpath=$libdir;;
10818           *) func_append dllsearchpath ":$libdir";;
10819           esac
10820           case :$dllsearchpath: in
10821           *":$testbindir:"*) ;;
10822           ::) dllsearchpath=$testbindir;;
10823           *) func_append dllsearchpath ":$testbindir";;
10824           esac
10825           ;;
10826         esac
10827       done
10828       # Substitute the hardcoded libdirs into the rpath.
10829       if test -n "$hardcode_libdir_separator" &&
10830          test -n "$hardcode_libdirs"; then
10831         libdir=$hardcode_libdirs
10832         eval rpath=\" $hardcode_libdir_flag_spec\"
10833       fi
10834       compile_rpath=$rpath
10835 
10836       rpath=
10837       hardcode_libdirs=
10838       for libdir in $finalize_rpath; do
10839         if test -n "$hardcode_libdir_flag_spec"; then
10840           if test -n "$hardcode_libdir_separator"; then
10841             if test -z "$hardcode_libdirs"; then
10842               hardcode_libdirs=$libdir
10843             else
10844               # Just accumulate the unique libdirs.
10845               case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
10846               *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
10847                 ;;
10848               *)
10849                 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
10850                 ;;
10851               esac
10852             fi
10853           else
10854             eval flag=\"$hardcode_libdir_flag_spec\"
10855             func_append rpath " $flag"
10856           fi
10857         elif test -n "$runpath_var"; then
10858           case "$finalize_perm_rpath " in
10859           *" $libdir "*) ;;
10860           *) func_append finalize_perm_rpath " $libdir" ;;
10861           esac
10862         fi
10863       done
10864       # Substitute the hardcoded libdirs into the rpath.
10865       if test -n "$hardcode_libdir_separator" &&
10866          test -n "$hardcode_libdirs"; then
10867         libdir=$hardcode_libdirs
10868         eval rpath=\" $hardcode_libdir_flag_spec\"
10869       fi
10870       finalize_rpath=$rpath
10871 
10872       if test -n "$libobjs" && test yes = "$build_old_libs"; then
10873         # Transform all the library objects into standard objects.
10874         compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
10875         finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
10876       fi
10877 
10878       func_generate_dlsyms "$outputname" "@PROGRAM@" false
10879 
10880       # template prelinking step
10881       if test -n "$prelink_cmds"; then
10882         func_execute_cmds "$prelink_cmds" 'exit $?'
10883       fi
10884 
10885       wrappers_required=:
10886       case $host in
10887       *cegcc* | *mingw32ce*)
10888         # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
10889         wrappers_required=false
10890         ;;
10891       *cygwin* | *mingw* )
10892         test yes = "$build_libtool_libs" || wrappers_required=false
10893         ;;
10894       *)
10895         if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
10896           wrappers_required=false
10897         fi
10898         ;;
10899       esac
10900       $wrappers_required || {
10901         # Replace the output file specification.
10902         compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
10903         link_command=$compile_command$compile_rpath
10904 
10905         # We have no uninstalled library dependencies, so finalize right now.
10906         exit_status=0
10907         func_show_eval "$link_command" 'exit_status=$?'
10908 
10909         if test -n "$postlink_cmds"; then
10910           func_to_tool_file "$output"
10911           postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
10912           func_execute_cmds "$postlink_cmds" 'exit $?'
10913         fi
10914 
10915         # Delete the generated files.
10916         if test -f "$output_objdir/${outputname}S.$objext"; then
10917           func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
10918         fi
10919 
10920         exit $exit_status
10921       }
10922 
10923       if test -n "$compile_shlibpath$finalize_shlibpath"; then
10924         compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
10925       fi
10926       if test -n "$finalize_shlibpath"; then
10927         finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
10928       fi
10929 
10930       compile_var=
10931       finalize_var=
10932       if test -n "$runpath_var"; then
10933         if test -n "$perm_rpath"; then
10934           # We should set the runpath_var.
10935           rpath=
10936           for dir in $perm_rpath; do
10937             func_append rpath "$dir:"
10938           done
10939           compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
10940         fi
10941         if test -n "$finalize_perm_rpath"; then
10942           # We should set the runpath_var.
10943           rpath=
10944           for dir in $finalize_perm_rpath; do
10945             func_append rpath "$dir:"
10946           done
10947           finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
10948         fi
10949       fi
10950 
10951       if test yes = "$no_install"; then
10952         # We don't need to create a wrapper script.
10953         link_command=$compile_var$compile_command$compile_rpath
10954         # Replace the output file specification.
10955         link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
10956         # Delete the old output file.
10957         $opt_dry_run || $RM $output
10958         # Link the executable and exit
10959         func_show_eval "$link_command" 'exit $?'
10960 
10961         if test -n "$postlink_cmds"; then
10962           func_to_tool_file "$output"
10963           postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
10964           func_execute_cmds "$postlink_cmds" 'exit $?'
10965         fi
10966 
10967         exit $EXIT_SUCCESS
10968       fi
10969 
10970       case $hardcode_action,$fast_install in
10971         relink,*)
10972           # Fast installation is not supported
10973           link_command=$compile_var$compile_command$compile_rpath
10974           relink_command=$finalize_var$finalize_command$finalize_rpath
10975 
10976           func_warning "this platform does not like uninstalled shared libraries"
10977           func_warning "'$output' will be relinked during installation"
10978           ;;
10979         *,yes)
10980           link_command=$finalize_var$compile_command$finalize_rpath
10981           relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
10982           ;;
10983         *,no)
10984           link_command=$compile_var$compile_command$compile_rpath
10985           relink_command=$finalize_var$finalize_command$finalize_rpath
10986           ;;
10987         *,needless)
10988           link_command=$finalize_var$compile_command$finalize_rpath
10989           relink_command=
10990           ;;
10991       esac
10992 
10993       # Replace the output file specification.
10994       link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
10995 
10996       # Delete the old output files.
10997       $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
10998 
10999       func_show_eval "$link_command" 'exit $?'
11000 
11001       if test -n "$postlink_cmds"; then
11002         func_to_tool_file "$output_objdir/$outputname"
11003         postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
11004         func_execute_cmds "$postlink_cmds" 'exit $?'
11005       fi
11006 
11007       # Now create the wrapper script.
11008       func_verbose "creating $output"
11009 
11010       # Quote the relink command for shipping.
11011       if test -n "$relink_command"; then
11012         # Preserve any variables that may affect compiler behavior
11013         for var in $variables_saved_for_relink; do
11014           if eval test -z \"\${$var+set}\"; then
11015             relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
11016           elif eval var_value=\$$var; test -z "$var_value"; then
11017             relink_command="$var=; export $var; $relink_command"
11018           else
11019             func_quote_for_eval "$var_value"
11020             relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
11021           fi
11022         done
11023         relink_command="(cd `pwd`; $relink_command)"
11024         relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
11025       fi
11026 
11027       # Only actually do things if not in dry run mode.
11028       $opt_dry_run || {
11029         # win32 will think the script is a binary if it has
11030         # a .exe suffix, so we strip it off here.
11031         case $output in
11032           *.exe) func_stripname '' '.exe' "$output"
11033                  output=$func_stripname_result ;;
11034         esac
11035         # test for cygwin because mv fails w/o .exe extensions
11036         case $host in
11037           *cygwin*)
11038             exeext=.exe
11039             func_stripname '' '.exe' "$outputname"
11040             outputname=$func_stripname_result ;;
11041           *) exeext= ;;
11042         esac
11043         case $host in
11044           *cygwin* | *mingw* )
11045             func_dirname_and_basename "$output" "" "."
11046             output_name=$func_basename_result
11047             output_path=$func_dirname_result
11048             cwrappersource=$output_path/$objdir/lt-$output_name.c
11049             cwrapper=$output_path/$output_name.exe
11050             $RM $cwrappersource $cwrapper
11051             trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
11052 
11053             func_emit_cwrapperexe_src > $cwrappersource
11054 
11055             # The wrapper executable is built using the $host compiler,
11056             # because it contains $host paths and files. If cross-
11057             # compiling, it, like the target executable, must be
11058             # executed on the $host or under an emulation environment.
11059             $opt_dry_run || {
11060               $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
11061               $STRIP $cwrapper
11062             }
11063 
11064             # Now, create the wrapper script for func_source use:
11065             func_ltwrapper_scriptname $cwrapper
11066             $RM $func_ltwrapper_scriptname_result
11067             trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
11068             $opt_dry_run || {
11069               # note: this script will not be executed, so do not chmod.
11070               if test "x$build" = "x$host"; then
11071                 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
11072               else
11073                 func_emit_wrapper no > $func_ltwrapper_scriptname_result
11074               fi
11075             }
11076           ;;
11077           * )
11078             $RM $output
11079             trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
11080 
11081             func_emit_wrapper no > $output
11082             chmod +x $output
11083           ;;
11084         esac
11085       }
11086       exit $EXIT_SUCCESS
11087       ;;
11088     esac
11089 
11090     # See if we need to build an old-fashioned archive.
11091     for oldlib in $oldlibs; do
11092 
11093       case $build_libtool_libs in
11094         convenience)
11095           oldobjs="$libobjs_save $symfileobj"
11096           addlibs=$convenience
11097           build_libtool_libs=no
11098           ;;
11099         module)
11100           oldobjs=$libobjs_save
11101           addlibs=$old_convenience
11102           build_libtool_libs=no
11103           ;;
11104         *)
11105           oldobjs="$old_deplibs $non_pic_objects"
11106           $preload && test -f "$symfileobj" \
11107             && func_append oldobjs " $symfileobj"
11108           addlibs=$old_convenience
11109           ;;
11110       esac
11111 
11112       if test -n "$addlibs"; then
11113         gentop=$output_objdir/${outputname}x
11114         func_append generated " $gentop"
11115 
11116         func_extract_archives $gentop $addlibs
11117         func_append oldobjs " $func_extract_archives_result"
11118       fi
11119 
11120       # Do each command in the archive commands.
11121       if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
11122         cmds=$old_archive_from_new_cmds
11123       else
11124 
11125         # Add any objects from preloaded convenience libraries
11126         if test -n "$dlprefiles"; then
11127           gentop=$output_objdir/${outputname}x
11128           func_append generated " $gentop"
11129 
11130           func_extract_archives $gentop $dlprefiles
11131           func_append oldobjs " $func_extract_archives_result"
11132         fi
11133 
11134         # POSIX demands no paths to be encoded in archives.  We have
11135         # to avoid creating archives with duplicate basenames if we
11136         # might have to extract them afterwards, e.g., when creating a
11137         # static archive out of a convenience library, or when linking
11138         # the entirety of a libtool archive into another (currently
11139         # not supported by libtool).
11140         if (for obj in $oldobjs
11141             do
11142               func_basename "$obj"
11143               $ECHO "$func_basename_result"
11144             done | sort | sort -uc >/dev/null 2>&1); then
11145           :
11146         else
11147           echo "copying selected object files to avoid basename conflicts..."
11148           gentop=$output_objdir/${outputname}x
11149           func_append generated " $gentop"
11150           func_mkdir_p "$gentop"
11151           save_oldobjs=$oldobjs
11152           oldobjs=
11153           counter=1
11154           for obj in $save_oldobjs
11155           do
11156             func_basename "$obj"
11157             objbase=$func_basename_result
11158             case " $oldobjs " in
11159             " ") oldobjs=$obj ;;
11160             *[\ /]"$objbase "*)
11161               while :; do
11162                 # Make sure we don't pick an alternate name that also
11163                 # overlaps.
11164                 newobj=lt$counter-$objbase
11165                 func_arith $counter + 1
11166                 counter=$func_arith_result
11167                 case " $oldobjs " in
11168                 *[\ /]"$newobj "*) ;;
11169                 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
11170                 esac
11171               done
11172               func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
11173               func_append oldobjs " $gentop/$newobj"
11174               ;;
11175             *) func_append oldobjs " $obj" ;;
11176             esac
11177           done
11178         fi
11179         func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
11180         tool_oldlib=$func_to_tool_file_result
11181         eval cmds=\"$old_archive_cmds\"
11182 
11183         func_len " $cmds"
11184         len=$func_len_result
11185         if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
11186           cmds=$old_archive_cmds
11187         elif test -n "$archiver_list_spec"; then
11188           func_verbose "using command file archive linking..."
11189           for obj in $oldobjs
11190           do
11191             func_to_tool_file "$obj"
11192             $ECHO "$func_to_tool_file_result"
11193           done > $output_objdir/$libname.libcmd
11194           func_to_tool_file "$output_objdir/$libname.libcmd"
11195           oldobjs=" $archiver_list_spec$func_to_tool_file_result"
11196           cmds=$old_archive_cmds
11197         else
11198           # the command line is too long to link in one step, link in parts
11199           func_verbose "using piecewise archive linking..."
11200           save_RANLIB=$RANLIB
11201           RANLIB=:
11202           objlist=
11203           concat_cmds=
11204           save_oldobjs=$oldobjs
11205           oldobjs=
11206           # Is there a better way of finding the last object in the list?
11207           for obj in $save_oldobjs
11208           do
11209             last_oldobj=$obj
11210           done
11211           eval test_cmds=\"$old_archive_cmds\"
11212           func_len " $test_cmds"
11213           len0=$func_len_result
11214           len=$len0
11215           for obj in $save_oldobjs
11216           do
11217             func_len " $obj"
11218             func_arith $len + $func_len_result
11219             len=$func_arith_result
11220             func_append objlist " $obj"
11221             if test "$len" -lt "$max_cmd_len"; then
11222               :
11223             else
11224               # the above command should be used before it gets too long
11225               oldobjs=$objlist
11226               if test "$obj" = "$last_oldobj"; then
11227                 RANLIB=$save_RANLIB
11228               fi
11229               test -z "$concat_cmds" || concat_cmds=$concat_cmds~
11230               eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
11231               objlist=
11232               len=$len0
11233             fi
11234           done
11235           RANLIB=$save_RANLIB
11236           oldobjs=$objlist
11237           if test -z "$oldobjs"; then
11238             eval cmds=\"\$concat_cmds\"
11239           else
11240             eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
11241           fi
11242         fi
11243       fi
11244       func_execute_cmds "$cmds" 'exit $?'
11245     done
11246 
11247     test -n "$generated" && \
11248       func_show_eval "${RM}r$generated"
11249 
11250     # Now create the libtool archive.
11251     case $output in
11252     *.la)
11253       old_library=
11254       test yes = "$build_old_libs" && old_library=$libname.$libext
11255       func_verbose "creating $output"
11256 
11257       # Preserve any variables that may affect compiler behavior
11258       for var in $variables_saved_for_relink; do
11259         if eval test -z \"\${$var+set}\"; then
11260           relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
11261         elif eval var_value=\$$var; test -z "$var_value"; then
11262           relink_command="$var=; export $var; $relink_command"
11263         else
11264           func_quote_for_eval "$var_value"
11265           relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
11266         fi
11267       done
11268       # Quote the link command for shipping.
11269       relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
11270       relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
11271       if test yes = "$hardcode_automatic"; then
11272         relink_command=
11273       fi
11274 
11275       # Only create the output if not a dry run.
11276       $opt_dry_run || {
11277         for installed in no yes; do
11278           if test yes = "$installed"; then
11279             if test -z "$install_libdir"; then
11280               break
11281             fi
11282             output=$output_objdir/${outputname}i
11283             # Replace all uninstalled libtool libraries with the installed ones
11284             newdependency_libs=
11285             for deplib in $dependency_libs; do
11286               case $deplib in
11287               *.la)
11288                 func_basename "$deplib"
11289                 name=$func_basename_result
11290                 func_resolve_sysroot "$deplib"
11291                 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
11292                 test -z "$libdir" && \
11293                   func_fatal_error "'$deplib' is not a valid libtool archive"
11294                 func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
11295                 ;;
11296               -L*)
11297                 func_stripname -L '' "$deplib"
11298                 func_replace_sysroot "$func_stripname_result"
11299                 func_append newdependency_libs " -L$func_replace_sysroot_result"
11300                 ;;
11301               -R*)
11302                 func_stripname -R '' "$deplib"
11303                 func_replace_sysroot "$func_stripname_result"
11304                 func_append newdependency_libs " -R$func_replace_sysroot_result"
11305                 ;;
11306               *) func_append newdependency_libs " $deplib" ;;
11307               esac
11308             done
11309             dependency_libs=$newdependency_libs
11310             newdlfiles=
11311 
11312             for lib in $dlfiles; do
11313               case $lib in
11314               *.la)
11315                 func_basename "$lib"
11316                 name=$func_basename_result
11317                 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
11318                 test -z "$libdir" && \
11319                   func_fatal_error "'$lib' is not a valid libtool archive"
11320                 func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
11321                 ;;
11322               *) func_append newdlfiles " $lib" ;;
11323               esac
11324             done
11325             dlfiles=$newdlfiles
11326             newdlprefiles=
11327             for lib in $dlprefiles; do
11328               case $lib in
11329               *.la)
11330                 # Only pass preopened files to the pseudo-archive (for
11331                 # eventual linking with the app. that links it) if we
11332                 # didn't already link the preopened objects directly into
11333                 # the library:
11334                 func_basename "$lib"
11335                 name=$func_basename_result
11336                 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
11337                 test -z "$libdir" && \
11338                   func_fatal_error "'$lib' is not a valid libtool archive"
11339                 func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
11340                 ;;
11341               esac
11342             done
11343             dlprefiles=$newdlprefiles
11344           else
11345             newdlfiles=
11346             for lib in $dlfiles; do
11347               case $lib in
11348                 [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
11349                 *) abs=`pwd`"/$lib" ;;
11350               esac
11351               func_append newdlfiles " $abs"
11352             done
11353             dlfiles=$newdlfiles
11354             newdlprefiles=
11355             for lib in $dlprefiles; do
11356               case $lib in
11357                 [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
11358                 *) abs=`pwd`"/$lib" ;;
11359               esac
11360               func_append newdlprefiles " $abs"
11361             done
11362             dlprefiles=$newdlprefiles
11363           fi
11364           $RM $output
11365           # place dlname in correct position for cygwin
11366           # In fact, it would be nice if we could use this code for all target
11367           # systems that can't hard-code library paths into their executables
11368           # and that have no shared library path variable independent of PATH,
11369           # but it turns out we can't easily determine that from inspecting
11370           # libtool variables, so we have to hard-code the OSs to which it
11371           # applies here; at the moment, that means platforms that use the PE
11372           # object format with DLL files.  See the long comment at the top of
11373           # tests/bindir.at for full details.
11374           tdlname=$dlname
11375           case $host,$output,$installed,$module,$dlname in
11376             *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
11377               # If a -bindir argument was supplied, place the dll there.
11378               if test -n "$bindir"; then
11379                 func_relative_path "$install_libdir" "$bindir"
11380                 tdlname=$func_relative_path_result/$dlname
11381               else
11382                 # Otherwise fall back on heuristic.
11383                 tdlname=../bin/$dlname
11384               fi
11385               ;;
11386           esac
11387           $ECHO > $output "\
11388 # $outputname - a libtool library file
11389 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
11390 #
11391 # Please DO NOT delete this file!
11392 # It is necessary for linking the library.
11393 
11394 # The name that we can dlopen(3).
11395 dlname='$tdlname'
11396 
11397 # Names of this library.
11398 library_names='$library_names'
11399 
11400 # The name of the static archive.
11401 old_library='$old_library'
11402 
11403 # Linker flags that cannot go in dependency_libs.
11404 inherited_linker_flags='$new_inherited_linker_flags'
11405 
11406 # Libraries that this one depends upon.
11407 dependency_libs='$dependency_libs'
11408 
11409 # Names of additional weak libraries provided by this library
11410 weak_library_names='$weak_libs'
11411 
11412 # Version information for $libname.
11413 current=$current
11414 age=$age
11415 revision=$revision
11416 
11417 # Is this an already installed library?
11418 installed=$installed
11419 
11420 # Should we warn about portability when linking against -modules?
11421 shouldnotlink=$module
11422 
11423 # Files to dlopen/dlpreopen
11424 dlopen='$dlfiles'
11425 dlpreopen='$dlprefiles'
11426 
11427 # Directory that this library needs to be installed in:
11428 libdir='$install_libdir'"
11429           if test no,yes = "$installed,$need_relink"; then
11430             $ECHO >> $output "\
11431 relink_command=\"$relink_command\""
11432           fi
11433         done
11434       }
11435 
11436       # Do a symbolic link so that the libtool archive can be found in
11437       # LD_LIBRARY_PATH before the program is installed.
11438       func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
11439       ;;
11440     esac
11441     exit $EXIT_SUCCESS
11442 }
11443 
11444 if test link = "$opt_mode" || test relink = "$opt_mode"; then
11445   func_mode_link ${1+"$@"}
11446 fi
11447 
11448 
11449 # func_mode_uninstall arg...
11450 func_mode_uninstall ()
11451 {
11452     $debug_cmd
11453 
11454     RM=$nonopt
11455     files=
11456     rmforce=false
11457     exit_status=0
11458 
11459     # This variable tells wrapper scripts just to set variables rather
11460     # than running their programs.
11461     libtool_install_magic=$magic
11462 
11463     for arg
11464     do
11465       case $arg in
11466       -f) func_append RM " $arg"; rmforce=: ;;
11467       -*) func_append RM " $arg" ;;
11468       *) func_append files " $arg" ;;
11469       esac
11470     done
11471 
11472     test -z "$RM" && \
11473       func_fatal_help "you must specify an RM program"
11474 
11475     rmdirs=
11476 
11477     for file in $files; do
11478       func_dirname "$file" "" "."
11479       dir=$func_dirname_result
11480       if test . = "$dir"; then
11481         odir=$objdir
11482       else
11483         odir=$dir/$objdir
11484       fi
11485       func_basename "$file"
11486       name=$func_basename_result
11487       test uninstall = "$opt_mode" && odir=$dir
11488 
11489       # Remember odir for removal later, being careful to avoid duplicates
11490       if test clean = "$opt_mode"; then
11491         case " $rmdirs " in
11492           *" $odir "*) ;;
11493           *) func_append rmdirs " $odir" ;;
11494         esac
11495       fi
11496 
11497       # Don't error if the file doesn't exist and rm -f was used.
11498       if { test -L "$file"; } >/dev/null 2>&1 ||
11499          { test -h "$file"; } >/dev/null 2>&1 ||
11500          test -f "$file"; then
11501         :
11502       elif test -d "$file"; then
11503         exit_status=1
11504         continue
11505       elif $rmforce; then
11506         continue
11507       fi
11508 
11509       rmfiles=$file
11510 
11511       case $name in
11512       *.la)
11513         # Possibly a libtool archive, so verify it.
11514         if func_lalib_p "$file"; then
11515           func_source $dir/$name
11516 
11517           # Delete the libtool libraries and symlinks.
11518           for n in $library_names; do
11519             func_append rmfiles " $odir/$n"
11520           done
11521           test -n "$old_library" && func_append rmfiles " $odir/$old_library"
11522 
11523           case $opt_mode in
11524           clean)
11525             case " $library_names " in
11526             *" $dlname "*) ;;
11527             *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
11528             esac
11529             test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
11530             ;;
11531           uninstall)
11532             if test -n "$library_names"; then
11533               # Do each command in the postuninstall commands.
11534               func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
11535             fi
11536 
11537             if test -n "$old_library"; then
11538               # Do each command in the old_postuninstall commands.
11539               func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
11540             fi
11541             # FIXME: should reinstall the best remaining shared library.
11542             ;;
11543           esac
11544         fi
11545         ;;
11546 
11547       *.lo)
11548         # Possibly a libtool object, so verify it.
11549         if func_lalib_p "$file"; then
11550 
11551           # Read the .lo file
11552           func_source $dir/$name
11553 
11554           # Add PIC object to the list of files to remove.
11555           if test -n "$pic_object" && test none != "$pic_object"; then
11556             func_append rmfiles " $dir/$pic_object"
11557           fi
11558 
11559           # Add non-PIC object to the list of files to remove.
11560           if test -n "$non_pic_object" && test none != "$non_pic_object"; then
11561             func_append rmfiles " $dir/$non_pic_object"
11562           fi
11563         fi
11564         ;;
11565 
11566       *)
11567         if test clean = "$opt_mode"; then
11568           noexename=$name
11569           case $file in
11570           *.exe)
11571             func_stripname '' '.exe' "$file"
11572             file=$func_stripname_result
11573             func_stripname '' '.exe' "$name"
11574             noexename=$func_stripname_result
11575             # $file with .exe has already been added to rmfiles,
11576             # add $file without .exe
11577             func_append rmfiles " $file"
11578             ;;
11579           esac
11580           # Do a test to see if this is a libtool program.
11581           if func_ltwrapper_p "$file"; then
11582             if func_ltwrapper_executable_p "$file"; then
11583               func_ltwrapper_scriptname "$file"
11584               relink_command=
11585               func_source $func_ltwrapper_scriptname_result
11586               func_append rmfiles " $func_ltwrapper_scriptname_result"
11587             else
11588               relink_command=
11589               func_source $dir/$noexename
11590             fi
11591 
11592             # note $name still contains .exe if it was in $file originally
11593             # as does the version of $file that was added into $rmfiles
11594             func_append rmfiles " $odir/$name $odir/${name}S.$objext"
11595             if test yes = "$fast_install" && test -n "$relink_command"; then
11596               func_append rmfiles " $odir/lt-$name"
11597             fi
11598             if test "X$noexename" != "X$name"; then
11599               func_append rmfiles " $odir/lt-$noexename.c"
11600             fi
11601           fi
11602         fi
11603         ;;
11604       esac
11605       func_show_eval "$RM $rmfiles" 'exit_status=1'
11606     done
11607 
11608     # Try to remove the $objdir's in the directories where we deleted files
11609     for dir in $rmdirs; do
11610       if test -d "$dir"; then
11611         func_show_eval "rmdir $dir >/dev/null 2>&1"
11612       fi
11613     done
11614 
11615     exit $exit_status
11616 }
11617 
11618 if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
11619   func_mode_uninstall ${1+"$@"}
11620 fi
11621 
11622 test -z "$opt_mode" && {
11623   help=$generic_help
11624   func_fatal_help "you must specify a MODE"
11625 }
11626 
11627 test -z "$exec_cmd" && \
11628   func_fatal_help "invalid operation mode '$opt_mode'"
11629 
11630 if test -n "$exec_cmd"; then
11631   eval exec "$exec_cmd"
11632   exit $EXIT_FAILURE
11633 fi
11634 
11635 exit $exit_status
11636 
11637 
11638 # The TAGs below are defined such that we never get into a situation
11639 # where we disable both kinds of libraries.  Given conflicting
11640 # choices, we go for a static library, that is the most portable,
11641 # since we can't tell whether shared libraries were disabled because
11642 # the user asked for that or because the platform doesn't support
11643 # them.  This is particularly important on AIX, because we don't
11644 # support having both static and shared libraries enabled at the same
11645 # time on that platform, so we default to a shared-only configuration.
11646 # If a disable-shared tag is given, we'll fallback to a static-only
11647 # configuration.  But we'll never go from static-only to shared-only.
11648 
11649 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
11650 build_libtool_libs=no
11651 build_old_libs=yes
11652 # ### END LIBTOOL TAG CONFIG: disable-shared
11653 
11654 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
11655 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
11656 # ### END LIBTOOL TAG CONFIG: disable-static
11657 
11658 # Local Variables:
11659 # mode:shell-script
11660 # sh-indentation:2
11661 # End:
11662 
11663 # ### BEGIN LIBTOOL TAG CONFIG: CXX
11664 
11665 # The linker used to build libraries.
11666 LD="/cvmfs/sphenix.sdcc.bnl.gov/alma9.2-gcc-14.2.0/opt/sphenix/core/binutils/2.40-acaab/x86_64-el9/bin/ld -m elf_x86_64"
11667 
11668 # How to create reloadable object files.
11669 reload_flag=" -r"
11670 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
11671 
11672 # Commands used to build an old-style archive.
11673 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
11674 
11675 # A language specific compiler.
11676 CC="/cvmfs/sphenix.sdcc.bnl.gov/alma9.2-gcc-14.2.0/opt/sphenix/core/gcc/14.2.0-2f0a0/x86_64-el9/bin/g++"
11677 
11678 # Is the compiler the GNU compiler?
11679 with_gcc=yes
11680 
11681 # Compiler flag to turn off builtin functions.
11682 no_builtin_flag=" -fno-builtin"
11683 
11684 # Additional compiler flags for building library objects.
11685 pic_flag=" -fPIC -DPIC"
11686 
11687 # How to pass a linker flag through the compiler.
11688 wl="-Wl,"
11689 
11690 # Compiler flag to prevent dynamic linking.
11691 link_static_flag=""
11692 
11693 # Does compiler simultaneously support -c and -o options?
11694 compiler_c_o="yes"
11695 
11696 # Whether or not to add -lc for building shared libraries.
11697 build_libtool_need_lc=no
11698 
11699 # Whether or not to disallow shared libs when runtime libs are static.
11700 allow_libtool_libs_with_static_runtimes=no
11701 
11702 # Compiler flag to allow reflexive dlopens.
11703 export_dynamic_flag_spec="\$wl--export-dynamic"
11704 
11705 # Compiler flag to generate shared objects directly from archives.
11706 whole_archive_flag_spec="\$wl--whole-archive\$convenience \$wl--no-whole-archive"
11707 
11708 # Whether the compiler copes with passing no objects directly.
11709 compiler_needs_object="no"
11710 
11711 # Create an old-style archive from a shared archive.
11712 old_archive_from_new_cmds=""
11713 
11714 # Create a temporary old-style archive to link instead of a shared archive.
11715 old_archive_from_expsyms_cmds=""
11716 
11717 # Commands used to build a shared archive.
11718 archive_cmds="\$CC \$pic_flag -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \$wl-soname \$wl\$soname -o \$lib"
11719 archive_expsym_cmds="\$CC \$pic_flag -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \$wl-soname \$wl\$soname \$wl-retain-symbols-file \$wl\$export_symbols -o \$lib"
11720 
11721 # Commands used to build a loadable module if different from building
11722 # a shared archive.
11723 module_cmds=""
11724 module_expsym_cmds=""
11725 
11726 # Whether we are building with GNU ld or not.
11727 with_gnu_ld="yes"
11728 
11729 # Flag that allows shared libraries with undefined symbols to be built.
11730 allow_undefined_flag=""
11731 
11732 # Flag that enforces no undefined symbols.
11733 no_undefined_flag=""
11734 
11735 # Flag to hardcode $libdir into a binary during linking.
11736 # This must work even if $libdir does not exist
11737 hardcode_libdir_flag_spec="\$wl-rpath \$wl\$libdir"
11738 
11739 # Whether we need a single "-rpath" flag with a separated argument.
11740 hardcode_libdir_separator=""
11741 
11742 # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
11743 # DIR into the resulting binary.
11744 hardcode_direct=no
11745 
11746 # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
11747 # DIR into the resulting binary and the resulting library dependency is
11748 # "absolute",i.e impossible to change by setting $shlibpath_var if the
11749 # library is relocated.
11750 hardcode_direct_absolute=no
11751 
11752 # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
11753 # into the resulting binary.
11754 hardcode_minus_L=no
11755 
11756 # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
11757 # into the resulting binary.
11758 hardcode_shlibpath_var=unsupported
11759 
11760 # Set to "yes" if building a shared library automatically hardcodes DIR
11761 # into the library and all subsequent libraries and executables linked
11762 # against it.
11763 hardcode_automatic=no
11764 
11765 # Set to yes if linker adds runtime paths of dependent libraries
11766 # to runtime path list.
11767 inherit_rpath=no
11768 
11769 # Whether libtool must link a program against all its dependency libraries.
11770 link_all_deplibs=unknown
11771 
11772 # Set to "yes" if exported symbols are required.
11773 always_export_symbols=no
11774 
11775 # The commands to list exported symbols.
11776 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
11777 
11778 # Symbols that should not be listed in the preloaded symbols.
11779 exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
11780 
11781 # Symbols that must always be exported.
11782 include_expsyms=""
11783 
11784 # Commands necessary for linking programs (against libraries) with templates.
11785 prelink_cmds=""
11786 
11787 # Commands necessary for finishing linking programs.
11788 postlink_cmds=""
11789 
11790 # Specify filename containing input files.
11791 file_list_spec=""
11792 
11793 # How to hardcode a shared library path into an executable.
11794 hardcode_action=immediate
11795 
11796 # The directories searched by this compiler when creating a shared library.
11797 compiler_lib_search_dirs="/cvmfs/sphenix.sdcc.bnl.gov/alma9.2-gcc-14.2.0/opt/sphenix/core/gcc/14.2.0-2f0a0/x86_64-el9/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0 /cvmfs/sphenix.sdcc.bnl.gov/alma9.2-gcc-14.2.0/opt/sphenix/core/gcc/14.2.0-2f0a0/x86_64-el9/bin/../lib/gcc /cvmfs/sphenix.sdcc.bnl.gov/alma9.2-gcc-14.2.0/opt/sphenix/core/gcc/14.2.0-2f0a0/x86_64-el9/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../lib64 /lib/../lib64 /usr/lib/../lib64 /cvmfs/sphenix.sdcc.bnl.gov/alma9.2-gcc-14.2.0/opt/sphenix/core/gcc/14.2.0-2f0a0/x86_64-el9/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../.."
11798 
11799 # Dependencies to place before and after the objects being linked to
11800 # create a shared library.
11801 predep_objects="/lib/../lib64/crti.o /cvmfs/sphenix.sdcc.bnl.gov/alma9.2-gcc-14.2.0/opt/sphenix/core/gcc/14.2.0-2f0a0/x86_64-el9/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/crtbeginS.o"
11802 postdep_objects="/cvmfs/sphenix.sdcc.bnl.gov/alma9.2-gcc-14.2.0/opt/sphenix/core/gcc/14.2.0-2f0a0/x86_64-el9/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/crtendS.o /lib/../lib64/crtn.o"
11803 predeps=""
11804 postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
11805 
11806 # The library search path used internally by the compiler when linking
11807 # a shared library.
11808 compiler_lib_search_path="-L/cvmfs/sphenix.sdcc.bnl.gov/alma9.2-gcc-14.2.0/opt/sphenix/core/gcc/14.2.0-2f0a0/x86_64-el9/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0 -L/cvmfs/sphenix.sdcc.bnl.gov/alma9.2-gcc-14.2.0/opt/sphenix/core/gcc/14.2.0-2f0a0/x86_64-el9/bin/../lib/gcc -L/cvmfs/sphenix.sdcc.bnl.gov/alma9.2-gcc-14.2.0/opt/sphenix/core/gcc/14.2.0-2f0a0/x86_64-el9/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/cvmfs/sphenix.sdcc.bnl.gov/alma9.2-gcc-14.2.0/opt/sphenix/core/gcc/14.2.0-2f0a0/x86_64-el9/bin/../lib/gcc/x86_64-pc-linux-gnu/14.2.0/../../.."
11809 
11810 # ### END LIBTOOL TAG CONFIG: CXX