Annotation of embedaddon/ipsec-tools/libtool, revision 1.1.1.1.2.3.2.1

1.1       misho       1: #! /bin/sh
                      2: 
                      3: # libtool - Provide generalized library-building support services.
1.1.1.1.2.3.2  1(misho     4:4): # Generated automatically by config.status (ipsec-tools) 0.8.1
1.1       misho       5: # Libtool was configured on host elwix.aitnet.org:
                      6: # NOTE: Changes made to this file will be lost: look at ltmain.sh.
                      7: #
                      8: #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1.1.1.1.2.3.2  1(misho     9:4): #                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
                     10:4): #                 Foundation, Inc.
1.1       misho      11: #   Written by Gordon Matzigkeit, 1996
                     12: #
                     13: #   This file is part of GNU Libtool.
                     14: #
                     15: # GNU Libtool is free software; you can redistribute it and/or
                     16: # modify it under the terms of the GNU General Public License as
                     17: # published by the Free Software Foundation; either version 2 of
                     18: # the License, or (at your option) any later version.
                     19: #
                     20: # As a special exception to the GNU General Public License,
                     21: # if you distribute this file as part of a program or library that
                     22: # is built using GNU Libtool, you may include this file under the
                     23: # same distribution terms that you use for the rest of that program.
                     24: #
                     25: # GNU Libtool is distributed in the hope that it will be useful,
                     26: # but WITHOUT ANY WARRANTY; without even the implied warranty of
                     27: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     28: # GNU General Public License for more details.
                     29: #
                     30: # You should have received a copy of the GNU General Public License
                     31: # along with GNU Libtool; see the file COPYING.  If not, a copy
                     32: # can be downloaded from http://www.gnu.org/licenses/gpl.html, or
                     33: # obtained by writing to the Free Software Foundation, Inc.,
                     34: # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
                     35: 
                     36: 
                     37: # The names of the tagged configurations supported by this script.
                     38: available_tags=""
                     39: 
                     40: # ### BEGIN LIBTOOL CONFIG
                     41: 
                     42: # Whether or not to build shared libraries.
1.1.1.1.2.3.2  1(misho    43:4): build_libtool_libs=no
1.1       misho      44: 
                     45: # Which release of libtool.m4 was used?
1.1.1.1.2.3.2  1(misho    46:4): macro_version=2.4.2
                     47:4): macro_revision=1.3337
1.1       misho      48: 
                     49: # Whether or not to build static libraries.
                     50: build_old_libs=yes
                     51: 
                     52: # What type of objects to build.
                     53: pic_mode=default
                     54: 
                     55: # Whether or not to optimize for fast installation.
                     56: fast_install=needless
                     57: 
1.1.1.1.2.3.2  1(misho    58:4): # Shell to use when invoking shell scripts.
                     59:4): SHELL="/bin/sh"
                     60:4): 
                     61:4): # An echo program that protects backslashes.
                     62:4): ECHO="printf %s\\n"
                     63:4): 
                     64:4): # The PATH separator for the build system.
                     65:4): PATH_SEPARATOR=":"
                     66:4): 
1.1       misho      67: # The host system.
                     68: host_alias=
1.1.1.1.2.3.2  1(misho    69:4): host=i386-unknown-freebsd11.0
                     70:4): host_os=freebsd11.0
1.1       misho      71: 
                     72: # The build system.
1.1.1.1.2.3.2  1(misho    73:4): build_alias=
                     74:4): build=i386-unknown-freebsd11.0
                     75:4): build_os=freebsd11.0
1.1       misho      76: 
                     77: # A sed program that does not truncate output.
                     78: SED="/usr/bin/sed"
                     79: 
                     80: # Sed that helps us avoid accidentally triggering echo(1) options like -n.
                     81: Xsed="$SED -e 1s/^X//"
                     82: 
                     83: # A grep program that handles long lines.
                     84: GREP="/usr/bin/grep"
                     85: 
                     86: # An ERE matcher.
                     87: EGREP="/usr/bin/grep -E"
                     88: 
                     89: # A literal string matcher.
                     90: FGREP="/usr/bin/grep -F"
                     91: 
                     92: # A BSD- or MS-compatible name lister.
1.1.1.1.2.3.2  1(misho    93:4): NM="/usr/bin/nm -B"
1.1       misho      94: 
                     95: # Whether we need soft or hard links.
                     96: LN_S="ln -s"
                     97: 
                     98: # What is the maximum length of a command?
1.1.1.1.2.1  misho      99: max_cmd_len=196608
1.1       misho     100: 
                    101: # Object file suffix (normally "o").
                    102: objext=o
                    103: 
                    104: # Executable file suffix (normally "").
                    105: exeext=
                    106: 
                    107: # whether the shell understands "unset".
                    108: lt_unset=unset
                    109: 
                    110: # turn spaces into newlines.
                    111: SP2NL="tr \\040 \\012"
                    112: 
                    113: # turn newlines into spaces.
                    114: NL2SP="tr \\015\\012 \\040\\040"
                    115: 
1.1.1.1.2.3.2  1(misho   116:4): # convert $build file names to $host format.
                    117:4): to_host_file_cmd=func_convert_file_noop
                    118:4): 
                    119:4): # convert $build files to toolchain format.
                    120:4): to_tool_file_cmd=func_convert_file_noop
1.1       misho     121: 
                    122: # An object symbol dumper.
                    123: OBJDUMP="objdump"
                    124: 
                    125: # Method to check whether dependent libraries are shared objects.
                    126: deplibs_check_method="pass_all"
                    127: 
1.1.1.1.2.3.2  1(misho   128:4): # Command to use when deplibs_check_method = "file_magic".
1.1       misho     129: file_magic_cmd="\$MAGIC_CMD"
                    130: 
1.1.1.1.2.3.2  1(misho   131:4): # How to find potential files when deplibs_check_method = "file_magic".
                    132:4): file_magic_glob=""
                    133:4): 
                    134:4): # Find potential files using nocaseglob when deplibs_check_method = "file_magic".
                    135:4): want_nocaseglob="no"
                    136:4): 
                    137:4): # DLL creation program.
                    138:4): DLLTOOL="false"
                    139:4): 
                    140:4): # Command to associate shared and link libraries.
                    141:4): sharedlib_from_linklib_cmd="printf %s\\n"
                    142:4): 
1.1       misho     143: # The archiver.
                    144: AR="ar"
1.1.1.1.2.3.2  1(misho   145:4): 
                    146:4): # Flags to create an archive.
1.1       misho     147: AR_FLAGS="cru"
                    148: 
1.1.1.1.2.3.2  1(misho   149:4): # How to feed a file listing to the archiver.
                    150:4): archiver_list_spec=""
                    151:4): 
1.1       misho     152: # A symbol stripping program.
                    153: STRIP="strip"
                    154: 
                    155: # Commands used to install an old-style archive.
                    156: RANLIB="ranlib"
1.1.1.1.2.3.2  1(misho   157:4): old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$tool_oldlib"
1.1       misho     158: old_postuninstall_cmds=""
                    159: 
1.1.1.1.2.3.2  1(misho   160:4): # Whether to use a lock for old archive extraction.
                    161:4): lock_old_archive_extraction=no
                    162:4): 
1.1       misho     163: # A C compiler.
1.1.1.1.2.3.2  1(misho   164:4): LTCC="cc"
1.1       misho     165: 
                    166: # LTCC compiler flags.
1.1.1.1.2.1  misho     167: LTCFLAGS="-g -O2  -Wall -Werror -Wno-unused"
1.1       misho     168: 
                    169: # Take the output of nm and produce a listing of raw symbols and C names.
1.1.1.1.2.3.2  1(misho   170:4): global_symbol_pipe="sed -n -e 's/^.*[        ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[       ][      ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p' | sed '/ __gnu_lto/d'"
1.1       misho     171: 
                    172: # Transform the output of nm in a proper C declaration.
                    173: global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'"
                    174: 
                    175: # Transform the output of nm in a C name address pair.
1.1.1.1.2.3.2  1(misho   176:4): global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\)[ ]*\$/  {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/  {\"\\2\", (void *) \\&\\2},/p'"
1.1       misho     177: 
                    178: # Transform the output of nm in a C name address pair when lib prefix is needed.
1.1.1.1.2.3.2  1(misho   179:4): global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\([^ ]*\\)[ ]*\$/  {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\(lib[^ ]*\\)\$/  {\"\\2\", (void *) \\&\\2},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/  {\"lib\\2\", (void *) \\&\\2},/p'"
1.1       misho     180: 
1.1.1.1.2.3.2  1(misho   181:4): # Specify filename containing input files for $NM.
                    182:4): nm_file_list_spec="@"
1.1       misho     183: 
1.1.1.1.2.3.2  1(misho   184:4): # The root where to search for dependent libraries,and in which our libraries should be installed.
                    185:4): lt_sysroot=
1.1       misho     186: 
1.1.1.1.2.3.2  1(misho   187:4): # The name of the directory that contains temporary libtool files.
                    188:4): objdir=.libs
1.1       misho     189: 
                    190: # Used to examine libraries when file_magic_cmd begins with "file".
                    191: MAGIC_CMD=file
                    192: 
                    193: # Must we lock files when doing compilation?
                    194: need_locks="no"
                    195: 
1.1.1.1.2.3.2  1(misho   196:4): # Manifest tool.
                    197:4): MANIFEST_TOOL=":"
                    198:4): 
1.1       misho     199: # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
                    200: DSYMUTIL=""
                    201: 
                    202: # Tool to change global to local symbols on Mac OS X.
                    203: NMEDIT=""
                    204: 
                    205: # Tool to manipulate fat objects and archives on Mac OS X.
                    206: LIPO=""
                    207: 
                    208: # ldd/readelf like tool for Mach-O binaries on Mac OS X.
                    209: OTOOL=""
                    210: 
                    211: # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
                    212: OTOOL64=""
                    213: 
                    214: # Old archive suffix (normally "a").
                    215: libext=a
                    216: 
                    217: # Shared library suffix (normally ".so").
                    218: shrext_cmds=".so"
                    219: 
                    220: # The commands to extract the exported symbol list from a shared archive.
                    221: extract_expsyms_cmds=""
                    222: 
                    223: # Variables whose values should be saved in libtool wrapper scripts and
                    224: # restored at link time.
                    225: variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
                    226: 
                    227: # Do we need the "lib" prefix for modules?
                    228: need_lib_prefix=no
                    229: 
                    230: # Do we need a version for libraries?
                    231: need_version=no
                    232: 
                    233: # Library versioning type.
                    234: version_type=freebsd-elf
                    235: 
                    236: # Shared library runtime path variable.
                    237: runpath_var=LD_RUN_PATH
                    238: 
                    239: # Shared library path variable.
                    240: shlibpath_var=LD_LIBRARY_PATH
                    241: 
                    242: # Is shlibpath searched before the hard-coded library search path?
                    243: shlibpath_overrides_runpath=yes
                    244: 
                    245: # Format of library name prefix.
                    246: libname_spec="lib\$name"
                    247: 
                    248: # List of archive names.  First name is the real one, the rest are links.
                    249: # The last name is the one that the linker finds with -lNAME
                    250: library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext} \$libname\${shared_ext}"
                    251: 
                    252: # The coded name of the library, if different from the real name.
                    253: soname_spec=""
                    254: 
1.1.1.1.2.3.2  1(misho   255:4): # Permission mode override for installation of shared libraries.
                    256:4): install_override_mode=""
                    257:4): 
1.1       misho     258: # Command to use after installation of a shared archive.
                    259: postinstall_cmds=""
                    260: 
                    261: # Command to use after uninstallation of a shared archive.
                    262: postuninstall_cmds=""
                    263: 
                    264: # Commands used to finish a libtool library installation in a directory.
                    265: finish_cmds=""
                    266: 
                    267: # As "finish_cmds", except a single script fragment to be evaled but
                    268: # not shown.
                    269: finish_eval=""
                    270: 
                    271: # Whether we should hardcode library paths into libraries.
                    272: hardcode_into_libs=yes
                    273: 
                    274: # Compile-time system search path for libraries.
1.1.1.1.2.3.2  1(misho   275:4): sys_lib_search_path_spec="/usr/lib "
1.1       misho     276: 
                    277: # Run-time system search path for libraries.
                    278: sys_lib_dlsearch_path_spec="/lib /usr/lib"
                    279: 
                    280: # Whether dlopen is supported.
                    281: dlopen_support=unknown
                    282: 
                    283: # Whether dlopen of programs is supported.
                    284: dlopen_self=unknown
                    285: 
                    286: # Whether dlopen of statically linked programs is supported.
                    287: dlopen_self_static=unknown
                    288: 
                    289: # Commands to strip libraries.
                    290: old_striplib="strip --strip-debug"
                    291: striplib="strip --strip-unneeded"
                    292: 
                    293: 
                    294: # The linker used to build libraries.
1.1.1.1.2.3.2  1(misho   295:4): LD="/usr/bin/ld"
                    296:4): 
                    297:4): # How to create reloadable object files.
                    298:4): reload_flag=" -r"
                    299:4): reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
1.1       misho     300: 
                    301: # Commands used to build an old-style archive.
1.1.1.1.2.3.2  1(misho   302:4): old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
1.1       misho     303: 
                    304: # A language specific compiler.
1.1.1.1.2.3.2  1(misho   305:4): CC="cc"
1.1       misho     306: 
                    307: # Is the compiler the GNU compiler?
                    308: with_gcc=yes
                    309: 
                    310: # Compiler flag to turn off builtin functions.
1.1.1.1.2.3  misho     311: no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions"
1.1       misho     312: 
                    313: # Additional compiler flags for building library objects.
                    314: pic_flag=" -fPIC -DPIC"
                    315: 
1.1.1.1.2.3.2  1(misho   316:4): # How to pass a linker flag through the compiler.
                    317:4): wl="-Wl,"
                    318:4): 
1.1       misho     319: # Compiler flag to prevent dynamic linking.
                    320: link_static_flag="-static"
                    321: 
                    322: # Does compiler simultaneously support -c and -o options?
                    323: compiler_c_o="yes"
                    324: 
                    325: # Whether or not to add -lc for building shared libraries.
1.1.1.1.2.3.2  1(misho   326:4): build_libtool_need_lc=yes
1.1       misho     327: 
                    328: # Whether or not to disallow shared libs when runtime libs are static.
                    329: allow_libtool_libs_with_static_runtimes=no
                    330: 
                    331: # Compiler flag to allow reflexive dlopens.
                    332: export_dynamic_flag_spec="\${wl}--export-dynamic"
                    333: 
                    334: # Compiler flag to generate shared objects directly from archives.
                    335: whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
                    336: 
                    337: # Whether the compiler copes with passing no objects directly.
                    338: compiler_needs_object="no"
                    339: 
                    340: # Create an old-style archive from a shared archive.
                    341: old_archive_from_new_cmds=""
                    342: 
                    343: # Create a temporary old-style archive to link instead of a shared archive.
                    344: old_archive_from_expsyms_cmds=""
                    345: 
                    346: # Commands used to build a shared archive.
1.1.1.1.2.3.2  1(misho   347:4): archive_cmds="\$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
                    348:4): archive_expsym_cmds="\$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
1.1       misho     349: 
                    350: # Commands used to build a loadable module if different from building
                    351: # a shared archive.
                    352: module_cmds=""
                    353: module_expsym_cmds=""
                    354: 
                    355: # Whether we are building with GNU ld or not.
                    356: with_gnu_ld="yes"
                    357: 
                    358: # Flag that allows shared libraries with undefined symbols to be built.
                    359: allow_undefined_flag=""
                    360: 
                    361: # Flag that enforces no undefined symbols.
                    362: no_undefined_flag=""
                    363: 
                    364: # Flag to hardcode $libdir into a binary during linking.
                    365: # This must work even if $libdir does not exist
                    366: hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir"
                    367: 
                    368: # Whether we need a single "-rpath" flag with a separated argument.
                    369: hardcode_libdir_separator=""
                    370: 
                    371: # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
                    372: # DIR into the resulting binary.
                    373: hardcode_direct=no
                    374: 
                    375: # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
                    376: # DIR into the resulting binary and the resulting library dependency is
                    377: # "absolute",i.e impossible to change by setting ${shlibpath_var} if the
                    378: # library is relocated.
                    379: hardcode_direct_absolute=no
                    380: 
                    381: # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
                    382: # into the resulting binary.
                    383: hardcode_minus_L=no
                    384: 
                    385: # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
                    386: # into the resulting binary.
                    387: hardcode_shlibpath_var=unsupported
                    388: 
                    389: # Set to "yes" if building a shared library automatically hardcodes DIR
                    390: # into the library and all subsequent libraries and executables linked
                    391: # against it.
                    392: hardcode_automatic=no
                    393: 
                    394: # Set to yes if linker adds runtime paths of dependent libraries
                    395: # to runtime path list.
                    396: inherit_rpath=no
                    397: 
                    398: # Whether libtool must link a program against all its dependency libraries.
                    399: link_all_deplibs=unknown
                    400: 
                    401: # Set to "yes" if exported symbols are required.
                    402: always_export_symbols=no
                    403: 
                    404: # The commands to list exported symbols.
                    405: export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
                    406: 
                    407: # Symbols that should not be listed in the preloaded symbols.
                    408: exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
                    409: 
                    410: # Symbols that must always be exported.
                    411: include_expsyms=""
                    412: 
                    413: # Commands necessary for linking programs (against libraries) with templates.
                    414: prelink_cmds=""
                    415: 
1.1.1.1.2.3.2  1(misho   416:4): # Commands necessary for finishing linking programs.
                    417:4): postlink_cmds=""
                    418:4): 
1.1       misho     419: # Specify filename containing input files.
                    420: file_list_spec=""
                    421: 
                    422: # How to hardcode a shared library path into an executable.
                    423: hardcode_action=immediate
                    424: 
                    425: # ### END LIBTOOL CONFIG
                    426: 
                    427: 
1.1.1.1.2.3.2  1(misho   428:4): # libtool (GNU libtool) 2.4.2
1.1       misho     429: # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
                    430: 
1.1.1.1.2.3.2  1(misho   431:4): # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
                    432:4): # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
1.1       misho     433: # This is free software; see the source for copying conditions.  There is NO
                    434: # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
                    435: 
                    436: # GNU Libtool is free software; you can redistribute it and/or modify
                    437: # it under the terms of the GNU General Public License as published by
                    438: # the Free Software Foundation; either version 2 of the License, or
                    439: # (at your option) any later version.
                    440: #
                    441: # As a special exception to the GNU General Public License,
                    442: # if you distribute this file as part of a program or library that
                    443: # is built using GNU Libtool, you may include this file under the
                    444: # same distribution terms that you use for the rest of that program.
                    445: #
                    446: # GNU Libtool is distributed in the hope that it will be useful, but
                    447: # WITHOUT ANY WARRANTY; without even the implied warranty of
                    448: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
                    449: # General Public License for more details.
                    450: #
                    451: # You should have received a copy of the GNU General Public License
                    452: # along with GNU Libtool; see the file COPYING.  If not, a copy
                    453: # can be downloaded from http://www.gnu.org/licenses/gpl.html,
                    454: # or obtained by writing to the Free Software Foundation, Inc.,
                    455: # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
                    456: 
                    457: # Usage: $progname [OPTION]... [MODE-ARG]...
                    458: #
                    459: # Provide generalized library-building support services.
                    460: #
1.1.1.1.2.3.2  1(misho   461:4): #       --config             show all configuration variables
                    462:4): #       --debug              enable verbose shell tracing
                    463:4): #   -n, --dry-run            display commands without modifying any files
                    464:4): #       --features           display basic configuration information and exit
                    465:4): #       --mode=MODE          use operation mode MODE
                    466:4): #       --preserve-dup-deps  don't remove duplicate dependency libraries
                    467:4): #       --quiet, --silent    don't print informational messages
                    468:4): #       --no-quiet, --no-silent
                    469:4): #                            print informational messages (default)
                    470:4): #       --no-warn            don't display warning messages
                    471:4): #       --tag=TAG            use configuration variables from tag TAG
                    472:4): #   -v, --verbose            print more informational messages than default
                    473:4): #       --no-verbose         don't print the extra informational messages
                    474:4): #       --version            print version information
                    475:4): #   -h, --help, --help-all   print short, long, or detailed help message
1.1       misho     476: #
                    477: # MODE must be one of the following:
                    478: #
1.1.1.1.2.3.2  1(misho   479:4): #         clean              remove files from the build directory
                    480:4): #         compile            compile a source file into a libtool object
                    481:4): #         execute            automatically set library path, then run a program
                    482:4): #         finish             complete the installation of libtool libraries
                    483:4): #         install            install libraries or executables
                    484:4): #         link               create a library or an executable
                    485:4): #         uninstall          remove libraries from an installed directory
1.1       misho     486: #
1.1.1.1.2.3.2  1(misho   487:4): # MODE-ARGS vary depending on the MODE.  When passed as first option,
                    488:4): # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
1.1       misho     489: # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
                    490: #
                    491: # When reporting a bug, please describe a test case to reproduce it and
                    492: # include the following information:
                    493: #
1.1.1.1.2.3.2  1(misho   494:4): #         host-triplet:     $host
                    495:4): #         shell:            $SHELL
                    496:4): #         compiler:         $LTCC
                    497:4): #         compiler flags:           $LTCFLAGS
                    498:4): #         linker:           $LD (gnu? $with_gnu_ld)
                    499:4): #         $progname:        (GNU libtool) 2.4.2
                    500:4): #         automake: $automake_version
                    501:4): #         autoconf: $autoconf_version
1.1       misho     502: #
                    503: # Report bugs to <bug-libtool@gnu.org>.
1.1.1.1.2.3.2  1(misho   504:4): # GNU libtool home page: <http://www.gnu.org/software/libtool/>.
                    505:4): # General help using GNU software: <http://www.gnu.org/gethelp/>.
1.1       misho     506: 
1.1.1.1.2.3.2  1(misho   507:4): PROGRAM=libtool
1.1       misho     508: PACKAGE=libtool
1.1.1.1.2.3.2  1(misho   509:4): VERSION=2.4.2
1.1       misho     510: TIMESTAMP=""
1.1.1.1.2.3.2  1(misho   511:4): package_revision=1.3337
1.1       misho     512: 
                    513: # Be Bourne compatible
                    514: if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
                    515:   emulate sh
                    516:   NULLCMD=:
                    517:   # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
                    518:   # is contrary to our usage.  Disable this feature.
                    519:   alias -g '${1+"$@"}'='"$@"'
                    520:   setopt NO_GLOB_SUBST
                    521: else
                    522:   case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
                    523: fi
                    524: BIN_SH=xpg4; export BIN_SH # for Tru64
                    525: DUALCASE=1; export DUALCASE # for MKS sh
                    526: 
1.1.1.1.2.3.2  1(misho   527:4): # A function that is used when there is no print builtin or printf.
                    528:4): func_fallback_echo ()
                    529:4): {
                    530:4):   eval 'cat <<_LTECHO_EOF
                    531:4): $1
                    532:4): _LTECHO_EOF'
                    533:4): }
                    534:4): 
1.1       misho     535: # NLS nuisances: We save the old values to restore during execute mode.
                    536: lt_user_locale=
                    537: lt_safe_locale=
                    538: for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
                    539: do
                    540:   eval "if test \"\${$lt_var+set}\" = set; then
                    541:           save_$lt_var=\$$lt_var
                    542:           $lt_var=C
                    543:          export $lt_var
                    544:          lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
                    545:          lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
                    546:        fi"
                    547: done
1.1.1.1.2.3.2  1(misho   548:4): LC_ALL=C
                    549:4): LANGUAGE=C
                    550:4): export LANGUAGE LC_ALL
1.1       misho     551: 
                    552: $lt_unset CDPATH
                    553: 
                    554: 
1.1.1.1.2.3.2  1(misho   555:4): # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
                    556:4): # is ksh but when the shell is invoked as "sh" and the current value of
                    557:4): # the _XPG environment variable is not equal to 1 (one), the special
                    558:4): # positional parameter $0, within a function call, is the name of the
                    559:4): # function.
                    560:4): progpath="$0"
1.1       misho     561: 
                    562: 
                    563: 
                    564: : ${CP="cp -f"}
1.1.1.1.2.3.2  1(misho   565:4): test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
1.1       misho     566: : ${MAKE="make"}
                    567: : ${MKDIR="mkdir"}
                    568: : ${MV="mv -f"}
                    569: : ${RM="rm -f"}
                    570: : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
                    571: : ${Xsed="$SED -e 1s/^X//"}
                    572: 
                    573: # Global variables:
                    574: EXIT_SUCCESS=0
                    575: EXIT_FAILURE=1
                    576: EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
                    577: EXIT_SKIP=77     # $? = 77 is used to indicate a skipped test to automake.
                    578: 
                    579: exit_status=$EXIT_SUCCESS
                    580: 
                    581: # Make sure IFS has a sensible default
                    582: lt_nl='
                    583: '
                    584: IFS="  $lt_nl"
                    585: 
                    586: dirname="s,/[^/]*$,,"
                    587: basename="s,^.*/,,"
                    588: 
                    589: # func_dirname file append nondir_replacement
                    590: # Compute the dirname of FILE.  If nonempty, add APPEND to the result,
                    591: # otherwise set result to NONDIR_REPLACEMENT.
                    592: func_dirname ()
                    593: {
1.1.1.1.2.3.2  1(misho   594:4):     case ${1} in
                    595:4):       */*) func_dirname_result="${1%/*}${2}" ;;
                    596:4):       *  ) func_dirname_result="${3}" ;;
                    597:4):     esac
                    598:4): } # Extended-shell func_dirname implementation
                    599:4): 
1.1       misho     600: 
                    601: # func_basename file
                    602: func_basename ()
                    603: {
1.1.1.1.2.3.2  1(misho   604:4):     func_basename_result="${1##*/}"
                    605:4): } # Extended-shell func_basename implementation
                    606:4): 
1.1       misho     607: 
                    608: # func_dirname_and_basename file append nondir_replacement
                    609: # perform func_basename and func_dirname in a single function
                    610: # call:
                    611: #   dirname:  Compute the dirname of FILE.  If nonempty,
                    612: #             add APPEND to the result, otherwise set result
                    613: #             to NONDIR_REPLACEMENT.
                    614: #             value returned in "$func_dirname_result"
                    615: #   basename: Compute filename of FILE.
                    616: #             value retuned in "$func_basename_result"
                    617: # Implementation must be kept synchronized with func_dirname
                    618: # and func_basename. For efficiency, we do not delegate to
                    619: # those functions but instead duplicate the functionality here.
                    620: func_dirname_and_basename ()
                    621: {
1.1.1.1.2.3.2  1(misho   622:4):     case ${1} in
                    623:4):       */*) func_dirname_result="${1%/*}${2}" ;;
                    624:4):       *  ) func_dirname_result="${3}" ;;
                    625:4):     esac
                    626:4):     func_basename_result="${1##*/}"
                    627:4): } # Extended-shell func_dirname_and_basename implementation
                    628:4): 
1.1       misho     629: 
                    630: # func_stripname prefix suffix name
                    631: # strip PREFIX and SUFFIX off of NAME.
                    632: # PREFIX and SUFFIX must not contain globbing or regex special
                    633: # characters, hashes, percent signs, but SUFFIX may contain a leading
                    634: # dot (in which case that matches only a dot).
1.1.1.1.2.3.2  1(misho   635:4): # func_strip_suffix prefix name
1.1       misho     636: func_stripname ()
                    637: {
1.1.1.1.2.3.2  1(misho   638:4):     # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
                    639:4):     # positional parameters, so assign one to ordinary parameter first.
                    640:4):     func_stripname_result=${3}
                    641:4):     func_stripname_result=${func_stripname_result#"${1}"}
                    642:4):     func_stripname_result=${func_stripname_result%"${2}"}
                    643:4): } # Extended-shell func_stripname implementation
                    644:4): 
                    645:4): 
                    646:4): # These SED scripts presuppose an absolute path with a trailing slash.
                    647:4): pathcar='s,^/\([^/]*\).*$,\1,'
                    648:4): pathcdr='s,^/[^/]*,,'
                    649:4): removedotparts=':dotsl
                    650:4):             s@/\./@/@g
                    651:4):             t dotsl
                    652:4):             s,/\.$,/,'
                    653:4): collapseslashes='s@/\{1,\}@/@g'
                    654:4): finalslash='s,/*$,/,'
                    655:4): 
                    656:4): # func_normal_abspath PATH
                    657:4): # Remove doubled-up and trailing slashes, "." path components,
                    658:4): # and cancel out any ".." path components in PATH after making
                    659:4): # it an absolute path.
                    660:4): #             value returned in "$func_normal_abspath_result"
                    661:4): func_normal_abspath ()
                    662:4): {
                    663:4):   # Start from root dir and reassemble the path.
                    664:4):   func_normal_abspath_result=
                    665:4):   func_normal_abspath_tpath=$1
                    666:4):   func_normal_abspath_altnamespace=
                    667:4):   case $func_normal_abspath_tpath in
                    668:4):     "")
                    669:4):       # Empty path, that just means $cwd.
                    670:4):       func_stripname '' '/' "`pwd`"
                    671:4):       func_normal_abspath_result=$func_stripname_result
                    672:4):       return
                    673:4):     ;;
                    674:4):     # The next three entries are used to spot a run of precisely
                    675:4):     # two leading slashes without using negated character classes;
                    676:4):     # we take advantage of case's first-match behaviour.
                    677:4):     ///*)
                    678:4):       # Unusual form of absolute path, do nothing.
                    679:4):     ;;
                    680:4):     //*)
                    681:4):       # Not necessarily an ordinary path; POSIX reserves leading '//'
                    682:4):       # and for example Cygwin uses it to access remote file shares
                    683:4):       # over CIFS/SMB, so we conserve a leading double slash if found.
                    684:4):       func_normal_abspath_altnamespace=/
                    685:4):     ;;
                    686:4):     /*)
                    687:4):       # Absolute path, do nothing.
                    688:4):     ;;
                    689:4):     *)
                    690:4):       # Relative path, prepend $cwd.
                    691:4):       func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
                    692:4):     ;;
1.1       misho     693:   esac
1.1.1.1.2.3.2  1(misho   694:4):   # Cancel out all the simple stuff to save iterations.  We also want
                    695:4):   # the path to end with a slash for ease of parsing, so make sure
                    696:4):   # there is one (and only one) here.
                    697:4):   func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
                    698:4):         -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
                    699:4):   while :; do
                    700:4):     # Processed it all yet?
                    701:4):     if test "$func_normal_abspath_tpath" = / ; then
                    702:4):       # If we ascended to the root using ".." the result may be empty now.
                    703:4):       if test -z "$func_normal_abspath_result" ; then
                    704:4):         func_normal_abspath_result=/
                    705:4):       fi
                    706:4):       break
                    707:4):     fi
                    708:4):     func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
                    709:4):         -e "$pathcar"`
                    710:4):     func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
                    711:4):         -e "$pathcdr"`
                    712:4):     # Figure out what to do with it
                    713:4):     case $func_normal_abspath_tcomponent in
                    714:4):       "")
                    715:4):         # Trailing empty path component, ignore it.
                    716:4):       ;;
                    717:4):       ..)
                    718:4):         # Parent dir; strip last assembled component from result.
                    719:4):         func_dirname "$func_normal_abspath_result"
                    720:4):         func_normal_abspath_result=$func_dirname_result
                    721:4):       ;;
                    722:4):       *)
                    723:4):         # Actual path component, append it.
                    724:4):         func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
                    725:4):       ;;
                    726:4):     esac
                    727:4):   done
                    728:4):   # Restore leading double-slash if one was found on entry.
                    729:4):   func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
1.1       misho     730: }
                    731: 
1.1.1.1.2.3.2  1(misho   732:4): # func_relative_path SRCDIR DSTDIR
                    733:4): # generates a relative path from SRCDIR to DSTDIR, with a trailing
                    734:4): # slash if non-empty, suitable for immediately appending a filename
                    735:4): # without needing to append a separator.
                    736:4): #             value returned in "$func_relative_path_result"
                    737:4): func_relative_path ()
                    738:4): {
                    739:4):   func_relative_path_result=
                    740:4):   func_normal_abspath "$1"
                    741:4):   func_relative_path_tlibdir=$func_normal_abspath_result
                    742:4):   func_normal_abspath "$2"
                    743:4):   func_relative_path_tbindir=$func_normal_abspath_result
                    744:4): 
                    745:4):   # Ascend the tree starting from libdir
                    746:4):   while :; do
                    747:4):     # check if we have found a prefix of bindir
                    748:4):     case $func_relative_path_tbindir in
                    749:4):       $func_relative_path_tlibdir)
                    750:4):         # found an exact match
                    751:4):         func_relative_path_tcancelled=
                    752:4):         break
                    753:4):         ;;
                    754:4):       $func_relative_path_tlibdir*)
                    755:4):         # found a matching prefix
                    756:4):         func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
                    757:4):         func_relative_path_tcancelled=$func_stripname_result
                    758:4):         if test -z "$func_relative_path_result"; then
                    759:4):           func_relative_path_result=.
                    760:4):         fi
                    761:4):         break
                    762:4):         ;;
                    763:4):       *)
                    764:4):         func_dirname $func_relative_path_tlibdir
                    765:4):         func_relative_path_tlibdir=${func_dirname_result}
                    766:4):         if test "x$func_relative_path_tlibdir" = x ; then
                    767:4):           # Have to descend all the way to the root!
                    768:4):           func_relative_path_result=../$func_relative_path_result
                    769:4):           func_relative_path_tcancelled=$func_relative_path_tbindir
                    770:4):           break
                    771:4):         fi
                    772:4):         func_relative_path_result=../$func_relative_path_result
                    773:4):         ;;
                    774:4):     esac
                    775:4):   done
1.1       misho     776: 
1.1.1.1.2.3.2  1(misho   777:4):   # Now calculate path; take care to avoid doubling-up slashes.
                    778:4):   func_stripname '' '/' "$func_relative_path_result"
                    779:4):   func_relative_path_result=$func_stripname_result
                    780:4):   func_stripname '/' '/' "$func_relative_path_tcancelled"
                    781:4):   if test "x$func_stripname_result" != x ; then
                    782:4):     func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
                    783:4):   fi
1.1       misho     784: 
1.1.1.1.2.3.2  1(misho   785:4):   # Normalisation. If bindir is libdir, return empty string,
                    786:4):   # else relative path ending with a slash; either way, target
                    787:4):   # file name can be directly appended.
                    788:4):   if test ! -z "$func_relative_path_result"; then
                    789:4):     func_stripname './' '' "$func_relative_path_result/"
                    790:4):     func_relative_path_result=$func_stripname_result
                    791:4):   fi
1.1       misho     792: }
                    793: 
                    794: # The name of this program:
                    795: func_dirname_and_basename "$progpath"
                    796: progname=$func_basename_result
                    797: 
                    798: # Make sure we have an absolute path for reexecution:
                    799: case $progpath in
                    800:   [\\/]*|[A-Za-z]:\\*) ;;
                    801:   *[\\/]*)
                    802:      progdir=$func_dirname_result
                    803:      progdir=`cd "$progdir" && pwd`
                    804:      progpath="$progdir/$progname"
                    805:      ;;
                    806:   *)
                    807:      save_IFS="$IFS"
1.1.1.1.2.3.2  1(misho   808:4):      IFS=${PATH_SEPARATOR-:}
1.1       misho     809:      for progdir in $PATH; do
                    810:        IFS="$save_IFS"
                    811:        test -x "$progdir/$progname" && break
                    812:      done
                    813:      IFS="$save_IFS"
                    814:      test -n "$progdir" || progdir=`pwd`
                    815:      progpath="$progdir/$progname"
                    816:      ;;
                    817: esac
                    818: 
                    819: # Sed substitution that helps us do robust quoting.  It backslashifies
                    820: # metacharacters that are still active within double-quoted strings.
                    821: Xsed="${SED}"' -e 1s/^X//'
                    822: sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
                    823: 
                    824: # Same as above, but do not quote variable references.
                    825: double_quote_subst='s/\(["`\\]\)/\\\1/g'
                    826: 
1.1.1.1.2.3.2  1(misho   827:4): # Sed substitution that turns a string into a regex matching for the
                    828:4): # string literally.
                    829:4): sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
                    830:4): 
                    831:4): # Sed substitution that converts a w32 file name or path
                    832:4): # which contains forward slashes, into one that contains
                    833:4): # (escaped) backslashes.  A very naive implementation.
                    834:4): lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
                    835:4): 
1.1       misho     836: # Re-`\' parameter expansions in output of double_quote_subst that were
                    837: # `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
                    838: # in input to double_quote_subst, that '$' was protected from expansion.
                    839: # Since each input `\' is now two `\'s, look for any number of runs of
                    840: # four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
                    841: bs='\\'
                    842: bs2='\\\\'
                    843: bs4='\\\\\\\\'
                    844: dollar='\$'
                    845: sed_double_backslash="\
                    846:   s/$bs4/&\\
                    847: /g
                    848:   s/^$bs2$dollar/$bs&/
                    849:   s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
                    850:   s/\n//g"
                    851: 
                    852: # Standard options:
                    853: opt_dry_run=false
                    854: opt_help=false
                    855: opt_quiet=false
                    856: opt_verbose=false
                    857: opt_warning=:
                    858: 
                    859: # func_echo arg...
                    860: # Echo program name prefixed message, along with the current mode
                    861: # name if it has been set yet.
                    862: func_echo ()
                    863: {
1.1.1.1.2.3.2  1(misho   864:4):     $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
1.1       misho     865: }
                    866: 
                    867: # func_verbose arg...
                    868: # Echo program name prefixed message in verbose mode only.
                    869: func_verbose ()
                    870: {
                    871:     $opt_verbose && func_echo ${1+"$@"}
                    872: 
                    873:     # A bug in bash halts the script if the last line of a function
                    874:     # fails when set -e is in force, so we need another command to
                    875:     # work around that:
                    876:     :
                    877: }
                    878: 
1.1.1.1.2.3.2  1(misho   879:4): # func_echo_all arg...
                    880:4): # Invoke $ECHO with all args, space-separated.
                    881:4): func_echo_all ()
                    882:4): {
                    883:4):     $ECHO "$*"
                    884:4): }
                    885:4): 
1.1       misho     886: # func_error arg...
                    887: # Echo program name prefixed message to standard error.
                    888: func_error ()
                    889: {
1.1.1.1.2.3.2  1(misho   890:4):     $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
1.1       misho     891: }
                    892: 
                    893: # func_warning arg...
                    894: # Echo program name prefixed warning message to standard error.
                    895: func_warning ()
                    896: {
1.1.1.1.2.3.2  1(misho   897:4):     $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
1.1       misho     898: 
                    899:     # bash bug again:
                    900:     :
                    901: }
                    902: 
                    903: # func_fatal_error arg...
                    904: # Echo program name prefixed message to standard error, and exit.
                    905: func_fatal_error ()
                    906: {
                    907:     func_error ${1+"$@"}
                    908:     exit $EXIT_FAILURE
                    909: }
                    910: 
                    911: # func_fatal_help arg...
                    912: # Echo program name prefixed message to standard error, followed by
                    913: # a help hint, and exit.
                    914: func_fatal_help ()
                    915: {
                    916:     func_error ${1+"$@"}
                    917:     func_fatal_error "$help"
                    918: }
                    919: help="Try \`$progname --help' for more information."  ## default
                    920: 
                    921: 
                    922: # func_grep expression filename
                    923: # Check whether EXPRESSION matches any line of FILENAME, without output.
                    924: func_grep ()
                    925: {
                    926:     $GREP "$1" "$2" >/dev/null 2>&1
                    927: }
                    928: 
                    929: 
                    930: # func_mkdir_p directory-path
                    931: # Make sure the entire path to DIRECTORY-PATH is available.
                    932: func_mkdir_p ()
                    933: {
                    934:     my_directory_path="$1"
                    935:     my_dir_list=
                    936: 
                    937:     if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
                    938: 
                    939:       # Protect directory names starting with `-'
                    940:       case $my_directory_path in
                    941:         -*) my_directory_path="./$my_directory_path" ;;
                    942:       esac
                    943: 
                    944:       # While some portion of DIR does not yet exist...
                    945:       while test ! -d "$my_directory_path"; do
                    946:         # ...make a list in topmost first order.  Use a colon delimited
                    947:        # list incase some portion of path contains whitespace.
                    948:         my_dir_list="$my_directory_path:$my_dir_list"
                    949: 
                    950:         # If the last portion added has no slash in it, the list is done
                    951:         case $my_directory_path in */*) ;; *) break ;; esac
                    952: 
                    953:         # ...otherwise throw away the child directory and loop
1.1.1.1.2.3.2  1(misho   954:4):         my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
1.1       misho     955:       done
1.1.1.1.2.3.2  1(misho   956:4):       my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
1.1       misho     957: 
                    958:       save_mkdir_p_IFS="$IFS"; IFS=':'
                    959:       for my_dir in $my_dir_list; do
                    960:        IFS="$save_mkdir_p_IFS"
                    961:         # mkdir can fail with a `File exist' error if two processes
                    962:         # try to create one of the directories concurrently.  Don't
                    963:         # stop in that case!
                    964:         $MKDIR "$my_dir" 2>/dev/null || :
                    965:       done
                    966:       IFS="$save_mkdir_p_IFS"
                    967: 
                    968:       # Bail out if we (or some other process) failed to create a directory.
                    969:       test -d "$my_directory_path" || \
                    970:         func_fatal_error "Failed to create \`$1'"
                    971:     fi
                    972: }
                    973: 
                    974: 
                    975: # func_mktempdir [string]
                    976: # Make a temporary directory that won't clash with other running
                    977: # libtool processes, and avoids race conditions if possible.  If
                    978: # given, STRING is the basename for that directory.
                    979: func_mktempdir ()
                    980: {
                    981:     my_template="${TMPDIR-/tmp}/${1-$progname}"
                    982: 
                    983:     if test "$opt_dry_run" = ":"; then
                    984:       # Return a directory name, but don't create it in dry-run mode
                    985:       my_tmpdir="${my_template}-$$"
                    986:     else
                    987: 
                    988:       # If mktemp works, use that first and foremost
                    989:       my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
                    990: 
                    991:       if test ! -d "$my_tmpdir"; then
                    992:         # Failing that, at least try and use $RANDOM to avoid a race
                    993:         my_tmpdir="${my_template}-${RANDOM-0}$$"
                    994: 
                    995:         save_mktempdir_umask=`umask`
                    996:         umask 0077
                    997:         $MKDIR "$my_tmpdir"
                    998:         umask $save_mktempdir_umask
                    999:       fi
                   1000: 
                   1001:       # If we're not in dry-run mode, bomb out on failure
                   1002:       test -d "$my_tmpdir" || \
                   1003:         func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
                   1004:     fi
                   1005: 
1.1.1.1.2.3.2  1(misho  1006:4):     $ECHO "$my_tmpdir"
1.1       misho    1007: }
                   1008: 
                   1009: 
                   1010: # func_quote_for_eval arg
                   1011: # Aesthetically quote ARG to be evaled later.
                   1012: # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
                   1013: # is double-quoted, suitable for a subsequent eval, whereas
                   1014: # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
                   1015: # which are still active within double quotes backslashified.
                   1016: func_quote_for_eval ()
                   1017: {
                   1018:     case $1 in
                   1019:       *[\\\`\"\$]*)
1.1.1.1.2.3.2  1(misho  1020:4):     func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
1.1       misho    1021:       *)
                   1022:         func_quote_for_eval_unquoted_result="$1" ;;
                   1023:     esac
                   1024: 
                   1025:     case $func_quote_for_eval_unquoted_result in
                   1026:       # Double-quote args containing shell metacharacters to delay
                   1027:       # word splitting, command substitution and and variable
                   1028:       # expansion for a subsequent eval.
                   1029:       # Many Bourne shells cannot handle close brackets correctly
                   1030:       # in scan sets, so we specify it separately.
                   1031:       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
                   1032:         func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
                   1033:         ;;
                   1034:       *)
                   1035:         func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
                   1036:     esac
                   1037: }
                   1038: 
                   1039: 
                   1040: # func_quote_for_expand arg
                   1041: # Aesthetically quote ARG to be evaled later; same as above,
                   1042: # but do not quote variable references.
                   1043: func_quote_for_expand ()
                   1044: {
                   1045:     case $1 in
                   1046:       *[\\\`\"]*)
1.1.1.1.2.3.2  1(misho  1047:4):     my_arg=`$ECHO "$1" | $SED \
1.1       misho    1048:            -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
                   1049:       *)
                   1050:         my_arg="$1" ;;
                   1051:     esac
                   1052: 
                   1053:     case $my_arg in
                   1054:       # Double-quote args containing shell metacharacters to delay
                   1055:       # word splitting and command substitution for a subsequent eval.
                   1056:       # Many Bourne shells cannot handle close brackets correctly
                   1057:       # in scan sets, so we specify it separately.
                   1058:       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
                   1059:         my_arg="\"$my_arg\""
                   1060:         ;;
                   1061:     esac
                   1062: 
                   1063:     func_quote_for_expand_result="$my_arg"
                   1064: }
                   1065: 
                   1066: 
                   1067: # func_show_eval cmd [fail_exp]
                   1068: # Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
                   1069: # not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
                   1070: # is given, then evaluate it.
                   1071: func_show_eval ()
                   1072: {
                   1073:     my_cmd="$1"
                   1074:     my_fail_exp="${2-:}"
                   1075: 
                   1076:     ${opt_silent-false} || {
                   1077:       func_quote_for_expand "$my_cmd"
                   1078:       eval "func_echo $func_quote_for_expand_result"
                   1079:     }
                   1080: 
                   1081:     if ${opt_dry_run-false}; then :; else
                   1082:       eval "$my_cmd"
                   1083:       my_status=$?
                   1084:       if test "$my_status" -eq 0; then :; else
                   1085:        eval "(exit $my_status); $my_fail_exp"
                   1086:       fi
                   1087:     fi
                   1088: }
                   1089: 
                   1090: 
                   1091: # func_show_eval_locale cmd [fail_exp]
                   1092: # Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
                   1093: # not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
                   1094: # is given, then evaluate it.  Use the saved locale for evaluation.
                   1095: func_show_eval_locale ()
                   1096: {
                   1097:     my_cmd="$1"
                   1098:     my_fail_exp="${2-:}"
                   1099: 
                   1100:     ${opt_silent-false} || {
                   1101:       func_quote_for_expand "$my_cmd"
                   1102:       eval "func_echo $func_quote_for_expand_result"
                   1103:     }
                   1104: 
                   1105:     if ${opt_dry_run-false}; then :; else
                   1106:       eval "$lt_user_locale
                   1107:            $my_cmd"
                   1108:       my_status=$?
                   1109:       eval "$lt_safe_locale"
                   1110:       if test "$my_status" -eq 0; then :; else
                   1111:        eval "(exit $my_status); $my_fail_exp"
                   1112:       fi
                   1113:     fi
                   1114: }
                   1115: 
1.1.1.1.2.3.2  1(misho  1116:4): # func_tr_sh
                   1117:4): # Turn $1 into a string suitable for a shell variable name.
                   1118:4): # Result is stored in $func_tr_sh_result.  All characters
                   1119:4): # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
                   1120:4): # if $1 begins with a digit, a '_' is prepended as well.
                   1121:4): func_tr_sh ()
                   1122:4): {
                   1123:4):   case $1 in
                   1124:4):   [0-9]* | *[!a-zA-Z0-9_]*)
                   1125:4):     func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
                   1126:4):     ;;
                   1127:4):   * )
                   1128:4):     func_tr_sh_result=$1
                   1129:4):     ;;
                   1130:4):   esac
                   1131:4): }
1.1       misho    1132: 
                   1133: 
                   1134: # func_version
                   1135: # Echo version message to standard output and exit.
                   1136: func_version ()
                   1137: {
1.1.1.1.2.3.2  1(misho  1138:4):     $opt_debug
                   1139:4): 
                   1140:4):     $SED -n '/(C)/!b go
                   1141:4):     :more
                   1142:4):     /\./!{
                   1143:4):       N
                   1144:4):       s/\n# / /
                   1145:4):       b more
                   1146:4):     }
                   1147:4):     :go
                   1148:4):     /^# '$PROGRAM' (GNU /,/# warranty; / {
1.1       misho    1149:         s/^# //
                   1150:        s/^# *$//
                   1151:         s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
                   1152:         p
                   1153:      }' < "$progpath"
                   1154:      exit $?
                   1155: }
                   1156: 
                   1157: # func_usage
                   1158: # Echo short help message to standard output and exit.
                   1159: func_usage ()
                   1160: {
1.1.1.1.2.3.2  1(misho  1161:4):     $opt_debug
                   1162:4): 
                   1163:4):     $SED -n '/^# Usage:/,/^#  *.*--help/ {
1.1       misho    1164:         s/^# //
                   1165:        s/^# *$//
                   1166:        s/\$progname/'$progname'/
                   1167:        p
                   1168:     }' < "$progpath"
1.1.1.1.2.3.2  1(misho  1169:4):     echo
1.1       misho    1170:     $ECHO "run \`$progname --help | more' for full usage"
                   1171:     exit $?
                   1172: }
                   1173: 
1.1.1.1.2.3.2  1(misho  1174:4): # func_help [NOEXIT]
                   1175:4): # Echo long help message to standard output and exit,
                   1176:4): # unless 'noexit' is passed as argument.
1.1       misho    1177: func_help ()
                   1178: {
1.1.1.1.2.3.2  1(misho  1179:4):     $opt_debug
                   1180:4): 
1.1       misho    1181:     $SED -n '/^# Usage:/,/# Report bugs to/ {
1.1.1.1.2.3.2  1(misho  1182:4):     :print
1.1       misho    1183:         s/^# //
                   1184:        s/^# *$//
                   1185:        s*\$progname*'$progname'*
                   1186:        s*\$host*'"$host"'*
                   1187:        s*\$SHELL*'"$SHELL"'*
                   1188:        s*\$LTCC*'"$LTCC"'*
                   1189:        s*\$LTCFLAGS*'"$LTCFLAGS"'*
                   1190:        s*\$LD*'"$LD"'*
                   1191:        s/\$with_gnu_ld/'"$with_gnu_ld"'/
1.1.1.1.2.3.2  1(misho  1192:4):     s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
                   1193:4):     s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
1.1       misho    1194:        p
1.1.1.1.2.3.2  1(misho  1195:4):     d
                   1196:4):      }
                   1197:4):      /^# .* home page:/b print
                   1198:4):      /^# General help using/b print
                   1199:4):      ' < "$progpath"
                   1200:4):     ret=$?
                   1201:4):     if test -z "$1"; then
                   1202:4):       exit $ret
                   1203:4):     fi
1.1       misho    1204: }
                   1205: 
                   1206: # func_missing_arg argname
                   1207: # Echo program name prefixed message to standard error and set global
                   1208: # exit_cmd.
                   1209: func_missing_arg ()
                   1210: {
1.1.1.1.2.3.2  1(misho  1211:4):     $opt_debug
                   1212:4): 
                   1213:4):     func_error "missing argument for $1."
1.1       misho    1214:     exit_cmd=exit
                   1215: }
                   1216: 
                   1217: 
1.1.1.1.2.3.2  1(misho  1218:4): # func_split_short_opt shortopt
                   1219:4): # Set func_split_short_opt_name and func_split_short_opt_arg shell
                   1220:4): # variables after splitting SHORTOPT after the 2nd character.
                   1221:4): func_split_short_opt ()
                   1222:4): {
                   1223:4):     func_split_short_opt_arg=${1#??}
                   1224:4):     func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
                   1225:4): } # Extended-shell func_split_short_opt implementation
                   1226:4): 
                   1227:4): 
                   1228:4): # func_split_long_opt longopt
                   1229:4): # Set func_split_long_opt_name and func_split_long_opt_arg shell
                   1230:4): # variables after splitting LONGOPT at the `=' sign.
                   1231:4): func_split_long_opt ()
                   1232:4): {
                   1233:4):     func_split_long_opt_name=${1%%=*}
                   1234:4):     func_split_long_opt_arg=${1#*=}
                   1235:4): } # Extended-shell func_split_long_opt implementation
1.1       misho    1236: 
1.1.1.1.2.3.2  1(misho  1237:4): exit_cmd=:
1.1       misho    1238: 
                   1239: 
                   1240: 
                   1241: 
                   1242: 
                   1243: magic="%%%MAGIC variable%%%"
                   1244: magic_exe="%%%MAGIC EXE variable%%%"
                   1245: 
                   1246: # Global variables.
                   1247: nonopt=
                   1248: preserve_args=
                   1249: lo2o="s/\\.lo\$/.${objext}/"
                   1250: o2lo="s/\\.${objext}\$/.lo/"
                   1251: extracted_archives=
                   1252: extracted_serial=0
                   1253: 
                   1254: # If this variable is set in any of the actions, the command in it
                   1255: # will be execed at the end.  This prevents here-documents from being
                   1256: # left over by shells.
                   1257: exec_cmd=
                   1258: 
1.1.1.1.2.3.2  1(misho  1259:4): # func_append var value
                   1260:4): # Append VALUE to the end of shell variable VAR.
                   1261:4): func_append ()
                   1262:4): {
                   1263:4):     eval "${1}=\$${1}\${2}"
                   1264:4): } # func_append may be replaced by extended shell implementation
                   1265:4): 
                   1266:4): # func_append_quoted var value
                   1267:4): # Quote VALUE and append to the end of shell variable VAR, separated
                   1268:4): # by a space.
                   1269:4): func_append_quoted ()
                   1270:4): {
                   1271:4):     func_quote_for_eval "${2}"
                   1272:4):     eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
                   1273:4): } # func_append_quoted may be replaced by extended shell implementation
                   1274:4): 
                   1275:4): 
                   1276:4): # func_arith arithmetic-term...
                   1277:4): func_arith ()
                   1278:4): {
                   1279:4): func_arith_result=$(( $* ))
                   1280:4): } # Extended-shell func_arith implementation
                   1281:4): 
                   1282:4): 
                   1283:4): # func_len string
                   1284:4): # STRING may not start with a hyphen.
                   1285:4): func_len ()
                   1286:4): {
                   1287:4): func_len_result=${#1}
                   1288:4): } # Extended-shell func_len implementation
                   1289:4): 
                   1290:4): 
                   1291:4): # func_lo2o object
                   1292:4): func_lo2o ()
                   1293:4): {
                   1294:4):     case ${1} in
                   1295:4):       *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
                   1296:4):       *)    func_lo2o_result=${1} ;;
                   1297:4):     esac
                   1298:4): } # Extended-shell func_lo2o implementation
                   1299:4): 
                   1300:4): 
                   1301:4): # func_xform libobj-or-source
                   1302:4): func_xform ()
                   1303:4): {
                   1304:4): func_xform_result=${1%.*}.lo
                   1305:4): } # Extended-shell func_xform implementation
                   1306:4): 
                   1307:4): 
1.1       misho    1308: # func_fatal_configuration arg...
                   1309: # Echo program name prefixed message to standard error, followed by
                   1310: # a configuration failure hint, and exit.
                   1311: func_fatal_configuration ()
                   1312: {
                   1313:     func_error ${1+"$@"}
                   1314:     func_error "See the $PACKAGE documentation for more information."
                   1315:     func_fatal_error "Fatal configuration error."
                   1316: }
                   1317: 
                   1318: 
                   1319: # func_config
                   1320: # Display the configuration for all the tags in this script.
                   1321: func_config ()
                   1322: {
                   1323:     re_begincf='^# ### BEGIN LIBTOOL'
                   1324:     re_endcf='^# ### END LIBTOOL'
                   1325: 
                   1326:     # Default configuration.
                   1327:     $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
                   1328: 
                   1329:     # Now print the configurations for the tags.
                   1330:     for tagname in $taglist; do
                   1331:       $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
                   1332:     done
                   1333: 
                   1334:     exit $?
                   1335: }
                   1336: 
                   1337: # func_features
                   1338: # Display the features supported by this script.
                   1339: func_features ()
                   1340: {
1.1.1.1.2.3.2  1(misho  1341:4):     echo "host: $host"
1.1       misho    1342:     if test "$build_libtool_libs" = yes; then
1.1.1.1.2.3.2  1(misho  1343:4):       echo "enable shared libraries"
1.1       misho    1344:     else
1.1.1.1.2.3.2  1(misho  1345:4):       echo "disable shared libraries"
1.1       misho    1346:     fi
                   1347:     if test "$build_old_libs" = yes; then
1.1.1.1.2.3.2  1(misho  1348:4):       echo "enable static libraries"
1.1       misho    1349:     else
1.1.1.1.2.3.2  1(misho  1350:4):       echo "disable static libraries"
1.1       misho    1351:     fi
                   1352: 
                   1353:     exit $?
                   1354: }
                   1355: 
                   1356: # func_enable_tag tagname
                   1357: # Verify that TAGNAME is valid, and either flag an error and exit, or
                   1358: # enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
                   1359: # variable here.
                   1360: func_enable_tag ()
                   1361: {
                   1362:   # Global variable:
                   1363:   tagname="$1"
                   1364: 
                   1365:   re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
                   1366:   re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
                   1367:   sed_extractcf="/$re_begincf/,/$re_endcf/p"
                   1368: 
                   1369:   # Validate tagname.
                   1370:   case $tagname in
                   1371:     *[!-_A-Za-z0-9,/]*)
                   1372:       func_fatal_error "invalid tag name: $tagname"
                   1373:       ;;
                   1374:   esac
                   1375: 
                   1376:   # Don't test for the "default" C tag, as we know it's
                   1377:   # there but not specially marked.
                   1378:   case $tagname in
                   1379:     CC) ;;
                   1380:     *)
                   1381:       if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
                   1382:        taglist="$taglist $tagname"
                   1383: 
                   1384:        # Evaluate the configuration.  Be careful to quote the path
                   1385:        # and the sed script, to avoid splitting on whitespace, but
                   1386:        # also don't use non-portable quotes within backquotes within
                   1387:        # quotes we have to do it in 2 steps:
                   1388:        extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
                   1389:        eval "$extractedcf"
                   1390:       else
                   1391:        func_error "ignoring unknown tag $tagname"
                   1392:       fi
                   1393:       ;;
                   1394:   esac
                   1395: }
                   1396: 
1.1.1.1.2.3.2  1(misho  1397:4): # func_check_version_match
                   1398:4): # Ensure that we are using m4 macros, and libtool script from the same
                   1399:4): # release of libtool.
                   1400:4): func_check_version_match ()
1.1       misho    1401: {
1.1.1.1.2.3.2  1(misho  1402:4):   if test "$package_revision" != "$macro_revision"; then
                   1403:4):     if test "$VERSION" != "$macro_version"; then
                   1404:4):       if test -z "$macro_version"; then
                   1405:4):         cat >&2 <<_LT_EOF
                   1406:4): $progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
                   1407:4): $progname: definition of this LT_INIT comes from an older release.
                   1408:4): $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
                   1409:4): $progname: and run autoconf again.
                   1410:4): _LT_EOF
                   1411:4):       else
                   1412:4):         cat >&2 <<_LT_EOF
                   1413:4): $progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
                   1414:4): $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
                   1415:4): $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
                   1416:4): $progname: and run autoconf again.
                   1417:4): _LT_EOF
                   1418:4):       fi
                   1419:4):     else
                   1420:4):       cat >&2 <<_LT_EOF
                   1421:4): $progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
                   1422:4): $progname: but the definition of this LT_INIT comes from revision $macro_revision.
                   1423:4): $progname: You should recreate aclocal.m4 with macros from revision $package_revision
                   1424:4): $progname: of $PACKAGE $VERSION and run autoconf again.
                   1425:4): _LT_EOF
                   1426:4):     fi
1.1       misho    1427: 
1.1.1.1.2.3.2  1(misho  1428:4):     exit $EXIT_MISMATCH
                   1429:4):   fi
                   1430:4): }
1.1       misho    1431: 
                   1432: 
1.1.1.1.2.3.2  1(misho  1433:4): # Shorthand for --mode=foo, only valid as the first argument
                   1434:4): case $1 in
                   1435:4): clean|clea|cle|cl)
                   1436:4):   shift; set dummy --mode clean ${1+"$@"}; shift
                   1437:4):   ;;
                   1438:4): compile|compil|compi|comp|com|co|c)
                   1439:4):   shift; set dummy --mode compile ${1+"$@"}; shift
                   1440:4):   ;;
                   1441:4): execute|execut|execu|exec|exe|ex|e)
                   1442:4):   shift; set dummy --mode execute ${1+"$@"}; shift
                   1443:4):   ;;
                   1444:4): finish|finis|fini|fin|fi|f)
                   1445:4):   shift; set dummy --mode finish ${1+"$@"}; shift
                   1446:4):   ;;
                   1447:4): install|instal|insta|inst|ins|in|i)
                   1448:4):   shift; set dummy --mode install ${1+"$@"}; shift
                   1449:4):   ;;
                   1450:4): link|lin|li|l)
                   1451:4):   shift; set dummy --mode link ${1+"$@"}; shift
                   1452:4):   ;;
                   1453:4): uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
                   1454:4):   shift; set dummy --mode uninstall ${1+"$@"}; shift
                   1455:4):   ;;
                   1456:4): esac
1.1       misho    1457: 
                   1458: 
                   1459: 
1.1.1.1.2.3.2  1(misho  1460:4): # Option defaults:
                   1461:4): opt_debug=:
                   1462:4): opt_dry_run=false
                   1463:4): opt_config=false
                   1464:4): opt_preserve_dup_deps=false
                   1465:4): opt_features=false
                   1466:4): opt_finish=false
                   1467:4): opt_help=false
                   1468:4): opt_help_all=false
                   1469:4): opt_silent=:
                   1470:4): opt_warning=:
                   1471:4): opt_verbose=:
                   1472:4): opt_silent=false
                   1473:4): opt_verbose=false
1.1       misho    1474: 
                   1475: 
1.1.1.1.2.3.2  1(misho  1476:4): # Parse options once, thoroughly.  This comes as soon as possible in the
                   1477:4): # script to make things like `--version' happen as quickly as we can.
                   1478:4): {
                   1479:4):   # this just eases exit handling
                   1480:4):   while test $# -gt 0; do
                   1481:4):     opt="$1"
                   1482:4):     shift
                   1483:4):     case $opt in
                   1484:4):       --debug|-x)   opt_debug='set -x'
                   1485:4):                     func_echo "enabling shell trace mode"
                   1486:4):                     $opt_debug
                   1487:4):                     ;;
                   1488:4):       --dry-run|--dryrun|-n)
                   1489:4):                     opt_dry_run=:
                   1490:4):                     ;;
                   1491:4):       --config)
                   1492:4):                     opt_config=:
                   1493:4): func_config
                   1494:4):                     ;;
                   1495:4):       --dlopen|-dlopen)
                   1496:4):                     optarg="$1"
                   1497:4):                     opt_dlopen="${opt_dlopen+$opt_dlopen
                   1498:4): }$optarg"
                   1499:4):                     shift
                   1500:4):                     ;;
                   1501:4):       --preserve-dup-deps)
                   1502:4):                     opt_preserve_dup_deps=:
                   1503:4):                     ;;
                   1504:4):       --features)
                   1505:4):                     opt_features=:
                   1506:4): func_features
                   1507:4):                     ;;
                   1508:4):       --finish)
                   1509:4):                     opt_finish=:
                   1510:4): set dummy --mode finish ${1+"$@"}; shift
                   1511:4):                     ;;
                   1512:4):       --help)
                   1513:4):                     opt_help=:
                   1514:4):                     ;;
                   1515:4):       --help-all)
                   1516:4):                     opt_help_all=:
                   1517:4): opt_help=': help-all'
                   1518:4):                     ;;
                   1519:4):       --mode)
                   1520:4):                     test $# = 0 && func_missing_arg $opt && break
                   1521:4):                     optarg="$1"
                   1522:4):                     opt_mode="$optarg"
                   1523:4): case $optarg in
                   1524:4):   # Valid mode arguments:
                   1525:4):   clean|compile|execute|finish|install|link|relink|uninstall) ;;
                   1526:4): 
                   1527:4):   # Catch anything else as an error
                   1528:4):   *) func_error "invalid argument for $opt"
                   1529:4):      exit_cmd=exit
                   1530:4):      break
                   1531:4):      ;;
                   1532:4): esac
                   1533:4):                     shift
                   1534:4):                     ;;
                   1535:4):       --no-silent|--no-quiet)
1.1       misho    1536:                        opt_silent=false
1.1.1.1.2.3.2  1(misho  1537:4): preserve_args="$preserve_args $opt"
1.1       misho    1538:                        ;;
1.1.1.1.2.3.2  1(misho  1539:4):       --no-warning|--no-warn)
                   1540:4):                     opt_warning=false
                   1541:4): preserve_args="$preserve_args $opt"
                   1542:4):                     ;;
                   1543:4):       --no-verbose)
                   1544:4):                     opt_verbose=false
                   1545:4): preserve_args="$preserve_args $opt"
                   1546:4):                     ;;
                   1547:4):       --silent|--quiet)
                   1548:4):                     opt_silent=:
                   1549:4): preserve_args="$preserve_args $opt"
                   1550:4):         opt_verbose=false
                   1551:4):                     ;;
                   1552:4):       --verbose|-v)
                   1553:4):                     opt_verbose=:
                   1554:4): preserve_args="$preserve_args $opt"
                   1555:4): opt_silent=false
                   1556:4):                     ;;
                   1557:4):       --tag)
                   1558:4):                     test $# = 0 && func_missing_arg $opt && break
                   1559:4):                     optarg="$1"
                   1560:4):                     opt_tag="$optarg"
                   1561:4): preserve_args="$preserve_args $opt $optarg"
                   1562:4): func_enable_tag "$optarg"
1.1       misho    1563:                        shift
                   1564:                        ;;
                   1565: 
1.1.1.1.2.3.2  1(misho  1566:4):       -\?|-h)               func_usage                              ;;
                   1567:4):       --help)               func_help                               ;;
                   1568:4):       --version)    func_version                            ;;
                   1569:4): 
1.1       misho    1570:       # Separate optargs to long options:
1.1.1.1.2.3.2  1(misho  1571:4):       --*=*)
                   1572:4):                     func_split_long_opt "$opt"
                   1573:4):                     set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
1.1       misho    1574:                        shift
                   1575:                        ;;
                   1576: 
1.1.1.1.2.3.2  1(misho  1577:4):       # Separate non-argument short options:
                   1578:4):       -\?*|-h*|-n*|-v*)
                   1579:4):                     func_split_short_opt "$opt"
                   1580:4):                     set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
                   1581:4):                     shift
1.1       misho    1582:                        ;;
1.1.1.1.2.3.2  1(misho  1583:4): 
                   1584:4):       --)           break                                   ;;
                   1585:4):       -*)           func_fatal_help "unrecognized option \`$opt'" ;;
                   1586:4):       *)            set dummy "$opt" ${1+"$@"};     shift; break  ;;
1.1       misho    1587:     esac
                   1588:   done
                   1589: 
1.1.1.1.2.3.2  1(misho  1590:4):   # Validate options:
                   1591:4): 
                   1592:4):   # save first non-option argument
                   1593:4):   if test "$#" -gt 0; then
                   1594:4):     nonopt="$opt"
                   1595:4):     shift
                   1596:4):   fi
                   1597:4): 
                   1598:4):   # preserve --debug
                   1599:4):   test "$opt_debug" = : || preserve_args="$preserve_args --debug"
1.1       misho    1600: 
                   1601:   case $host in
                   1602:     *cygwin* | *mingw* | *pw32* | *cegcc*)
                   1603:       # don't eliminate duplications in $postdeps and $predeps
                   1604:       opt_duplicate_compiler_generated_deps=:
                   1605:       ;;
                   1606:     *)
1.1.1.1.2.3.2  1(misho  1607:4):       opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
1.1       misho    1608:       ;;
                   1609:   esac
                   1610: 
1.1.1.1.2.3.2  1(misho  1611:4):   $opt_help || {
                   1612:4):     # Sanity checks first:
                   1613:4):     func_check_version_match
1.1       misho    1614: 
1.1.1.1.2.3.2  1(misho  1615:4):     if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
                   1616:4):       func_fatal_configuration "not configured to build any kind of library"
1.1       misho    1617:     fi
                   1618: 
1.1.1.1.2.3.2  1(misho  1619:4):     # Darwin sucks
                   1620:4):     eval std_shrext=\"$shrext_cmds\"
1.1       misho    1621: 
1.1.1.1.2.3.2  1(misho  1622:4):     # Only execute mode is allowed to have -dlopen flags.
                   1623:4):     if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
                   1624:4):       func_error "unrecognized option \`-dlopen'"
                   1625:4):       $ECHO "$help" 1>&2
                   1626:4):       exit $EXIT_FAILURE
                   1627:4):     fi
1.1       misho    1628: 
1.1.1.1.2.3.2  1(misho  1629:4):     # Change the help message to a mode-specific one.
                   1630:4):     generic_help="$help"
                   1631:4):     help="Try \`$progname --help --mode=$opt_mode' for more information."
                   1632:4):   }
1.1       misho    1633: 
                   1634: 
1.1.1.1.2.3.2  1(misho  1635:4):   # Bail if the options were screwed
                   1636:4):   $exit_cmd $EXIT_FAILURE
                   1637:4): }
1.1       misho    1638: 
                   1639: 
                   1640: 
                   1641: 
1.1.1.1.2.3.2  1(misho  1642:4): ## ----------- ##
                   1643:4): ##    Main.    ##
                   1644:4): ## ----------- ##
1.1       misho    1645: 
                   1646: # func_lalib_p file
                   1647: # True iff FILE is a libtool `.la' library or `.lo' object file.
                   1648: # This function is only a basic sanity check; it will hardly flush out
                   1649: # determined imposters.
                   1650: func_lalib_p ()
                   1651: {
                   1652:     test -f "$1" &&
                   1653:       $SED -e 4q "$1" 2>/dev/null \
                   1654:         | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
                   1655: }
                   1656: 
                   1657: # func_lalib_unsafe_p file
                   1658: # True iff FILE is a libtool `.la' library or `.lo' object file.
                   1659: # This function implements the same check as func_lalib_p without
                   1660: # resorting to external programs.  To this end, it redirects stdin and
                   1661: # closes it afterwards, without saving the original file descriptor.
                   1662: # As a safety measure, use it only where a negative result would be
                   1663: # fatal anyway.  Works if `file' does not exist.
                   1664: func_lalib_unsafe_p ()
                   1665: {
                   1666:     lalib_p=no
                   1667:     if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
                   1668:        for lalib_p_l in 1 2 3 4
                   1669:        do
                   1670:            read lalib_p_line
                   1671:            case "$lalib_p_line" in
                   1672:                \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
                   1673:            esac
                   1674:        done
                   1675:        exec 0<&5 5<&-
                   1676:     fi
                   1677:     test "$lalib_p" = yes
                   1678: }
                   1679: 
                   1680: # func_ltwrapper_script_p file
                   1681: # True iff FILE is a libtool wrapper script
                   1682: # This function is only a basic sanity check; it will hardly flush out
                   1683: # determined imposters.
                   1684: func_ltwrapper_script_p ()
                   1685: {
                   1686:     func_lalib_p "$1"
                   1687: }
                   1688: 
                   1689: # func_ltwrapper_executable_p file
                   1690: # True iff FILE is a libtool wrapper executable
                   1691: # This function is only a basic sanity check; it will hardly flush out
                   1692: # determined imposters.
                   1693: func_ltwrapper_executable_p ()
                   1694: {
                   1695:     func_ltwrapper_exec_suffix=
                   1696:     case $1 in
                   1697:     *.exe) ;;
                   1698:     *) func_ltwrapper_exec_suffix=.exe ;;
                   1699:     esac
                   1700:     $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
                   1701: }
                   1702: 
                   1703: # func_ltwrapper_scriptname file
                   1704: # Assumes file is an ltwrapper_executable
                   1705: # uses $file to determine the appropriate filename for a
                   1706: # temporary ltwrapper_script.
                   1707: func_ltwrapper_scriptname ()
                   1708: {
1.1.1.1.2.3.2  1(misho  1709:4):     func_dirname_and_basename "$1" "" "."
                   1710:4):     func_stripname '' '.exe' "$func_basename_result"
                   1711:4):     func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
1.1       misho    1712: }
                   1713: 
                   1714: # func_ltwrapper_p file
                   1715: # True iff FILE is a libtool wrapper script or wrapper executable
                   1716: # This function is only a basic sanity check; it will hardly flush out
                   1717: # determined imposters.
                   1718: func_ltwrapper_p ()
                   1719: {
                   1720:     func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
                   1721: }
                   1722: 
                   1723: 
                   1724: # func_execute_cmds commands fail_cmd
                   1725: # Execute tilde-delimited COMMANDS.
                   1726: # If FAIL_CMD is given, eval that upon failure.
                   1727: # FAIL_CMD may read-access the current command in variable CMD!
                   1728: func_execute_cmds ()
                   1729: {
                   1730:     $opt_debug
                   1731:     save_ifs=$IFS; IFS='~'
                   1732:     for cmd in $1; do
                   1733:       IFS=$save_ifs
                   1734:       eval cmd=\"$cmd\"
                   1735:       func_show_eval "$cmd" "${2-:}"
                   1736:     done
                   1737:     IFS=$save_ifs
                   1738: }
                   1739: 
                   1740: 
                   1741: # func_source file
                   1742: # Source FILE, adding directory component if necessary.
                   1743: # Note that it is not necessary on cygwin/mingw to append a dot to
                   1744: # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
                   1745: # behavior happens only for exec(3), not for open(2)!  Also, sourcing
                   1746: # `FILE.' does not work on cygwin managed mounts.
                   1747: func_source ()
                   1748: {
                   1749:     $opt_debug
                   1750:     case $1 in
                   1751:     */* | *\\*)        . "$1" ;;
                   1752:     *)         . "./$1" ;;
                   1753:     esac
                   1754: }
                   1755: 
                   1756: 
1.1.1.1.2.3.2  1(misho  1757:4): # func_resolve_sysroot PATH
                   1758:4): # Replace a leading = in PATH with a sysroot.  Store the result into
                   1759:4): # func_resolve_sysroot_result
                   1760:4): func_resolve_sysroot ()
                   1761:4): {
                   1762:4):   func_resolve_sysroot_result=$1
                   1763:4):   case $func_resolve_sysroot_result in
                   1764:4):   =*)
                   1765:4):     func_stripname '=' '' "$func_resolve_sysroot_result"
                   1766:4):     func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
                   1767:4):     ;;
                   1768:4):   esac
                   1769:4): }
                   1770:4): 
                   1771:4): # func_replace_sysroot PATH
                   1772:4): # If PATH begins with the sysroot, replace it with = and
                   1773:4): # store the result into func_replace_sysroot_result.
                   1774:4): func_replace_sysroot ()
                   1775:4): {
                   1776:4):   case "$lt_sysroot:$1" in
                   1777:4):   ?*:"$lt_sysroot"*)
                   1778:4):     func_stripname "$lt_sysroot" '' "$1"
                   1779:4):     func_replace_sysroot_result="=$func_stripname_result"
                   1780:4):     ;;
                   1781:4):   *)
                   1782:4):     # Including no sysroot.
                   1783:4):     func_replace_sysroot_result=$1
                   1784:4):     ;;
                   1785:4):   esac
                   1786:4): }
                   1787:4): 
1.1       misho    1788: # func_infer_tag arg
                   1789: # Infer tagged configuration to use if any are available and
                   1790: # if one wasn't chosen via the "--tag" command line option.
                   1791: # Only attempt this if the compiler in the base compile
                   1792: # command doesn't match the default compiler.
                   1793: # arg is usually of the form 'gcc ...'
                   1794: func_infer_tag ()
                   1795: {
                   1796:     $opt_debug
                   1797:     if test -n "$available_tags" && test -z "$tagname"; then
                   1798:       CC_quoted=
                   1799:       for arg in $CC; do
1.1.1.1.2.3.2  1(misho  1800:4):     func_append_quoted CC_quoted "$arg"
1.1       misho    1801:       done
1.1.1.1.2.3.2  1(misho  1802:4):       CC_expanded=`func_echo_all $CC`
                   1803:4):       CC_quoted_expanded=`func_echo_all $CC_quoted`
1.1       misho    1804:       case $@ in
                   1805:       # Blanks in the command may have been stripped by the calling shell,
                   1806:       # but not from the CC environment variable when configure was run.
1.1.1.1.2.3.2  1(misho  1807:4):       " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
                   1808:4):       " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
1.1       misho    1809:       # Blanks at the start of $base_compile will cause this to fail
                   1810:       # if we don't check for them as well.
                   1811:       *)
                   1812:        for z in $available_tags; do
                   1813:          if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
                   1814:            # Evaluate the configuration.
                   1815:            eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
                   1816:            CC_quoted=
                   1817:            for arg in $CC; do
                   1818:              # Double-quote args containing other shell metacharacters.
1.1.1.1.2.3.2  1(misho  1819:4):           func_append_quoted CC_quoted "$arg"
1.1       misho    1820:            done
1.1.1.1.2.3.2  1(misho  1821:4):         CC_expanded=`func_echo_all $CC`
                   1822:4):         CC_quoted_expanded=`func_echo_all $CC_quoted`
1.1       misho    1823:            case "$@ " in
1.1.1.1.2.3.2  1(misho  1824:4):         " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
                   1825:4):         " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
1.1       misho    1826:              # The compiler in the base compile command matches
                   1827:              # the one in the tagged configuration.
                   1828:              # Assume this is the tagged configuration we want.
                   1829:              tagname=$z
                   1830:              break
                   1831:              ;;
                   1832:            esac
                   1833:          fi
                   1834:        done
                   1835:        # If $tagname still isn't set, then no tagged configuration
                   1836:        # was found and let the user know that the "--tag" command
                   1837:        # line option must be used.
                   1838:        if test -z "$tagname"; then
                   1839:          func_echo "unable to infer tagged configuration"
                   1840:          func_fatal_error "specify a tag with \`--tag'"
                   1841: #      else
                   1842: #        func_verbose "using $tagname tagged configuration"
                   1843:        fi
                   1844:        ;;
                   1845:       esac
                   1846:     fi
                   1847: }
                   1848: 
                   1849: 
                   1850: 
                   1851: # func_write_libtool_object output_name pic_name nonpic_name
                   1852: # Create a libtool object file (analogous to a ".la" file),
                   1853: # but don't create it if we're doing a dry run.
                   1854: func_write_libtool_object ()
                   1855: {
                   1856:     write_libobj=${1}
                   1857:     if test "$build_libtool_libs" = yes; then
                   1858:       write_lobj=\'${2}\'
                   1859:     else
                   1860:       write_lobj=none
                   1861:     fi
                   1862: 
                   1863:     if test "$build_old_libs" = yes; then
                   1864:       write_oldobj=\'${3}\'
                   1865:     else
                   1866:       write_oldobj=none
                   1867:     fi
                   1868: 
                   1869:     $opt_dry_run || {
                   1870:       cat >${write_libobj}T <<EOF
                   1871: # $write_libobj - a libtool object file
                   1872: # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
                   1873: #
                   1874: # Please DO NOT delete this file!
                   1875: # It is necessary for linking the library.
                   1876: 
                   1877: # Name of the PIC object.
                   1878: pic_object=$write_lobj
                   1879: 
                   1880: # Name of the non-PIC object
                   1881: non_pic_object=$write_oldobj
                   1882: 
                   1883: EOF
                   1884:       $MV "${write_libobj}T" "${write_libobj}"
                   1885:     }
                   1886: }
                   1887: 
1.1.1.1.2.3.2  1(misho  1888:4): 
                   1889:4): ##################################################
                   1890:4): # FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
                   1891:4): ##################################################
                   1892:4): 
                   1893:4): # func_convert_core_file_wine_to_w32 ARG
                   1894:4): # Helper function used by file name conversion functions when $build is *nix,
                   1895:4): # and $host is mingw, cygwin, or some other w32 environment. Relies on a
                   1896:4): # correctly configured wine environment available, with the winepath program
                   1897:4): # in $build's $PATH.
                   1898:4): #
                   1899:4): # ARG is the $build file name to be converted to w32 format.
                   1900:4): # Result is available in $func_convert_core_file_wine_to_w32_result, and will
                   1901:4): # be empty on error (or when ARG is empty)
                   1902:4): func_convert_core_file_wine_to_w32 ()
                   1903:4): {
                   1904:4):   $opt_debug
                   1905:4):   func_convert_core_file_wine_to_w32_result="$1"
                   1906:4):   if test -n "$1"; then
                   1907:4):     # Unfortunately, winepath does not exit with a non-zero error code, so we
                   1908:4):     # are forced to check the contents of stdout. On the other hand, if the
                   1909:4):     # command is not found, the shell will set an exit code of 127 and print
                   1910:4):     # *an error message* to stdout. So we must check for both error code of
                   1911:4):     # zero AND non-empty stdout, which explains the odd construction:
                   1912:4):     func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
                   1913:4):     if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
                   1914:4):       func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
                   1915:4):         $SED -e "$lt_sed_naive_backslashify"`
                   1916:4):     else
                   1917:4):       func_convert_core_file_wine_to_w32_result=
                   1918:4):     fi
                   1919:4):   fi
                   1920:4): }
                   1921:4): # end: func_convert_core_file_wine_to_w32
                   1922:4): 
                   1923:4): 
                   1924:4): # func_convert_core_path_wine_to_w32 ARG
                   1925:4): # Helper function used by path conversion functions when $build is *nix, and
                   1926:4): # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
                   1927:4): # configured wine environment available, with the winepath program in $build's
                   1928:4): # $PATH. Assumes ARG has no leading or trailing path separator characters.
                   1929:4): #
                   1930:4): # ARG is path to be converted from $build format to win32.
                   1931:4): # Result is available in $func_convert_core_path_wine_to_w32_result.
                   1932:4): # Unconvertible file (directory) names in ARG are skipped; if no directory names
                   1933:4): # are convertible, then the result may be empty.
                   1934:4): func_convert_core_path_wine_to_w32 ()
                   1935:4): {
                   1936:4):   $opt_debug
                   1937:4):   # unfortunately, winepath doesn't convert paths, only file names
                   1938:4):   func_convert_core_path_wine_to_w32_result=""
                   1939:4):   if test -n "$1"; then
                   1940:4):     oldIFS=$IFS
                   1941:4):     IFS=:
                   1942:4):     for func_convert_core_path_wine_to_w32_f in $1; do
                   1943:4):       IFS=$oldIFS
                   1944:4):       func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
                   1945:4):       if test -n "$func_convert_core_file_wine_to_w32_result" ; then
                   1946:4):         if test -z "$func_convert_core_path_wine_to_w32_result"; then
                   1947:4):           func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
                   1948:4):         else
                   1949:4):           func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
                   1950:4):         fi
                   1951:4):       fi
                   1952:4):     done
                   1953:4):     IFS=$oldIFS
                   1954:4):   fi
                   1955:4): }
                   1956:4): # end: func_convert_core_path_wine_to_w32
                   1957:4): 
                   1958:4): 
                   1959:4): # func_cygpath ARGS...
                   1960:4): # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
                   1961:4): # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
                   1962:4): # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
                   1963:4): # (2), returns the Cygwin file name or path in func_cygpath_result (input
                   1964:4): # file name or path is assumed to be in w32 format, as previously converted
                   1965:4): # from $build's *nix or MSYS format). In case (3), returns the w32 file name
                   1966:4): # or path in func_cygpath_result (input file name or path is assumed to be in
                   1967:4): # Cygwin format). Returns an empty string on error.
                   1968:4): #
                   1969:4): # ARGS are passed to cygpath, with the last one being the file name or path to
                   1970:4): # be converted.
                   1971:4): #
                   1972:4): # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
                   1973:4): # environment variable; do not put it in $PATH.
                   1974:4): func_cygpath ()
                   1975:4): {
                   1976:4):   $opt_debug
                   1977:4):   if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
                   1978:4):     func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
                   1979:4):     if test "$?" -ne 0; then
                   1980:4):       # on failure, ensure result is empty
                   1981:4):       func_cygpath_result=
                   1982:4):     fi
                   1983:4):   else
                   1984:4):     func_cygpath_result=
                   1985:4):     func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
                   1986:4):   fi
                   1987:4): }
                   1988:4): #end: func_cygpath
                   1989:4): 
                   1990:4): 
                   1991:4): # func_convert_core_msys_to_w32 ARG
                   1992:4): # Convert file name or path ARG from MSYS format to w32 format.  Return
                   1993:4): # result in func_convert_core_msys_to_w32_result.
                   1994:4): func_convert_core_msys_to_w32 ()
                   1995:4): {
                   1996:4):   $opt_debug
                   1997:4):   # awkward: cmd appends spaces to result
                   1998:4):   func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
                   1999:4):     $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
                   2000:4): }
                   2001:4): #end: func_convert_core_msys_to_w32
                   2002:4): 
                   2003:4): 
                   2004:4): # func_convert_file_check ARG1 ARG2
                   2005:4): # Verify that ARG1 (a file name in $build format) was converted to $host
                   2006:4): # format in ARG2. Otherwise, emit an error message, but continue (resetting
                   2007:4): # func_to_host_file_result to ARG1).
                   2008:4): func_convert_file_check ()
                   2009:4): {
                   2010:4):   $opt_debug
                   2011:4):   if test -z "$2" && test -n "$1" ; then
                   2012:4):     func_error "Could not determine host file name corresponding to"
                   2013:4):     func_error "  \`$1'"
                   2014:4):     func_error "Continuing, but uninstalled executables may not work."
                   2015:4):     # Fallback:
                   2016:4):     func_to_host_file_result="$1"
                   2017:4):   fi
                   2018:4): }
                   2019:4): # end func_convert_file_check
                   2020:4): 
                   2021:4): 
                   2022:4): # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
                   2023:4): # Verify that FROM_PATH (a path in $build format) was converted to $host
                   2024:4): # format in TO_PATH. Otherwise, emit an error message, but continue, resetting
                   2025:4): # func_to_host_file_result to a simplistic fallback value (see below).
                   2026:4): func_convert_path_check ()
                   2027:4): {
                   2028:4):   $opt_debug
                   2029:4):   if test -z "$4" && test -n "$3"; then
                   2030:4):     func_error "Could not determine the host path corresponding to"
                   2031:4):     func_error "  \`$3'"
                   2032:4):     func_error "Continuing, but uninstalled executables may not work."
                   2033:4):     # Fallback.  This is a deliberately simplistic "conversion" and
                   2034:4):     # should not be "improved".  See libtool.info.
                   2035:4):     if test "x$1" != "x$2"; then
                   2036:4):       lt_replace_pathsep_chars="s|$1|$2|g"
                   2037:4):       func_to_host_path_result=`echo "$3" |
                   2038:4):         $SED -e "$lt_replace_pathsep_chars"`
                   2039:4):     else
                   2040:4):       func_to_host_path_result="$3"
                   2041:4):     fi
                   2042:4):   fi
                   2043:4): }
                   2044:4): # end func_convert_path_check
                   2045:4): 
                   2046:4): 
                   2047:4): # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
                   2048:4): # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
                   2049:4): # and appending REPL if ORIG matches BACKPAT.
                   2050:4): func_convert_path_front_back_pathsep ()
                   2051:4): {
                   2052:4):   $opt_debug
                   2053:4):   case $4 in
                   2054:4):   $1 ) func_to_host_path_result="$3$func_to_host_path_result"
                   2055:4):     ;;
                   2056:4):   esac
                   2057:4):   case $4 in
                   2058:4):   $2 ) func_to_host_path_result="$func_to_host_path_result$3"
                   2059:4):     ;;
                   2060:4):   esac
                   2061:4): }
                   2062:4): # end func_convert_path_front_back_pathsep
                   2063:4): 
                   2064:4): 
                   2065:4): ##################################################
                   2066:4): # $build to $host FILE NAME CONVERSION FUNCTIONS #
                   2067:4): ##################################################
                   2068:4): # invoked via `$to_host_file_cmd ARG'
                   2069:4): #
                   2070:4): # In each case, ARG is the path to be converted from $build to $host format.
                   2071:4): # Result will be available in $func_to_host_file_result.
                   2072:4): 
                   2073:4): 
                   2074:4): # func_to_host_file ARG
                   2075:4): # Converts the file name ARG from $build format to $host format. Return result
                   2076:4): # in func_to_host_file_result.
                   2077:4): func_to_host_file ()
                   2078:4): {
                   2079:4):   $opt_debug
                   2080:4):   $to_host_file_cmd "$1"
                   2081:4): }
                   2082:4): # end func_to_host_file
                   2083:4): 
                   2084:4): 
                   2085:4): # func_to_tool_file ARG LAZY
                   2086:4): # converts the file name ARG from $build format to toolchain format. Return
                   2087:4): # result in func_to_tool_file_result.  If the conversion in use is listed
                   2088:4): # in (the comma separated) LAZY, no conversion takes place.
                   2089:4): func_to_tool_file ()
                   2090:4): {
                   2091:4):   $opt_debug
                   2092:4):   case ,$2, in
                   2093:4):     *,"$to_tool_file_cmd",*)
                   2094:4):       func_to_tool_file_result=$1
                   2095:4):       ;;
                   2096:4):     *)
                   2097:4):       $to_tool_file_cmd "$1"
                   2098:4):       func_to_tool_file_result=$func_to_host_file_result
                   2099:4):       ;;
                   2100:4):   esac
                   2101:4): }
                   2102:4): # end func_to_tool_file
                   2103:4): 
                   2104:4): 
                   2105:4): # func_convert_file_noop ARG
                   2106:4): # Copy ARG to func_to_host_file_result.
                   2107:4): func_convert_file_noop ()
                   2108:4): {
                   2109:4):   func_to_host_file_result="$1"
                   2110:4): }
                   2111:4): # end func_convert_file_noop
                   2112:4): 
                   2113:4): 
                   2114:4): # func_convert_file_msys_to_w32 ARG
                   2115:4): # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
                   2116:4): # conversion to w32 is not available inside the cwrapper.  Returns result in
                   2117:4): # func_to_host_file_result.
                   2118:4): func_convert_file_msys_to_w32 ()
                   2119:4): {
                   2120:4):   $opt_debug
                   2121:4):   func_to_host_file_result="$1"
                   2122:4):   if test -n "$1"; then
                   2123:4):     func_convert_core_msys_to_w32 "$1"
                   2124:4):     func_to_host_file_result="$func_convert_core_msys_to_w32_result"
                   2125:4):   fi
                   2126:4):   func_convert_file_check "$1" "$func_to_host_file_result"
                   2127:4): }
                   2128:4): # end func_convert_file_msys_to_w32
                   2129:4): 
                   2130:4): 
                   2131:4): # func_convert_file_cygwin_to_w32 ARG
                   2132:4): # Convert file name ARG from Cygwin to w32 format.  Returns result in
                   2133:4): # func_to_host_file_result.
                   2134:4): func_convert_file_cygwin_to_w32 ()
                   2135:4): {
                   2136:4):   $opt_debug
                   2137:4):   func_to_host_file_result="$1"
                   2138:4):   if test -n "$1"; then
                   2139:4):     # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
                   2140:4):     # LT_CYGPATH in this case.
                   2141:4):     func_to_host_file_result=`cygpath -m "$1"`
                   2142:4):   fi
                   2143:4):   func_convert_file_check "$1" "$func_to_host_file_result"
                   2144:4): }
                   2145:4): # end func_convert_file_cygwin_to_w32
                   2146:4): 
                   2147:4): 
                   2148:4): # func_convert_file_nix_to_w32 ARG
                   2149:4): # Convert file name ARG from *nix to w32 format.  Requires a wine environment
                   2150:4): # and a working winepath. Returns result in func_to_host_file_result.
                   2151:4): func_convert_file_nix_to_w32 ()
                   2152:4): {
                   2153:4):   $opt_debug
                   2154:4):   func_to_host_file_result="$1"
                   2155:4):   if test -n "$1"; then
                   2156:4):     func_convert_core_file_wine_to_w32 "$1"
                   2157:4):     func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
                   2158:4):   fi
                   2159:4):   func_convert_file_check "$1" "$func_to_host_file_result"
                   2160:4): }
                   2161:4): # end func_convert_file_nix_to_w32
                   2162:4): 
                   2163:4): 
                   2164:4): # func_convert_file_msys_to_cygwin ARG
                   2165:4): # Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
                   2166:4): # Returns result in func_to_host_file_result.
                   2167:4): func_convert_file_msys_to_cygwin ()
                   2168:4): {
                   2169:4):   $opt_debug
                   2170:4):   func_to_host_file_result="$1"
                   2171:4):   if test -n "$1"; then
                   2172:4):     func_convert_core_msys_to_w32 "$1"
                   2173:4):     func_cygpath -u "$func_convert_core_msys_to_w32_result"
                   2174:4):     func_to_host_file_result="$func_cygpath_result"
                   2175:4):   fi
                   2176:4):   func_convert_file_check "$1" "$func_to_host_file_result"
                   2177:4): }
                   2178:4): # end func_convert_file_msys_to_cygwin
                   2179:4): 
                   2180:4): 
                   2181:4): # func_convert_file_nix_to_cygwin ARG
                   2182:4): # Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
                   2183:4): # in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
                   2184:4): # in func_to_host_file_result.
                   2185:4): func_convert_file_nix_to_cygwin ()
                   2186:4): {
                   2187:4):   $opt_debug
                   2188:4):   func_to_host_file_result="$1"
                   2189:4):   if test -n "$1"; then
                   2190:4):     # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
                   2191:4):     func_convert_core_file_wine_to_w32 "$1"
                   2192:4):     func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
                   2193:4):     func_to_host_file_result="$func_cygpath_result"
                   2194:4):   fi
                   2195:4):   func_convert_file_check "$1" "$func_to_host_file_result"
                   2196:4): }
                   2197:4): # end func_convert_file_nix_to_cygwin
                   2198:4): 
                   2199:4): 
                   2200:4): #############################################
                   2201:4): # $build to $host PATH CONVERSION FUNCTIONS #
                   2202:4): #############################################
                   2203:4): # invoked via `$to_host_path_cmd ARG'
                   2204:4): #
                   2205:4): # In each case, ARG is the path to be converted from $build to $host format.
                   2206:4): # The result will be available in $func_to_host_path_result.
                   2207:4): #
                   2208:4): # Path separators are also converted from $build format to $host format.  If
                   2209:4): # ARG begins or ends with a path separator character, it is preserved (but
                   2210:4): # converted to $host format) on output.
                   2211:4): #
                   2212:4): # All path conversion functions are named using the following convention:
                   2213:4): #   file name conversion function    : func_convert_file_X_to_Y ()
                   2214:4): #   path conversion function         : func_convert_path_X_to_Y ()
                   2215:4): # where, for any given $build/$host combination the 'X_to_Y' value is the
                   2216:4): # same.  If conversion functions are added for new $build/$host combinations,
                   2217:4): # the two new functions must follow this pattern, or func_init_to_host_path_cmd
                   2218:4): # will break.
                   2219:4): 
                   2220:4): 
                   2221:4): # func_init_to_host_path_cmd
                   2222:4): # Ensures that function "pointer" variable $to_host_path_cmd is set to the
                   2223:4): # appropriate value, based on the value of $to_host_file_cmd.
                   2224:4): to_host_path_cmd=
                   2225:4): func_init_to_host_path_cmd ()
                   2226:4): {
                   2227:4):   $opt_debug
                   2228:4):   if test -z "$to_host_path_cmd"; then
                   2229:4):     func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
                   2230:4):     to_host_path_cmd="func_convert_path_${func_stripname_result}"
                   2231:4):   fi
                   2232:4): }
                   2233:4): 
                   2234:4): 
                   2235:4): # func_to_host_path ARG
                   2236:4): # Converts the path ARG from $build format to $host format. Return result
                   2237:4): # in func_to_host_path_result.
                   2238:4): func_to_host_path ()
                   2239:4): {
                   2240:4):   $opt_debug
                   2241:4):   func_init_to_host_path_cmd
                   2242:4):   $to_host_path_cmd "$1"
                   2243:4): }
                   2244:4): # end func_to_host_path
                   2245:4): 
                   2246:4): 
                   2247:4): # func_convert_path_noop ARG
                   2248:4): # Copy ARG to func_to_host_path_result.
                   2249:4): func_convert_path_noop ()
                   2250:4): {
                   2251:4):   func_to_host_path_result="$1"
                   2252:4): }
                   2253:4): # end func_convert_path_noop
                   2254:4): 
                   2255:4): 
                   2256:4): # func_convert_path_msys_to_w32 ARG
                   2257:4): # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
                   2258:4): # conversion to w32 is not available inside the cwrapper.  Returns result in
                   2259:4): # func_to_host_path_result.
                   2260:4): func_convert_path_msys_to_w32 ()
                   2261:4): {
                   2262:4):   $opt_debug
                   2263:4):   func_to_host_path_result="$1"
                   2264:4):   if test -n "$1"; then
                   2265:4):     # Remove leading and trailing path separator characters from ARG.  MSYS
                   2266:4):     # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
                   2267:4):     # and winepath ignores them completely.
                   2268:4):     func_stripname : : "$1"
                   2269:4):     func_to_host_path_tmp1=$func_stripname_result
                   2270:4):     func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
                   2271:4):     func_to_host_path_result="$func_convert_core_msys_to_w32_result"
                   2272:4):     func_convert_path_check : ";" \
                   2273:4):       "$func_to_host_path_tmp1" "$func_to_host_path_result"
                   2274:4):     func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
                   2275:4):   fi
                   2276:4): }
                   2277:4): # end func_convert_path_msys_to_w32
                   2278:4): 
                   2279:4): 
                   2280:4): # func_convert_path_cygwin_to_w32 ARG
                   2281:4): # Convert path ARG from Cygwin to w32 format.  Returns result in
                   2282:4): # func_to_host_file_result.
                   2283:4): func_convert_path_cygwin_to_w32 ()
                   2284:4): {
                   2285:4):   $opt_debug
                   2286:4):   func_to_host_path_result="$1"
                   2287:4):   if test -n "$1"; then
                   2288:4):     # See func_convert_path_msys_to_w32:
                   2289:4):     func_stripname : : "$1"
                   2290:4):     func_to_host_path_tmp1=$func_stripname_result
                   2291:4):     func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
                   2292:4):     func_convert_path_check : ";" \
                   2293:4):       "$func_to_host_path_tmp1" "$func_to_host_path_result"
                   2294:4):     func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
                   2295:4):   fi
                   2296:4): }
                   2297:4): # end func_convert_path_cygwin_to_w32
                   2298:4): 
                   2299:4): 
                   2300:4): # func_convert_path_nix_to_w32 ARG
                   2301:4): # Convert path ARG from *nix to w32 format.  Requires a wine environment and
                   2302:4): # a working winepath.  Returns result in func_to_host_file_result.
                   2303:4): func_convert_path_nix_to_w32 ()
                   2304:4): {
                   2305:4):   $opt_debug
                   2306:4):   func_to_host_path_result="$1"
                   2307:4):   if test -n "$1"; then
                   2308:4):     # See func_convert_path_msys_to_w32:
                   2309:4):     func_stripname : : "$1"
                   2310:4):     func_to_host_path_tmp1=$func_stripname_result
                   2311:4):     func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
                   2312:4):     func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
                   2313:4):     func_convert_path_check : ";" \
                   2314:4):       "$func_to_host_path_tmp1" "$func_to_host_path_result"
                   2315:4):     func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
                   2316:4):   fi
                   2317:4): }
                   2318:4): # end func_convert_path_nix_to_w32
                   2319:4): 
                   2320:4): 
                   2321:4): # func_convert_path_msys_to_cygwin ARG
                   2322:4): # Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
                   2323:4): # Returns result in func_to_host_file_result.
                   2324:4): func_convert_path_msys_to_cygwin ()
                   2325:4): {
                   2326:4):   $opt_debug
                   2327:4):   func_to_host_path_result="$1"
                   2328:4):   if test -n "$1"; then
                   2329:4):     # See func_convert_path_msys_to_w32:
                   2330:4):     func_stripname : : "$1"
                   2331:4):     func_to_host_path_tmp1=$func_stripname_result
                   2332:4):     func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
                   2333:4):     func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
                   2334:4):     func_to_host_path_result="$func_cygpath_result"
                   2335:4):     func_convert_path_check : : \
                   2336:4):       "$func_to_host_path_tmp1" "$func_to_host_path_result"
                   2337:4):     func_convert_path_front_back_pathsep ":*" "*:" : "$1"
                   2338:4):   fi
                   2339:4): }
                   2340:4): # end func_convert_path_msys_to_cygwin
                   2341:4): 
                   2342:4): 
                   2343:4): # func_convert_path_nix_to_cygwin ARG
                   2344:4): # Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
                   2345:4): # a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
                   2346:4): # func_to_host_file_result.
                   2347:4): func_convert_path_nix_to_cygwin ()
                   2348:4): {
                   2349:4):   $opt_debug
                   2350:4):   func_to_host_path_result="$1"
                   2351:4):   if test -n "$1"; then
                   2352:4):     # Remove leading and trailing path separator characters from
                   2353:4):     # ARG. msys behavior is inconsistent here, cygpath turns them
                   2354:4):     # into '.;' and ';.', and winepath ignores them completely.
                   2355:4):     func_stripname : : "$1"
                   2356:4):     func_to_host_path_tmp1=$func_stripname_result
                   2357:4):     func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
                   2358:4):     func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
                   2359:4):     func_to_host_path_result="$func_cygpath_result"
                   2360:4):     func_convert_path_check : : \
                   2361:4):       "$func_to_host_path_tmp1" "$func_to_host_path_result"
                   2362:4):     func_convert_path_front_back_pathsep ":*" "*:" : "$1"
                   2363:4):   fi
                   2364:4): }
                   2365:4): # end func_convert_path_nix_to_cygwin
                   2366:4): 
                   2367:4): 
1.1       misho    2368: # func_mode_compile arg...
                   2369: func_mode_compile ()
                   2370: {
                   2371:     $opt_debug
                   2372:     # Get the compilation command and the source file.
                   2373:     base_compile=
                   2374:     srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
                   2375:     suppress_opt=yes
                   2376:     suppress_output=
                   2377:     arg_mode=normal
                   2378:     libobj=
                   2379:     later=
                   2380:     pie_flag=
                   2381: 
                   2382:     for arg
                   2383:     do
                   2384:       case $arg_mode in
                   2385:       arg  )
                   2386:        # do not "continue".  Instead, add this to base_compile
                   2387:        lastarg="$arg"
                   2388:        arg_mode=normal
                   2389:        ;;
                   2390: 
                   2391:       target )
                   2392:        libobj="$arg"
                   2393:        arg_mode=normal
                   2394:        continue
                   2395:        ;;
                   2396: 
                   2397:       normal )
                   2398:        # Accept any command-line options.
                   2399:        case $arg in
                   2400:        -o)
                   2401:          test -n "$libobj" && \
                   2402:            func_fatal_error "you cannot specify \`-o' more than once"
                   2403:          arg_mode=target
                   2404:          continue
                   2405:          ;;
                   2406: 
                   2407:        -pie | -fpie | -fPIE)
                   2408:           pie_flag="$pie_flag $arg"
                   2409:          continue
                   2410:          ;;
                   2411: 
                   2412:        -shared | -static | -prefer-pic | -prefer-non-pic)
                   2413:          later="$later $arg"
                   2414:          continue
                   2415:          ;;
                   2416: 
                   2417:        -no-suppress)
                   2418:          suppress_opt=no
                   2419:          continue
                   2420:          ;;
                   2421: 
                   2422:        -Xcompiler)
                   2423:          arg_mode=arg  #  the next one goes into the "base_compile" arg list
                   2424:          continue      #  The current "srcfile" will either be retained or
                   2425:          ;;            #  replaced later.  I would guess that would be a bug.
                   2426: 
                   2427:        -Wc,*)
                   2428:          func_stripname '-Wc,' '' "$arg"
                   2429:          args=$func_stripname_result
                   2430:          lastarg=
                   2431:          save_ifs="$IFS"; IFS=','
                   2432:          for arg in $args; do
                   2433:            IFS="$save_ifs"
1.1.1.1.2.3.2  1(misho  2434:4):         func_append_quoted lastarg "$arg"
1.1       misho    2435:          done
                   2436:          IFS="$save_ifs"
                   2437:          func_stripname ' ' '' "$lastarg"
                   2438:          lastarg=$func_stripname_result
                   2439: 
                   2440:          # Add the arguments to base_compile.
                   2441:          base_compile="$base_compile $lastarg"
                   2442:          continue
                   2443:          ;;
                   2444: 
                   2445:        *)
                   2446:          # Accept the current argument as the source file.
                   2447:          # The previous "srcfile" becomes the current argument.
                   2448:          #
                   2449:          lastarg="$srcfile"
                   2450:          srcfile="$arg"
                   2451:          ;;
                   2452:        esac  #  case $arg
                   2453:        ;;
                   2454:       esac    #  case $arg_mode
                   2455: 
                   2456:       # Aesthetically quote the previous argument.
1.1.1.1.2.3.2  1(misho  2457:4):       func_append_quoted base_compile "$lastarg"
1.1       misho    2458:     done # for arg
                   2459: 
                   2460:     case $arg_mode in
                   2461:     arg)
                   2462:       func_fatal_error "you must specify an argument for -Xcompile"
                   2463:       ;;
                   2464:     target)
                   2465:       func_fatal_error "you must specify a target with \`-o'"
                   2466:       ;;
                   2467:     *)
                   2468:       # Get the name of the library object.
                   2469:       test -z "$libobj" && {
                   2470:        func_basename "$srcfile"
                   2471:        libobj="$func_basename_result"
                   2472:       }
                   2473:       ;;
                   2474:     esac
                   2475: 
                   2476:     # Recognize several different file suffixes.
                   2477:     # If the user specifies -o file.o, it is replaced with file.lo
                   2478:     case $libobj in
                   2479:     *.[cCFSifmso] | \
                   2480:     *.ada | *.adb | *.ads | *.asm | \
                   2481:     *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
1.1.1.1.2.3.2  1(misho  2482:4):     *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
1.1       misho    2483:       func_xform "$libobj"
                   2484:       libobj=$func_xform_result
                   2485:       ;;
                   2486:     esac
                   2487: 
                   2488:     case $libobj in
                   2489:     *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
                   2490:     *)
                   2491:       func_fatal_error "cannot determine name of library object from \`$libobj'"
                   2492:       ;;
                   2493:     esac
                   2494: 
                   2495:     func_infer_tag $base_compile
                   2496: 
                   2497:     for arg in $later; do
                   2498:       case $arg in
                   2499:       -shared)
                   2500:        test "$build_libtool_libs" != yes && \
                   2501:          func_fatal_configuration "can not build a shared library"
                   2502:        build_old_libs=no
                   2503:        continue
                   2504:        ;;
                   2505: 
                   2506:       -static)
                   2507:        build_libtool_libs=no
                   2508:        build_old_libs=yes
                   2509:        continue
                   2510:        ;;
                   2511: 
                   2512:       -prefer-pic)
                   2513:        pic_mode=yes
                   2514:        continue
                   2515:        ;;
                   2516: 
                   2517:       -prefer-non-pic)
                   2518:        pic_mode=no
                   2519:        continue
                   2520:        ;;
                   2521:       esac
                   2522:     done
                   2523: 
                   2524:     func_quote_for_eval "$libobj"
                   2525:     test "X$libobj" != "X$func_quote_for_eval_result" \
                   2526:       && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'   &()|`$[]' \
                   2527:       && func_warning "libobj name \`$libobj' may not contain shell special characters."
                   2528:     func_dirname_and_basename "$obj" "/" ""
                   2529:     objname="$func_basename_result"
                   2530:     xdir="$func_dirname_result"
                   2531:     lobj=${xdir}$objdir/$objname
                   2532: 
                   2533:     test -z "$base_compile" && \
                   2534:       func_fatal_help "you must specify a compilation command"
                   2535: 
                   2536:     # Delete any leftover library objects.
                   2537:     if test "$build_old_libs" = yes; then
                   2538:       removelist="$obj $lobj $libobj ${libobj}T"
                   2539:     else
                   2540:       removelist="$lobj $libobj ${libobj}T"
                   2541:     fi
                   2542: 
                   2543:     # On Cygwin there's no "real" PIC flag so we must build both object types
                   2544:     case $host_os in
                   2545:     cygwin* | mingw* | pw32* | os2* | cegcc*)
                   2546:       pic_mode=default
                   2547:       ;;
                   2548:     esac
                   2549:     if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
                   2550:       # non-PIC code in shared libraries is not supported
                   2551:       pic_mode=default
                   2552:     fi
                   2553: 
                   2554:     # Calculate the filename of the output object if compiler does
                   2555:     # not support -o with -c
                   2556:     if test "$compiler_c_o" = no; then
1.1.1.1.2.3.2  1(misho  2557:4):       output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
1.1       misho    2558:       lockfile="$output_obj.lock"
                   2559:     else
                   2560:       output_obj=
                   2561:       need_locks=no
                   2562:       lockfile=
                   2563:     fi
                   2564: 
                   2565:     # Lock this critical section if it is needed
                   2566:     # We use this script file to make the link, it avoids creating a new file
                   2567:     if test "$need_locks" = yes; then
                   2568:       until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
                   2569:        func_echo "Waiting for $lockfile to be removed"
                   2570:        sleep 2
                   2571:       done
                   2572:     elif test "$need_locks" = warn; then
                   2573:       if test -f "$lockfile"; then
                   2574:        $ECHO "\
                   2575: *** ERROR, $lockfile exists and contains:
                   2576: `cat $lockfile 2>/dev/null`
                   2577: 
                   2578: This indicates that another process is trying to use the same
                   2579: temporary object file, and libtool could not work around it because
                   2580: your compiler does not support \`-c' and \`-o' together.  If you
                   2581: repeat this compilation, it may succeed, by chance, but you had better
                   2582: avoid parallel builds (make -j) in this platform, or get a better
                   2583: compiler."
                   2584: 
                   2585:        $opt_dry_run || $RM $removelist
                   2586:        exit $EXIT_FAILURE
                   2587:       fi
                   2588:       removelist="$removelist $output_obj"
                   2589:       $ECHO "$srcfile" > "$lockfile"
                   2590:     fi
                   2591: 
                   2592:     $opt_dry_run || $RM $removelist
                   2593:     removelist="$removelist $lockfile"
                   2594:     trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
                   2595: 
1.1.1.1.2.3.2  1(misho  2596:4):     func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
                   2597:4):     srcfile=$func_to_tool_file_result
1.1       misho    2598:     func_quote_for_eval "$srcfile"
                   2599:     qsrcfile=$func_quote_for_eval_result
                   2600: 
                   2601:     # Only build a PIC object if we are building libtool libraries.
                   2602:     if test "$build_libtool_libs" = yes; then
                   2603:       # Without this assignment, base_compile gets emptied.
                   2604:       fbsd_hideous_sh_bug=$base_compile
                   2605: 
                   2606:       if test "$pic_mode" != no; then
                   2607:        command="$base_compile $qsrcfile $pic_flag"
                   2608:       else
                   2609:        # Don't build PIC code
                   2610:        command="$base_compile $qsrcfile"
                   2611:       fi
                   2612: 
                   2613:       func_mkdir_p "$xdir$objdir"
                   2614: 
                   2615:       if test -z "$output_obj"; then
                   2616:        # Place PIC objects in $objdir
                   2617:        command="$command -o $lobj"
                   2618:       fi
                   2619: 
                   2620:       func_show_eval_locale "$command" \
                   2621:           'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
                   2622: 
                   2623:       if test "$need_locks" = warn &&
                   2624:         test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
                   2625:        $ECHO "\
                   2626: *** ERROR, $lockfile contains:
                   2627: `cat $lockfile 2>/dev/null`
                   2628: 
                   2629: but it should contain:
                   2630: $srcfile
                   2631: 
                   2632: This indicates that another process is trying to use the same
                   2633: temporary object file, and libtool could not work around it because
                   2634: your compiler does not support \`-c' and \`-o' together.  If you
                   2635: repeat this compilation, it may succeed, by chance, but you had better
                   2636: avoid parallel builds (make -j) in this platform, or get a better
                   2637: compiler."
                   2638: 
                   2639:        $opt_dry_run || $RM $removelist
                   2640:        exit $EXIT_FAILURE
                   2641:       fi
                   2642: 
                   2643:       # Just move the object if needed, then go on to compile the next one
                   2644:       if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
                   2645:        func_show_eval '$MV "$output_obj" "$lobj"' \
                   2646:          'error=$?; $opt_dry_run || $RM $removelist; exit $error'
                   2647:       fi
                   2648: 
                   2649:       # Allow error messages only from the first compilation.
                   2650:       if test "$suppress_opt" = yes; then
                   2651:        suppress_output=' >/dev/null 2>&1'
                   2652:       fi
                   2653:     fi
                   2654: 
                   2655:     # Only build a position-dependent object if we build old libraries.
                   2656:     if test "$build_old_libs" = yes; then
                   2657:       if test "$pic_mode" != yes; then
                   2658:        # Don't build PIC code
                   2659:        command="$base_compile $qsrcfile$pie_flag"
                   2660:       else
                   2661:        command="$base_compile $qsrcfile $pic_flag"
                   2662:       fi
                   2663:       if test "$compiler_c_o" = yes; then
                   2664:        command="$command -o $obj"
                   2665:       fi
                   2666: 
                   2667:       # Suppress compiler output if we already did a PIC compilation.
                   2668:       command="$command$suppress_output"
                   2669:       func_show_eval_locale "$command" \
                   2670:         '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
                   2671: 
                   2672:       if test "$need_locks" = warn &&
                   2673:         test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
                   2674:        $ECHO "\
                   2675: *** ERROR, $lockfile contains:
                   2676: `cat $lockfile 2>/dev/null`
                   2677: 
                   2678: but it should contain:
                   2679: $srcfile
                   2680: 
                   2681: This indicates that another process is trying to use the same
                   2682: temporary object file, and libtool could not work around it because
                   2683: your compiler does not support \`-c' and \`-o' together.  If you
                   2684: repeat this compilation, it may succeed, by chance, but you had better
                   2685: avoid parallel builds (make -j) in this platform, or get a better
                   2686: compiler."
                   2687: 
                   2688:        $opt_dry_run || $RM $removelist
                   2689:        exit $EXIT_FAILURE
                   2690:       fi
                   2691: 
                   2692:       # Just move the object if needed
                   2693:       if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
                   2694:        func_show_eval '$MV "$output_obj" "$obj"' \
                   2695:          'error=$?; $opt_dry_run || $RM $removelist; exit $error'
                   2696:       fi
                   2697:     fi
                   2698: 
                   2699:     $opt_dry_run || {
                   2700:       func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
                   2701: 
                   2702:       # Unlock the critical section if it was locked
                   2703:       if test "$need_locks" != no; then
                   2704:        removelist=$lockfile
                   2705:         $RM "$lockfile"
                   2706:       fi
                   2707:     }
                   2708: 
                   2709:     exit $EXIT_SUCCESS
                   2710: }
                   2711: 
                   2712: $opt_help || {
1.1.1.1.2.3.2  1(misho  2713:4):   test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
1.1       misho    2714: }
                   2715: 
                   2716: func_mode_help ()
                   2717: {
                   2718:     # We need to display help for each of the modes.
1.1.1.1.2.3.2  1(misho  2719:4):     case $opt_mode in
1.1       misho    2720:       "")
                   2721:         # Generic help is extracted from the usage comments
                   2722:         # at the start of this file.
                   2723:         func_help
                   2724:         ;;
                   2725: 
                   2726:       clean)
                   2727:         $ECHO \
                   2728: "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
                   2729: 
                   2730: Remove files from the build directory.
                   2731: 
                   2732: RM is the name of the program to use to delete files associated with each FILE
                   2733: (typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
                   2734: to RM.
                   2735: 
                   2736: If FILE is a libtool library, object or program, all the files associated
                   2737: with it are deleted. Otherwise, only FILE itself is deleted using RM."
                   2738:         ;;
                   2739: 
                   2740:       compile)
                   2741:       $ECHO \
                   2742: "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
                   2743: 
                   2744: Compile a source file into a libtool library object.
                   2745: 
                   2746: This mode accepts the following additional options:
                   2747: 
                   2748:   -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
                   2749:   -no-suppress      do not suppress compiler output for multiple passes
1.1.1.1.2.3.2  1(misho  2750:4):   -prefer-pic       try to build PIC objects only
                   2751:4):   -prefer-non-pic   try to build non-PIC objects only
1.1       misho    2752:   -shared           do not build a \`.o' file suitable for static linking
                   2753:   -static           only build a \`.o' file suitable for static linking
1.1.1.1.2.3.2  1(misho  2754:4):   -Wc,FLAG          pass FLAG directly to the compiler
1.1       misho    2755: 
                   2756: COMPILE-COMMAND is a command to be used in creating a \`standard' object file
                   2757: from the given SOURCEFILE.
                   2758: 
                   2759: The output file name is determined by removing the directory component from
                   2760: SOURCEFILE, then substituting the C source code suffix \`.c' with the
                   2761: library object suffix, \`.lo'."
                   2762:         ;;
                   2763: 
                   2764:       execute)
                   2765:         $ECHO \
                   2766: "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
                   2767: 
                   2768: Automatically set library path, then run a program.
                   2769: 
                   2770: This mode accepts the following additional options:
                   2771: 
                   2772:   -dlopen FILE      add the directory containing FILE to the library path
                   2773: 
                   2774: This mode sets the library path environment variable according to \`-dlopen'
                   2775: flags.
                   2776: 
                   2777: If any of the ARGS are libtool executable wrappers, then they are translated
                   2778: into their corresponding uninstalled binary, and any of their required library
                   2779: directories are added to the library path.
                   2780: 
                   2781: Then, COMMAND is executed, with ARGS as arguments."
                   2782:         ;;
                   2783: 
                   2784:       finish)
                   2785:         $ECHO \
                   2786: "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
                   2787: 
                   2788: Complete the installation of libtool libraries.
                   2789: 
                   2790: Each LIBDIR is a directory that contains libtool libraries.
                   2791: 
                   2792: The commands that this mode executes may require superuser privileges.  Use
                   2793: the \`--dry-run' option if you just want to see what would be executed."
                   2794:         ;;
                   2795: 
                   2796:       install)
                   2797:         $ECHO \
                   2798: "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
                   2799: 
                   2800: Install executables or libraries.
                   2801: 
                   2802: INSTALL-COMMAND is the installation command.  The first component should be
                   2803: either the \`install' or \`cp' program.
                   2804: 
                   2805: The following components of INSTALL-COMMAND are treated specially:
                   2806: 
1.1.1.1.2.3.2  1(misho  2807:4):   -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
1.1       misho    2808: 
                   2809: The rest of the components are interpreted as arguments to that command (only
                   2810: BSD-compatible install options are recognized)."
                   2811:         ;;
                   2812: 
                   2813:       link)
                   2814:         $ECHO \
                   2815: "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
                   2816: 
                   2817: Link object files or libraries together to form another library, or to
                   2818: create an executable program.
                   2819: 
                   2820: LINK-COMMAND is a command using the C compiler that you would use to create
                   2821: a program from several object files.
                   2822: 
                   2823: The following components of LINK-COMMAND are treated specially:
                   2824: 
                   2825:   -all-static       do not do any dynamic linking at all
                   2826:   -avoid-version    do not add a version suffix if possible
1.1.1.1.2.3.2  1(misho  2827:4):   -bindir BINDIR    specify path to binaries directory (for systems where
                   2828:4):                     libraries must be found in the PATH setting at runtime)
1.1       misho    2829:   -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
                   2830:   -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
                   2831:   -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
                   2832:   -export-symbols SYMFILE
                   2833:                     try to export only the symbols listed in SYMFILE
                   2834:   -export-symbols-regex REGEX
                   2835:                     try to export only the symbols matching REGEX
                   2836:   -LLIBDIR          search LIBDIR for required installed libraries
                   2837:   -lNAME            OUTPUT-FILE requires the installed library libNAME
                   2838:   -module           build a library that can dlopened
                   2839:   -no-fast-install  disable the fast-install mode
                   2840:   -no-install       link a not-installable executable
                   2841:   -no-undefined     declare that a library does not refer to external symbols
                   2842:   -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
                   2843:   -objectlist FILE  Use a list of object files found in FILE to specify objects
                   2844:   -precious-files-regex REGEX
                   2845:                     don't remove output files matching REGEX
                   2846:   -release RELEASE  specify package release information
                   2847:   -rpath LIBDIR     the created library will eventually be installed in LIBDIR
                   2848:   -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
                   2849:   -shared           only do dynamic linking of libtool libraries
                   2850:   -shrext SUFFIX    override the standard shared library file extension
                   2851:   -static           do not do any dynamic linking of uninstalled libtool libraries
                   2852:   -static-libtool-libs
                   2853:                     do not do any dynamic linking of libtool libraries
                   2854:   -version-info CURRENT[:REVISION[:AGE]]
                   2855:                     specify library version info [each variable defaults to 0]
                   2856:   -weak LIBNAME     declare that the target provides the LIBNAME interface
1.1.1.1.2.3.2  1(misho  2857:4):   -Wc,FLAG
                   2858:4):   -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
                   2859:4):   -Wl,FLAG
                   2860:4):   -Xlinker FLAG     pass linker-specific FLAG directly to the linker
                   2861:4):   -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
1.1       misho    2862: 
                   2863: All other options (arguments beginning with \`-') are ignored.
                   2864: 
                   2865: Every other argument is treated as a filename.  Files ending in \`.la' are
                   2866: treated as uninstalled libtool libraries, other files are standard or library
                   2867: object files.
                   2868: 
                   2869: If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
                   2870: only library objects (\`.lo' files) may be specified, and \`-rpath' is
                   2871: required, except when creating a convenience library.
                   2872: 
                   2873: If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
                   2874: using \`ar' and \`ranlib', or on Windows using \`lib'.
                   2875: 
                   2876: If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
                   2877: is created, otherwise an executable program is created."
                   2878:         ;;
                   2879: 
                   2880:       uninstall)
                   2881:         $ECHO \
                   2882: "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
                   2883: 
                   2884: Remove libraries from an installation directory.
                   2885: 
                   2886: RM is the name of the program to use to delete files associated with each FILE
                   2887: (typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
                   2888: to RM.
                   2889: 
                   2890: If FILE is a libtool library, all the files associated with it are deleted.
                   2891: Otherwise, only FILE itself is deleted using RM."
                   2892:         ;;
                   2893: 
                   2894:       *)
1.1.1.1.2.3.2  1(misho  2895:4):         func_fatal_help "invalid operation mode \`$opt_mode'"
1.1       misho    2896:         ;;
                   2897:     esac
                   2898: 
1.1.1.1.2.3.2  1(misho  2899:4):     echo
1.1       misho    2900:     $ECHO "Try \`$progname --help' for more information about other modes."
                   2901: }
                   2902: 
1.1.1.1.2.3.2  1(misho  2903:4): # Now that we've collected a possible --mode arg, show help if necessary
                   2904:4): if $opt_help; then
                   2905:4):   if test "$opt_help" = :; then
                   2906:4):     func_mode_help
                   2907:4):   else
                   2908:4):     {
                   2909:4):       func_help noexit
                   2910:4):       for opt_mode in compile link execute install finish uninstall clean; do
                   2911:4):     func_mode_help
                   2912:4):       done
                   2913:4):     } | sed -n '1p; 2,$s/^Usage:/  or: /p'
                   2914:4):     {
                   2915:4):       func_help noexit
                   2916:4):       for opt_mode in compile link execute install finish uninstall clean; do
                   2917:4):     echo
                   2918:4):     func_mode_help
                   2919:4):       done
                   2920:4):     } |
                   2921:4):     sed '1d
                   2922:4):       /^When reporting/,/^Report/{
                   2923:4):     H
                   2924:4):     d
                   2925:4):       }
                   2926:4):       $x
                   2927:4):       /information about other modes/d
                   2928:4):       /more detailed .*MODE/d
                   2929:4):       s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
                   2930:4):   fi
                   2931:4):   exit $?
                   2932:4): fi
1.1       misho    2933: 
                   2934: 
                   2935: # func_mode_execute arg...
                   2936: func_mode_execute ()
                   2937: {
                   2938:     $opt_debug
                   2939:     # The first argument is the command name.
                   2940:     cmd="$nonopt"
                   2941:     test -z "$cmd" && \
                   2942:       func_fatal_help "you must specify a COMMAND"
                   2943: 
                   2944:     # Handle -dlopen flags immediately.
1.1.1.1.2.3.2  1(misho  2945:4):     for file in $opt_dlopen; do
1.1       misho    2946:       test -f "$file" \
                   2947:        || func_fatal_help "\`$file' is not a file"
                   2948: 
                   2949:       dir=
                   2950:       case $file in
                   2951:       *.la)
1.1.1.1.2.3.2  1(misho  2952:4):     func_resolve_sysroot "$file"
                   2953:4):     file=$func_resolve_sysroot_result
                   2954:4): 
1.1       misho    2955:        # Check to see that this really is a libtool archive.
                   2956:        func_lalib_unsafe_p "$file" \
                   2957:          || func_fatal_help "\`$lib' is not a valid libtool archive"
                   2958: 
                   2959:        # Read the libtool library.
                   2960:        dlname=
                   2961:        library_names=
                   2962:        func_source "$file"
                   2963: 
                   2964:        # Skip this library if it cannot be dlopened.
                   2965:        if test -z "$dlname"; then
                   2966:          # Warn if it was a shared library.
                   2967:          test -n "$library_names" && \
                   2968:            func_warning "\`$file' was not linked with \`-export-dynamic'"
                   2969:          continue
                   2970:        fi
                   2971: 
                   2972:        func_dirname "$file" "" "."
                   2973:        dir="$func_dirname_result"
                   2974: 
                   2975:        if test -f "$dir/$objdir/$dlname"; then
                   2976:          dir="$dir/$objdir"
                   2977:        else
                   2978:          if test ! -f "$dir/$dlname"; then
                   2979:            func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
                   2980:          fi
                   2981:        fi
                   2982:        ;;
                   2983: 
                   2984:       *.lo)
                   2985:        # Just add the directory containing the .lo file.
                   2986:        func_dirname "$file" "" "."
                   2987:        dir="$func_dirname_result"
                   2988:        ;;
                   2989: 
                   2990:       *)
                   2991:        func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
                   2992:        continue
                   2993:        ;;
                   2994:       esac
                   2995: 
                   2996:       # Get the absolute pathname.
                   2997:       absdir=`cd "$dir" && pwd`
                   2998:       test -n "$absdir" && dir="$absdir"
                   2999: 
                   3000:       # Now add the directory to shlibpath_var.
                   3001:       if eval "test -z \"\$$shlibpath_var\""; then
                   3002:        eval "$shlibpath_var=\"\$dir\""
                   3003:       else
                   3004:        eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
                   3005:       fi
                   3006:     done
                   3007: 
                   3008:     # This variable tells wrapper scripts just to set shlibpath_var
                   3009:     # rather than running their programs.
                   3010:     libtool_execute_magic="$magic"
                   3011: 
                   3012:     # Check if any of the arguments is a wrapper script.
                   3013:     args=
                   3014:     for file
                   3015:     do
                   3016:       case $file in
1.1.1.1.2.3.2  1(misho  3017:4):       -* | *.la | *.lo ) ;;
1.1       misho    3018:       *)
                   3019:        # Do a test to see if this is really a libtool program.
                   3020:        if func_ltwrapper_script_p "$file"; then
                   3021:          func_source "$file"
                   3022:          # Transform arg to wrapped name.
                   3023:          file="$progdir/$program"
                   3024:        elif func_ltwrapper_executable_p "$file"; then
                   3025:          func_ltwrapper_scriptname "$file"
                   3026:          func_source "$func_ltwrapper_scriptname_result"
                   3027:          # Transform arg to wrapped name.
                   3028:          file="$progdir/$program"
                   3029:        fi
                   3030:        ;;
                   3031:       esac
                   3032:       # Quote arguments (to preserve shell metacharacters).
1.1.1.1.2.3.2  1(misho  3033:4):       func_append_quoted args "$file"
1.1       misho    3034:     done
                   3035: 
                   3036:     if test "X$opt_dry_run" = Xfalse; then
                   3037:       if test -n "$shlibpath_var"; then
                   3038:        # Export the shlibpath_var.
                   3039:        eval "export $shlibpath_var"
                   3040:       fi
                   3041: 
                   3042:       # Restore saved environment variables
                   3043:       for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
                   3044:       do
                   3045:        eval "if test \"\${save_$lt_var+set}\" = set; then
                   3046:                 $lt_var=\$save_$lt_var; export $lt_var
                   3047:              else
                   3048:                $lt_unset $lt_var
                   3049:              fi"
                   3050:       done
                   3051: 
                   3052:       # Now prepare to actually exec the command.
                   3053:       exec_cmd="\$cmd$args"
                   3054:     else
                   3055:       # Display what would be done.
                   3056:       if test -n "$shlibpath_var"; then
                   3057:        eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
1.1.1.1.2.3.2  1(misho  3058:4):     echo "export $shlibpath_var"
1.1       misho    3059:       fi
                   3060:       $ECHO "$cmd$args"
                   3061:       exit $EXIT_SUCCESS
                   3062:     fi
                   3063: }
                   3064: 
1.1.1.1.2.3.2  1(misho  3065:4): test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
1.1       misho    3066: 
                   3067: 
                   3068: # func_mode_finish arg...
                   3069: func_mode_finish ()
                   3070: {
                   3071:     $opt_debug
1.1.1.1.2.3.2  1(misho  3072:4):     libs=
                   3073:4):     libdirs=
1.1       misho    3074:     admincmds=
                   3075: 
1.1.1.1.2.3.2  1(misho  3076:4):     for opt in "$nonopt" ${1+"$@"}
                   3077:4):     do
                   3078:4):       if test -d "$opt"; then
                   3079:4):     libdirs="$libdirs $opt"
                   3080:4): 
                   3081:4):       elif test -f "$opt"; then
                   3082:4):     if func_lalib_unsafe_p "$opt"; then
                   3083:4):       libs="$libs $opt"
                   3084:4):     else
                   3085:4):       func_warning "\`$opt' is not a valid libtool archive"
                   3086:4):     fi
                   3087:4): 
                   3088:4):       else
                   3089:4):     func_fatal_error "invalid argument \`$opt'"
                   3090:4):       fi
                   3091:4):     done
1.1       misho    3092: 
1.1.1.1.2.3.2  1(misho  3093:4):     if test -n "$libs"; then
                   3094:4):       if test -n "$lt_sysroot"; then
                   3095:4):         sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
                   3096:4):         sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
                   3097:4):       else
                   3098:4):         sysroot_cmd=
                   3099:4):       fi
                   3100:4): 
                   3101:4):       # Remove sysroot references
                   3102:4):       if $opt_dry_run; then
                   3103:4):         for lib in $libs; do
                   3104:4):           echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
                   3105:4):         done
                   3106:4):       else
                   3107:4):         tmpdir=`func_mktempdir`
                   3108:4):         for lib in $libs; do
                   3109:4):       sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
                   3110:4):         > $tmpdir/tmp-la
                   3111:4):       mv -f $tmpdir/tmp-la $lib
                   3112:4):     done
                   3113:4):         ${RM}r "$tmpdir"
                   3114:4):       fi
                   3115:4):     fi
                   3116:4): 
                   3117:4):     if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
1.1       misho    3118:       for libdir in $libdirs; do
                   3119:        if test -n "$finish_cmds"; then
                   3120:          # Do each command in the finish commands.
                   3121:          func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
                   3122: '"$cmd"'"'
                   3123:        fi
                   3124:        if test -n "$finish_eval"; then
                   3125:          # Do the single finish_eval.
                   3126:          eval cmds=\"$finish_eval\"
                   3127:          $opt_dry_run || eval "$cmds" || admincmds="$admincmds
                   3128:        $cmds"
                   3129:        fi
                   3130:       done
                   3131:     fi
                   3132: 
                   3133:     # Exit here if they wanted silent mode.
                   3134:     $opt_silent && exit $EXIT_SUCCESS
                   3135: 
1.1.1.1.2.3.2  1(misho  3136:4):     if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
                   3137:4):       echo "----------------------------------------------------------------------"
                   3138:4):       echo "Libraries have been installed in:"
                   3139:4):       for libdir in $libdirs; do
                   3140:4):     $ECHO "   $libdir"
                   3141:4):       done
                   3142:4):       echo
                   3143:4):       echo "If you ever happen to want to link against installed libraries"
                   3144:4):       echo "in a given directory, LIBDIR, you must either use libtool, and"
                   3145:4):       echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
                   3146:4):       echo "flag during linking and do at least one of the following:"
                   3147:4):       if test -n "$shlibpath_var"; then
                   3148:4):     echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
                   3149:4):     echo "     during execution"
                   3150:4):       fi
                   3151:4):       if test -n "$runpath_var"; then
                   3152:4):     echo "   - add LIBDIR to the \`$runpath_var' environment variable"
                   3153:4):     echo "     during linking"
                   3154:4):       fi
                   3155:4):       if test -n "$hardcode_libdir_flag_spec"; then
                   3156:4):     libdir=LIBDIR
                   3157:4):     eval flag=\"$hardcode_libdir_flag_spec\"
                   3158:4): 
                   3159:4):     $ECHO "   - use the \`$flag' linker flag"
                   3160:4):       fi
                   3161:4):       if test -n "$admincmds"; then
                   3162:4):     $ECHO "   - have your system administrator run these commands:$admincmds"
                   3163:4):       fi
                   3164:4):       if test -f /etc/ld.so.conf; then
                   3165:4):     echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
                   3166:4):       fi
                   3167:4):       echo
1.1       misho    3168: 
1.1.1.1.2.3.2  1(misho  3169:4):       echo "See any operating system documentation about shared libraries for"
                   3170:4):       case $host in
                   3171:4):     solaris2.[6789]|solaris2.1[0-9])
                   3172:4):       echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
                   3173:4):       echo "pages."
                   3174:4):       ;;
                   3175:4):     *)
                   3176:4):       echo "more information, such as the ld(1) and ld.so(8) manual pages."
                   3177:4):       ;;
                   3178:4):       esac
                   3179:4):       echo "----------------------------------------------------------------------"
1.1       misho    3180:     fi
                   3181:     exit $EXIT_SUCCESS
                   3182: }
                   3183: 
1.1.1.1.2.3.2  1(misho  3184:4): test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
1.1       misho    3185: 
                   3186: 
                   3187: # func_mode_install arg...
                   3188: func_mode_install ()
                   3189: {
                   3190:     $opt_debug
                   3191:     # There may be an optional sh(1) argument at the beginning of
                   3192:     # install_prog (especially on Windows NT).
                   3193:     if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
                   3194:        # Allow the use of GNU shtool's install command.
1.1.1.1.2.3.2  1(misho  3195:4):        case $nonopt in *shtool*) :;; *) false;; esac; then
1.1       misho    3196:       # Aesthetically quote it.
                   3197:       func_quote_for_eval "$nonopt"
                   3198:       install_prog="$func_quote_for_eval_result "
                   3199:       arg=$1
                   3200:       shift
                   3201:     else
                   3202:       install_prog=
                   3203:       arg=$nonopt
                   3204:     fi
                   3205: 
                   3206:     # The real first argument should be the name of the installation program.
                   3207:     # Aesthetically quote it.
                   3208:     func_quote_for_eval "$arg"
                   3209:     install_prog="$install_prog$func_quote_for_eval_result"
1.1.1.1.2.3.2  1(misho  3210:4):     install_shared_prog=$install_prog
                   3211:4):     case " $install_prog " in
                   3212:4):       *[\\\ /]cp\ *) install_cp=: ;;
                   3213:4):       *) install_cp=false ;;
                   3214:4):     esac
1.1       misho    3215: 
                   3216:     # We need to accept at least all the BSD install flags.
                   3217:     dest=
                   3218:     files=
                   3219:     opts=
                   3220:     prev=
                   3221:     install_type=
                   3222:     isdir=no
                   3223:     stripme=
1.1.1.1.2.3.2  1(misho  3224:4):     no_mode=:
1.1       misho    3225:     for arg
                   3226:     do
1.1.1.1.2.3.2  1(misho  3227:4):       arg2=
1.1       misho    3228:       if test -n "$dest"; then
                   3229:        files="$files $dest"
                   3230:        dest=$arg
                   3231:        continue
                   3232:       fi
                   3233: 
                   3234:       case $arg in
                   3235:       -d) isdir=yes ;;
                   3236:       -f)
1.1.1.1.2.3.2  1(misho  3237:4):     if $install_cp; then :; else
                   3238:4):       prev=$arg
                   3239:4):     fi
1.1       misho    3240:        ;;
                   3241:       -g | -m | -o)
                   3242:        prev=$arg
                   3243:        ;;
                   3244:       -s)
                   3245:        stripme=" -s"
                   3246:        continue
                   3247:        ;;
                   3248:       -*)
                   3249:        ;;
                   3250:       *)
                   3251:        # If the previous option needed an argument, then skip it.
                   3252:        if test -n "$prev"; then
1.1.1.1.2.3.2  1(misho  3253:4):       if test "x$prev" = x-m && test -n "$install_override_mode"; then
                   3254:4):         arg2=$install_override_mode
                   3255:4):         no_mode=false
                   3256:4):       fi
1.1       misho    3257:          prev=
                   3258:        else
                   3259:          dest=$arg
                   3260:          continue
                   3261:        fi
                   3262:        ;;
                   3263:       esac
                   3264: 
                   3265:       # Aesthetically quote the argument.
                   3266:       func_quote_for_eval "$arg"
                   3267:       install_prog="$install_prog $func_quote_for_eval_result"
1.1.1.1.2.3.2  1(misho  3268:4):       if test -n "$arg2"; then
                   3269:4):     func_quote_for_eval "$arg2"
                   3270:4):       fi
                   3271:4):       install_shared_prog="$install_shared_prog $func_quote_for_eval_result"
1.1       misho    3272:     done
                   3273: 
                   3274:     test -z "$install_prog" && \
                   3275:       func_fatal_help "you must specify an install program"
                   3276: 
                   3277:     test -n "$prev" && \
                   3278:       func_fatal_help "the \`$prev' option requires an argument"
                   3279: 
1.1.1.1.2.3.2  1(misho  3280:4):     if test -n "$install_override_mode" && $no_mode; then
                   3281:4):       if $install_cp; then :; else
                   3282:4):     func_quote_for_eval "$install_override_mode"
                   3283:4):     install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result"
                   3284:4):       fi
                   3285:4):     fi
                   3286:4): 
1.1       misho    3287:     if test -z "$files"; then
                   3288:       if test -z "$dest"; then
                   3289:        func_fatal_help "no file or destination specified"
                   3290:       else
                   3291:        func_fatal_help "you must specify a destination"
                   3292:       fi
                   3293:     fi
                   3294: 
                   3295:     # Strip any trailing slash from the destination.
                   3296:     func_stripname '' '/' "$dest"
                   3297:     dest=$func_stripname_result
                   3298: 
                   3299:     # Check to see that the destination is a directory.
                   3300:     test -d "$dest" && isdir=yes
                   3301:     if test "$isdir" = yes; then
                   3302:       destdir="$dest"
                   3303:       destname=
                   3304:     else
                   3305:       func_dirname_and_basename "$dest" "" "."
                   3306:       destdir="$func_dirname_result"
                   3307:       destname="$func_basename_result"
                   3308: 
                   3309:       # Not a directory, so check to see that there is only one file specified.
                   3310:       set dummy $files; shift
                   3311:       test "$#" -gt 1 && \
                   3312:        func_fatal_help "\`$dest' is not a directory"
                   3313:     fi
                   3314:     case $destdir in
                   3315:     [\\/]* | [A-Za-z]:[\\/]*) ;;
                   3316:     *)
                   3317:       for file in $files; do
                   3318:        case $file in
                   3319:        *.lo) ;;
                   3320:        *)
                   3321:          func_fatal_help "\`$destdir' must be an absolute directory name"
                   3322:          ;;
                   3323:        esac
                   3324:       done
                   3325:       ;;
                   3326:     esac
                   3327: 
                   3328:     # This variable tells wrapper scripts just to set variables rather
                   3329:     # than running their programs.
                   3330:     libtool_install_magic="$magic"
                   3331: 
                   3332:     staticlibs=
                   3333:     future_libdirs=
                   3334:     current_libdirs=
                   3335:     for file in $files; do
                   3336: 
                   3337:       # Do each installation.
                   3338:       case $file in
                   3339:       *.$libext)
                   3340:        # Do the static libraries later.
                   3341:        staticlibs="$staticlibs $file"
                   3342:        ;;
                   3343: 
                   3344:       *.la)
1.1.1.1.2.3.2  1(misho  3345:4):     func_resolve_sysroot "$file"
                   3346:4):     file=$func_resolve_sysroot_result
                   3347:4): 
1.1       misho    3348:        # Check to see that this really is a libtool archive.
                   3349:        func_lalib_unsafe_p "$file" \
                   3350:          || func_fatal_help "\`$file' is not a valid libtool archive"
                   3351: 
                   3352:        library_names=
                   3353:        old_library=
                   3354:        relink_command=
                   3355:        func_source "$file"
                   3356: 
                   3357:        # Add the libdir to current_libdirs if it is the destination.
                   3358:        if test "X$destdir" = "X$libdir"; then
                   3359:          case "$current_libdirs " in
                   3360:          *" $libdir "*) ;;
                   3361:          *) current_libdirs="$current_libdirs $libdir" ;;
                   3362:          esac
                   3363:        else
                   3364:          # Note the libdir as a future libdir.
                   3365:          case "$future_libdirs " in
                   3366:          *" $libdir "*) ;;
                   3367:          *) future_libdirs="$future_libdirs $libdir" ;;
                   3368:          esac
                   3369:        fi
                   3370: 
                   3371:        func_dirname "$file" "/" ""
                   3372:        dir="$func_dirname_result"
                   3373:        dir="$dir$objdir"
                   3374: 
                   3375:        if test -n "$relink_command"; then
                   3376:          # Determine the prefix the user has applied to our future dir.
1.1.1.1.2.3.2  1(misho  3377:4):       inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
1.1       misho    3378: 
                   3379:          # Don't allow the user to place us outside of our expected
                   3380:          # location b/c this prevents finding dependent libraries that
                   3381:          # are installed to the same prefix.
                   3382:          # At present, this check doesn't affect windows .dll's that
                   3383:          # are installed into $libdir/../bin (currently, that works fine)
                   3384:          # but it's something to keep an eye on.
                   3385:          test "$inst_prefix_dir" = "$destdir" && \
                   3386:            func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
                   3387: 
                   3388:          if test -n "$inst_prefix_dir"; then
                   3389:            # Stick the inst_prefix_dir data into the link command.
1.1.1.1.2.3.2  1(misho  3390:4):         relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
1.1       misho    3391:          else
1.1.1.1.2.3.2  1(misho  3392:4):         relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
1.1       misho    3393:          fi
                   3394: 
                   3395:          func_warning "relinking \`$file'"
                   3396:          func_show_eval "$relink_command" \
                   3397:            'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
                   3398:        fi
                   3399: 
                   3400:        # See the names of the shared library.
                   3401:        set dummy $library_names; shift
                   3402:        if test -n "$1"; then
                   3403:          realname="$1"
                   3404:          shift
                   3405: 
                   3406:          srcname="$realname"
                   3407:          test -n "$relink_command" && srcname="$realname"T
                   3408: 
                   3409:          # Install the shared library and build the symlinks.
1.1.1.1.2.3.2  1(misho  3410:4):       func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
1.1       misho    3411:              'exit $?'
                   3412:          tstripme="$stripme"
                   3413:          case $host_os in
                   3414:          cygwin* | mingw* | pw32* | cegcc*)
                   3415:            case $realname in
                   3416:            *.dll.a)
                   3417:              tstripme=""
                   3418:              ;;
                   3419:            esac
                   3420:            ;;
                   3421:          esac
                   3422:          if test -n "$tstripme" && test -n "$striplib"; then
                   3423:            func_show_eval "$striplib $destdir/$realname" 'exit $?'
                   3424:          fi
                   3425: 
                   3426:          if test "$#" -gt 0; then
                   3427:            # Delete the old symlinks, and create new ones.
                   3428:            # Try `ln -sf' first, because the `ln' binary might depend on
                   3429:            # the symlink we replace!  Solaris /bin/ln does not understand -f,
                   3430:            # so we also need to try rm && ln -s.
                   3431:            for linkname
                   3432:            do
                   3433:              test "$linkname" != "$realname" \
                   3434:                && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
                   3435:            done
                   3436:          fi
                   3437: 
                   3438:          # Do each command in the postinstall commands.
                   3439:          lib="$destdir/$realname"
                   3440:          func_execute_cmds "$postinstall_cmds" 'exit $?'
                   3441:        fi
                   3442: 
                   3443:        # Install the pseudo-library for information purposes.
                   3444:        func_basename "$file"
                   3445:        name="$func_basename_result"
                   3446:        instname="$dir/$name"i
                   3447:        func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
                   3448: 
                   3449:        # Maybe install the static library, too.
                   3450:        test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
                   3451:        ;;
                   3452: 
                   3453:       *.lo)
                   3454:        # Install (i.e. copy) a libtool object.
                   3455: 
                   3456:        # Figure out destination file name, if it wasn't already specified.
                   3457:        if test -n "$destname"; then
                   3458:          destfile="$destdir/$destname"
                   3459:        else
                   3460:          func_basename "$file"
                   3461:          destfile="$func_basename_result"
                   3462:          destfile="$destdir/$destfile"
                   3463:        fi
                   3464: 
                   3465:        # Deduce the name of the destination old-style object file.
                   3466:        case $destfile in
                   3467:        *.lo)
                   3468:          func_lo2o "$destfile"
                   3469:          staticdest=$func_lo2o_result
                   3470:          ;;
                   3471:        *.$objext)
                   3472:          staticdest="$destfile"
                   3473:          destfile=
                   3474:          ;;
                   3475:        *)
                   3476:          func_fatal_help "cannot copy a libtool object to \`$destfile'"
                   3477:          ;;
                   3478:        esac
                   3479: 
                   3480:        # Install the libtool object if requested.
                   3481:        test -n "$destfile" && \
                   3482:          func_show_eval "$install_prog $file $destfile" 'exit $?'
                   3483: 
                   3484:        # Install the old object if enabled.
                   3485:        if test "$build_old_libs" = yes; then
                   3486:          # Deduce the name of the old-style object file.
                   3487:          func_lo2o "$file"
                   3488:          staticobj=$func_lo2o_result
                   3489:          func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
                   3490:        fi
                   3491:        exit $EXIT_SUCCESS
                   3492:        ;;
                   3493: 
                   3494:       *)
                   3495:        # Figure out destination file name, if it wasn't already specified.
                   3496:        if test -n "$destname"; then
                   3497:          destfile="$destdir/$destname"
                   3498:        else
                   3499:          func_basename "$file"
                   3500:          destfile="$func_basename_result"
                   3501:          destfile="$destdir/$destfile"
                   3502:        fi
                   3503: 
                   3504:        # If the file is missing, and there is a .exe on the end, strip it
                   3505:        # because it is most likely a libtool script we actually want to
                   3506:        # install
                   3507:        stripped_ext=""
                   3508:        case $file in
                   3509:          *.exe)
                   3510:            if test ! -f "$file"; then
                   3511:              func_stripname '' '.exe' "$file"
                   3512:              file=$func_stripname_result
                   3513:              stripped_ext=".exe"
                   3514:            fi
                   3515:            ;;
                   3516:        esac
                   3517: 
                   3518:        # Do a test to see if this is really a libtool program.
                   3519:        case $host in
                   3520:        *cygwin* | *mingw*)
                   3521:            if func_ltwrapper_executable_p "$file"; then
                   3522:              func_ltwrapper_scriptname "$file"
                   3523:              wrapper=$func_ltwrapper_scriptname_result
                   3524:            else
                   3525:              func_stripname '' '.exe' "$file"
                   3526:              wrapper=$func_stripname_result
                   3527:            fi
                   3528:            ;;
                   3529:        *)
                   3530:            wrapper=$file
                   3531:            ;;
                   3532:        esac
                   3533:        if func_ltwrapper_script_p "$wrapper"; then
                   3534:          notinst_deplibs=
                   3535:          relink_command=
                   3536: 
                   3537:          func_source "$wrapper"
                   3538: 
                   3539:          # Check the variables that should have been set.
                   3540:          test -z "$generated_by_libtool_version" && \
                   3541:            func_fatal_error "invalid libtool wrapper script \`$wrapper'"
                   3542: 
                   3543:          finalize=yes
                   3544:          for lib in $notinst_deplibs; do
                   3545:            # Check to see that each library is installed.
                   3546:            libdir=
                   3547:            if test -f "$lib"; then
                   3548:              func_source "$lib"
                   3549:            fi
1.1.1.1.2.3.2  1(misho  3550:4):         libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
1.1       misho    3551:            if test -n "$libdir" && test ! -f "$libfile"; then
                   3552:              func_warning "\`$lib' has not been installed in \`$libdir'"
                   3553:              finalize=no
                   3554:            fi
                   3555:          done
                   3556: 
                   3557:          relink_command=
                   3558:          func_source "$wrapper"
                   3559: 
                   3560:          outputname=
                   3561:          if test "$fast_install" = no && test -n "$relink_command"; then
                   3562:            $opt_dry_run || {
                   3563:              if test "$finalize" = yes; then
                   3564:                tmpdir=`func_mktempdir`
                   3565:                func_basename "$file$stripped_ext"
                   3566:                file="$func_basename_result"
                   3567:                outputname="$tmpdir/$file"
                   3568:                # Replace the output file specification.
1.1.1.1.2.3.2  1(misho  3569:4):             relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
1.1       misho    3570: 
                   3571:                $opt_silent || {
                   3572:                  func_quote_for_expand "$relink_command"
                   3573:                  eval "func_echo $func_quote_for_expand_result"
                   3574:                }
                   3575:                if eval "$relink_command"; then :
                   3576:                  else
                   3577:                  func_error "error: relink \`$file' with the above command before installing it"
                   3578:                  $opt_dry_run || ${RM}r "$tmpdir"
                   3579:                  continue
                   3580:                fi
                   3581:                file="$outputname"
                   3582:              else
                   3583:                func_warning "cannot relink \`$file'"
                   3584:              fi
                   3585:            }
                   3586:          else
                   3587:            # Install the binary that we compiled earlier.
1.1.1.1.2.3.2  1(misho  3588:4):         file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
1.1       misho    3589:          fi
                   3590:        fi
                   3591: 
                   3592:        # remove .exe since cygwin /usr/bin/install will append another
                   3593:        # one anyway
                   3594:        case $install_prog,$host in
                   3595:        */usr/bin/install*,*cygwin*)
                   3596:          case $file:$destfile in
                   3597:          *.exe:*.exe)
                   3598:            # this is ok
                   3599:            ;;
                   3600:          *.exe:*)
                   3601:            destfile=$destfile.exe
                   3602:            ;;
                   3603:          *:*.exe)
                   3604:            func_stripname '' '.exe' "$destfile"
                   3605:            destfile=$func_stripname_result
                   3606:            ;;
                   3607:          esac
                   3608:          ;;
                   3609:        esac
                   3610:        func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
                   3611:        $opt_dry_run || if test -n "$outputname"; then
                   3612:          ${RM}r "$tmpdir"
                   3613:        fi
                   3614:        ;;
                   3615:       esac
                   3616:     done
                   3617: 
                   3618:     for file in $staticlibs; do
                   3619:       func_basename "$file"
                   3620:       name="$func_basename_result"
                   3621: 
                   3622:       # Set up the ranlib parameters.
                   3623:       oldlib="$destdir/$name"
1.1.1.1.2.3.2  1(misho  3624:4):       func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
                   3625:4):       tool_oldlib=$func_to_tool_file_result
1.1       misho    3626: 
                   3627:       func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
                   3628: 
                   3629:       if test -n "$stripme" && test -n "$old_striplib"; then
1.1.1.1.2.3.2  1(misho  3630:4):     func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
1.1       misho    3631:       fi
                   3632: 
                   3633:       # Do each command in the postinstall commands.
                   3634:       func_execute_cmds "$old_postinstall_cmds" 'exit $?'
                   3635:     done
                   3636: 
                   3637:     test -n "$future_libdirs" && \
                   3638:       func_warning "remember to run \`$progname --finish$future_libdirs'"
                   3639: 
                   3640:     if test -n "$current_libdirs"; then
                   3641:       # Maybe just do a dry run.
                   3642:       $opt_dry_run && current_libdirs=" -n$current_libdirs"
                   3643:       exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
                   3644:     else
                   3645:       exit $EXIT_SUCCESS
                   3646:     fi
                   3647: }
                   3648: 
1.1.1.1.2.3.2  1(misho  3649:4): test "$opt_mode" = install && func_mode_install ${1+"$@"}
1.1       misho    3650: 
                   3651: 
                   3652: # func_generate_dlsyms outputname originator pic_p
                   3653: # Extract symbols from dlprefiles and create ${outputname}S.o with
                   3654: # a dlpreopen symbol table.
                   3655: func_generate_dlsyms ()
                   3656: {
                   3657:     $opt_debug
                   3658:     my_outputname="$1"
                   3659:     my_originator="$2"
                   3660:     my_pic_p="${3-no}"
                   3661:     my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
                   3662:     my_dlsyms=
                   3663: 
                   3664:     if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
                   3665:       if test -n "$NM" && test -n "$global_symbol_pipe"; then
                   3666:        my_dlsyms="${my_outputname}S.c"
                   3667:       else
                   3668:        func_error "not configured to extract global symbols from dlpreopened files"
                   3669:       fi
                   3670:     fi
                   3671: 
                   3672:     if test -n "$my_dlsyms"; then
                   3673:       case $my_dlsyms in
                   3674:       "") ;;
                   3675:       *.c)
                   3676:        # Discover the nlist of each of the dlfiles.
                   3677:        nlist="$output_objdir/${my_outputname}.nm"
                   3678: 
                   3679:        func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
                   3680: 
                   3681:        # Parse the name list into a source file.
                   3682:        func_verbose "creating $output_objdir/$my_dlsyms"
                   3683: 
                   3684:        $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
                   3685: /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
                   3686: /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
                   3687: 
                   3688: #ifdef __cplusplus
                   3689: extern \"C\" {
                   3690: #endif
                   3691: 
1.1.1.1.2.3.2  1(misho  3692:4): #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
                   3693:4): #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
                   3694:4): #endif
                   3695:4): 
                   3696:4): /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
                   3697:4): #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
                   3698:4): /* DATA imports from DLLs on WIN32 con't be const, because runtime
                   3699:4):    relocations are performed -- see ld's documentation on pseudo-relocs.  */
                   3700:4): # define LT_DLSYM_CONST
                   3701:4): #elif defined(__osf__)
                   3702:4): /* This system does not cope well with relocations in const data.  */
                   3703:4): # define LT_DLSYM_CONST
                   3704:4): #else
                   3705:4): # define LT_DLSYM_CONST const
                   3706:4): #endif
                   3707:4): 
1.1       misho    3708: /* External symbol declarations for the compiler. */\
                   3709: "
                   3710: 
                   3711:        if test "$dlself" = yes; then
                   3712:          func_verbose "generating symbol list for \`$output'"
                   3713: 
                   3714:          $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
                   3715: 
                   3716:          # Add our own program objects to the symbol list.
1.1.1.1.2.3.2  1(misho  3717:4):       progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
1.1       misho    3718:          for progfile in $progfiles; do
1.1.1.1.2.3.2  1(misho  3719:4):         func_to_tool_file "$progfile" func_convert_file_msys_to_w32
                   3720:4):         func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
                   3721:4):         $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
1.1       misho    3722:          done
                   3723: 
                   3724:          if test -n "$exclude_expsyms"; then
                   3725:            $opt_dry_run || {
                   3726:              eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
                   3727:              eval '$MV "$nlist"T "$nlist"'
                   3728:            }
                   3729:          fi
                   3730: 
                   3731:          if test -n "$export_symbols_regex"; then
                   3732:            $opt_dry_run || {
                   3733:              eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
                   3734:              eval '$MV "$nlist"T "$nlist"'
                   3735:            }
                   3736:          fi
                   3737: 
                   3738:          # Prepare the list of exported symbols
                   3739:          if test -z "$export_symbols"; then
                   3740:            export_symbols="$output_objdir/$outputname.exp"
                   3741:            $opt_dry_run || {
                   3742:              $RM $export_symbols
                   3743:              eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
                   3744:              case $host in
                   3745:              *cygwin* | *mingw* | *cegcc* )
                   3746:                 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
                   3747:                 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
                   3748:                ;;
                   3749:              esac
                   3750:            }
                   3751:          else
                   3752:            $opt_dry_run || {
                   3753:              eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
                   3754:              eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
                   3755:              eval '$MV "$nlist"T "$nlist"'
                   3756:              case $host in
1.1.1.1.2.3.2  1(misho  3757:4):             *cygwin* | *mingw* | *cegcc* )
1.1       misho    3758:                  eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
                   3759:                  eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
                   3760:                  ;;
                   3761:              esac
                   3762:            }
                   3763:          fi
                   3764:        fi
                   3765: 
                   3766:        for dlprefile in $dlprefiles; do
                   3767:          func_verbose "extracting global C symbols from \`$dlprefile'"
                   3768:          func_basename "$dlprefile"
                   3769:          name="$func_basename_result"
1.1.1.1.2.3.2  1(misho  3770:4):           case $host in
                   3771:4):         *cygwin* | *mingw* | *cegcc* )
                   3772:4):           # if an import library, we need to obtain dlname
                   3773:4):           if func_win32_import_lib_p "$dlprefile"; then
                   3774:4):             func_tr_sh "$dlprefile"
                   3775:4):             eval "curr_lafile=\$libfile_$func_tr_sh_result"
                   3776:4):             dlprefile_dlbasename=""
                   3777:4):             if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
                   3778:4):               # Use subshell, to avoid clobbering current variable values
                   3779:4):               dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
                   3780:4):               if test -n "$dlprefile_dlname" ; then
                   3781:4):                 func_basename "$dlprefile_dlname"
                   3782:4):                 dlprefile_dlbasename="$func_basename_result"
                   3783:4):               else
                   3784:4):                 # no lafile. user explicitly requested -dlpreopen <import library>.
                   3785:4):                 $sharedlib_from_linklib_cmd "$dlprefile"
                   3786:4):                 dlprefile_dlbasename=$sharedlib_from_linklib_result
                   3787:4):               fi
                   3788:4):             fi
                   3789:4):             $opt_dry_run || {
                   3790:4):               if test -n "$dlprefile_dlbasename" ; then
                   3791:4):                 eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
                   3792:4):               else
                   3793:4):                 func_warning "Could not compute DLL name from $name"
                   3794:4):                 eval '$ECHO ": $name " >> "$nlist"'
                   3795:4):               fi
                   3796:4):               func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
                   3797:4):               eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
                   3798:4):                 $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
                   3799:4):             }
                   3800:4):           else # not an import lib
                   3801:4):             $opt_dry_run || {
                   3802:4):               eval '$ECHO ": $name " >> "$nlist"'
                   3803:4):               func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
                   3804:4):               eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
                   3805:4):             }
                   3806:4):           fi
                   3807:4):         ;;
                   3808:4):         *)
                   3809:4):           $opt_dry_run || {
                   3810:4):             eval '$ECHO ": $name " >> "$nlist"'
                   3811:4):             func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
                   3812:4):             eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
                   3813:4):           }
                   3814:4):         ;;
                   3815:4):           esac
1.1       misho    3816:        done
                   3817: 
                   3818:        $opt_dry_run || {
                   3819:          # Make sure we have at least an empty file.
                   3820:          test -f "$nlist" || : > "$nlist"
                   3821: 
                   3822:          if test -n "$exclude_expsyms"; then
                   3823:            $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
                   3824:            $MV "$nlist"T "$nlist"
                   3825:          fi
                   3826: 
                   3827:          # Try sorting and uniquifying the output.
                   3828:          if $GREP -v "^: " < "$nlist" |
                   3829:              if sort -k 3 </dev/null >/dev/null 2>&1; then
                   3830:                sort -k 3
                   3831:              else
                   3832:                sort +2
                   3833:              fi |
                   3834:              uniq > "$nlist"S; then
                   3835:            :
                   3836:          else
                   3837:            $GREP -v "^: " < "$nlist" > "$nlist"S
                   3838:          fi
                   3839: 
                   3840:          if test -f "$nlist"S; then
                   3841:            eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
                   3842:          else
1.1.1.1.2.3.2  1(misho  3843:4):         echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
1.1       misho    3844:          fi
                   3845: 
1.1.1.1.2.3.2  1(misho  3846:4):       echo >> "$output_objdir/$my_dlsyms" "\
1.1       misho    3847: 
                   3848: /* The mapping between symbol names and symbols.  */
                   3849: typedef struct {
                   3850:   const char *name;
                   3851:   void *address;
                   3852: } lt_dlsymlist;
1.1.1.1.2.3.2  1(misho  3853:4): extern LT_DLSYM_CONST lt_dlsymlist
1.1       misho    3854: lt_${my_prefix}_LTX_preloaded_symbols[];
1.1.1.1.2.3.2  1(misho  3855:4): LT_DLSYM_CONST lt_dlsymlist
1.1       misho    3856: lt_${my_prefix}_LTX_preloaded_symbols[] =
                   3857: {\
                   3858:   { \"$my_originator\", (void *) 0 },"
                   3859: 
                   3860:          case $need_lib_prefix in
                   3861:          no)
                   3862:            eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
                   3863:            ;;
                   3864:          *)
                   3865:            eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
                   3866:            ;;
                   3867:          esac
1.1.1.1.2.3.2  1(misho  3868:4):       echo >> "$output_objdir/$my_dlsyms" "\
1.1       misho    3869:   {0, (void *) 0}
                   3870: };
                   3871: 
                   3872: /* This works around a problem in FreeBSD linker */
                   3873: #ifdef FREEBSD_WORKAROUND
                   3874: static const void *lt_preloaded_setup() {
                   3875:   return lt_${my_prefix}_LTX_preloaded_symbols;
                   3876: }
                   3877: #endif
                   3878: 
                   3879: #ifdef __cplusplus
                   3880: }
                   3881: #endif\
                   3882: "
                   3883:        } # !$opt_dry_run
                   3884: 
                   3885:        pic_flag_for_symtable=
                   3886:        case "$compile_command " in
                   3887:        *" -static "*) ;;
                   3888:        *)
                   3889:          case $host in
                   3890:          # compiling the symbol table file with pic_flag works around
                   3891:          # a FreeBSD bug that causes programs to crash when -lm is
                   3892:          # linked before any other PIC object.  But we must not use
                   3893:          # pic_flag when linking with -static.  The problem exists in
                   3894:          # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
1.1.1.1.2.3.2  1(misho  3895:4):       *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
1.1       misho    3896:            pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
                   3897:          *-*-hpux*)
                   3898:            pic_flag_for_symtable=" $pic_flag"  ;;
                   3899:          *)
                   3900:            if test "X$my_pic_p" != Xno; then
                   3901:              pic_flag_for_symtable=" $pic_flag"
                   3902:            fi
                   3903:            ;;
                   3904:          esac
                   3905:          ;;
                   3906:        esac
                   3907:        symtab_cflags=
                   3908:        for arg in $LTCFLAGS; do
                   3909:          case $arg in
                   3910:          -pie | -fpie | -fPIE) ;;
                   3911:          *) symtab_cflags="$symtab_cflags $arg" ;;
                   3912:          esac
                   3913:        done
                   3914: 
                   3915:        # Now compile the dynamic symbol file.
                   3916:        func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
                   3917: 
                   3918:        # Clean up the generated files.
                   3919:        func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
                   3920: 
                   3921:        # Transform the symbol file into the correct name.
                   3922:        symfileobj="$output_objdir/${my_outputname}S.$objext"
                   3923:        case $host in
                   3924:        *cygwin* | *mingw* | *cegcc* )
                   3925:          if test -f "$output_objdir/$my_outputname.def"; then
1.1.1.1.2.3.2  1(misho  3926:4):         compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
                   3927:4):         finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
1.1       misho    3928:          else
1.1.1.1.2.3.2  1(misho  3929:4):         compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
                   3930:4):         finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
1.1       misho    3931:          fi
                   3932:          ;;
                   3933:        *)
1.1.1.1.2.3.2  1(misho  3934:4):       compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
                   3935:4):       finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
1.1       misho    3936:          ;;
                   3937:        esac
                   3938:        ;;
                   3939:       *)
                   3940:        func_fatal_error "unknown suffix for \`$my_dlsyms'"
                   3941:        ;;
                   3942:       esac
                   3943:     else
                   3944:       # We keep going just in case the user didn't refer to
                   3945:       # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
                   3946:       # really was required.
                   3947: 
                   3948:       # Nullify the symbol file.
1.1.1.1.2.3.2  1(misho  3949:4):       compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
                   3950:4):       finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
1.1       misho    3951:     fi
                   3952: }
                   3953: 
                   3954: # func_win32_libid arg
                   3955: # return the library type of file 'arg'
                   3956: #
                   3957: # Need a lot of goo to handle *both* DLLs and import libs
                   3958: # Has to be a shell function in order to 'eat' the argument
                   3959: # that is supplied when $file_magic_command is called.
1.1.1.1.2.3.2  1(misho  3960:4): # Despite the name, also deal with 64 bit binaries.
1.1       misho    3961: func_win32_libid ()
                   3962: {
                   3963:   $opt_debug
                   3964:   win32_libid_type="unknown"
                   3965:   win32_fileres=`file -L $1 2>/dev/null`
                   3966:   case $win32_fileres in
                   3967:   *ar\ archive\ import\ library*) # definitely import
                   3968:     win32_libid_type="x86 archive import"
                   3969:     ;;
                   3970:   *ar\ archive*) # could be an import, or static
1.1.1.1.2.3.2  1(misho  3971:4):     # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
1.1       misho    3972:     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
1.1.1.1.2.3.2  1(misho  3973:4):        $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
                   3974:4):       func_to_tool_file "$1" func_convert_file_msys_to_w32
                   3975:4):       win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
1.1       misho    3976:        $SED -n -e '
                   3977:            1,100{
                   3978:                / I /{
                   3979:                    s,.*,import,
                   3980:                    p
                   3981:                    q
                   3982:                }
                   3983:            }'`
                   3984:       case $win32_nmres in
                   3985:       import*)  win32_libid_type="x86 archive import";;
                   3986:       *)        win32_libid_type="x86 archive static";;
                   3987:       esac
                   3988:     fi
                   3989:     ;;
                   3990:   *DLL*)
                   3991:     win32_libid_type="x86 DLL"
                   3992:     ;;
                   3993:   *executable*) # but shell scripts are "executable" too...
                   3994:     case $win32_fileres in
                   3995:     *MS\ Windows\ PE\ Intel*)
                   3996:       win32_libid_type="x86 DLL"
                   3997:       ;;
                   3998:     esac
                   3999:     ;;
                   4000:   esac
                   4001:   $ECHO "$win32_libid_type"
                   4002: }
                   4003: 
1.1.1.1.2.3.2  1(misho  4004:4): # func_cygming_dll_for_implib ARG
                   4005:4): #
                   4006:4): # Platform-specific function to extract the
                   4007:4): # name of the DLL associated with the specified
                   4008:4): # import library ARG.
                   4009:4): # Invoked by eval'ing the libtool variable
                   4010:4): #    $sharedlib_from_linklib_cmd
                   4011:4): # Result is available in the variable
                   4012:4): #    $sharedlib_from_linklib_result
                   4013:4): func_cygming_dll_for_implib ()
                   4014:4): {
                   4015:4):   $opt_debug
                   4016:4):   sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
                   4017:4): }
                   4018:4): 
                   4019:4): # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
                   4020:4): #
                   4021:4): # The is the core of a fallback implementation of a
                   4022:4): # platform-specific function to extract the name of the
                   4023:4): # DLL associated with the specified import library LIBNAME.
                   4024:4): #
                   4025:4): # SECTION_NAME is either .idata$6 or .idata$7, depending
                   4026:4): # on the platform and compiler that created the implib.
                   4027:4): #
                   4028:4): # Echos the name of the DLL associated with the
                   4029:4): # specified import library.
                   4030:4): func_cygming_dll_for_implib_fallback_core ()
                   4031:4): {
                   4032:4):   $opt_debug
                   4033:4):   match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
                   4034:4):   $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
                   4035:4):     $SED '/^Contents of section '"$match_literal"':/{
                   4036:4):       # Place marker at beginning of archive member dllname section
                   4037:4):       s/.*/====MARK====/
                   4038:4):       p
                   4039:4):       d
                   4040:4):     }
                   4041:4):     # These lines can sometimes be longer than 43 characters, but
                   4042:4):     # are always uninteresting
                   4043:4):     /:[      ]*file format pe[i]\{,1\}-/d
                   4044:4):     /^In archive [^:]*:/d
                   4045:4):     # Ensure marker is printed
                   4046:4):     /^====MARK====/p
                   4047:4):     # Remove all lines with less than 43 characters
                   4048:4):     /^.\{43\}/!d
                   4049:4):     # From remaining lines, remove first 43 characters
                   4050:4):     s/^.\{43\}//' |
                   4051:4):     $SED -n '
                   4052:4):       # Join marker and all lines until next marker into a single line
                   4053:4):       /^====MARK====/ b para
                   4054:4):       H
                   4055:4):       $ b para
                   4056:4):       b
                   4057:4):       :para
                   4058:4):       x
                   4059:4):       s/\n//g
                   4060:4):       # Remove the marker
                   4061:4):       s/^====MARK====//
                   4062:4):       # Remove trailing dots and whitespace
                   4063:4):       s/[\. \t]*$//
                   4064:4):       # Print
                   4065:4):       /./p' |
                   4066:4):     # we now have a list, one entry per line, of the stringified
                   4067:4):     # contents of the appropriate section of all members of the
                   4068:4):     # archive which possess that section. Heuristic: eliminate
                   4069:4):     # all those which have a first or second character that is
                   4070:4):     # a '.' (that is, objdump's representation of an unprintable
                   4071:4):     # character.) This should work for all archives with less than
                   4072:4):     # 0x302f exports -- but will fail for DLLs whose name actually
                   4073:4):     # begins with a literal '.' or a single character followed by
                   4074:4):     # a '.'.
                   4075:4):     #
                   4076:4):     # Of those that remain, print the first one.
                   4077:4):     $SED -e '/^\./d;/^.\./d;q'
                   4078:4): }
                   4079:4): 
                   4080:4): # func_cygming_gnu_implib_p ARG
                   4081:4): # This predicate returns with zero status (TRUE) if
                   4082:4): # ARG is a GNU/binutils-style import library. Returns
                   4083:4): # with nonzero status (FALSE) otherwise.
                   4084:4): func_cygming_gnu_implib_p ()
                   4085:4): {
                   4086:4):   $opt_debug
                   4087:4):   func_to_tool_file "$1" func_convert_file_msys_to_w32
                   4088:4):   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)$'`
                   4089:4):   test -n "$func_cygming_gnu_implib_tmp"
                   4090:4): }
                   4091:4): 
                   4092:4): # func_cygming_ms_implib_p ARG
                   4093:4): # This predicate returns with zero status (TRUE) if
                   4094:4): # ARG is an MS-style import library. Returns
                   4095:4): # with nonzero status (FALSE) otherwise.
                   4096:4): func_cygming_ms_implib_p ()
                   4097:4): {
                   4098:4):   $opt_debug
                   4099:4):   func_to_tool_file "$1" func_convert_file_msys_to_w32
                   4100:4):   func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
                   4101:4):   test -n "$func_cygming_ms_implib_tmp"
                   4102:4): }
                   4103:4): 
                   4104:4): # func_cygming_dll_for_implib_fallback ARG
                   4105:4): # Platform-specific function to extract the
                   4106:4): # name of the DLL associated with the specified
                   4107:4): # import library ARG.
                   4108:4): #
                   4109:4): # This fallback implementation is for use when $DLLTOOL
                   4110:4): # does not support the --identify-strict option.
                   4111:4): # Invoked by eval'ing the libtool variable
                   4112:4): #    $sharedlib_from_linklib_cmd
                   4113:4): # Result is available in the variable
                   4114:4): #    $sharedlib_from_linklib_result
                   4115:4): func_cygming_dll_for_implib_fallback ()
                   4116:4): {
                   4117:4):   $opt_debug
                   4118:4):   if func_cygming_gnu_implib_p "$1" ; then
                   4119:4):     # binutils import library
                   4120:4):     sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
                   4121:4):   elif func_cygming_ms_implib_p "$1" ; then
                   4122:4):     # ms-generated import library
                   4123:4):     sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
                   4124:4):   else
                   4125:4):     # unknown
                   4126:4):     sharedlib_from_linklib_result=""
                   4127:4):   fi
                   4128:4): }
1.1       misho    4129: 
                   4130: 
                   4131: # func_extract_an_archive dir oldlib
                   4132: func_extract_an_archive ()
                   4133: {
                   4134:     $opt_debug
                   4135:     f_ex_an_ar_dir="$1"; shift
                   4136:     f_ex_an_ar_oldlib="$1"
1.1.1.1.2.3.2  1(misho  4137:4):     if test "$lock_old_archive_extraction" = yes; then
                   4138:4):       lockfile=$f_ex_an_ar_oldlib.lock
                   4139:4):       until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
                   4140:4):     func_echo "Waiting for $lockfile to be removed"
                   4141:4):     sleep 2
                   4142:4):       done
                   4143:4):     fi
                   4144:4):     func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
                   4145:4):                'stat=$?; rm -f "$lockfile"; exit $stat'
                   4146:4):     if test "$lock_old_archive_extraction" = yes; then
                   4147:4):       $opt_dry_run || rm -f "$lockfile"
                   4148:4):     fi
1.1       misho    4149:     if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
                   4150:      :
                   4151:     else
                   4152:       func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
                   4153:     fi
                   4154: }
                   4155: 
                   4156: 
                   4157: # func_extract_archives gentop oldlib ...
                   4158: func_extract_archives ()
                   4159: {
                   4160:     $opt_debug
                   4161:     my_gentop="$1"; shift
                   4162:     my_oldlibs=${1+"$@"}
                   4163:     my_oldobjs=""
                   4164:     my_xlib=""
                   4165:     my_xabs=""
                   4166:     my_xdir=""
                   4167: 
                   4168:     for my_xlib in $my_oldlibs; do
                   4169:       # Extract the objects.
                   4170:       case $my_xlib in
                   4171:        [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
                   4172:        *) my_xabs=`pwd`"/$my_xlib" ;;
                   4173:       esac
                   4174:       func_basename "$my_xlib"
                   4175:       my_xlib="$func_basename_result"
                   4176:       my_xlib_u=$my_xlib
                   4177:       while :; do
                   4178:         case " $extracted_archives " in
                   4179:        *" $my_xlib_u "*)
                   4180:          func_arith $extracted_serial + 1
                   4181:          extracted_serial=$func_arith_result
                   4182:          my_xlib_u=lt$extracted_serial-$my_xlib ;;
                   4183:        *) break ;;
                   4184:        esac
                   4185:       done
                   4186:       extracted_archives="$extracted_archives $my_xlib_u"
                   4187:       my_xdir="$my_gentop/$my_xlib_u"
                   4188: 
                   4189:       func_mkdir_p "$my_xdir"
                   4190: 
                   4191:       case $host in
                   4192:       *-darwin*)
                   4193:        func_verbose "Extracting $my_xabs"
                   4194:        # Do not bother doing anything if just a dry run
                   4195:        $opt_dry_run || {
                   4196:          darwin_orig_dir=`pwd`
                   4197:          cd $my_xdir || exit $?
                   4198:          darwin_archive=$my_xabs
                   4199:          darwin_curdir=`pwd`
                   4200:          darwin_base_archive=`basename "$darwin_archive"`
                   4201:          darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
                   4202:          if test -n "$darwin_arches"; then
                   4203:            darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
                   4204:            darwin_arch=
                   4205:            func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
                   4206:            for darwin_arch in  $darwin_arches ; do
                   4207:              func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
                   4208:              $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
                   4209:              cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
                   4210:              func_extract_an_archive "`pwd`" "${darwin_base_archive}"
                   4211:              cd "$darwin_curdir"
                   4212:              $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
                   4213:            done # $darwin_arches
                   4214:             ## Okay now we've a bunch of thin objects, gotta fatten them up :)
                   4215:            darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
                   4216:            darwin_file=
                   4217:            darwin_files=
                   4218:            for darwin_file in $darwin_filelist; do
1.1.1.1.2.3.2  1(misho  4219:4):           darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
1.1       misho    4220:              $LIPO -create -output "$darwin_file" $darwin_files
                   4221:            done # $darwin_filelist
                   4222:            $RM -rf unfat-$$
                   4223:            cd "$darwin_orig_dir"
                   4224:          else
                   4225:            cd $darwin_orig_dir
                   4226:            func_extract_an_archive "$my_xdir" "$my_xabs"
                   4227:          fi # $darwin_arches
                   4228:        } # !$opt_dry_run
                   4229:        ;;
                   4230:       *)
                   4231:         func_extract_an_archive "$my_xdir" "$my_xabs"
                   4232:        ;;
                   4233:       esac
1.1.1.1.2.3.2  1(misho  4234:4):       my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
1.1       misho    4235:     done
                   4236: 
                   4237:     func_extract_archives_result="$my_oldobjs"
                   4238: }
                   4239: 
                   4240: 
1.1.1.1.2.3.2  1(misho  4241:4): # func_emit_wrapper [arg=no]
1.1       misho    4242: #
1.1.1.1.2.3.2  1(misho  4243:4): # Emit a libtool wrapper script on stdout.
                   4244:4): # Don't directly open a file because we may want to
                   4245:4): # incorporate the script contents within a cygwin/mingw
                   4246:4): # wrapper executable.  Must ONLY be called from within
                   4247:4): # func_mode_link because it depends on a number of variables
                   4248:4): # set therein.
                   4249:4): #
                   4250:4): # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
                   4251:4): # variable will take.  If 'yes', then the emitted script
                   4252:4): # will assume that the directory in which it is stored is
                   4253:4): # the $objdir directory.  This is a cygwin/mingw-specific
                   4254:4): # behavior.
                   4255:4): func_emit_wrapper ()
                   4256:4): {
                   4257:4):     func_emit_wrapper_arg1=${1-no}
1.1       misho    4258: 
                   4259:        $ECHO "\
                   4260: #! $SHELL
                   4261: 
                   4262: # $output - temporary wrapper script for $objdir/$outputname
                   4263: # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
                   4264: #
                   4265: # The $output program cannot be directly executed until all the libtool
                   4266: # libraries that it depends on are installed.
                   4267: #
                   4268: # This wrapper script should never be moved out of the build directory.
                   4269: # If it is, it will not operate correctly.
                   4270: 
                   4271: # Sed substitution that helps us do robust quoting.  It backslashifies
                   4272: # metacharacters that are still active within double-quoted strings.
                   4273: sed_quote_subst='$sed_quote_subst'
                   4274: 
                   4275: # Be Bourne compatible
                   4276: if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
                   4277:   emulate sh
                   4278:   NULLCMD=:
                   4279:   # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
                   4280:   # is contrary to our usage.  Disable this feature.
                   4281:   alias -g '\${1+\"\$@\"}'='\"\$@\"'
                   4282:   setopt NO_GLOB_SUBST
                   4283: else
                   4284:   case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
                   4285: fi
                   4286: BIN_SH=xpg4; export BIN_SH # for Tru64
                   4287: DUALCASE=1; export DUALCASE # for MKS sh
                   4288: 
                   4289: # The HP-UX ksh and POSIX shell print the target directory to stdout
                   4290: # if CDPATH is set.
                   4291: (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
                   4292: 
                   4293: relink_command=\"$relink_command\"
                   4294: 
                   4295: # This environment variable determines our operation mode.
                   4296: if test \"\$libtool_install_magic\" = \"$magic\"; then
                   4297:   # install mode needs the following variables:
                   4298:   generated_by_libtool_version='$macro_version'
                   4299:   notinst_deplibs='$notinst_deplibs'
                   4300: else
                   4301:   # When we are sourced in execute mode, \$file and \$ECHO are already set.
                   4302:   if test \"\$libtool_execute_magic\" != \"$magic\"; then
1.1.1.1.2.3.2  1(misho  4303:4):     file=\"\$0\""
                   4304:4): 
                   4305:4):     qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
                   4306:4):     $ECHO "\
                   4307:4): 
                   4308:4): # A function that is used when there is no print builtin or printf.
                   4309:4): func_fallback_echo ()
                   4310:4): {
                   4311:4):   eval 'cat <<_LTECHO_EOF
                   4312:4): \$1
                   4313:4): _LTECHO_EOF'
                   4314:4): }
                   4315:4):     ECHO=\"$qECHO\"
                   4316:4):   fi
                   4317:4): 
                   4318:4): # Very basic option parsing. These options are (a) specific to
                   4319:4): # the libtool wrapper, (b) are identical between the wrapper
                   4320:4): # /script/ and the wrapper /executable/ which is used only on
                   4321:4): # windows platforms, and (c) all begin with the string "--lt-"
                   4322:4): # (application programs are unlikely to have options which match
                   4323:4): # this pattern).
                   4324:4): #
                   4325:4): # There are only two supported options: --lt-debug and
                   4326:4): # --lt-dump-script. There is, deliberately, no --lt-help.
                   4327:4): #
                   4328:4): # The first argument to this parsing function should be the
                   4329:4): # script's $0 value, followed by "$@".
                   4330:4): lt_option_debug=
                   4331:4): func_parse_lt_options ()
                   4332:4): {
                   4333:4):   lt_script_arg0=\$0
                   4334:4):   shift
                   4335:4):   for lt_opt
                   4336:4):   do
                   4337:4):     case \"\$lt_opt\" in
                   4338:4):     --lt-debug) lt_option_debug=1 ;;
                   4339:4):     --lt-dump-script)
                   4340:4):         lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
                   4341:4):         test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
                   4342:4):         lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
                   4343:4):         cat \"\$lt_dump_D/\$lt_dump_F\"
                   4344:4):         exit 0
                   4345:4):       ;;
                   4346:4):     --lt-*)
                   4347:4):         \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
                   4348:4):         exit 1
                   4349:4):       ;;
                   4350:4):     esac
                   4351:4):   done
                   4352:4): 
                   4353:4):   # Print the debug banner immediately:
                   4354:4):   if test -n \"\$lt_option_debug\"; then
                   4355:4):     echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
                   4356:4):   fi
                   4357:4): }
                   4358:4): 
                   4359:4): # Used when --lt-debug. Prints its arguments to stdout
                   4360:4): # (redirection is the responsibility of the caller)
                   4361:4): func_lt_dump_args ()
                   4362:4): {
                   4363:4):   lt_dump_args_N=1;
                   4364:4):   for lt_arg
                   4365:4):   do
                   4366:4):     \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
                   4367:4):     lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
                   4368:4):   done
                   4369:4): }
                   4370:4): 
                   4371:4): # Core function for launching the target application
                   4372:4): func_exec_program_core ()
                   4373:4): {
1.1       misho    4374: "
1.1.1.1.2.3.2  1(misho  4375:4):   case $host in
                   4376:4):   # Backslashes separate directories on plain windows
                   4377:4):   *-*-mingw | *-*-os2* | *-cegcc*)
                   4378:4):     $ECHO "\
                   4379:4):       if test -n \"\$lt_option_debug\"; then
                   4380:4):         \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
                   4381:4):         func_lt_dump_args \${1+\"\$@\"} 1>&2
                   4382:4):       fi
                   4383:4):       exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
                   4384:4): "
                   4385:4):     ;;
                   4386:4): 
                   4387:4):   *)
                   4388:4):     $ECHO "\
                   4389:4):       if test -n \"\$lt_option_debug\"; then
                   4390:4):         \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
                   4391:4):         func_lt_dump_args \${1+\"\$@\"} 1>&2
                   4392:4):       fi
                   4393:4):       exec \"\$progdir/\$program\" \${1+\"\$@\"}
                   4394:4): "
                   4395:4):     ;;
                   4396:4):   esac
                   4397:4):   $ECHO "\
                   4398:4):       \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
                   4399:4):       exit 1
                   4400:4): }
                   4401:4): 
                   4402:4): # A function to encapsulate launching the target application
                   4403:4): # Strips options in the --lt-* namespace from \$@ and
                   4404:4): # launches target application with the remaining arguments.
                   4405:4): func_exec_program ()
                   4406:4): {
                   4407:4):   case \" \$* \" in
                   4408:4):   *\\ --lt-*)
                   4409:4):     for lt_wr_arg
                   4410:4):     do
                   4411:4):       case \$lt_wr_arg in
                   4412:4):       --lt-*) ;;
                   4413:4):       *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
                   4414:4):       esac
                   4415:4):       shift
                   4416:4):     done ;;
                   4417:4):   esac
                   4418:4):   func_exec_program_core \${1+\"\$@\"}
                   4419:4): }
                   4420:4): 
                   4421:4):   # Parse options
                   4422:4):   func_parse_lt_options \"\$0\" \${1+\"\$@\"}
1.1       misho    4423: 
                   4424:   # Find the directory that this script lives in.
1.1.1.1.2.3.2  1(misho  4425:4):   thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
1.1       misho    4426:   test \"x\$thisdir\" = \"x\$file\" && thisdir=.
                   4427: 
                   4428:   # Follow symbolic links until we get to the real thisdir.
1.1.1.1.2.3.2  1(misho  4429:4):   file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
1.1       misho    4430:   while test -n \"\$file\"; do
1.1.1.1.2.3.2  1(misho  4431:4):     destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
1.1       misho    4432: 
                   4433:     # If there was a directory component, then change thisdir.
                   4434:     if test \"x\$destdir\" != \"x\$file\"; then
                   4435:       case \"\$destdir\" in
                   4436:       [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
                   4437:       *) thisdir=\"\$thisdir/\$destdir\" ;;
                   4438:       esac
                   4439:     fi
                   4440: 
1.1.1.1.2.3.2  1(misho  4441:4):     file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
                   4442:4):     file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
1.1       misho    4443:   done
                   4444: 
                   4445:   # Usually 'no', except on cygwin/mingw when embedded into
                   4446:   # the cwrapper.
1.1.1.1.2.3.2  1(misho  4447:4):   WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
1.1       misho    4448:   if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
                   4449:     # special case for '.'
                   4450:     if test \"\$thisdir\" = \".\"; then
                   4451:       thisdir=\`pwd\`
                   4452:     fi
                   4453:     # remove .libs from thisdir
                   4454:     case \"\$thisdir\" in
1.1.1.1.2.3.2  1(misho  4455:4):     *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
1.1       misho    4456:     $objdir )   thisdir=. ;;
                   4457:     esac
                   4458:   fi
                   4459: 
                   4460:   # Try to get the absolute directory name.
                   4461:   absdir=\`cd \"\$thisdir\" && pwd\`
                   4462:   test -n \"\$absdir\" && thisdir=\"\$absdir\"
                   4463: "
                   4464: 
                   4465:        if test "$fast_install" = yes; then
                   4466:          $ECHO "\
                   4467:   program=lt-'$outputname'$exeext
                   4468:   progdir=\"\$thisdir/$objdir\"
                   4469: 
                   4470:   if test ! -f \"\$progdir/\$program\" ||
                   4471:      { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
                   4472:        test \"X\$file\" != \"X\$progdir/\$program\"; }; then
                   4473: 
                   4474:     file=\"\$\$-\$program\"
                   4475: 
                   4476:     if test ! -d \"\$progdir\"; then
                   4477:       $MKDIR \"\$progdir\"
                   4478:     else
                   4479:       $RM \"\$progdir/\$file\"
                   4480:     fi"
                   4481: 
                   4482:          $ECHO "\
                   4483: 
                   4484:     # relink executable if necessary
                   4485:     if test -n \"\$relink_command\"; then
                   4486:       if relink_command_output=\`eval \$relink_command 2>&1\`; then :
                   4487:       else
                   4488:        $ECHO \"\$relink_command_output\" >&2
                   4489:        $RM \"\$progdir/\$file\"
                   4490:        exit 1
                   4491:       fi
                   4492:     fi
                   4493: 
                   4494:     $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
                   4495:     { $RM \"\$progdir/\$program\";
                   4496:       $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
                   4497:     $RM \"\$progdir/\$file\"
                   4498:   fi"
                   4499:        else
                   4500:          $ECHO "\
                   4501:   program='$outputname'
                   4502:   progdir=\"\$thisdir/$objdir\"
                   4503: "
                   4504:        fi
                   4505: 
                   4506:        $ECHO "\
                   4507: 
                   4508:   if test -f \"\$progdir/\$program\"; then"
                   4509: 
1.1.1.1.2.3.2  1(misho  4510:4):     # fixup the dll searchpath if we need to.
                   4511:4):     #
                   4512:4):     # Fix the DLL searchpath if we need to.  Do this before prepending
                   4513:4):     # to shlibpath, because on Windows, both are PATH and uninstalled
                   4514:4):     # libraries must come first.
                   4515:4):     if test -n "$dllsearchpath"; then
                   4516:4):       $ECHO "\
                   4517:4):     # Add the dll search path components to the executable PATH
                   4518:4):     PATH=$dllsearchpath:\$PATH
                   4519:4): "
                   4520:4):     fi
                   4521:4): 
1.1       misho    4522:        # Export our shlibpath_var if we have one.
                   4523:        if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
                   4524:          $ECHO "\
                   4525:     # Add our own library path to $shlibpath_var
                   4526:     $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
                   4527: 
                   4528:     # Some systems cannot cope with colon-terminated $shlibpath_var
                   4529:     # The second colon is a workaround for a bug in BeOS R4 sed
1.1.1.1.2.3.2  1(misho  4530:4):     $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
1.1       misho    4531: 
                   4532:     export $shlibpath_var
                   4533: "
                   4534:        fi
                   4535: 
                   4536:        $ECHO "\
                   4537:     if test \"\$libtool_execute_magic\" != \"$magic\"; then
                   4538:       # Run the actual program with our arguments.
1.1.1.1.2.3.2  1(misho  4539:4):       func_exec_program \${1+\"\$@\"}
1.1       misho    4540:     fi
                   4541:   else
                   4542:     # The program doesn't exist.
                   4543:     \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
                   4544:     \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
1.1.1.1.2.3.2  1(misho  4545:4):     \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
1.1       misho    4546:     exit 1
                   4547:   fi
                   4548: fi\
                   4549: "
                   4550: }
                   4551: 
                   4552: 
                   4553: # func_emit_cwrapperexe_src
                   4554: # emit the source code for a wrapper executable on stdout
                   4555: # Must ONLY be called from within func_mode_link because
                   4556: # it depends on a number of variable set therein.
                   4557: func_emit_cwrapperexe_src ()
                   4558: {
                   4559:        cat <<EOF
                   4560: 
                   4561: /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
                   4562:    Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
                   4563: 
                   4564:    The $output program cannot be directly executed until all the libtool
                   4565:    libraries that it depends on are installed.
                   4566: 
                   4567:    This wrapper executable should never be moved out of the build directory.
                   4568:    If it is, it will not operate correctly.
                   4569: */
                   4570: EOF
                   4571:            cat <<"EOF"
1.1.1.1.2.3.2  1(misho  4572:4): #ifdef _MSC_VER
                   4573:4): # define _CRT_SECURE_NO_DEPRECATE 1
                   4574:4): #endif
1.1       misho    4575: #include <stdio.h>
                   4576: #include <stdlib.h>
                   4577: #ifdef _MSC_VER
                   4578: # include <direct.h>
                   4579: # include <process.h>
                   4580: # include <io.h>
                   4581: #else
                   4582: # include <unistd.h>
                   4583: # include <stdint.h>
                   4584: # ifdef __CYGWIN__
                   4585: #  include <io.h>
                   4586: # endif
                   4587: #endif
                   4588: #include <malloc.h>
                   4589: #include <stdarg.h>
                   4590: #include <assert.h>
                   4591: #include <string.h>
                   4592: #include <ctype.h>
                   4593: #include <errno.h>
                   4594: #include <fcntl.h>
                   4595: #include <sys/stat.h>
                   4596: 
1.1.1.1.2.3.2  1(misho  4597:4): /* declarations of non-ANSI functions */
                   4598:4): #if defined(__MINGW32__)
                   4599:4): # ifdef __STRICT_ANSI__
                   4600:4): int _putenv (const char *);
                   4601:4): # endif
                   4602:4): #elif defined(__CYGWIN__)
                   4603:4): # ifdef __STRICT_ANSI__
                   4604:4): char *realpath (const char *, char *);
                   4605:4): int putenv (char *);
                   4606:4): int setenv (const char *, const char *, int);
                   4607:4): # endif
                   4608:4): /* #elif defined (other platforms) ... */
                   4609:4): #endif
                   4610:4): 
                   4611:4): /* portability defines, excluding path handling macros */
                   4612:4): #if defined(_MSC_VER)
                   4613:4): # define setmode _setmode
                   4614:4): # define stat    _stat
                   4615:4): # define chmod   _chmod
                   4616:4): # define getcwd  _getcwd
                   4617:4): # define putenv  _putenv
                   4618:4): # define S_IXUSR _S_IEXEC
                   4619:4): # ifndef _INTPTR_T_DEFINED
                   4620:4): #  define _INTPTR_T_DEFINED
                   4621:4): #  define intptr_t int
                   4622:4): # endif
                   4623:4): #elif defined(__MINGW32__)
                   4624:4): # define setmode _setmode
                   4625:4): # define stat    _stat
                   4626:4): # define chmod   _chmod
                   4627:4): # define getcwd  _getcwd
                   4628:4): # define putenv  _putenv
                   4629:4): #elif defined(__CYGWIN__)
                   4630:4): # define HAVE_SETENV
                   4631:4): # define FOPEN_WB "wb"
                   4632:4): /* #elif defined (other platforms) ... */
                   4633:4): #endif
                   4634:4): 
1.1       misho    4635: #if defined(PATH_MAX)
                   4636: # define LT_PATHMAX PATH_MAX
                   4637: #elif defined(MAXPATHLEN)
                   4638: # define LT_PATHMAX MAXPATHLEN
                   4639: #else
                   4640: # define LT_PATHMAX 1024
                   4641: #endif
                   4642: 
                   4643: #ifndef S_IXOTH
                   4644: # define S_IXOTH 0
                   4645: #endif
                   4646: #ifndef S_IXGRP
                   4647: # define S_IXGRP 0
                   4648: #endif
                   4649: 
1.1.1.1.2.3.2  1(misho  4650:4): /* path handling portability macros */
1.1       misho    4651: #ifndef DIR_SEPARATOR
                   4652: # define DIR_SEPARATOR '/'
                   4653: # define PATH_SEPARATOR ':'
                   4654: #endif
                   4655: 
                   4656: #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
                   4657:   defined (__OS2__)
                   4658: # define HAVE_DOS_BASED_FILE_SYSTEM
                   4659: # define FOPEN_WB "wb"
                   4660: # ifndef DIR_SEPARATOR_2
                   4661: #  define DIR_SEPARATOR_2 '\\'
                   4662: # endif
                   4663: # ifndef PATH_SEPARATOR_2
                   4664: #  define PATH_SEPARATOR_2 ';'
                   4665: # endif
                   4666: #endif
                   4667: 
                   4668: #ifndef DIR_SEPARATOR_2
                   4669: # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
                   4670: #else /* DIR_SEPARATOR_2 */
                   4671: # define IS_DIR_SEPARATOR(ch) \
                   4672:        (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
                   4673: #endif /* DIR_SEPARATOR_2 */
                   4674: 
                   4675: #ifndef PATH_SEPARATOR_2
                   4676: # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
                   4677: #else /* PATH_SEPARATOR_2 */
                   4678: # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
                   4679: #endif /* PATH_SEPARATOR_2 */
                   4680: 
                   4681: #ifndef FOPEN_WB
                   4682: # define FOPEN_WB "w"
                   4683: #endif
                   4684: #ifndef _O_BINARY
                   4685: # define _O_BINARY 0
                   4686: #endif
                   4687: 
                   4688: #define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
                   4689: #define XFREE(stale) do { \
                   4690:   if (stale) { free ((void *) stale); stale = 0; } \
                   4691: } while (0)
                   4692: 
1.1.1.1.2.3.2  1(misho  4693:4): #if defined(LT_DEBUGWRAPPER)
                   4694:4): static int lt_debug = 1;
1.1       misho    4695: #else
1.1.1.1.2.3.2  1(misho  4696:4): static int lt_debug = 0;
1.1       misho    4697: #endif
                   4698: 
1.1.1.1.2.3.2  1(misho  4699:4): const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
1.1       misho    4700: 
                   4701: void *xmalloc (size_t num);
                   4702: char *xstrdup (const char *string);
                   4703: const char *base_name (const char *name);
                   4704: char *find_executable (const char *wrapper);
                   4705: char *chase_symlinks (const char *pathspec);
                   4706: int make_executable (const char *path);
                   4707: int check_executable (const char *path);
                   4708: char *strendzap (char *str, const char *pat);
1.1.1.1.2.3.2  1(misho  4709:4): void lt_debugprintf (const char *file, int line, const char *fmt, ...);
                   4710:4): void lt_fatal (const char *file, int line, const char *message, ...);
                   4711:4): static const char *nonnull (const char *s);
                   4712:4): static const char *nonempty (const char *s);
1.1       misho    4713: void lt_setenv (const char *name, const char *value);
                   4714: char *lt_extend_str (const char *orig_value, const char *add, int to_end);
                   4715: void lt_update_exe_path (const char *name, const char *value);
                   4716: void lt_update_lib_path (const char *name, const char *value);
1.1.1.1.2.3.2  1(misho  4717:4): char **prepare_spawn (char **argv);
                   4718:4): void lt_dump_script (FILE *f);
1.1       misho    4719: EOF
                   4720: 
                   4721:            cat <<EOF
1.1.1.1.2.3.2  1(misho  4722:4): volatile const char * MAGIC_EXE = "$magic_exe";
1.1       misho    4723: const char * LIB_PATH_VARNAME = "$shlibpath_var";
                   4724: EOF
                   4725: 
                   4726:            if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
1.1.1.1.2.3.2  1(misho  4727:4):               func_to_host_path "$temp_rpath"
1.1       misho    4728:              cat <<EOF
1.1.1.1.2.3.2  1(misho  4729:4): const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
1.1       misho    4730: EOF
                   4731:            else
                   4732:              cat <<"EOF"
                   4733: const char * LIB_PATH_VALUE   = "";
                   4734: EOF
                   4735:            fi
                   4736: 
                   4737:            if test -n "$dllsearchpath"; then
1.1.1.1.2.3.2  1(misho  4738:4):               func_to_host_path "$dllsearchpath:"
1.1       misho    4739:              cat <<EOF
                   4740: const char * EXE_PATH_VARNAME = "PATH";
1.1.1.1.2.3.2  1(misho  4741:4): const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
1.1       misho    4742: EOF
                   4743:            else
                   4744:              cat <<"EOF"
                   4745: const char * EXE_PATH_VARNAME = "";
                   4746: const char * EXE_PATH_VALUE   = "";
                   4747: EOF
                   4748:            fi
                   4749: 
                   4750:            if test "$fast_install" = yes; then
                   4751:              cat <<EOF
                   4752: const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
                   4753: EOF
                   4754:            else
                   4755:              cat <<EOF
                   4756: const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
                   4757: EOF
                   4758:            fi
                   4759: 
                   4760: 
                   4761:            cat <<"EOF"
                   4762: 
                   4763: #define LTWRAPPER_OPTION_PREFIX         "--lt-"
                   4764: 
                   4765: static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
                   4766: static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
1.1.1.1.2.3.2  1(misho  4767:4): static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
1.1       misho    4768: 
                   4769: int
                   4770: main (int argc, char *argv[])
                   4771: {
                   4772:   char **newargz;
                   4773:   int  newargc;
                   4774:   char *tmp_pathspec;
                   4775:   char *actual_cwrapper_path;
                   4776:   char *actual_cwrapper_name;
                   4777:   char *target_name;
                   4778:   char *lt_argv_zero;
                   4779:   intptr_t rval = 127;
                   4780: 
                   4781:   int i;
                   4782: 
                   4783:   program_name = (char *) xstrdup (base_name (argv[0]));
1.1.1.1.2.3.2  1(misho  4784:4):   newargz = XMALLOC (char *, argc + 1);
1.1       misho    4785: 
1.1.1.1.2.3.2  1(misho  4786:4):   /* very simple arg parsing; don't want to rely on getopt
                   4787:4):    * also, copy all non cwrapper options to newargz, except
                   4788:4):    * argz[0], which is handled differently
                   4789:4):    */
                   4790:4):   newargc=0;
1.1       misho    4791:   for (i = 1; i < argc; i++)
                   4792:     {
                   4793:       if (strcmp (argv[i], dumpscript_opt) == 0)
                   4794:        {
                   4795: EOF
                   4796:            case "$host" in
                   4797:              *mingw* | *cygwin* )
                   4798:                # make stdout use "unix" line endings
                   4799:                echo "          setmode(1,_O_BINARY);"
                   4800:                ;;
                   4801:              esac
                   4802: 
                   4803:            cat <<"EOF"
1.1.1.1.2.3.2  1(misho  4804:4):       lt_dump_script (stdout);
1.1       misho    4805:          return 0;
                   4806:        }
1.1.1.1.2.3.2  1(misho  4807:4):       if (strcmp (argv[i], debug_opt) == 0)
                   4808:4):     {
                   4809:4):           lt_debug = 1;
                   4810:4):           continue;
                   4811:4):     }
                   4812:4):       if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
                   4813:4):         {
                   4814:4):           /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
                   4815:4):              namespace, but it is not one of the ones we know about and
                   4816:4):              have already dealt with, above (inluding dump-script), then
                   4817:4):              report an error. Otherwise, targets might begin to believe
                   4818:4):              they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
                   4819:4):              namespace. The first time any user complains about this, we'll
                   4820:4):              need to make LTWRAPPER_OPTION_PREFIX a configure-time option
                   4821:4):              or a configure.ac-settable value.
                   4822:4):            */
                   4823:4):           lt_fatal (__FILE__, __LINE__,
                   4824:4):                 "unrecognized %s option: '%s'",
                   4825:4):                     ltwrapper_option_prefix, argv[i]);
                   4826:4):         }
                   4827:4):       /* otherwise ... */
                   4828:4):       newargz[++newargc] = xstrdup (argv[i]);
1.1       misho    4829:     }
1.1.1.1.2.3.2  1(misho  4830:4):   newargz[++newargc] = NULL;
                   4831:4): 
                   4832:4): EOF
                   4833:4):         cat <<EOF
                   4834:4):   /* The GNU banner must be the first non-error debug message */
                   4835:4):   lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
                   4836:4): EOF
                   4837:4):         cat <<"EOF"
                   4838:4):   lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
                   4839:4):   lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
1.1       misho    4840: 
                   4841:   tmp_pathspec = find_executable (argv[0]);
                   4842:   if (tmp_pathspec == NULL)
1.1.1.1.2.3.2  1(misho  4843:4):     lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
                   4844:4):   lt_debugprintf (__FILE__, __LINE__,
                   4845:4):                   "(main) found exe (before symlink chase) at: %s\n",
                   4846:4):               tmp_pathspec);
1.1       misho    4847: 
                   4848:   actual_cwrapper_path = chase_symlinks (tmp_pathspec);
1.1.1.1.2.3.2  1(misho  4849:4):   lt_debugprintf (__FILE__, __LINE__,
                   4850:4):                   "(main) found exe (after symlink chase) at: %s\n",
                   4851:4):               actual_cwrapper_path);
1.1       misho    4852:   XFREE (tmp_pathspec);
                   4853: 
1.1.1.1.2.3.2  1(misho  4854:4):   actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
1.1       misho    4855:   strendzap (actual_cwrapper_path, actual_cwrapper_name);
                   4856: 
                   4857:   /* wrapper name transforms */
                   4858:   strendzap (actual_cwrapper_name, ".exe");
                   4859:   tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
                   4860:   XFREE (actual_cwrapper_name);
                   4861:   actual_cwrapper_name = tmp_pathspec;
                   4862:   tmp_pathspec = 0;
                   4863: 
                   4864:   /* target_name transforms -- use actual target program name; might have lt- prefix */
                   4865:   target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
                   4866:   strendzap (target_name, ".exe");
                   4867:   tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
                   4868:   XFREE (target_name);
                   4869:   target_name = tmp_pathspec;
                   4870:   tmp_pathspec = 0;
                   4871: 
1.1.1.1.2.3.2  1(misho  4872:4):   lt_debugprintf (__FILE__, __LINE__,
                   4873:4):               "(main) libtool target name: %s\n",
                   4874:4):               target_name);
1.1       misho    4875: EOF
                   4876: 
                   4877:            cat <<EOF
                   4878:   newargz[0] =
                   4879:     XMALLOC (char, (strlen (actual_cwrapper_path) +
                   4880:                    strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
                   4881:   strcpy (newargz[0], actual_cwrapper_path);
                   4882:   strcat (newargz[0], "$objdir");
                   4883:   strcat (newargz[0], "/");
                   4884: EOF
                   4885: 
                   4886:            cat <<"EOF"
                   4887:   /* stop here, and copy so we don't have to do this twice */
                   4888:   tmp_pathspec = xstrdup (newargz[0]);
                   4889: 
                   4890:   /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
                   4891:   strcat (newargz[0], actual_cwrapper_name);
                   4892: 
                   4893:   /* DO want the lt- prefix here if it exists, so use target_name */
                   4894:   lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
                   4895:   XFREE (tmp_pathspec);
                   4896:   tmp_pathspec = NULL;
                   4897: EOF
                   4898: 
                   4899:            case $host_os in
                   4900:              mingw*)
                   4901:            cat <<"EOF"
                   4902:   {
                   4903:     char* p;
                   4904:     while ((p = strchr (newargz[0], '\\')) != NULL)
                   4905:       {
                   4906:        *p = '/';
                   4907:       }
                   4908:     while ((p = strchr (lt_argv_zero, '\\')) != NULL)
                   4909:       {
                   4910:        *p = '/';
                   4911:       }
                   4912:   }
                   4913: EOF
                   4914:            ;;
                   4915:            esac
                   4916: 
                   4917:            cat <<"EOF"
                   4918:   XFREE (target_name);
                   4919:   XFREE (actual_cwrapper_path);
                   4920:   XFREE (actual_cwrapper_name);
                   4921: 
                   4922:   lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
                   4923:   lt_setenv ("DUALCASE", "1");  /* for MSK sh */
1.1.1.1.2.3.2  1(misho  4924:4):   /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
                   4925:4):      be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
                   4926:4):      because on Windows, both *_VARNAMEs are PATH but uninstalled
                   4927:4):      libraries must come first. */
1.1       misho    4928:   lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
1.1.1.1.2.3.2  1(misho  4929:4):   lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
1.1       misho    4930: 
1.1.1.1.2.3.2  1(misho  4931:4):   lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
                   4932:4):               nonnull (lt_argv_zero));
1.1       misho    4933:   for (i = 0; i < newargc; i++)
                   4934:     {
1.1.1.1.2.3.2  1(misho  4935:4):       lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
                   4936:4):                   i, nonnull (newargz[i]));
1.1       misho    4937:     }
                   4938: 
                   4939: EOF
                   4940: 
                   4941:            case $host_os in
                   4942:              mingw*)
                   4943:                cat <<"EOF"
                   4944:   /* execv doesn't actually work on mingw as expected on unix */
1.1.1.1.2.3.2  1(misho  4945:4):   newargz = prepare_spawn (newargz);
1.1       misho    4946:   rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
                   4947:   if (rval == -1)
                   4948:     {
                   4949:       /* failed to start process */
1.1.1.1.2.3.2  1(misho  4950:4):       lt_debugprintf (__FILE__, __LINE__,
                   4951:4):                   "(main) failed to launch target \"%s\": %s\n",
                   4952:4):                   lt_argv_zero, nonnull (strerror (errno)));
1.1       misho    4953:       return 127;
                   4954:     }
                   4955:   return rval;
                   4956: EOF
                   4957:                ;;
                   4958:              *)
                   4959:                cat <<"EOF"
                   4960:   execv (lt_argv_zero, newargz);
                   4961:   return rval; /* =127, but avoids unused variable warning */
                   4962: EOF
                   4963:                ;;
                   4964:            esac
                   4965: 
                   4966:            cat <<"EOF"
                   4967: }
                   4968: 
                   4969: void *
                   4970: xmalloc (size_t num)
                   4971: {
                   4972:   void *p = (void *) malloc (num);
                   4973:   if (!p)
1.1.1.1.2.3.2  1(misho  4974:4):     lt_fatal (__FILE__, __LINE__, "memory exhausted");
1.1       misho    4975: 
                   4976:   return p;
                   4977: }
                   4978: 
                   4979: char *
                   4980: xstrdup (const char *string)
                   4981: {
                   4982:   return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
                   4983:                          string) : NULL;
                   4984: }
                   4985: 
                   4986: const char *
                   4987: base_name (const char *name)
                   4988: {
                   4989:   const char *base;
                   4990: 
                   4991: #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
                   4992:   /* Skip over the disk name in MSDOS pathnames. */
                   4993:   if (isalpha ((unsigned char) name[0]) && name[1] == ':')
                   4994:     name += 2;
                   4995: #endif
                   4996: 
                   4997:   for (base = name; *name; name++)
                   4998:     if (IS_DIR_SEPARATOR (*name))
                   4999:       base = name + 1;
                   5000:   return base;
                   5001: }
                   5002: 
                   5003: int
                   5004: check_executable (const char *path)
                   5005: {
                   5006:   struct stat st;
                   5007: 
1.1.1.1.2.3.2  1(misho  5008:4):   lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
                   5009:4):                   nonempty (path));
1.1       misho    5010:   if ((!path) || (!*path))
                   5011:     return 0;
                   5012: 
                   5013:   if ((stat (path, &st) >= 0)
                   5014:       && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
                   5015:     return 1;
                   5016:   else
                   5017:     return 0;
                   5018: }
                   5019: 
                   5020: int
                   5021: make_executable (const char *path)
                   5022: {
                   5023:   int rval = 0;
                   5024:   struct stat st;
                   5025: 
1.1.1.1.2.3.2  1(misho  5026:4):   lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
                   5027:4):                   nonempty (path));
1.1       misho    5028:   if ((!path) || (!*path))
                   5029:     return 0;
                   5030: 
                   5031:   if (stat (path, &st) >= 0)
                   5032:     {
                   5033:       rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
                   5034:     }
                   5035:   return rval;
                   5036: }
                   5037: 
                   5038: /* Searches for the full path of the wrapper.  Returns
                   5039:    newly allocated full path name if found, NULL otherwise
                   5040:    Does not chase symlinks, even on platforms that support them.
                   5041: */
                   5042: char *
                   5043: find_executable (const char *wrapper)
                   5044: {
                   5045:   int has_slash = 0;
                   5046:   const char *p;
                   5047:   const char *p_next;
                   5048:   /* static buffer for getcwd */
                   5049:   char tmp[LT_PATHMAX + 1];
                   5050:   int tmp_len;
                   5051:   char *concat_name;
                   5052: 
1.1.1.1.2.3.2  1(misho  5053:4):   lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
                   5054:4):                   nonempty (wrapper));
1.1       misho    5055: 
                   5056:   if ((wrapper == NULL) || (*wrapper == '\0'))
                   5057:     return NULL;
                   5058: 
                   5059:   /* Absolute path? */
                   5060: #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
                   5061:   if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
                   5062:     {
                   5063:       concat_name = xstrdup (wrapper);
                   5064:       if (check_executable (concat_name))
                   5065:        return concat_name;
                   5066:       XFREE (concat_name);
                   5067:     }
                   5068:   else
                   5069:     {
                   5070: #endif
                   5071:       if (IS_DIR_SEPARATOR (wrapper[0]))
                   5072:        {
                   5073:          concat_name = xstrdup (wrapper);
                   5074:          if (check_executable (concat_name))
                   5075:            return concat_name;
                   5076:          XFREE (concat_name);
                   5077:        }
                   5078: #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
                   5079:     }
                   5080: #endif
                   5081: 
                   5082:   for (p = wrapper; *p; p++)
                   5083:     if (*p == '/')
                   5084:       {
                   5085:        has_slash = 1;
                   5086:        break;
                   5087:       }
                   5088:   if (!has_slash)
                   5089:     {
                   5090:       /* no slashes; search PATH */
                   5091:       const char *path = getenv ("PATH");
                   5092:       if (path != NULL)
                   5093:        {
                   5094:          for (p = path; *p; p = p_next)
                   5095:            {
                   5096:              const char *q;
                   5097:              size_t p_len;
                   5098:              for (q = p; *q; q++)
                   5099:                if (IS_PATH_SEPARATOR (*q))
                   5100:                  break;
                   5101:              p_len = q - p;
                   5102:              p_next = (*q == '\0' ? q : q + 1);
                   5103:              if (p_len == 0)
                   5104:                {
                   5105:                  /* empty path: current directory */
                   5106:                  if (getcwd (tmp, LT_PATHMAX) == NULL)
1.1.1.1.2.3.2  1(misho  5107:4):                 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
                   5108:4):                               nonnull (strerror (errno)));
1.1       misho    5109:                  tmp_len = strlen (tmp);
                   5110:                  concat_name =
                   5111:                    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
                   5112:                  memcpy (concat_name, tmp, tmp_len);
                   5113:                  concat_name[tmp_len] = '/';
                   5114:                  strcpy (concat_name + tmp_len + 1, wrapper);
                   5115:                }
                   5116:              else
                   5117:                {
                   5118:                  concat_name =
                   5119:                    XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
                   5120:                  memcpy (concat_name, p, p_len);
                   5121:                  concat_name[p_len] = '/';
                   5122:                  strcpy (concat_name + p_len + 1, wrapper);
                   5123:                }
                   5124:              if (check_executable (concat_name))
                   5125:                return concat_name;
                   5126:              XFREE (concat_name);
                   5127:            }
                   5128:        }
                   5129:       /* not found in PATH; assume curdir */
                   5130:     }
                   5131:   /* Relative path | not found in path: prepend cwd */
                   5132:   if (getcwd (tmp, LT_PATHMAX) == NULL)
1.1.1.1.2.3.2  1(misho  5133:4):     lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
                   5134:4):               nonnull (strerror (errno)));
1.1       misho    5135:   tmp_len = strlen (tmp);
                   5136:   concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
                   5137:   memcpy (concat_name, tmp, tmp_len);
                   5138:   concat_name[tmp_len] = '/';
                   5139:   strcpy (concat_name + tmp_len + 1, wrapper);
                   5140: 
                   5141:   if (check_executable (concat_name))
                   5142:     return concat_name;
                   5143:   XFREE (concat_name);
                   5144:   return NULL;
                   5145: }
                   5146: 
                   5147: char *
                   5148: chase_symlinks (const char *pathspec)
                   5149: {
                   5150: #ifndef S_ISLNK
                   5151:   return xstrdup (pathspec);
                   5152: #else
                   5153:   char buf[LT_PATHMAX];
                   5154:   struct stat s;
                   5155:   char *tmp_pathspec = xstrdup (pathspec);
                   5156:   char *p;
                   5157:   int has_symlinks = 0;
                   5158:   while (strlen (tmp_pathspec) && !has_symlinks)
                   5159:     {
1.1.1.1.2.3.2  1(misho  5160:4):       lt_debugprintf (__FILE__, __LINE__,
                   5161:4):                   "checking path component for symlinks: %s\n",
                   5162:4):                   tmp_pathspec);
1.1       misho    5163:       if (lstat (tmp_pathspec, &s) == 0)
                   5164:        {
                   5165:          if (S_ISLNK (s.st_mode) != 0)
                   5166:            {
                   5167:              has_symlinks = 1;
                   5168:              break;
                   5169:            }
                   5170: 
                   5171:          /* search backwards for last DIR_SEPARATOR */
                   5172:          p = tmp_pathspec + strlen (tmp_pathspec) - 1;
                   5173:          while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
                   5174:            p--;
                   5175:          if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
                   5176:            {
                   5177:              /* no more DIR_SEPARATORS left */
                   5178:              break;
                   5179:            }
                   5180:          *p = '\0';
                   5181:        }
                   5182:       else
                   5183:        {
1.1.1.1.2.3.2  1(misho  5184:4):       lt_fatal (__FILE__, __LINE__,
                   5185:4):                 "error accessing file \"%s\": %s",
                   5186:4):                 tmp_pathspec, nonnull (strerror (errno)));
1.1       misho    5187:        }
                   5188:     }
                   5189:   XFREE (tmp_pathspec);
                   5190: 
                   5191:   if (!has_symlinks)
                   5192:     {
                   5193:       return xstrdup (pathspec);
                   5194:     }
                   5195: 
                   5196:   tmp_pathspec = realpath (pathspec, buf);
                   5197:   if (tmp_pathspec == 0)
                   5198:     {
1.1.1.1.2.3.2  1(misho  5199:4):       lt_fatal (__FILE__, __LINE__,
                   5200:4):             "could not follow symlinks for %s", pathspec);
1.1       misho    5201:     }
                   5202:   return xstrdup (tmp_pathspec);
                   5203: #endif
                   5204: }
                   5205: 
                   5206: char *
                   5207: strendzap (char *str, const char *pat)
                   5208: {
                   5209:   size_t len, patlen;
                   5210: 
                   5211:   assert (str != NULL);
                   5212:   assert (pat != NULL);
                   5213: 
                   5214:   len = strlen (str);
                   5215:   patlen = strlen (pat);
                   5216: 
                   5217:   if (patlen <= len)
                   5218:     {
                   5219:       str += len - patlen;
                   5220:       if (strcmp (str, pat) == 0)
                   5221:        *str = '\0';
                   5222:     }
                   5223:   return str;
                   5224: }
                   5225: 
1.1.1.1.2.3.2  1(misho  5226:4): void
                   5227:4): lt_debugprintf (const char *file, int line, const char *fmt, ...)
                   5228:4): {
                   5229:4):   va_list args;
                   5230:4):   if (lt_debug)
                   5231:4):     {
                   5232:4):       (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
                   5233:4):       va_start (args, fmt);
                   5234:4):       (void) vfprintf (stderr, fmt, args);
                   5235:4):       va_end (args);
                   5236:4):     }
                   5237:4): }
                   5238:4): 
1.1       misho    5239: static void
1.1.1.1.2.3.2  1(misho  5240:4): lt_error_core (int exit_status, const char *file,
                   5241:4):            int line, const char *mode,
1.1       misho    5242:               const char *message, va_list ap)
                   5243: {
1.1.1.1.2.3.2  1(misho  5244:4):   fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
1.1       misho    5245:   vfprintf (stderr, message, ap);
                   5246:   fprintf (stderr, ".\n");
                   5247: 
                   5248:   if (exit_status >= 0)
                   5249:     exit (exit_status);
                   5250: }
                   5251: 
                   5252: void
1.1.1.1.2.3.2  1(misho  5253:4): lt_fatal (const char *file, int line, const char *message, ...)
1.1       misho    5254: {
                   5255:   va_list ap;
                   5256:   va_start (ap, message);
1.1.1.1.2.3.2  1(misho  5257:4):   lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
1.1       misho    5258:   va_end (ap);
                   5259: }
                   5260: 
1.1.1.1.2.3.2  1(misho  5261:4): static const char *
                   5262:4): nonnull (const char *s)
                   5263:4): {
                   5264:4):   return s ? s : "(null)";
                   5265:4): }
                   5266:4): 
                   5267:4): static const char *
                   5268:4): nonempty (const char *s)
                   5269:4): {
                   5270:4):   return (s && !*s) ? "(empty)" : nonnull (s);
                   5271:4): }
                   5272:4): 
1.1       misho    5273: void
                   5274: lt_setenv (const char *name, const char *value)
                   5275: {
1.1.1.1.2.3.2  1(misho  5276:4):   lt_debugprintf (__FILE__, __LINE__,
                   5277:4):               "(lt_setenv) setting '%s' to '%s'\n",
                   5278:4):                   nonnull (name), nonnull (value));
1.1       misho    5279:   {
                   5280: #ifdef HAVE_SETENV
                   5281:     /* always make a copy, for consistency with !HAVE_SETENV */
                   5282:     char *str = xstrdup (value);
                   5283:     setenv (name, str, 1);
                   5284: #else
                   5285:     int len = strlen (name) + 1 + strlen (value) + 1;
                   5286:     char *str = XMALLOC (char, len);
                   5287:     sprintf (str, "%s=%s", name, value);
                   5288:     if (putenv (str) != EXIT_SUCCESS)
                   5289:       {
                   5290:         XFREE (str);
                   5291:       }
                   5292: #endif
                   5293:   }
                   5294: }
                   5295: 
                   5296: char *
                   5297: lt_extend_str (const char *orig_value, const char *add, int to_end)
                   5298: {
                   5299:   char *new_value;
                   5300:   if (orig_value && *orig_value)
                   5301:     {
                   5302:       int orig_value_len = strlen (orig_value);
                   5303:       int add_len = strlen (add);
                   5304:       new_value = XMALLOC (char, add_len + orig_value_len + 1);
                   5305:       if (to_end)
                   5306:         {
                   5307:           strcpy (new_value, orig_value);
                   5308:           strcpy (new_value + orig_value_len, add);
                   5309:         }
                   5310:       else
                   5311:         {
                   5312:           strcpy (new_value, add);
                   5313:           strcpy (new_value + add_len, orig_value);
                   5314:         }
                   5315:     }
                   5316:   else
                   5317:     {
                   5318:       new_value = xstrdup (add);
                   5319:     }
                   5320:   return new_value;
                   5321: }
                   5322: 
                   5323: void
                   5324: lt_update_exe_path (const char *name, const char *value)
                   5325: {
1.1.1.1.2.3.2  1(misho  5326:4):   lt_debugprintf (__FILE__, __LINE__,
                   5327:4):               "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
                   5328:4):                   nonnull (name), nonnull (value));
1.1       misho    5329: 
                   5330:   if (name && *name && value && *value)
                   5331:     {
                   5332:       char *new_value = lt_extend_str (getenv (name), value, 0);
                   5333:       /* some systems can't cope with a ':'-terminated path #' */
                   5334:       int len = strlen (new_value);
                   5335:       while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
                   5336:         {
                   5337:           new_value[len-1] = '\0';
                   5338:         }
                   5339:       lt_setenv (name, new_value);
                   5340:       XFREE (new_value);
                   5341:     }
                   5342: }
                   5343: 
                   5344: void
                   5345: lt_update_lib_path (const char *name, const char *value)
                   5346: {
1.1.1.1.2.3.2  1(misho  5347:4):   lt_debugprintf (__FILE__, __LINE__,
                   5348:4):               "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
                   5349:4):                   nonnull (name), nonnull (value));
1.1       misho    5350: 
                   5351:   if (name && *name && value && *value)
                   5352:     {
                   5353:       char *new_value = lt_extend_str (getenv (name), value, 0);
                   5354:       lt_setenv (name, new_value);
                   5355:       XFREE (new_value);
                   5356:     }
                   5357: }
                   5358: 
1.1.1.1.2.3.2  1(misho  5359:4): EOF
                   5360:4):         case $host_os in
                   5361:4):           mingw*)
                   5362:4):             cat <<"EOF"
                   5363:4): 
                   5364:4): /* Prepares an argument vector before calling spawn().
                   5365:4):    Note that spawn() does not by itself call the command interpreter
                   5366:4):      (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
                   5367:4):       ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
                   5368:4):          GetVersionEx(&v);
                   5369:4):          v.dwPlatformId == VER_PLATFORM_WIN32_NT;
                   5370:4):       }) ? "cmd.exe" : "command.com").
                   5371:4):    Instead it simply concatenates the arguments, separated by ' ', and calls
                   5372:4):    CreateProcess().  We must quote the arguments since Win32 CreateProcess()
                   5373:4):    interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
                   5374:4):    special way:
                   5375:4):    - Space and tab are interpreted as delimiters. They are not treated as
                   5376:4):      delimiters if they are surrounded by double quotes: "...".
                   5377:4):    - Unescaped double quotes are removed from the input. Their only effect is
                   5378:4):      that within double quotes, space and tab are treated like normal
                   5379:4):      characters.
                   5380:4):    - Backslashes not followed by double quotes are not special.
                   5381:4):    - But 2*n+1 backslashes followed by a double quote become
                   5382:4):      n backslashes followed by a double quote (n >= 0):
                   5383:4):        \" -> "
                   5384:4):        \\\" -> \"
                   5385:4):        \\\\\" -> \\"
                   5386:4):  */
                   5387:4): #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"
                   5388:4): #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"
                   5389:4): char **
                   5390:4): prepare_spawn (char **argv)
                   5391:4): {
                   5392:4):   size_t argc;
                   5393:4):   char **new_argv;
                   5394:4):   size_t i;
                   5395:4): 
                   5396:4):   /* Count number of arguments.  */
                   5397:4):   for (argc = 0; argv[argc] != NULL; argc++)
                   5398:4):     ;
                   5399:4): 
                   5400:4):   /* Allocate new argument vector.  */
                   5401:4):   new_argv = XMALLOC (char *, argc + 1);
                   5402:4): 
                   5403:4):   /* Put quoted arguments into the new argument vector.  */
                   5404:4):   for (i = 0; i < argc; i++)
                   5405:4):     {
                   5406:4):       const char *string = argv[i];
                   5407:4): 
                   5408:4):       if (string[0] == '\0')
                   5409:4):     new_argv[i] = xstrdup ("\"\"");
                   5410:4):       else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
                   5411:4):     {
                   5412:4):       int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
                   5413:4):       size_t length;
                   5414:4):       unsigned int backslashes;
                   5415:4):       const char *s;
                   5416:4):       char *quoted_string;
                   5417:4):       char *p;
                   5418:4): 
                   5419:4):       length = 0;
                   5420:4):       backslashes = 0;
                   5421:4):       if (quote_around)
                   5422:4):         length++;
                   5423:4):       for (s = string; *s != '\0'; s++)
                   5424:4):         {
                   5425:4):           char c = *s;
                   5426:4):           if (c == '"')
                   5427:4):             length += backslashes + 1;
                   5428:4):           length++;
                   5429:4):           if (c == '\\')
                   5430:4):             backslashes++;
                   5431:4):           else
                   5432:4):             backslashes = 0;
                   5433:4):         }
                   5434:4):       if (quote_around)
                   5435:4):         length += backslashes + 1;
                   5436:4): 
                   5437:4):       quoted_string = XMALLOC (char, length + 1);
                   5438:4): 
                   5439:4):       p = quoted_string;
                   5440:4):       backslashes = 0;
                   5441:4):       if (quote_around)
                   5442:4):         *p++ = '"';
                   5443:4):       for (s = string; *s != '\0'; s++)
                   5444:4):         {
                   5445:4):           char c = *s;
                   5446:4):           if (c == '"')
                   5447:4):             {
                   5448:4):               unsigned int j;
                   5449:4):               for (j = backslashes + 1; j > 0; j--)
                   5450:4):                 *p++ = '\\';
                   5451:4):             }
                   5452:4):           *p++ = c;
                   5453:4):           if (c == '\\')
                   5454:4):             backslashes++;
                   5455:4):           else
                   5456:4):             backslashes = 0;
                   5457:4):         }
                   5458:4):       if (quote_around)
                   5459:4):         {
                   5460:4):           unsigned int j;
                   5461:4):           for (j = backslashes; j > 0; j--)
                   5462:4):             *p++ = '\\';
                   5463:4):           *p++ = '"';
                   5464:4):         }
                   5465:4):       *p = '\0';
                   5466:4): 
                   5467:4):       new_argv[i] = quoted_string;
                   5468:4):     }
                   5469:4):       else
                   5470:4):     new_argv[i] = (char *) string;
                   5471:4):     }
                   5472:4):   new_argv[argc] = NULL;
                   5473:4): 
                   5474:4):   return new_argv;
                   5475:4): }
                   5476:4): EOF
                   5477:4):             ;;
                   5478:4):         esac
1.1       misho    5479: 
1.1.1.1.2.3.2  1(misho  5480:4):             cat <<"EOF"
                   5481:4): void lt_dump_script (FILE* f)
                   5482:4): {
                   5483:4): EOF
                   5484:4):         func_emit_wrapper yes |
                   5485:4):           $SED -n -e '
                   5486:4): s/^\(.\{79\}\)\(..*\)/\1\
                   5487:4): \2/
                   5488:4): h
                   5489:4): s/\([\\"]\)/\\\1/g
                   5490:4): s/$/\\n/
                   5491:4): s/\([^\n]*\).*/  fputs ("\1", f);/p
                   5492:4): g
                   5493:4): D'
                   5494:4):             cat <<"EOF"
                   5495:4): }
1.1       misho    5496: EOF
                   5497: }
                   5498: # end: func_emit_cwrapperexe_src
                   5499: 
1.1.1.1.2.3.2  1(misho  5500:4): # func_win32_import_lib_p ARG
                   5501:4): # True if ARG is an import lib, as indicated by $file_magic_cmd
                   5502:4): func_win32_import_lib_p ()
                   5503:4): {
                   5504:4):     $opt_debug
                   5505:4):     case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
                   5506:4):     *import*) : ;;
                   5507:4):     *) false ;;
                   5508:4):     esac
                   5509:4): }
                   5510:4): 
1.1       misho    5511: # func_mode_link arg...
                   5512: func_mode_link ()
                   5513: {
                   5514:     $opt_debug
                   5515:     case $host in
                   5516:     *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
                   5517:       # It is impossible to link a dll without this setting, and
                   5518:       # we shouldn't force the makefile maintainer to figure out
                   5519:       # which system we are compiling for in order to pass an extra
                   5520:       # flag for every libtool invocation.
                   5521:       # allow_undefined=no
                   5522: 
                   5523:       # FIXME: Unfortunately, there are problems with the above when trying
                   5524:       # to make a dll which has undefined symbols, in which case not
                   5525:       # even a static library is built.  For now, we need to specify
                   5526:       # -no-undefined on the libtool link line when we can be certain
                   5527:       # that all symbols are satisfied, otherwise we get a static library.
                   5528:       allow_undefined=yes
                   5529:       ;;
                   5530:     *)
                   5531:       allow_undefined=yes
                   5532:       ;;
                   5533:     esac
                   5534:     libtool_args=$nonopt
                   5535:     base_compile="$nonopt $@"
                   5536:     compile_command=$nonopt
                   5537:     finalize_command=$nonopt
                   5538: 
                   5539:     compile_rpath=
                   5540:     finalize_rpath=
                   5541:     compile_shlibpath=
                   5542:     finalize_shlibpath=
                   5543:     convenience=
                   5544:     old_convenience=
                   5545:     deplibs=
                   5546:     old_deplibs=
                   5547:     compiler_flags=
                   5548:     linker_flags=
                   5549:     dllsearchpath=
                   5550:     lib_search_path=`pwd`
                   5551:     inst_prefix_dir=
                   5552:     new_inherited_linker_flags=
                   5553: 
                   5554:     avoid_version=no
1.1.1.1.2.3.2  1(misho  5555:4):     bindir=
1.1       misho    5556:     dlfiles=
                   5557:     dlprefiles=
                   5558:     dlself=no
                   5559:     export_dynamic=no
                   5560:     export_symbols=
                   5561:     export_symbols_regex=
                   5562:     generated=
                   5563:     libobjs=
                   5564:     ltlibs=
                   5565:     module=no
                   5566:     no_install=no
                   5567:     objs=
                   5568:     non_pic_objects=
                   5569:     precious_files_regex=
                   5570:     prefer_static_libs=no
                   5571:     preload=no
                   5572:     prev=
                   5573:     prevarg=
                   5574:     release=
                   5575:     rpath=
                   5576:     xrpath=
                   5577:     perm_rpath=
                   5578:     temp_rpath=
                   5579:     thread_safe=no
                   5580:     vinfo=
                   5581:     vinfo_number=no
                   5582:     weak_libs=
                   5583:     single_module="${wl}-single_module"
                   5584:     func_infer_tag $base_compile
                   5585: 
                   5586:     # We need to know -static, to get the right output filenames.
                   5587:     for arg
                   5588:     do
                   5589:       case $arg in
                   5590:       -shared)
                   5591:        test "$build_libtool_libs" != yes && \
                   5592:          func_fatal_configuration "can not build a shared library"
                   5593:        build_old_libs=no
                   5594:        break
                   5595:        ;;
                   5596:       -all-static | -static | -static-libtool-libs)
                   5597:        case $arg in
                   5598:        -all-static)
                   5599:          if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
                   5600:            func_warning "complete static linking is impossible in this configuration"
                   5601:          fi
                   5602:          if test -n "$link_static_flag"; then
                   5603:            dlopen_self=$dlopen_self_static
                   5604:          fi
                   5605:          prefer_static_libs=yes
                   5606:          ;;
                   5607:        -static)
                   5608:          if test -z "$pic_flag" && test -n "$link_static_flag"; then
                   5609:            dlopen_self=$dlopen_self_static
                   5610:          fi
                   5611:          prefer_static_libs=built
                   5612:          ;;
                   5613:        -static-libtool-libs)
                   5614:          if test -z "$pic_flag" && test -n "$link_static_flag"; then
                   5615:            dlopen_self=$dlopen_self_static
                   5616:          fi
                   5617:          prefer_static_libs=yes
                   5618:          ;;
                   5619:        esac
                   5620:        build_libtool_libs=no
                   5621:        build_old_libs=yes
                   5622:        break
                   5623:        ;;
                   5624:       esac
                   5625:     done
                   5626: 
                   5627:     # See if our shared archives depend on static archives.
                   5628:     test -n "$old_archive_from_new_cmds" && build_old_libs=yes
                   5629: 
                   5630:     # Go through the arguments, transforming them on the way.
                   5631:     while test "$#" -gt 0; do
                   5632:       arg="$1"
                   5633:       shift
                   5634:       func_quote_for_eval "$arg"
                   5635:       qarg=$func_quote_for_eval_unquoted_result
1.1.1.1.2.3.2  1(misho  5636:4):       libtool_args="$libtool_args $func_quote_for_eval_result"
1.1       misho    5637: 
                   5638:       # If the previous option needs an argument, assign it.
                   5639:       if test -n "$prev"; then
                   5640:        case $prev in
                   5641:        output)
1.1.1.1.2.3.2  1(misho  5642:4):       compile_command="$compile_command @OUTPUT@"
                   5643:4):       finalize_command="$finalize_command @OUTPUT@"
1.1       misho    5644:          ;;
                   5645:        esac
                   5646: 
                   5647:        case $prev in
1.1.1.1.2.3.2  1(misho  5648:4):     bindir)
                   5649:4):       bindir="$arg"
                   5650:4):       prev=
                   5651:4):       continue
                   5652:4):       ;;
1.1       misho    5653:        dlfiles|dlprefiles)
                   5654:          if test "$preload" = no; then
                   5655:            # Add the symbol object into the linking commands.
1.1.1.1.2.3.2  1(misho  5656:4):         compile_command="$compile_command @SYMFILE@"
                   5657:4):         finalize_command="$finalize_command @SYMFILE@"
1.1       misho    5658:            preload=yes
                   5659:          fi
                   5660:          case $arg in
                   5661:          *.la | *.lo) ;;  # We handle these cases below.
                   5662:          force)
                   5663:            if test "$dlself" = no; then
                   5664:              dlself=needless
                   5665:              export_dynamic=yes
                   5666:            fi
                   5667:            prev=
                   5668:            continue
                   5669:            ;;
                   5670:          self)
                   5671:            if test "$prev" = dlprefiles; then
                   5672:              dlself=yes
                   5673:            elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
                   5674:              dlself=yes
                   5675:            else
                   5676:              dlself=needless
                   5677:              export_dynamic=yes
                   5678:            fi
                   5679:            prev=
                   5680:            continue
                   5681:            ;;
                   5682:          *)
                   5683:            if test "$prev" = dlfiles; then
                   5684:              dlfiles="$dlfiles $arg"
                   5685:            else
                   5686:              dlprefiles="$dlprefiles $arg"
                   5687:            fi
                   5688:            prev=
                   5689:            continue
                   5690:            ;;
                   5691:          esac
                   5692:          ;;
                   5693:        expsyms)
                   5694:          export_symbols="$arg"
                   5695:          test -f "$arg" \
                   5696:            || func_fatal_error "symbol file \`$arg' does not exist"
                   5697:          prev=
                   5698:          continue
                   5699:          ;;
                   5700:        expsyms_regex)
                   5701:          export_symbols_regex="$arg"
                   5702:          prev=
                   5703:          continue
                   5704:          ;;
                   5705:        framework)
                   5706:          case $host in
                   5707:            *-*-darwin*)
                   5708:              case "$deplibs " in
                   5709:                *" $qarg.ltframework "*) ;;
                   5710:                *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
                   5711:                   ;;
                   5712:              esac
                   5713:              ;;
                   5714:          esac
                   5715:          prev=
                   5716:          continue
                   5717:          ;;
                   5718:        inst_prefix)
                   5719:          inst_prefix_dir="$arg"
                   5720:          prev=
                   5721:          continue
                   5722:          ;;
                   5723:        objectlist)
                   5724:          if test -f "$arg"; then
                   5725:            save_arg=$arg
                   5726:            moreargs=
                   5727:            for fil in `cat "$save_arg"`
                   5728:            do
                   5729: #            moreargs="$moreargs $fil"
                   5730:              arg=$fil
                   5731:              # A libtool-controlled object.
                   5732: 
                   5733:              # Check to see that this really is a libtool object.
                   5734:              if func_lalib_unsafe_p "$arg"; then
                   5735:                pic_object=
                   5736:                non_pic_object=
                   5737: 
                   5738:                # Read the .lo file
                   5739:                func_source "$arg"
                   5740: 
                   5741:                if test -z "$pic_object" ||
                   5742:                   test -z "$non_pic_object" ||
                   5743:                   test "$pic_object" = none &&
                   5744:                   test "$non_pic_object" = none; then
                   5745:                  func_fatal_error "cannot find name of object for \`$arg'"
                   5746:                fi
                   5747: 
                   5748:                # Extract subdirectory from the argument.
                   5749:                func_dirname "$arg" "/" ""
                   5750:                xdir="$func_dirname_result"
                   5751: 
                   5752:                if test "$pic_object" != none; then
                   5753:                  # Prepend the subdirectory the object is found in.
                   5754:                  pic_object="$xdir$pic_object"
                   5755: 
                   5756:                  if test "$prev" = dlfiles; then
                   5757:                    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
                   5758:                      dlfiles="$dlfiles $pic_object"
                   5759:                      prev=
                   5760:                      continue
                   5761:                    else
                   5762:                      # If libtool objects are unsupported, then we need to preload.
                   5763:                      prev=dlprefiles
                   5764:                    fi
                   5765:                  fi
                   5766: 
                   5767:                  # CHECK ME:  I think I busted this.  -Ossama
                   5768:                  if test "$prev" = dlprefiles; then
                   5769:                    # Preload the old-style object.
                   5770:                    dlprefiles="$dlprefiles $pic_object"
                   5771:                    prev=
                   5772:                  fi
                   5773: 
                   5774:                  # A PIC object.
1.1.1.1.2.3.2  1(misho  5775:4):               libobjs="$libobjs $pic_object"
1.1       misho    5776:                  arg="$pic_object"
                   5777:                fi
                   5778: 
                   5779:                # Non-PIC object.
                   5780:                if test "$non_pic_object" != none; then
                   5781:                  # Prepend the subdirectory the object is found in.
                   5782:                  non_pic_object="$xdir$non_pic_object"
                   5783: 
                   5784:                  # A standard non-PIC object
1.1.1.1.2.3.2  1(misho  5785:4):               non_pic_objects="$non_pic_objects $non_pic_object"
1.1       misho    5786:                  if test -z "$pic_object" || test "$pic_object" = none ; then
                   5787:                    arg="$non_pic_object"
                   5788:                  fi
                   5789:                else
                   5790:                  # If the PIC object exists, use it instead.
                   5791:                  # $xdir was prepended to $pic_object above.
                   5792:                  non_pic_object="$pic_object"
1.1.1.1.2.3.2  1(misho  5793:4):               non_pic_objects="$non_pic_objects $non_pic_object"
1.1       misho    5794:                fi
                   5795:              else
                   5796:                # Only an error if not doing a dry-run.
                   5797:                if $opt_dry_run; then
                   5798:                  # Extract subdirectory from the argument.
                   5799:                  func_dirname "$arg" "/" ""
                   5800:                  xdir="$func_dirname_result"
                   5801: 
                   5802:                  func_lo2o "$arg"
                   5803:                  pic_object=$xdir$objdir/$func_lo2o_result
                   5804:                  non_pic_object=$xdir$func_lo2o_result
1.1.1.1.2.3.2  1(misho  5805:4):               libobjs="$libobjs $pic_object"
                   5806:4):               non_pic_objects="$non_pic_objects $non_pic_object"
1.1       misho    5807:                else
                   5808:                  func_fatal_error "\`$arg' is not a valid libtool object"
                   5809:                fi
                   5810:              fi
                   5811:            done
                   5812:          else
                   5813:            func_fatal_error "link input file \`$arg' does not exist"
                   5814:          fi
                   5815:          arg=$save_arg
                   5816:          prev=
                   5817:          continue
                   5818:          ;;
                   5819:        precious_regex)
                   5820:          precious_files_regex="$arg"
                   5821:          prev=
                   5822:          continue
                   5823:          ;;
                   5824:        release)
                   5825:          release="-$arg"
                   5826:          prev=
                   5827:          continue
                   5828:          ;;
                   5829:        rpath | xrpath)
                   5830:          # We need an absolute path.
                   5831:          case $arg in
                   5832:          [\\/]* | [A-Za-z]:[\\/]*) ;;
                   5833:          *)
                   5834:            func_fatal_error "only absolute run-paths are allowed"
                   5835:            ;;
                   5836:          esac
                   5837:          if test "$prev" = rpath; then
                   5838:            case "$rpath " in
                   5839:            *" $arg "*) ;;
                   5840:            *) rpath="$rpath $arg" ;;
                   5841:            esac
                   5842:          else
                   5843:            case "$xrpath " in
                   5844:            *" $arg "*) ;;
                   5845:            *) xrpath="$xrpath $arg" ;;
                   5846:            esac
                   5847:          fi
                   5848:          prev=
                   5849:          continue
                   5850:          ;;
                   5851:        shrext)
                   5852:          shrext_cmds="$arg"
                   5853:          prev=
                   5854:          continue
                   5855:          ;;
                   5856:        weak)
                   5857:          weak_libs="$weak_libs $arg"
                   5858:          prev=
                   5859:          continue
                   5860:          ;;
                   5861:        xcclinker)
                   5862:          linker_flags="$linker_flags $qarg"
                   5863:          compiler_flags="$compiler_flags $qarg"
                   5864:          prev=
1.1.1.1.2.3.2  1(misho  5865:4):       compile_command="$compile_command $qarg"
                   5866:4):       finalize_command="$finalize_command $qarg"
1.1       misho    5867:          continue
                   5868:          ;;
                   5869:        xcompiler)
                   5870:          compiler_flags="$compiler_flags $qarg"
                   5871:          prev=
1.1.1.1.2.3.2  1(misho  5872:4):       compile_command="$compile_command $qarg"
                   5873:4):       finalize_command="$finalize_command $qarg"
1.1       misho    5874:          continue
                   5875:          ;;
                   5876:        xlinker)
                   5877:          linker_flags="$linker_flags $qarg"
                   5878:          compiler_flags="$compiler_flags $wl$qarg"
                   5879:          prev=
1.1.1.1.2.3.2  1(misho  5880:4):       compile_command="$compile_command $wl$qarg"
                   5881:4):       finalize_command="$finalize_command $wl$qarg"
1.1       misho    5882:          continue
                   5883:          ;;
                   5884:        *)
                   5885:          eval "$prev=\"\$arg\""
                   5886:          prev=
                   5887:          continue
                   5888:          ;;
                   5889:        esac
                   5890:       fi # test -n "$prev"
                   5891: 
                   5892:       prevarg="$arg"
                   5893: 
                   5894:       case $arg in
                   5895:       -all-static)
                   5896:        if test -n "$link_static_flag"; then
                   5897:          # See comment for -static flag below, for more details.
1.1.1.1.2.3.2  1(misho  5898:4):       compile_command="$compile_command $link_static_flag"
                   5899:4):       finalize_command="$finalize_command $link_static_flag"
1.1       misho    5900:        fi
                   5901:        continue
                   5902:        ;;
                   5903: 
                   5904:       -allow-undefined)
                   5905:        # FIXME: remove this flag sometime in the future.
                   5906:        func_fatal_error "\`-allow-undefined' must not be used because it is the default"
                   5907:        ;;
                   5908: 
                   5909:       -avoid-version)
                   5910:        avoid_version=yes
                   5911:        continue
                   5912:        ;;
                   5913: 
1.1.1.1.2.3.2  1(misho  5914:4):       -bindir)
                   5915:4):     prev=bindir
                   5916:4):     continue
                   5917:4):     ;;
                   5918:4): 
1.1       misho    5919:       -dlopen)
                   5920:        prev=dlfiles
                   5921:        continue
                   5922:        ;;
                   5923: 
                   5924:       -dlpreopen)
                   5925:        prev=dlprefiles
                   5926:        continue
                   5927:        ;;
                   5928: 
                   5929:       -export-dynamic)
                   5930:        export_dynamic=yes
                   5931:        continue
                   5932:        ;;
                   5933: 
                   5934:       -export-symbols | -export-symbols-regex)
                   5935:        if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
                   5936:          func_fatal_error "more than one -exported-symbols argument is not allowed"
                   5937:        fi
                   5938:        if test "X$arg" = "X-export-symbols"; then
                   5939:          prev=expsyms
                   5940:        else
                   5941:          prev=expsyms_regex
                   5942:        fi
                   5943:        continue
                   5944:        ;;
                   5945: 
                   5946:       -framework)
                   5947:        prev=framework
                   5948:        continue
                   5949:        ;;
                   5950: 
                   5951:       -inst-prefix-dir)
                   5952:        prev=inst_prefix
                   5953:        continue
                   5954:        ;;
                   5955: 
                   5956:       # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
                   5957:       # so, if we see these flags be careful not to treat them like -L
                   5958:       -L[A-Z][A-Z]*:*)
                   5959:        case $with_gcc/$host in
                   5960:        no/*-*-irix* | /*-*-irix*)
1.1.1.1.2.3.2  1(misho  5961:4):       compile_command="$compile_command $arg"
                   5962:4):       finalize_command="$finalize_command $arg"
1.1       misho    5963:          ;;
                   5964:        esac
                   5965:        continue
                   5966:        ;;
                   5967: 
                   5968:       -L*)
1.1.1.1.2.3.2  1(misho  5969:4):     func_stripname "-L" '' "$arg"
                   5970:4):     if test -z "$func_stripname_result"; then
1.1       misho    5971:          if test "$#" -gt 0; then
                   5972:            func_fatal_error "require no space between \`-L' and \`$1'"
                   5973:          else
                   5974:            func_fatal_error "need path for \`-L' option"
                   5975:          fi
                   5976:        fi
1.1.1.1.2.3.2  1(misho  5977:4):     func_resolve_sysroot "$func_stripname_result"
                   5978:4):     dir=$func_resolve_sysroot_result
1.1       misho    5979:        # We need an absolute path.
                   5980:        case $dir in
                   5981:        [\\/]* | [A-Za-z]:[\\/]*) ;;
                   5982:        *)
                   5983:          absdir=`cd "$dir" && pwd`
                   5984:          test -z "$absdir" && \
                   5985:            func_fatal_error "cannot determine absolute directory name of \`$dir'"
                   5986:          dir="$absdir"
                   5987:          ;;
                   5988:        esac
                   5989:        case "$deplibs " in
1.1.1.1.2.3.2  1(misho  5990:4):     *" -L$dir "* | *" $arg "*)
                   5991:4):       # Will only happen for absolute or sysroot arguments
                   5992:4):       ;;
1.1       misho    5993:        *)
1.1.1.1.2.3.2  1(misho  5994:4):       # Preserve sysroot, but never include relative directories
                   5995:4):       case $dir in
                   5996:4):         [\\/]* | [A-Za-z]:[\\/]* | =*) deplibs="$deplibs $arg" ;;
                   5997:4):         *) deplibs="$deplibs -L$dir" ;;
                   5998:4):       esac
1.1       misho    5999:          lib_search_path="$lib_search_path $dir"
                   6000:          ;;
                   6001:        esac
                   6002:        case $host in
                   6003:        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
1.1.1.1.2.3.2  1(misho  6004:4):       testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
1.1       misho    6005:          case :$dllsearchpath: in
                   6006:          *":$dir:"*) ;;
                   6007:          ::) dllsearchpath=$dir;;
                   6008:          *) dllsearchpath="$dllsearchpath:$dir";;
                   6009:          esac
                   6010:          case :$dllsearchpath: in
                   6011:          *":$testbindir:"*) ;;
                   6012:          ::) dllsearchpath=$testbindir;;
                   6013:          *) dllsearchpath="$dllsearchpath:$testbindir";;
                   6014:          esac
                   6015:          ;;
                   6016:        esac
                   6017:        continue
                   6018:        ;;
                   6019: 
                   6020:       -l*)
                   6021:        if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
                   6022:          case $host in
1.1.1.1.2.3.2  1(misho  6023:4):       *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
1.1       misho    6024:            # These systems don't actually have a C or math library (as such)
                   6025:            continue
                   6026:            ;;
                   6027:          *-*-os2*)
                   6028:            # These systems don't actually have a C library (as such)
                   6029:            test "X$arg" = "X-lc" && continue
                   6030:            ;;
                   6031:          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
                   6032:            # Do not include libc due to us having libc/libc_r.
                   6033:            test "X$arg" = "X-lc" && continue
                   6034:            ;;
                   6035:          *-*-rhapsody* | *-*-darwin1.[012])
                   6036:            # Rhapsody C and math libraries are in the System framework
                   6037:            deplibs="$deplibs System.ltframework"
                   6038:            continue
                   6039:            ;;
                   6040:          *-*-sco3.2v5* | *-*-sco5v6*)
                   6041:            # Causes problems with __ctype
                   6042:            test "X$arg" = "X-lc" && continue
                   6043:            ;;
                   6044:          *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
                   6045:            # Compiler inserts libc in the correct place for threads to work
                   6046:            test "X$arg" = "X-lc" && continue
                   6047:            ;;
                   6048:          esac
                   6049:        elif test "X$arg" = "X-lc_r"; then
                   6050:         case $host in
                   6051:         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
                   6052:           # Do not include libc_r directly, use -pthread flag.
                   6053:           continue
                   6054:           ;;
                   6055:         esac
                   6056:        fi
                   6057:        deplibs="$deplibs $arg"
                   6058:        continue
                   6059:        ;;
                   6060: 
                   6061:       -module)
                   6062:        module=yes
                   6063:        continue
                   6064:        ;;
                   6065: 
                   6066:       # Tru64 UNIX uses -model [arg] to determine the layout of C++
                   6067:       # classes, name mangling, and exception handling.
                   6068:       # Darwin uses the -arch flag to determine output architecture.
1.1.1.1.2.3.2  1(misho  6069:4):       -model|-arch|-isysroot|--sysroot)
1.1       misho    6070:        compiler_flags="$compiler_flags $arg"
1.1.1.1.2.3.2  1(misho  6071:4):     compile_command="$compile_command $arg"
                   6072:4):     finalize_command="$finalize_command $arg"
1.1       misho    6073:        prev=xcompiler
                   6074:        continue
                   6075:        ;;
                   6076: 
1.1.1.1.2.3.2  1(misho  6077:4):       -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
                   6078:4):       |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
1.1       misho    6079:        compiler_flags="$compiler_flags $arg"
1.1.1.1.2.3.2  1(misho  6080:4):     compile_command="$compile_command $arg"
                   6081:4):     finalize_command="$finalize_command $arg"
1.1       misho    6082:        case "$new_inherited_linker_flags " in
                   6083:            *" $arg "*) ;;
                   6084:            * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
                   6085:        esac
                   6086:        continue
                   6087:        ;;
                   6088: 
                   6089:       -multi_module)
                   6090:        single_module="${wl}-multi_module"
                   6091:        continue
                   6092:        ;;
                   6093: 
                   6094:       -no-fast-install)
                   6095:        fast_install=no
                   6096:        continue
                   6097:        ;;
                   6098: 
                   6099:       -no-install)
                   6100:        case $host in
                   6101:        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
                   6102:          # The PATH hackery in wrapper scripts is required on Windows
                   6103:          # and Darwin in order for the loader to find any dlls it needs.
                   6104:          func_warning "\`-no-install' is ignored for $host"
                   6105:          func_warning "assuming \`-no-fast-install' instead"
                   6106:          fast_install=no
                   6107:          ;;
                   6108:        *) no_install=yes ;;
                   6109:        esac
                   6110:        continue
                   6111:        ;;
                   6112: 
                   6113:       -no-undefined)
                   6114:        allow_undefined=no
                   6115:        continue
                   6116:        ;;
                   6117: 
                   6118:       -objectlist)
                   6119:        prev=objectlist
                   6120:        continue
                   6121:        ;;
                   6122: 
                   6123:       -o) prev=output ;;
                   6124: 
                   6125:       -precious-files-regex)
                   6126:        prev=precious_regex
                   6127:        continue
                   6128:        ;;
                   6129: 
                   6130:       -release)
                   6131:        prev=release
                   6132:        continue
                   6133:        ;;
                   6134: 
                   6135:       -rpath)
                   6136:        prev=rpath
                   6137:        continue
                   6138:        ;;
                   6139: 
                   6140:       -R)
                   6141:        prev=xrpath
                   6142:        continue
                   6143:        ;;
                   6144: 
                   6145:       -R*)
                   6146:        func_stripname '-R' '' "$arg"
                   6147:        dir=$func_stripname_result
                   6148:        # We need an absolute path.
                   6149:        case $dir in
                   6150:        [\\/]* | [A-Za-z]:[\\/]*) ;;
1.1.1.1.2.3.2  1(misho  6151:4):     =*)
                   6152:4):       func_stripname '=' '' "$dir"
                   6153:4):       dir=$lt_sysroot$func_stripname_result
                   6154:4):       ;;
1.1       misho    6155:        *)
                   6156:          func_fatal_error "only absolute run-paths are allowed"
                   6157:          ;;
                   6158:        esac
                   6159:        case "$xrpath " in
                   6160:        *" $dir "*) ;;
                   6161:        *) xrpath="$xrpath $dir" ;;
                   6162:        esac
                   6163:        continue
                   6164:        ;;
                   6165: 
                   6166:       -shared)
                   6167:        # The effects of -shared are defined in a previous loop.
                   6168:        continue
                   6169:        ;;
                   6170: 
                   6171:       -shrext)
                   6172:        prev=shrext
                   6173:        continue
                   6174:        ;;
                   6175: 
                   6176:       -static | -static-libtool-libs)
                   6177:        # The effects of -static are defined in a previous loop.
                   6178:        # We used to do the same as -all-static on platforms that
                   6179:        # didn't have a PIC flag, but the assumption that the effects
                   6180:        # would be equivalent was wrong.  It would break on at least
                   6181:        # Digital Unix and AIX.
                   6182:        continue
                   6183:        ;;
                   6184: 
                   6185:       -thread-safe)
                   6186:        thread_safe=yes
                   6187:        continue
                   6188:        ;;
                   6189: 
                   6190:       -version-info)
                   6191:        prev=vinfo
                   6192:        continue
                   6193:        ;;
                   6194: 
                   6195:       -version-number)
                   6196:        prev=vinfo
                   6197:        vinfo_number=yes
                   6198:        continue
                   6199:        ;;
                   6200: 
                   6201:       -weak)
                   6202:         prev=weak
                   6203:        continue
                   6204:        ;;
                   6205: 
                   6206:       -Wc,*)
                   6207:        func_stripname '-Wc,' '' "$arg"
                   6208:        args=$func_stripname_result
                   6209:        arg=
                   6210:        save_ifs="$IFS"; IFS=','
                   6211:        for flag in $args; do
                   6212:          IFS="$save_ifs"
                   6213:           func_quote_for_eval "$flag"
1.1.1.1.2.3.2  1(misho  6214:4):       arg="$arg $func_quote_for_eval_result"
1.1       misho    6215:          compiler_flags="$compiler_flags $func_quote_for_eval_result"
                   6216:        done
                   6217:        IFS="$save_ifs"
                   6218:        func_stripname ' ' '' "$arg"
                   6219:        arg=$func_stripname_result
                   6220:        ;;
                   6221: 
                   6222:       -Wl,*)
                   6223:        func_stripname '-Wl,' '' "$arg"
                   6224:        args=$func_stripname_result
                   6225:        arg=
                   6226:        save_ifs="$IFS"; IFS=','
                   6227:        for flag in $args; do
                   6228:          IFS="$save_ifs"
                   6229:           func_quote_for_eval "$flag"
                   6230:          arg="$arg $wl$func_quote_for_eval_result"
                   6231:          compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
                   6232:          linker_flags="$linker_flags $func_quote_for_eval_result"
                   6233:        done
                   6234:        IFS="$save_ifs"
                   6235:        func_stripname ' ' '' "$arg"
                   6236:        arg=$func_stripname_result
                   6237:        ;;
                   6238: 
                   6239:       -Xcompiler)
                   6240:        prev=xcompiler
                   6241:        continue
                   6242:        ;;
                   6243: 
                   6244:       -Xlinker)
                   6245:        prev=xlinker
                   6246:        continue
                   6247:        ;;
                   6248: 
                   6249:       -XCClinker)
                   6250:        prev=xcclinker
                   6251:        continue
                   6252:        ;;
                   6253: 
                   6254:       # -msg_* for osf cc
                   6255:       -msg_*)
                   6256:        func_quote_for_eval "$arg"
                   6257:        arg="$func_quote_for_eval_result"
                   6258:        ;;
                   6259: 
1.1.1.1.2.3.2  1(misho  6260:4):       # Flags to be passed through unchanged, with rationale:
                   6261:4):       # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
                   6262:4):       # -r[0-9][0-9]*        specify processor for the SGI compiler
                   6263:4):       # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
                   6264:4):       # +DA*, +DD*           enable 64-bit mode for the HP compiler
                   6265:4):       # -q*                  compiler args for the IBM compiler
                   6266:4):       # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
                   6267:4):       # -F/path              path to uninstalled frameworks, gcc on darwin
                   6268:4):       # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
                   6269:4):       # @file                GCC response files
                   6270:4):       # -tp=*                Portland pgcc target processor selection
                   6271:4):       # --sysroot=*          for sysroot support
                   6272:4):       # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
1.1       misho    6273:       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
1.1.1.1.2.3.2  1(misho  6274:4):       -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
                   6275:4):       -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
1.1       misho    6276:         func_quote_for_eval "$arg"
                   6277:        arg="$func_quote_for_eval_result"
1.1.1.1.2.3.2  1(misho  6278:4):         compile_command="$compile_command $arg"
                   6279:4):         finalize_command="$finalize_command $arg"
1.1       misho    6280:         compiler_flags="$compiler_flags $arg"
                   6281:         continue
                   6282:         ;;
                   6283: 
                   6284:       # Some other compiler flag.
                   6285:       -* | +*)
                   6286:         func_quote_for_eval "$arg"
                   6287:        arg="$func_quote_for_eval_result"
                   6288:        ;;
                   6289: 
                   6290:       *.$objext)
                   6291:        # A standard object.
                   6292:        objs="$objs $arg"
                   6293:        ;;
                   6294: 
                   6295:       *.lo)
                   6296:        # A libtool-controlled object.
                   6297: 
                   6298:        # Check to see that this really is a libtool object.
                   6299:        if func_lalib_unsafe_p "$arg"; then
                   6300:          pic_object=
                   6301:          non_pic_object=
                   6302: 
                   6303:          # Read the .lo file
                   6304:          func_source "$arg"
                   6305: 
                   6306:          if test -z "$pic_object" ||
                   6307:             test -z "$non_pic_object" ||
                   6308:             test "$pic_object" = none &&
                   6309:             test "$non_pic_object" = none; then
                   6310:            func_fatal_error "cannot find name of object for \`$arg'"
                   6311:          fi
                   6312: 
                   6313:          # Extract subdirectory from the argument.
                   6314:          func_dirname "$arg" "/" ""
                   6315:          xdir="$func_dirname_result"
                   6316: 
                   6317:          if test "$pic_object" != none; then
                   6318:            # Prepend the subdirectory the object is found in.
                   6319:            pic_object="$xdir$pic_object"
                   6320: 
                   6321:            if test "$prev" = dlfiles; then
                   6322:              if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
                   6323:                dlfiles="$dlfiles $pic_object"
                   6324:                prev=
                   6325:                continue
                   6326:              else
                   6327:                # If libtool objects are unsupported, then we need to preload.
                   6328:                prev=dlprefiles
                   6329:              fi
                   6330:            fi
                   6331: 
                   6332:            # CHECK ME:  I think I busted this.  -Ossama
                   6333:            if test "$prev" = dlprefiles; then
                   6334:              # Preload the old-style object.
                   6335:              dlprefiles="$dlprefiles $pic_object"
                   6336:              prev=
                   6337:            fi
                   6338: 
                   6339:            # A PIC object.
1.1.1.1.2.3.2  1(misho  6340:4):         libobjs="$libobjs $pic_object"
1.1       misho    6341:            arg="$pic_object"
                   6342:          fi
                   6343: 
                   6344:          # Non-PIC object.
                   6345:          if test "$non_pic_object" != none; then
                   6346:            # Prepend the subdirectory the object is found in.
                   6347:            non_pic_object="$xdir$non_pic_object"
                   6348: 
                   6349:            # A standard non-PIC object
1.1.1.1.2.3.2  1(misho  6350:4):         non_pic_objects="$non_pic_objects $non_pic_object"
1.1       misho    6351:            if test -z "$pic_object" || test "$pic_object" = none ; then
                   6352:              arg="$non_pic_object"
                   6353:            fi
                   6354:          else
                   6355:            # If the PIC object exists, use it instead.
                   6356:            # $xdir was prepended to $pic_object above.
                   6357:            non_pic_object="$pic_object"
1.1.1.1.2.3.2  1(misho  6358:4):         non_pic_objects="$non_pic_objects $non_pic_object"
1.1       misho    6359:          fi
                   6360:        else
                   6361:          # Only an error if not doing a dry-run.
                   6362:          if $opt_dry_run; then
                   6363:            # Extract subdirectory from the argument.
                   6364:            func_dirname "$arg" "/" ""
                   6365:            xdir="$func_dirname_result"
                   6366: 
                   6367:            func_lo2o "$arg"
                   6368:            pic_object=$xdir$objdir/$func_lo2o_result
                   6369:            non_pic_object=$xdir$func_lo2o_result
1.1.1.1.2.3.2  1(misho  6370:4):         libobjs="$libobjs $pic_object"
                   6371:4):         non_pic_objects="$non_pic_objects $non_pic_object"
1.1       misho    6372:          else
                   6373:            func_fatal_error "\`$arg' is not a valid libtool object"
                   6374:          fi
                   6375:        fi
                   6376:        ;;
                   6377: 
                   6378:       *.$libext)
                   6379:        # An archive.
                   6380:        deplibs="$deplibs $arg"
                   6381:        old_deplibs="$old_deplibs $arg"
                   6382:        continue
                   6383:        ;;
                   6384: 
                   6385:       *.la)
                   6386:        # A libtool-controlled library.
                   6387: 
1.1.1.1.2.3.2  1(misho  6388:4):     func_resolve_sysroot "$arg"
1.1       misho    6389:        if test "$prev" = dlfiles; then
                   6390:          # This library was specified with -dlopen.
1.1.1.1.2.3.2  1(misho  6391:4):       dlfiles="$dlfiles $func_resolve_sysroot_result"
1.1       misho    6392:          prev=
                   6393:        elif test "$prev" = dlprefiles; then
                   6394:          # The library was specified with -dlpreopen.
1.1.1.1.2.3.2  1(misho  6395:4):       dlprefiles="$dlprefiles $func_resolve_sysroot_result"
1.1       misho    6396:          prev=
                   6397:        else
1.1.1.1.2.3.2  1(misho  6398:4):       deplibs="$deplibs $func_resolve_sysroot_result"
1.1       misho    6399:        fi
                   6400:        continue
                   6401:        ;;
                   6402: 
                   6403:       # Some other compiler argument.
                   6404:       *)
                   6405:        # Unknown arguments in both finalize_command and compile_command need
                   6406:        # to be aesthetically quoted because they are evaled later.
                   6407:        func_quote_for_eval "$arg"
                   6408:        arg="$func_quote_for_eval_result"
                   6409:        ;;
                   6410:       esac # arg
                   6411: 
                   6412:       # Now actually substitute the argument into the commands.
                   6413:       if test -n "$arg"; then
1.1.1.1.2.3.2  1(misho  6414:4):     compile_command="$compile_command $arg"
                   6415:4):     finalize_command="$finalize_command $arg"
1.1       misho    6416:       fi
                   6417:     done # argument parsing loop
                   6418: 
                   6419:     test -n "$prev" && \
                   6420:       func_fatal_help "the \`$prevarg' option requires an argument"
                   6421: 
                   6422:     if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
                   6423:       eval arg=\"$export_dynamic_flag_spec\"
1.1.1.1.2.3.2  1(misho  6424:4):       compile_command="$compile_command $arg"
                   6425:4):       finalize_command="$finalize_command $arg"
1.1       misho    6426:     fi
                   6427: 
                   6428:     oldlibs=
                   6429:     # calculate the name of the file, without its directory
                   6430:     func_basename "$output"
                   6431:     outputname="$func_basename_result"
                   6432:     libobjs_save="$libobjs"
                   6433: 
                   6434:     if test -n "$shlibpath_var"; then
                   6435:       # get the directories listed in $shlibpath_var
1.1.1.1.2.3.2  1(misho  6436:4):       eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
1.1       misho    6437:     else
                   6438:       shlib_search_path=
                   6439:     fi
                   6440:     eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
                   6441:     eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
                   6442: 
                   6443:     func_dirname "$output" "/" ""
                   6444:     output_objdir="$func_dirname_result$objdir"
1.1.1.1.2.3.2  1(misho  6445:4):     func_to_tool_file "$output_objdir/"
                   6446:4):     tool_output_objdir=$func_to_tool_file_result
1.1       misho    6447:     # Create the object directory.
                   6448:     func_mkdir_p "$output_objdir"
                   6449: 
                   6450:     # Determine the type of output
                   6451:     case $output in
                   6452:     "")
                   6453:       func_fatal_help "you must specify an output file"
                   6454:       ;;
                   6455:     *.$libext) linkmode=oldlib ;;
                   6456:     *.lo | *.$objext) linkmode=obj ;;
                   6457:     *.la) linkmode=lib ;;
                   6458:     *) linkmode=prog ;; # Anything else should be a program.
                   6459:     esac
                   6460: 
                   6461:     specialdeplibs=
                   6462: 
                   6463:     libs=
                   6464:     # Find all interdependent deplibs by searching for libraries
                   6465:     # that are linked more than once (e.g. -la -lb -la)
                   6466:     for deplib in $deplibs; do
1.1.1.1.2.3.2  1(misho  6467:4):       if $opt_preserve_dup_deps ; then
1.1       misho    6468:        case "$libs " in
                   6469:        *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
                   6470:        esac
                   6471:       fi
                   6472:       libs="$libs $deplib"
                   6473:     done
                   6474: 
                   6475:     if test "$linkmode" = lib; then
                   6476:       libs="$predeps $libs $compiler_lib_search_path $postdeps"
                   6477: 
                   6478:       # Compute libraries that are listed more than once in $predeps
                   6479:       # $postdeps and mark them as special (i.e., whose duplicates are
                   6480:       # not to be eliminated).
                   6481:       pre_post_deps=
                   6482:       if $opt_duplicate_compiler_generated_deps; then
                   6483:        for pre_post_dep in $predeps $postdeps; do
                   6484:          case "$pre_post_deps " in
                   6485:          *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
                   6486:          esac
                   6487:          pre_post_deps="$pre_post_deps $pre_post_dep"
                   6488:        done
                   6489:       fi
                   6490:       pre_post_deps=
                   6491:     fi
                   6492: 
                   6493:     deplibs=
                   6494:     newdependency_libs=
                   6495:     newlib_search_path=
                   6496:     need_relink=no # whether we're linking any uninstalled libtool libraries
                   6497:     notinst_deplibs= # not-installed libtool libraries
                   6498:     notinst_path= # paths that contain not-installed libtool libraries
                   6499: 
                   6500:     case $linkmode in
                   6501:     lib)
                   6502:        passes="conv dlpreopen link"
                   6503:        for file in $dlfiles $dlprefiles; do
                   6504:          case $file in
                   6505:          *.la) ;;
                   6506:          *)
                   6507:            func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
                   6508:            ;;
                   6509:          esac
                   6510:        done
                   6511:        ;;
                   6512:     prog)
                   6513:        compile_deplibs=
                   6514:        finalize_deplibs=
                   6515:        alldeplibs=no
                   6516:        newdlfiles=
                   6517:        newdlprefiles=
                   6518:        passes="conv scan dlopen dlpreopen link"
                   6519:        ;;
                   6520:     *)  passes="conv"
                   6521:        ;;
                   6522:     esac
                   6523: 
                   6524:     for pass in $passes; do
                   6525:       # The preopen pass in lib mode reverses $deplibs; put it back here
                   6526:       # so that -L comes before libs that need it for instance...
                   6527:       if test "$linkmode,$pass" = "lib,link"; then
                   6528:        ## FIXME: Find the place where the list is rebuilt in the wrong
                   6529:        ##        order, and fix it there properly
                   6530:         tmp_deplibs=
                   6531:        for deplib in $deplibs; do
                   6532:          tmp_deplibs="$deplib $tmp_deplibs"
                   6533:        done
                   6534:        deplibs="$tmp_deplibs"
                   6535:       fi
                   6536: 
                   6537:       if test "$linkmode,$pass" = "lib,link" ||
                   6538:         test "$linkmode,$pass" = "prog,scan"; then
                   6539:        libs="$deplibs"
                   6540:        deplibs=
                   6541:       fi
                   6542:       if test "$linkmode" = prog; then
                   6543:        case $pass in
                   6544:        dlopen) libs="$dlfiles" ;;
                   6545:        dlpreopen) libs="$dlprefiles" ;;
1.1.1.1.2.3.2  1(misho  6546:4):     link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1.1       misho    6547:        esac
                   6548:       fi
                   6549:       if test "$linkmode,$pass" = "lib,dlpreopen"; then
                   6550:        # Collect and forward deplibs of preopened libtool libs
                   6551:        for lib in $dlprefiles; do
                   6552:          # Ignore non-libtool-libs
                   6553:          dependency_libs=
1.1.1.1.2.3.2  1(misho  6554:4):       func_resolve_sysroot "$lib"
1.1       misho    6555:          case $lib in
1.1.1.1.2.3.2  1(misho  6556:4):       *.la) func_source "$func_resolve_sysroot_result" ;;
1.1       misho    6557:          esac
                   6558: 
                   6559:          # Collect preopened libtool deplibs, except any this library
                   6560:          # has declared as weak libs
                   6561:          for deplib in $dependency_libs; do
1.1.1.1.2.3.2  1(misho  6562:4):         func_basename "$deplib"
                   6563:4):             deplib_base=$func_basename_result
1.1       misho    6564:            case " $weak_libs " in
                   6565:            *" $deplib_base "*) ;;
                   6566:            *) deplibs="$deplibs $deplib" ;;
                   6567:            esac
                   6568:          done
                   6569:        done
                   6570:        libs="$dlprefiles"
                   6571:       fi
                   6572:       if test "$pass" = dlopen; then
                   6573:        # Collect dlpreopened libraries
                   6574:        save_deplibs="$deplibs"
                   6575:        deplibs=
                   6576:       fi
                   6577: 
                   6578:       for deplib in $libs; do
                   6579:        lib=
                   6580:        found=no
                   6581:        case $deplib in
1.1.1.1.2.3.2  1(misho  6582:4):     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
                   6583:4):         |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
1.1       misho    6584:          if test "$linkmode,$pass" = "prog,link"; then
                   6585:            compile_deplibs="$deplib $compile_deplibs"
                   6586:            finalize_deplibs="$deplib $finalize_deplibs"
                   6587:          else
                   6588:            compiler_flags="$compiler_flags $deplib"
                   6589:            if test "$linkmode" = lib ; then
                   6590:                case "$new_inherited_linker_flags " in
                   6591:                    *" $deplib "*) ;;
                   6592:                    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
                   6593:                esac
                   6594:            fi
                   6595:          fi
                   6596:          continue
                   6597:          ;;
                   6598:        -l*)
                   6599:          if test "$linkmode" != lib && test "$linkmode" != prog; then
                   6600:            func_warning "\`-l' is ignored for archives/objects"
                   6601:            continue
                   6602:          fi
                   6603:          func_stripname '-l' '' "$deplib"
                   6604:          name=$func_stripname_result
                   6605:          if test "$linkmode" = lib; then
                   6606:            searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
                   6607:          else
                   6608:            searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
                   6609:          fi
                   6610:          for searchdir in $searchdirs; do
                   6611:            for search_ext in .la $std_shrext .so .a; do
                   6612:              # Search the libtool library
                   6613:              lib="$searchdir/lib${name}${search_ext}"
                   6614:              if test -f "$lib"; then
                   6615:                if test "$search_ext" = ".la"; then
                   6616:                  found=yes
                   6617:                else
                   6618:                  found=no
                   6619:                fi
                   6620:                break 2
                   6621:              fi
                   6622:            done
                   6623:          done
                   6624:          if test "$found" != yes; then
                   6625:            # deplib doesn't seem to be a libtool library
                   6626:            if test "$linkmode,$pass" = "prog,link"; then
                   6627:              compile_deplibs="$deplib $compile_deplibs"
                   6628:              finalize_deplibs="$deplib $finalize_deplibs"
                   6629:            else
                   6630:              deplibs="$deplib $deplibs"
                   6631:              test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
                   6632:            fi
                   6633:            continue
                   6634:          else # deplib is a libtool library
                   6635:            # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
                   6636:            # We need to do some special things here, and not later.
                   6637:            if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
                   6638:              case " $predeps $postdeps " in
                   6639:              *" $deplib "*)
                   6640:                if func_lalib_p "$lib"; then
                   6641:                  library_names=
                   6642:                  old_library=
                   6643:                  func_source "$lib"
                   6644:                  for l in $old_library $library_names; do
                   6645:                    ll="$l"
                   6646:                  done
                   6647:                  if test "X$ll" = "X$old_library" ; then # only static version available
                   6648:                    found=no
                   6649:                    func_dirname "$lib" "" "."
                   6650:                    ladir="$func_dirname_result"
                   6651:                    lib=$ladir/$old_library
                   6652:                    if test "$linkmode,$pass" = "prog,link"; then
                   6653:                      compile_deplibs="$deplib $compile_deplibs"
                   6654:                      finalize_deplibs="$deplib $finalize_deplibs"
                   6655:                    else
                   6656:                      deplibs="$deplib $deplibs"
                   6657:                      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
                   6658:                    fi
                   6659:                    continue
                   6660:                  fi
                   6661:                fi
                   6662:                ;;
                   6663:              *) ;;
                   6664:              esac
                   6665:            fi
                   6666:          fi
                   6667:          ;; # -l
                   6668:        *.ltframework)
                   6669:          if test "$linkmode,$pass" = "prog,link"; then
                   6670:            compile_deplibs="$deplib $compile_deplibs"
                   6671:            finalize_deplibs="$deplib $finalize_deplibs"
                   6672:          else
                   6673:            deplibs="$deplib $deplibs"
                   6674:            if test "$linkmode" = lib ; then
                   6675:                case "$new_inherited_linker_flags " in
                   6676:                    *" $deplib "*) ;;
                   6677:                    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
                   6678:                esac
                   6679:            fi
                   6680:          fi
                   6681:          continue
                   6682:          ;;
                   6683:        -L*)
                   6684:          case $linkmode in
                   6685:          lib)
                   6686:            deplibs="$deplib $deplibs"
                   6687:            test "$pass" = conv && continue
                   6688:            newdependency_libs="$deplib $newdependency_libs"
                   6689:            func_stripname '-L' '' "$deplib"
1.1.1.1.2.3.2  1(misho  6690:4):         func_resolve_sysroot "$func_stripname_result"
                   6691:4):         newlib_search_path="$newlib_search_path $func_resolve_sysroot_result"
1.1       misho    6692:            ;;
                   6693:          prog)
                   6694:            if test "$pass" = conv; then
                   6695:              deplibs="$deplib $deplibs"
                   6696:              continue
                   6697:            fi
                   6698:            if test "$pass" = scan; then
                   6699:              deplibs="$deplib $deplibs"
                   6700:            else
                   6701:              compile_deplibs="$deplib $compile_deplibs"
                   6702:              finalize_deplibs="$deplib $finalize_deplibs"
                   6703:            fi
                   6704:            func_stripname '-L' '' "$deplib"
1.1.1.1.2.3.2  1(misho  6705:4):         func_resolve_sysroot "$func_stripname_result"
                   6706:4):         newlib_search_path="$newlib_search_path $func_resolve_sysroot_result"
1.1       misho    6707:            ;;
                   6708:          *)
                   6709:            func_warning "\`-L' is ignored for archives/objects"
                   6710:            ;;
                   6711:          esac # linkmode
                   6712:          continue
                   6713:          ;; # -L
                   6714:        -R*)
                   6715:          if test "$pass" = link; then
                   6716:            func_stripname '-R' '' "$deplib"
1.1.1.1.2.3.2  1(misho  6717:4):         func_resolve_sysroot "$func_stripname_result"
                   6718:4):         dir=$func_resolve_sysroot_result
1.1       misho    6719:            # Make sure the xrpath contains only unique directories.
                   6720:            case "$xrpath " in
                   6721:            *" $dir "*) ;;
                   6722:            *) xrpath="$xrpath $dir" ;;
                   6723:            esac
                   6724:          fi
                   6725:          deplibs="$deplib $deplibs"
                   6726:          continue
                   6727:          ;;
1.1.1.1.2.3.2  1(misho  6728:4):     *.la)
                   6729:4):       func_resolve_sysroot "$deplib"
                   6730:4):       lib=$func_resolve_sysroot_result
                   6731:4):       ;;
1.1       misho    6732:        *.$libext)
                   6733:          if test "$pass" = conv; then
                   6734:            deplibs="$deplib $deplibs"
                   6735:            continue
                   6736:          fi
                   6737:          case $linkmode in
                   6738:          lib)
                   6739:            # Linking convenience modules into shared libraries is allowed,
                   6740:            # but linking other static libraries is non-portable.
                   6741:            case " $dlpreconveniencelibs " in
                   6742:            *" $deplib "*) ;;
                   6743:            *)
                   6744:              valid_a_lib=no
                   6745:              case $deplibs_check_method in
                   6746:                match_pattern*)
                   6747:                  set dummy $deplibs_check_method; shift
                   6748:                  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
1.1.1.1.2.3.2  1(misho  6749:4):               if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
1.1       misho    6750:                    | $EGREP "$match_pattern_regex" > /dev/null; then
                   6751:                    valid_a_lib=yes
                   6752:                  fi
                   6753:                ;;
                   6754:                pass_all)
                   6755:                  valid_a_lib=yes
                   6756:                ;;
                   6757:              esac
                   6758:              if test "$valid_a_lib" != yes; then
1.1.1.1.2.3.2  1(misho  6759:4):             echo
1.1       misho    6760:                $ECHO "*** Warning: Trying to link with static lib archive $deplib."
1.1.1.1.2.3.2  1(misho  6761:4):             echo "*** I have the capability to make that library automatically link in when"
                   6762:4):             echo "*** you link to this library.  But I can only do this if you have a"
                   6763:4):             echo "*** shared version of the library, which you do not appear to have"
                   6764:4):             echo "*** because the file extensions .$libext of this argument makes me believe"
                   6765:4):             echo "*** that it is just a static archive that I should not use here."
1.1       misho    6766:              else
1.1.1.1.2.3.2  1(misho  6767:4):             echo
1.1       misho    6768:                $ECHO "*** Warning: Linking the shared library $output against the"
                   6769:                $ECHO "*** static library $deplib is not portable!"
                   6770:                deplibs="$deplib $deplibs"
                   6771:              fi
                   6772:              ;;
                   6773:            esac
                   6774:            continue
                   6775:            ;;
                   6776:          prog)
                   6777:            if test "$pass" != link; then
                   6778:              deplibs="$deplib $deplibs"
                   6779:            else
                   6780:              compile_deplibs="$deplib $compile_deplibs"
                   6781:              finalize_deplibs="$deplib $finalize_deplibs"
                   6782:            fi
                   6783:            continue
                   6784:            ;;
                   6785:          esac # linkmode
                   6786:          ;; # *.$libext
                   6787:        *.lo | *.$objext)
                   6788:          if test "$pass" = conv; then
                   6789:            deplibs="$deplib $deplibs"
                   6790:          elif test "$linkmode" = prog; then
                   6791:            if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
                   6792:              # If there is no dlopen support or we're linking statically,
                   6793:              # we need to preload.
                   6794:              newdlprefiles="$newdlprefiles $deplib"
                   6795:              compile_deplibs="$deplib $compile_deplibs"
                   6796:              finalize_deplibs="$deplib $finalize_deplibs"
                   6797:            else
                   6798:              newdlfiles="$newdlfiles $deplib"
                   6799:            fi
                   6800:          fi
                   6801:          continue
                   6802:          ;;
                   6803:        %DEPLIBS%)
                   6804:          alldeplibs=yes
                   6805:          continue
                   6806:          ;;
                   6807:        esac # case $deplib
                   6808: 
                   6809:        if test "$found" = yes || test -f "$lib"; then :
                   6810:        else
                   6811:          func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
                   6812:        fi
                   6813: 
                   6814:        # Check to see that this really is a libtool archive.
                   6815:        func_lalib_unsafe_p "$lib" \
                   6816:          || func_fatal_error "\`$lib' is not a valid libtool archive"
                   6817: 
                   6818:        func_dirname "$lib" "" "."
                   6819:        ladir="$func_dirname_result"
                   6820: 
                   6821:        dlname=
                   6822:        dlopen=
                   6823:        dlpreopen=
                   6824:        libdir=
                   6825:        library_names=
                   6826:        old_library=
                   6827:        inherited_linker_flags=
                   6828:        # If the library was installed with an old release of libtool,
                   6829:        # it will not redefine variables installed, or shouldnotlink
                   6830:        installed=yes
                   6831:        shouldnotlink=no
                   6832:        avoidtemprpath=
                   6833: 
                   6834: 
                   6835:        # Read the .la file
                   6836:        func_source "$lib"
                   6837: 
                   6838:        # Convert "-framework foo" to "foo.ltframework"
                   6839:        if test -n "$inherited_linker_flags"; then
1.1.1.1.2.3.2  1(misho  6840:4):       tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
1.1       misho    6841:          for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
                   6842:            case " $new_inherited_linker_flags " in
                   6843:              *" $tmp_inherited_linker_flag "*) ;;
                   6844:              *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
                   6845:            esac
                   6846:          done
                   6847:        fi
1.1.1.1.2.3.2  1(misho  6848:4):     dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
1.1       misho    6849:        if test "$linkmode,$pass" = "lib,link" ||
                   6850:           test "$linkmode,$pass" = "prog,scan" ||
                   6851:           { test "$linkmode" != prog && test "$linkmode" != lib; }; then
                   6852:          test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
                   6853:          test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
                   6854:        fi
                   6855: 
                   6856:        if test "$pass" = conv; then
                   6857:          # Only check for convenience libraries
                   6858:          deplibs="$lib $deplibs"
                   6859:          if test -z "$libdir"; then
                   6860:            if test -z "$old_library"; then
                   6861:              func_fatal_error "cannot find name of link library for \`$lib'"
                   6862:            fi
                   6863:            # It is a libtool convenience library, so add in its objects.
                   6864:            convenience="$convenience $ladir/$objdir/$old_library"
                   6865:            old_convenience="$old_convenience $ladir/$objdir/$old_library"
                   6866:          elif test "$linkmode" != prog && test "$linkmode" != lib; then
                   6867:            func_fatal_error "\`$lib' is not a convenience library"
                   6868:          fi
1.1.1.1.2.3.2  1(misho  6869:4):       tmp_libs=
                   6870:4):       for deplib in $dependency_libs; do
                   6871:4):         deplibs="$deplib $deplibs"
                   6872:4):         if $opt_preserve_dup_deps ; then
                   6873:4):           case "$tmp_libs " in
                   6874:4):           *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
                   6875:4):           esac
                   6876:4):         fi
                   6877:4):         tmp_libs="$tmp_libs $deplib"
                   6878:4):       done
1.1       misho    6879:          continue
                   6880:        fi # $pass = conv
                   6881: 
                   6882: 
                   6883:        # Get the name of the library we link against.
                   6884:        linklib=
1.1.1.1.2.3.2  1(misho  6885:4):     if test -n "$old_library" &&
                   6886:4):        { test "$prefer_static_libs" = yes ||
                   6887:4):          test "$prefer_static_libs,$installed" = "built,no"; }; then
                   6888:4):       linklib=$old_library
                   6889:4):     else
                   6890:4):       for l in $old_library $library_names; do
                   6891:4):         linklib="$l"
                   6892:4):       done
                   6893:4):     fi
1.1       misho    6894:        if test -z "$linklib"; then
                   6895:          func_fatal_error "cannot find name of link library for \`$lib'"
                   6896:        fi
                   6897: 
                   6898:        # This library was specified with -dlopen.
                   6899:        if test "$pass" = dlopen; then
                   6900:          if test -z "$libdir"; then
                   6901:            func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
                   6902:          fi
                   6903:          if test -z "$dlname" ||
                   6904:             test "$dlopen_support" != yes ||
                   6905:             test "$build_libtool_libs" = no; then
                   6906:            # If there is no dlname, no dlopen support or we're linking
                   6907:            # statically, we need to preload.  We also need to preload any
                   6908:            # dependent libraries so libltdl's deplib preloader doesn't
                   6909:            # bomb out in the load deplibs phase.
                   6910:            dlprefiles="$dlprefiles $lib $dependency_libs"
                   6911:          else
                   6912:            newdlfiles="$newdlfiles $lib"
                   6913:          fi
                   6914:          continue
                   6915:        fi # $pass = dlopen
                   6916: 
                   6917:        # We need an absolute path.
                   6918:        case $ladir in
                   6919:        [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
                   6920:        *)
                   6921:          abs_ladir=`cd "$ladir" && pwd`
                   6922:          if test -z "$abs_ladir"; then
                   6923:            func_warning "cannot determine absolute directory name of \`$ladir'"
                   6924:            func_warning "passing it literally to the linker, although it might fail"
                   6925:            abs_ladir="$ladir"
                   6926:          fi
                   6927:          ;;
                   6928:        esac
                   6929:        func_basename "$lib"
                   6930:        laname="$func_basename_result"
                   6931: 
                   6932:        # Find the relevant object directory and library name.
                   6933:        if test "X$installed" = Xyes; then
1.1.1.1.2.3.2  1(misho  6934:4):       if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1.1       misho    6935:            func_warning "library \`$lib' was moved."
                   6936:            dir="$ladir"
                   6937:            absdir="$abs_ladir"
                   6938:            libdir="$abs_ladir"
                   6939:          else
1.1.1.1.2.3.2  1(misho  6940:4):         dir="$lt_sysroot$libdir"
                   6941:4):         absdir="$lt_sysroot$libdir"
1.1       misho    6942:          fi
                   6943:          test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
                   6944:        else
                   6945:          if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
                   6946:            dir="$ladir"
                   6947:            absdir="$abs_ladir"
                   6948:            # Remove this search path later
                   6949:            notinst_path="$notinst_path $abs_ladir"
                   6950:          else
                   6951:            dir="$ladir/$objdir"
                   6952:            absdir="$abs_ladir/$objdir"
                   6953:            # Remove this search path later
                   6954:            notinst_path="$notinst_path $abs_ladir"
                   6955:          fi
                   6956:        fi # $installed = yes
                   6957:        func_stripname 'lib' '.la' "$laname"
                   6958:        name=$func_stripname_result
                   6959: 
                   6960:        # This library was specified with -dlpreopen.
                   6961:        if test "$pass" = dlpreopen; then
                   6962:          if test -z "$libdir" && test "$linkmode" = prog; then
                   6963:            func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
                   6964:          fi
1.1.1.1.2.3.2  1(misho  6965:4):       case "$host" in
                   6966:4):         # special handling for platforms with PE-DLLs.
                   6967:4):         *cygwin* | *mingw* | *cegcc* )
                   6968:4):           # Linker will automatically link against shared library if both
                   6969:4):           # static and shared are present.  Therefore, ensure we extract
                   6970:4):           # symbols from the import library if a shared library is present
                   6971:4):           # (otherwise, the dlopen module name will be incorrect).  We do
                   6972:4):           # this by putting the import library name into $newdlprefiles.
                   6973:4):           # We recover the dlopen module name by 'saving' the la file
                   6974:4):           # name in a special purpose variable, and (later) extracting the
                   6975:4):           # dlname from the la file.
                   6976:4):           if test -n "$dlname"; then
                   6977:4):             func_tr_sh "$dir/$linklib"
                   6978:4):             eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
                   6979:4):             newdlprefiles="$newdlprefiles $dir/$linklib"
                   6980:4):           else
                   6981:4):             newdlprefiles="$newdlprefiles $dir/$old_library"
                   6982:4):             # Keep a list of preopened convenience libraries to check
                   6983:4):             # that they are being used correctly in the link pass.
                   6984:4):             test -z "$libdir" && \
                   6985:4):               dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
                   6986:4):           fi
                   6987:4):         ;;
                   6988:4):         * )
                   6989:4):           # Prefer using a static library (so that no silly _DYNAMIC symbols
                   6990:4):           # are required to link).
                   6991:4):           if test -n "$old_library"; then
                   6992:4):             newdlprefiles="$newdlprefiles $dir/$old_library"
                   6993:4):             # Keep a list of preopened convenience libraries to check
                   6994:4):             # that they are being used correctly in the link pass.
                   6995:4):             test -z "$libdir" && \
                   6996:4):               dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
                   6997:4):           # Otherwise, use the dlname, so that lt_dlopen finds it.
                   6998:4):           elif test -n "$dlname"; then
                   6999:4):             newdlprefiles="$newdlprefiles $dir/$dlname"
                   7000:4):           else
                   7001:4):             newdlprefiles="$newdlprefiles $dir/$linklib"
                   7002:4):           fi
                   7003:4):         ;;
                   7004:4):       esac
1.1       misho    7005:        fi # $pass = dlpreopen
                   7006: 
                   7007:        if test -z "$libdir"; then
                   7008:          # Link the convenience library
                   7009:          if test "$linkmode" = lib; then
                   7010:            deplibs="$dir/$old_library $deplibs"
                   7011:          elif test "$linkmode,$pass" = "prog,link"; then
                   7012:            compile_deplibs="$dir/$old_library $compile_deplibs"
                   7013:            finalize_deplibs="$dir/$old_library $finalize_deplibs"
                   7014:          else
                   7015:            deplibs="$lib $deplibs" # used for prog,scan pass
                   7016:          fi
                   7017:          continue
                   7018:        fi
                   7019: 
                   7020: 
                   7021:        if test "$linkmode" = prog && test "$pass" != link; then
                   7022:          newlib_search_path="$newlib_search_path $ladir"
                   7023:          deplibs="$lib $deplibs"
                   7024: 
                   7025:          linkalldeplibs=no
                   7026:          if test "$link_all_deplibs" != no || test -z "$library_names" ||
                   7027:             test "$build_libtool_libs" = no; then
                   7028:            linkalldeplibs=yes
                   7029:          fi
                   7030: 
                   7031:          tmp_libs=
                   7032:          for deplib in $dependency_libs; do
                   7033:            case $deplib in
                   7034:            -L*) func_stripname '-L' '' "$deplib"
1.1.1.1.2.3.2  1(misho  7035:4):              func_resolve_sysroot "$func_stripname_result"
                   7036:4):              newlib_search_path="$newlib_search_path $func_resolve_sysroot_result"
1.1       misho    7037:                 ;;
                   7038:            esac
                   7039:            # Need to link against all dependency_libs?
                   7040:            if test "$linkalldeplibs" = yes; then
                   7041:              deplibs="$deplib $deplibs"
                   7042:            else
                   7043:              # Need to hardcode shared library paths
                   7044:              # or/and link against static libraries
                   7045:              newdependency_libs="$deplib $newdependency_libs"
                   7046:            fi
1.1.1.1.2.3.2  1(misho  7047:4):         if $opt_preserve_dup_deps ; then
1.1       misho    7048:              case "$tmp_libs " in
                   7049:              *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
                   7050:              esac
                   7051:            fi
                   7052:            tmp_libs="$tmp_libs $deplib"
                   7053:          done # for deplib
                   7054:          continue
                   7055:        fi # $linkmode = prog...
                   7056: 
                   7057:        if test "$linkmode,$pass" = "prog,link"; then
                   7058:          if test -n "$library_names" &&
                   7059:             { { test "$prefer_static_libs" = no ||
                   7060:                 test "$prefer_static_libs,$installed" = "built,yes"; } ||
                   7061:               test -z "$old_library"; }; then
                   7062:            # We need to hardcode the library path
                   7063:            if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
                   7064:              # Make sure the rpath contains only unique directories.
                   7065:              case "$temp_rpath:" in
                   7066:              *"$absdir:"*) ;;
                   7067:              *) temp_rpath="$temp_rpath$absdir:" ;;
                   7068:              esac
                   7069:            fi
                   7070: 
                   7071:            # Hardcode the library path.
                   7072:            # Skip directories that are in the system default run-time
                   7073:            # search path.
                   7074:            case " $sys_lib_dlsearch_path " in
                   7075:            *" $absdir "*) ;;
                   7076:            *)
                   7077:              case "$compile_rpath " in
                   7078:              *" $absdir "*) ;;
1.1.1.1.2.3.2  1(misho  7079:4):           *) compile_rpath="$compile_rpath $absdir" ;;
1.1       misho    7080:              esac
                   7081:              ;;
                   7082:            esac
                   7083:            case " $sys_lib_dlsearch_path " in
                   7084:            *" $libdir "*) ;;
                   7085:            *)
                   7086:              case "$finalize_rpath " in
                   7087:              *" $libdir "*) ;;
1.1.1.1.2.3.2  1(misho  7088:4):           *) finalize_rpath="$finalize_rpath $libdir" ;;
1.1       misho    7089:              esac
                   7090:              ;;
                   7091:            esac
                   7092:          fi # $linkmode,$pass = prog,link...
                   7093: 
                   7094:          if test "$alldeplibs" = yes &&
                   7095:             { test "$deplibs_check_method" = pass_all ||
                   7096:               { test "$build_libtool_libs" = yes &&
                   7097:                 test -n "$library_names"; }; }; then
                   7098:            # We only need to search for static libraries
                   7099:            continue
                   7100:          fi
                   7101:        fi
                   7102: 
                   7103:        link_static=no # Whether the deplib will be linked statically
                   7104:        use_static_libs=$prefer_static_libs
                   7105:        if test "$use_static_libs" = built && test "$installed" = yes; then
                   7106:          use_static_libs=no
                   7107:        fi
                   7108:        if test -n "$library_names" &&
                   7109:           { test "$use_static_libs" = no || test -z "$old_library"; }; then
                   7110:          case $host in
                   7111:          *cygwin* | *mingw* | *cegcc*)
                   7112:              # No point in relinking DLLs because paths are not encoded
                   7113:              notinst_deplibs="$notinst_deplibs $lib"
                   7114:              need_relink=no
                   7115:            ;;
                   7116:          *)
                   7117:            if test "$installed" = no; then
                   7118:              notinst_deplibs="$notinst_deplibs $lib"
                   7119:              need_relink=yes
                   7120:            fi
                   7121:            ;;
                   7122:          esac
                   7123:          # This is a shared library
                   7124: 
                   7125:          # Warn about portability, can't link against -module's on some
                   7126:          # systems (darwin).  Don't bleat about dlopened modules though!
                   7127:          dlopenmodule=""
                   7128:          for dlpremoduletest in $dlprefiles; do
                   7129:            if test "X$dlpremoduletest" = "X$lib"; then
                   7130:              dlopenmodule="$dlpremoduletest"
                   7131:              break
                   7132:            fi
                   7133:          done
                   7134:          if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
1.1.1.1.2.3.2  1(misho  7135:4):         echo
1.1       misho    7136:            if test "$linkmode" = prog; then
                   7137:              $ECHO "*** Warning: Linking the executable $output against the loadable module"
                   7138:            else
                   7139:              $ECHO "*** Warning: Linking the shared library $output against the loadable module"
                   7140:            fi
                   7141:            $ECHO "*** $linklib is not portable!"
                   7142:          fi
                   7143:          if test "$linkmode" = lib &&
                   7144:             test "$hardcode_into_libs" = yes; then
                   7145:            # Hardcode the library path.
                   7146:            # Skip directories that are in the system default run-time
                   7147:            # search path.
                   7148:            case " $sys_lib_dlsearch_path " in
                   7149:            *" $absdir "*) ;;
                   7150:            *)
                   7151:              case "$compile_rpath " in
                   7152:              *" $absdir "*) ;;
1.1.1.1.2.3.2  1(misho  7153:4):           *) compile_rpath="$compile_rpath $absdir" ;;
1.1       misho    7154:              esac
                   7155:              ;;
                   7156:            esac
                   7157:            case " $sys_lib_dlsearch_path " in
                   7158:            *" $libdir "*) ;;
                   7159:            *)
                   7160:              case "$finalize_rpath " in
                   7161:              *" $libdir "*) ;;
1.1.1.1.2.3.2  1(misho  7162:4):           *) finalize_rpath="$finalize_rpath $libdir" ;;
1.1       misho    7163:              esac
                   7164:              ;;
                   7165:            esac
                   7166:          fi
                   7167: 
                   7168:          if test -n "$old_archive_from_expsyms_cmds"; then
                   7169:            # figure out the soname
                   7170:            set dummy $library_names
                   7171:            shift
                   7172:            realname="$1"
                   7173:            shift
                   7174:            libname=`eval "\\$ECHO \"$libname_spec\""`
                   7175:            # use dlname if we got it. it's perfectly good, no?
                   7176:            if test -n "$dlname"; then
                   7177:              soname="$dlname"
                   7178:            elif test -n "$soname_spec"; then
                   7179:              # bleh windows
                   7180:              case $host in
                   7181:              *cygwin* | mingw* | *cegcc*)
                   7182:                func_arith $current - $age
                   7183:                major=$func_arith_result
                   7184:                versuffix="-$major"
                   7185:                ;;
                   7186:              esac
                   7187:              eval soname=\"$soname_spec\"
                   7188:            else
                   7189:              soname="$realname"
                   7190:            fi
                   7191: 
                   7192:            # Make a new name for the extract_expsyms_cmds to use
                   7193:            soroot="$soname"
                   7194:            func_basename "$soroot"
                   7195:            soname="$func_basename_result"
                   7196:            func_stripname 'lib' '.dll' "$soname"
                   7197:            newlib=libimp-$func_stripname_result.a
                   7198: 
                   7199:            # If the library has no export list, then create one now
                   7200:            if test -f "$output_objdir/$soname-def"; then :
                   7201:            else
                   7202:              func_verbose "extracting exported symbol list from \`$soname'"
                   7203:              func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
                   7204:            fi
                   7205: 
                   7206:            # Create $newlib
                   7207:            if test -f "$output_objdir/$newlib"; then :; else
                   7208:              func_verbose "generating import library for \`$soname'"
                   7209:              func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
                   7210:            fi
                   7211:            # make sure the library variables are pointing to the new library
                   7212:            dir=$output_objdir
                   7213:            linklib=$newlib
                   7214:          fi # test -n "$old_archive_from_expsyms_cmds"
                   7215: 
1.1.1.1.2.3.2  1(misho  7216:4):       if test "$linkmode" = prog || test "$opt_mode" != relink; then
1.1       misho    7217:            add_shlibpath=
                   7218:            add_dir=
                   7219:            add=
                   7220:            lib_linked=yes
                   7221:            case $hardcode_action in
                   7222:            immediate | unsupported)
                   7223:              if test "$hardcode_direct" = no; then
                   7224:                add="$dir/$linklib"
                   7225:                case $host in
                   7226:                  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
                   7227:                  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
                   7228:                  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
                   7229:                    *-*-unixware7*) add_dir="-L$dir" ;;
                   7230:                  *-*-darwin* )
                   7231:                    # if the lib is a (non-dlopened) module then we can not
                   7232:                    # link against it, someone is ignoring the earlier warnings
                   7233:                    if /usr/bin/file -L $add 2> /dev/null |
                   7234:                         $GREP ": [^:]* bundle" >/dev/null ; then
                   7235:                      if test "X$dlopenmodule" != "X$lib"; then
                   7236:                        $ECHO "*** Warning: lib $linklib is a module, not a shared library"
                   7237:                        if test -z "$old_library" ; then
1.1.1.1.2.3.2  1(misho  7238:4):                       echo
                   7239:4):                       echo "*** And there doesn't seem to be a static archive available"
                   7240:4):                       echo "*** The link will probably fail, sorry"
1.1       misho    7241:                        else
                   7242:                          add="$dir/$old_library"
                   7243:                        fi
                   7244:                      elif test -n "$old_library"; then
                   7245:                        add="$dir/$old_library"
                   7246:                      fi
                   7247:                    fi
                   7248:                esac
                   7249:              elif test "$hardcode_minus_L" = no; then
                   7250:                case $host in
                   7251:                *-*-sunos*) add_shlibpath="$dir" ;;
                   7252:                esac
                   7253:                add_dir="-L$dir"
                   7254:                add="-l$name"
                   7255:              elif test "$hardcode_shlibpath_var" = no; then
                   7256:                add_shlibpath="$dir"
                   7257:                add="-l$name"
                   7258:              else
                   7259:                lib_linked=no
                   7260:              fi
                   7261:              ;;
                   7262:            relink)
                   7263:              if test "$hardcode_direct" = yes &&
                   7264:                 test "$hardcode_direct_absolute" = no; then
                   7265:                add="$dir/$linklib"
                   7266:              elif test "$hardcode_minus_L" = yes; then
1.1.1.1.2.3.2  1(misho  7267:4):             add_dir="-L$absdir"
1.1       misho    7268:                # Try looking first in the location we're being installed to.
                   7269:                if test -n "$inst_prefix_dir"; then
                   7270:                  case $libdir in
                   7271:                    [\\/]*)
                   7272:                      add_dir="$add_dir -L$inst_prefix_dir$libdir"
                   7273:                      ;;
                   7274:                  esac
                   7275:                fi
                   7276:                add="-l$name"
                   7277:              elif test "$hardcode_shlibpath_var" = yes; then
                   7278:                add_shlibpath="$dir"
                   7279:                add="-l$name"
                   7280:              else
                   7281:                lib_linked=no
                   7282:              fi
                   7283:              ;;
                   7284:            *) lib_linked=no ;;
                   7285:            esac
                   7286: 
                   7287:            if test "$lib_linked" != yes; then
                   7288:              func_fatal_configuration "unsupported hardcode properties"
                   7289:            fi
                   7290: 
                   7291:            if test -n "$add_shlibpath"; then
                   7292:              case :$compile_shlibpath: in
                   7293:              *":$add_shlibpath:"*) ;;
                   7294:              *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
                   7295:              esac
                   7296:            fi
                   7297:            if test "$linkmode" = prog; then
                   7298:              test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
                   7299:              test -n "$add" && compile_deplibs="$add $compile_deplibs"
                   7300:            else
                   7301:              test -n "$add_dir" && deplibs="$add_dir $deplibs"
                   7302:              test -n "$add" && deplibs="$add $deplibs"
                   7303:              if test "$hardcode_direct" != yes &&
                   7304:                 test "$hardcode_minus_L" != yes &&
                   7305:                 test "$hardcode_shlibpath_var" = yes; then
                   7306:                case :$finalize_shlibpath: in
                   7307:                *":$libdir:"*) ;;
                   7308:                *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
                   7309:                esac
                   7310:              fi
                   7311:            fi
                   7312:          fi
                   7313: 
1.1.1.1.2.3.2  1(misho  7314:4):       if test "$linkmode" = prog || test "$opt_mode" = relink; then
1.1       misho    7315:            add_shlibpath=
                   7316:            add_dir=
                   7317:            add=
                   7318:            # Finalize command for both is simple: just hardcode it.
                   7319:            if test "$hardcode_direct" = yes &&
                   7320:               test "$hardcode_direct_absolute" = no; then
                   7321:              add="$libdir/$linklib"
                   7322:            elif test "$hardcode_minus_L" = yes; then
                   7323:              add_dir="-L$libdir"
                   7324:              add="-l$name"
                   7325:            elif test "$hardcode_shlibpath_var" = yes; then
                   7326:              case :$finalize_shlibpath: in
                   7327:              *":$libdir:"*) ;;
                   7328:              *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
                   7329:              esac
                   7330:              add="-l$name"
                   7331:            elif test "$hardcode_automatic" = yes; then
                   7332:              if test -n "$inst_prefix_dir" &&
                   7333:                 test -f "$inst_prefix_dir$libdir/$linklib" ; then
                   7334:                add="$inst_prefix_dir$libdir/$linklib"
                   7335:              else
                   7336:                add="$libdir/$linklib"
                   7337:              fi
                   7338:            else
                   7339:              # We cannot seem to hardcode it, guess we'll fake it.
                   7340:              add_dir="-L$libdir"
                   7341:              # Try looking first in the location we're being installed to.
                   7342:              if test -n "$inst_prefix_dir"; then
                   7343:                case $libdir in
                   7344:                  [\\/]*)
                   7345:                    add_dir="$add_dir -L$inst_prefix_dir$libdir"
                   7346:                    ;;
                   7347:                esac
                   7348:              fi
                   7349:              add="-l$name"
                   7350:            fi
                   7351: 
                   7352:            if test "$linkmode" = prog; then
                   7353:              test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
                   7354:              test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
                   7355:            else
                   7356:              test -n "$add_dir" && deplibs="$add_dir $deplibs"
                   7357:              test -n "$add" && deplibs="$add $deplibs"
                   7358:            fi
                   7359:          fi
                   7360:        elif test "$linkmode" = prog; then
                   7361:          # Here we assume that one of hardcode_direct or hardcode_minus_L
                   7362:          # is not unsupported.  This is valid on all known static and
                   7363:          # shared platforms.
                   7364:          if test "$hardcode_direct" != unsupported; then
                   7365:            test -n "$old_library" && linklib="$old_library"
                   7366:            compile_deplibs="$dir/$linklib $compile_deplibs"
                   7367:            finalize_deplibs="$dir/$linklib $finalize_deplibs"
                   7368:          else
                   7369:            compile_deplibs="-l$name -L$dir $compile_deplibs"
                   7370:            finalize_deplibs="-l$name -L$dir $finalize_deplibs"
                   7371:          fi
                   7372:        elif test "$build_libtool_libs" = yes; then
                   7373:          # Not a shared library
                   7374:          if test "$deplibs_check_method" != pass_all; then
                   7375:            # We're trying link a shared library against a static one
                   7376:            # but the system doesn't support it.
                   7377: 
                   7378:            # Just print a warning and add the library to dependency_libs so
                   7379:            # that the program can be linked against the static library.
1.1.1.1.2.3.2  1(misho  7380:4):         echo
1.1       misho    7381:            $ECHO "*** Warning: This system can not link to static lib archive $lib."
1.1.1.1.2.3.2  1(misho  7382:4):         echo "*** I have the capability to make that library automatically link in when"
                   7383:4):         echo "*** you link to this library.  But I can only do this if you have a"
                   7384:4):         echo "*** shared version of the library, which you do not appear to have."
1.1       misho    7385:            if test "$module" = yes; then
1.1.1.1.2.3.2  1(misho  7386:4):           echo "*** But as you try to build a module library, libtool will still create "
                   7387:4):           echo "*** a static module, that should work as long as the dlopening application"
                   7388:4):           echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
1.1       misho    7389:              if test -z "$global_symbol_pipe"; then
1.1.1.1.2.3.2  1(misho  7390:4):             echo
                   7391:4):             echo "*** However, this would only work if libtool was able to extract symbol"
                   7392:4):             echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
                   7393:4):             echo "*** not find such a program.  So, this module is probably useless."
                   7394:4):             echo "*** \`nm' from GNU binutils and a full rebuild may help."
1.1       misho    7395:              fi
                   7396:              if test "$build_old_libs" = no; then
                   7397:                build_libtool_libs=module
                   7398:                build_old_libs=yes
                   7399:              else
                   7400:                build_libtool_libs=no
                   7401:              fi
                   7402:            fi
                   7403:          else
                   7404:            deplibs="$dir/$old_library $deplibs"
                   7405:            link_static=yes
                   7406:          fi
                   7407:        fi # link shared/static library?
                   7408: 
                   7409:        if test "$linkmode" = lib; then
                   7410:          if test -n "$dependency_libs" &&
                   7411:             { test "$hardcode_into_libs" != yes ||
                   7412:               test "$build_old_libs" = yes ||
                   7413:               test "$link_static" = yes; }; then
                   7414:            # Extract -R from dependency_libs
                   7415:            temp_deplibs=
                   7416:            for libdir in $dependency_libs; do
                   7417:              case $libdir in
                   7418:              -R*) func_stripname '-R' '' "$libdir"
                   7419:                   temp_xrpath=$func_stripname_result
                   7420:                   case " $xrpath " in
                   7421:                   *" $temp_xrpath "*) ;;
                   7422:                   *) xrpath="$xrpath $temp_xrpath";;
                   7423:                   esac;;
                   7424:              *) temp_deplibs="$temp_deplibs $libdir";;
                   7425:              esac
                   7426:            done
                   7427:            dependency_libs="$temp_deplibs"
                   7428:          fi
                   7429: 
                   7430:          newlib_search_path="$newlib_search_path $absdir"
                   7431:          # Link against this library
                   7432:          test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
                   7433:          # ... and its dependency_libs
                   7434:          tmp_libs=
                   7435:          for deplib in $dependency_libs; do
                   7436:            newdependency_libs="$deplib $newdependency_libs"
1.1.1.1.2.3.2  1(misho  7437:4):         case $deplib in
                   7438:4):               -L*) func_stripname '-L' '' "$deplib"
                   7439:4):                    func_resolve_sysroot "$func_stripname_result";;
                   7440:4):               *) func_resolve_sysroot "$deplib" ;;
                   7441:4):             esac
                   7442:4):         if $opt_preserve_dup_deps ; then
1.1       misho    7443:              case "$tmp_libs " in
1.1.1.1.2.3.2  1(misho  7444:4):           *" $func_resolve_sysroot_result "*)
                   7445:4):                 specialdeplibs="$specialdeplibs $func_resolve_sysroot_result" ;;
1.1       misho    7446:              esac
                   7447:            fi
1.1.1.1.2.3.2  1(misho  7448:4):         tmp_libs="$tmp_libs $func_resolve_sysroot_result"
1.1       misho    7449:          done
                   7450: 
                   7451:          if test "$link_all_deplibs" != no; then
                   7452:            # Add the search paths of all dependency libraries
                   7453:            for deplib in $dependency_libs; do
                   7454:              path=
                   7455:              case $deplib in
                   7456:              -L*) path="$deplib" ;;
                   7457:              *.la)
1.1.1.1.2.3.2  1(misho  7458:4):             func_resolve_sysroot "$deplib"
                   7459:4):             deplib=$func_resolve_sysroot_result
1.1       misho    7460:                func_dirname "$deplib" "" "."
1.1.1.1.2.3.2  1(misho  7461:4):             dir=$func_dirname_result
1.1       misho    7462:                # We need an absolute path.
                   7463:                case $dir in
                   7464:                [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
                   7465:                *)
                   7466:                  absdir=`cd "$dir" && pwd`
                   7467:                  if test -z "$absdir"; then
                   7468:                    func_warning "cannot determine absolute directory name of \`$dir'"
                   7469:                    absdir="$dir"
                   7470:                  fi
                   7471:                  ;;
                   7472:                esac
                   7473:                if $GREP "^installed=no" $deplib > /dev/null; then
                   7474:                case $host in
                   7475:                *-*-darwin*)
                   7476:                  depdepl=
                   7477:                  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
                   7478:                  if test -n "$deplibrary_names" ; then
                   7479:                    for tmp in $deplibrary_names ; do
                   7480:                      depdepl=$tmp
                   7481:                    done
                   7482:                    if test -f "$absdir/$objdir/$depdepl" ; then
                   7483:                      depdepl="$absdir/$objdir/$depdepl"
                   7484:                      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
                   7485:                       if test -z "$darwin_install_name"; then
                   7486:                           darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
                   7487:                       fi
                   7488:                      compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
                   7489:                      linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
                   7490:                      path=
                   7491:                    fi
                   7492:                  fi
                   7493:                  ;;
                   7494:                *)
                   7495:                  path="-L$absdir/$objdir"
                   7496:                  ;;
                   7497:                esac
                   7498:                else
                   7499:                  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
                   7500:                  test -z "$libdir" && \
                   7501:                    func_fatal_error "\`$deplib' is not a valid libtool archive"
                   7502:                  test "$absdir" != "$libdir" && \
                   7503:                    func_warning "\`$deplib' seems to be moved"
                   7504: 
                   7505:                  path="-L$absdir"
                   7506:                fi
                   7507:                ;;
                   7508:              esac
                   7509:              case " $deplibs " in
                   7510:              *" $path "*) ;;
                   7511:              *) deplibs="$path $deplibs" ;;
                   7512:              esac
                   7513:            done
                   7514:          fi # link_all_deplibs != no
                   7515:        fi # linkmode = lib
                   7516:       done # for deplib in $libs
                   7517:       if test "$pass" = link; then
                   7518:        if test "$linkmode" = "prog"; then
                   7519:          compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
                   7520:          finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
                   7521:        else
1.1.1.1.2.3.2  1(misho  7522:4):       compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
1.1       misho    7523:        fi
                   7524:       fi
                   7525:       dependency_libs="$newdependency_libs"
                   7526:       if test "$pass" = dlpreopen; then
                   7527:        # Link the dlpreopened libraries before other libraries
                   7528:        for deplib in $save_deplibs; do
                   7529:          deplibs="$deplib $deplibs"
                   7530:        done
                   7531:       fi
                   7532:       if test "$pass" != dlopen; then
                   7533:        if test "$pass" != conv; then
                   7534:          # Make sure lib_search_path contains only unique directories.
                   7535:          lib_search_path=
                   7536:          for dir in $newlib_search_path; do
                   7537:            case "$lib_search_path " in
                   7538:            *" $dir "*) ;;
                   7539:            *) lib_search_path="$lib_search_path $dir" ;;
                   7540:            esac
                   7541:          done
                   7542:          newlib_search_path=
                   7543:        fi
                   7544: 
                   7545:        if test "$linkmode,$pass" != "prog,link"; then
                   7546:          vars="deplibs"
                   7547:        else
                   7548:          vars="compile_deplibs finalize_deplibs"
                   7549:        fi
                   7550:        for var in $vars dependency_libs; do
                   7551:          # Add libraries to $var in reverse order
                   7552:          eval tmp_libs=\"\$$var\"
                   7553:          new_libs=
                   7554:          for deplib in $tmp_libs; do
                   7555:            # FIXME: Pedantically, this is the right thing to do, so
                   7556:            #        that some nasty dependency loop isn't accidentally
                   7557:            #        broken:
                   7558:            #new_libs="$deplib $new_libs"
                   7559:            # Pragmatically, this seems to cause very few problems in
                   7560:            # practice:
                   7561:            case $deplib in
                   7562:            -L*) new_libs="$deplib $new_libs" ;;
                   7563:            -R*) ;;
                   7564:            *)
                   7565:              # And here is the reason: when a library appears more
                   7566:              # than once as an explicit dependence of a library, or
                   7567:              # is implicitly linked in more than once by the
                   7568:              # compiler, it is considered special, and multiple
                   7569:              # occurrences thereof are not removed.  Compare this
                   7570:              # with having the same library being listed as a
                   7571:              # dependency of multiple other libraries: in this case,
                   7572:              # we know (pedantically, we assume) the library does not
                   7573:              # need to be listed more than once, so we keep only the
                   7574:              # last copy.  This is not always right, but it is rare
                   7575:              # enough that we require users that really mean to play
                   7576:              # such unportable linking tricks to link the library
                   7577:              # using -Wl,-lname, so that libtool does not consider it
                   7578:              # for duplicate removal.
                   7579:              case " $specialdeplibs " in
                   7580:              *" $deplib "*) new_libs="$deplib $new_libs" ;;
                   7581:              *)
                   7582:                case " $new_libs " in
                   7583:                *" $deplib "*) ;;
                   7584:                *) new_libs="$deplib $new_libs" ;;
                   7585:                esac
                   7586:                ;;
                   7587:              esac
                   7588:              ;;
                   7589:            esac
                   7590:          done
                   7591:          tmp_libs=
                   7592:          for deplib in $new_libs; do
                   7593:            case $deplib in
                   7594:            -L*)
                   7595:              case " $tmp_libs " in
                   7596:              *" $deplib "*) ;;
                   7597:              *) tmp_libs="$tmp_libs $deplib" ;;
                   7598:              esac
                   7599:              ;;
                   7600:            *) tmp_libs="$tmp_libs $deplib" ;;
                   7601:            esac
                   7602:          done
                   7603:          eval $var=\"$tmp_libs\"
                   7604:        done # for var
                   7605:       fi
                   7606:       # Last step: remove runtime libs from dependency_libs
                   7607:       # (they stay in deplibs)
                   7608:       tmp_libs=
                   7609:       for i in $dependency_libs ; do
                   7610:        case " $predeps $postdeps $compiler_lib_search_path " in
                   7611:        *" $i "*)
                   7612:          i=""
                   7613:          ;;
                   7614:        esac
                   7615:        if test -n "$i" ; then
                   7616:          tmp_libs="$tmp_libs $i"
                   7617:        fi
                   7618:       done
                   7619:       dependency_libs=$tmp_libs
                   7620:     done # for pass
                   7621:     if test "$linkmode" = prog; then
                   7622:       dlfiles="$newdlfiles"
                   7623:     fi
                   7624:     if test "$linkmode" = prog || test "$linkmode" = lib; then
                   7625:       dlprefiles="$newdlprefiles"
                   7626:     fi
                   7627: 
                   7628:     case $linkmode in
                   7629:     oldlib)
                   7630:       if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
                   7631:        func_warning "\`-dlopen' is ignored for archives"
                   7632:       fi
                   7633: 
                   7634:       case " $deplibs" in
                   7635:       *\ -l* | *\ -L*)
                   7636:        func_warning "\`-l' and \`-L' are ignored for archives" ;;
                   7637:       esac
                   7638: 
                   7639:       test -n "$rpath" && \
                   7640:        func_warning "\`-rpath' is ignored for archives"
                   7641: 
                   7642:       test -n "$xrpath" && \
                   7643:        func_warning "\`-R' is ignored for archives"
                   7644: 
                   7645:       test -n "$vinfo" && \
                   7646:        func_warning "\`-version-info/-version-number' is ignored for archives"
                   7647: 
                   7648:       test -n "$release" && \
                   7649:        func_warning "\`-release' is ignored for archives"
                   7650: 
                   7651:       test -n "$export_symbols$export_symbols_regex" && \
                   7652:        func_warning "\`-export-symbols' is ignored for archives"
                   7653: 
                   7654:       # Now set the variables for building old libraries.
                   7655:       build_libtool_libs=no
                   7656:       oldlibs="$output"
                   7657:       objs="$objs$old_deplibs"
                   7658:       ;;
                   7659: 
                   7660:     lib)
                   7661:       # Make sure we only generate libraries of the form `libNAME.la'.
                   7662:       case $outputname in
                   7663:       lib*)
                   7664:        func_stripname 'lib' '.la' "$outputname"
                   7665:        name=$func_stripname_result
                   7666:        eval shared_ext=\"$shrext_cmds\"
                   7667:        eval libname=\"$libname_spec\"
                   7668:        ;;
                   7669:       *)
                   7670:        test "$module" = no && \
                   7671:          func_fatal_help "libtool library \`$output' must begin with \`lib'"
                   7672: 
                   7673:        if test "$need_lib_prefix" != no; then
                   7674:          # Add the "lib" prefix for modules if required
                   7675:          func_stripname '' '.la' "$outputname"
                   7676:          name=$func_stripname_result
                   7677:          eval shared_ext=\"$shrext_cmds\"
                   7678:          eval libname=\"$libname_spec\"
                   7679:        else
                   7680:          func_stripname '' '.la' "$outputname"
                   7681:          libname=$func_stripname_result
                   7682:        fi
                   7683:        ;;
                   7684:       esac
                   7685: 
                   7686:       if test -n "$objs"; then
                   7687:        if test "$deplibs_check_method" != pass_all; then
                   7688:          func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
                   7689:        else
1.1.1.1.2.3.2  1(misho  7690:4):       echo
1.1       misho    7691:          $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
                   7692:          $ECHO "*** objects $objs is not portable!"
                   7693:          libobjs="$libobjs $objs"
                   7694:        fi
                   7695:       fi
                   7696: 
                   7697:       test "$dlself" != no && \
                   7698:        func_warning "\`-dlopen self' is ignored for libtool libraries"
                   7699: 
                   7700:       set dummy $rpath
                   7701:       shift
                   7702:       test "$#" -gt 1 && \
                   7703:        func_warning "ignoring multiple \`-rpath's for a libtool library"
                   7704: 
                   7705:       install_libdir="$1"
                   7706: 
                   7707:       oldlibs=
                   7708:       if test -z "$rpath"; then
                   7709:        if test "$build_libtool_libs" = yes; then
                   7710:          # Building a libtool convenience library.
                   7711:          # Some compilers have problems with a `.al' extension so
                   7712:          # convenience libraries should have the same extension an
                   7713:          # archive normally would.
                   7714:          oldlibs="$output_objdir/$libname.$libext $oldlibs"
                   7715:          build_libtool_libs=convenience
                   7716:          build_old_libs=yes
                   7717:        fi
                   7718: 
                   7719:        test -n "$vinfo" && \
                   7720:          func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
                   7721: 
                   7722:        test -n "$release" && \
                   7723:          func_warning "\`-release' is ignored for convenience libraries"
                   7724:       else
                   7725: 
                   7726:        # Parse the version information argument.
                   7727:        save_ifs="$IFS"; IFS=':'
                   7728:        set dummy $vinfo 0 0 0
                   7729:        shift
                   7730:        IFS="$save_ifs"
                   7731: 
                   7732:        test -n "$7" && \
                   7733:          func_fatal_help "too many parameters to \`-version-info'"
                   7734: 
                   7735:        # convert absolute version numbers to libtool ages
                   7736:        # this retains compatibility with .la files and attempts
                   7737:        # to make the code below a bit more comprehensible
                   7738: 
                   7739:        case $vinfo_number in
                   7740:        yes)
                   7741:          number_major="$1"
                   7742:          number_minor="$2"
                   7743:          number_revision="$3"
                   7744:          #
                   7745:          # There are really only two kinds -- those that
                   7746:          # use the current revision as the major version
                   7747:          # and those that subtract age and use age as
                   7748:          # a minor version.  But, then there is irix
                   7749:          # which has an extra 1 added just for fun
                   7750:          #
                   7751:          case $version_type in
1.1.1.1.2.3.2  1(misho  7752:4):       # correct linux to gnu/linux during the next big refactor
1.1       misho    7753:          darwin|linux|osf|windows|none)
                   7754:            func_arith $number_major + $number_minor
                   7755:            current=$func_arith_result
                   7756:            age="$number_minor"
                   7757:            revision="$number_revision"
                   7758:            ;;
1.1.1.1.2.3.2  1(misho  7759:4):       freebsd-aout|freebsd-elf|qnx|sunos)
1.1       misho    7760:            current="$number_major"
                   7761:            revision="$number_minor"
                   7762:            age="0"
                   7763:            ;;
                   7764:          irix|nonstopux)
                   7765:            func_arith $number_major + $number_minor
                   7766:            current=$func_arith_result
                   7767:            age="$number_minor"
                   7768:            revision="$number_minor"
                   7769:            lt_irix_increment=no
                   7770:            ;;
                   7771:          esac
                   7772:          ;;
                   7773:        no)
                   7774:          current="$1"
                   7775:          revision="$2"
                   7776:          age="$3"
                   7777:          ;;
                   7778:        esac
                   7779: 
                   7780:        # Check that each of the things are valid numbers.
                   7781:        case $current in
                   7782:        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]) ;;
                   7783:        *)
                   7784:          func_error "CURRENT \`$current' must be a nonnegative integer"
                   7785:          func_fatal_error "\`$vinfo' is not valid version information"
                   7786:          ;;
                   7787:        esac
                   7788: 
                   7789:        case $revision in
                   7790:        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]) ;;
                   7791:        *)
                   7792:          func_error "REVISION \`$revision' must be a nonnegative integer"
                   7793:          func_fatal_error "\`$vinfo' is not valid version information"
                   7794:          ;;
                   7795:        esac
                   7796: 
                   7797:        case $age in
                   7798:        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]) ;;
                   7799:        *)
                   7800:          func_error "AGE \`$age' must be a nonnegative integer"
                   7801:          func_fatal_error "\`$vinfo' is not valid version information"
                   7802:          ;;
                   7803:        esac
                   7804: 
                   7805:        if test "$age" -gt "$current"; then
                   7806:          func_error "AGE \`$age' is greater than the current interface number \`$current'"
                   7807:          func_fatal_error "\`$vinfo' is not valid version information"
                   7808:        fi
                   7809: 
                   7810:        # Calculate the version variables.
                   7811:        major=
                   7812:        versuffix=
                   7813:        verstring=
                   7814:        case $version_type in
                   7815:        none) ;;
                   7816: 
                   7817:        darwin)
                   7818:          # Like Linux, but with the current version available in
                   7819:          # verstring for coding it into the library header
                   7820:          func_arith $current - $age
                   7821:          major=.$func_arith_result
                   7822:          versuffix="$major.$age.$revision"
                   7823:          # Darwin ld doesn't like 0 for these options...
                   7824:          func_arith $current + 1
                   7825:          minor_current=$func_arith_result
                   7826:          xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
                   7827:          verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
                   7828:          ;;
                   7829: 
                   7830:        freebsd-aout)
                   7831:          major=".$current"
                   7832:          versuffix=".$current.$revision";
                   7833:          ;;
                   7834: 
                   7835:        freebsd-elf)
                   7836:          major=".$current"
                   7837:          versuffix=".$current"
                   7838:          ;;
                   7839: 
                   7840:        irix | nonstopux)
                   7841:          if test "X$lt_irix_increment" = "Xno"; then
                   7842:            func_arith $current - $age
                   7843:          else
                   7844:            func_arith $current - $age + 1
                   7845:          fi
                   7846:          major=$func_arith_result
                   7847: 
                   7848:          case $version_type in
                   7849:            nonstopux) verstring_prefix=nonstopux ;;
                   7850:            *)         verstring_prefix=sgi ;;
                   7851:          esac
                   7852:          verstring="$verstring_prefix$major.$revision"
                   7853: 
                   7854:          # Add in all the interfaces that we are compatible with.
                   7855:          loop=$revision
                   7856:          while test "$loop" -ne 0; do
                   7857:            func_arith $revision - $loop
                   7858:            iface=$func_arith_result
                   7859:            func_arith $loop - 1
                   7860:            loop=$func_arith_result
                   7861:            verstring="$verstring_prefix$major.$iface:$verstring"
                   7862:          done
                   7863: 
                   7864:          # Before this point, $major must not contain `.'.
                   7865:          major=.$major
                   7866:          versuffix="$major.$revision"
                   7867:          ;;
                   7868: 
1.1.1.1.2.3.2  1(misho  7869:4):     linux) # correct to gnu/linux during the next big refactor
1.1       misho    7870:          func_arith $current - $age
                   7871:          major=.$func_arith_result
                   7872:          versuffix="$major.$age.$revision"
                   7873:          ;;
                   7874: 
                   7875:        osf)
                   7876:          func_arith $current - $age
                   7877:          major=.$func_arith_result
                   7878:          versuffix=".$current.$age.$revision"
                   7879:          verstring="$current.$age.$revision"
                   7880: 
                   7881:          # Add in all the interfaces that we are compatible with.
                   7882:          loop=$age
                   7883:          while test "$loop" -ne 0; do
                   7884:            func_arith $current - $loop
                   7885:            iface=$func_arith_result
                   7886:            func_arith $loop - 1
                   7887:            loop=$func_arith_result
                   7888:            verstring="$verstring:${iface}.0"
                   7889:          done
                   7890: 
                   7891:          # Make executables depend on our current version.
                   7892:          verstring="$verstring:${current}.0"
                   7893:          ;;
                   7894: 
                   7895:        qnx)
                   7896:          major=".$current"
                   7897:          versuffix=".$current"
                   7898:          ;;
                   7899: 
                   7900:        sunos)
                   7901:          major=".$current"
                   7902:          versuffix=".$current.$revision"
                   7903:          ;;
                   7904: 
                   7905:        windows)
                   7906:          # Use '-' rather than '.', since we only want one
                   7907:          # extension on DOS 8.3 filesystems.
                   7908:          func_arith $current - $age
                   7909:          major=$func_arith_result
                   7910:          versuffix="-$major"
                   7911:          ;;
                   7912: 
                   7913:        *)
                   7914:          func_fatal_configuration "unknown library version type \`$version_type'"
                   7915:          ;;
                   7916:        esac
                   7917: 
                   7918:        # Clear the version info if we defaulted, and they specified a release.
                   7919:        if test -z "$vinfo" && test -n "$release"; then
                   7920:          major=
                   7921:          case $version_type in
                   7922:          darwin)
                   7923:            # we can't check for "0.0" in archive_cmds due to quoting
                   7924:            # problems, so we reset it completely
                   7925:            verstring=
                   7926:            ;;
                   7927:          *)
                   7928:            verstring="0.0"
                   7929:            ;;
                   7930:          esac
                   7931:          if test "$need_version" = no; then
                   7932:            versuffix=
                   7933:          else
                   7934:            versuffix=".0.0"
                   7935:          fi
                   7936:        fi
                   7937: 
                   7938:        # Remove version info from name if versioning should be avoided
                   7939:        if test "$avoid_version" = yes && test "$need_version" = no; then
                   7940:          major=
                   7941:          versuffix=
                   7942:          verstring=""
                   7943:        fi
                   7944: 
                   7945:        # Check to see if the archive will have undefined symbols.
                   7946:        if test "$allow_undefined" = yes; then
                   7947:          if test "$allow_undefined_flag" = unsupported; then
                   7948:            func_warning "undefined symbols not allowed in $host shared libraries"
                   7949:            build_libtool_libs=no
                   7950:            build_old_libs=yes
                   7951:          fi
                   7952:        else
                   7953:          # Don't allow undefined symbols.
                   7954:          allow_undefined_flag="$no_undefined_flag"
                   7955:        fi
                   7956: 
                   7957:       fi
                   7958: 
                   7959:       func_generate_dlsyms "$libname" "$libname" "yes"
                   7960:       libobjs="$libobjs $symfileobj"
                   7961:       test "X$libobjs" = "X " && libobjs=
                   7962: 
1.1.1.1.2.3.2  1(misho  7963:4):       if test "$opt_mode" != relink; then
1.1       misho    7964:        # Remove our outputs, but don't remove object files since they
                   7965:        # may have been created when compiling PIC objects.
                   7966:        removelist=
                   7967:        tempremovelist=`$ECHO "$output_objdir/*"`
                   7968:        for p in $tempremovelist; do
                   7969:          case $p in
                   7970:            *.$objext | *.gcno)
                   7971:               ;;
                   7972:            $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
                   7973:               if test "X$precious_files_regex" != "X"; then
                   7974:                 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
                   7975:                 then
                   7976:                   continue
                   7977:                 fi
                   7978:               fi
                   7979:               removelist="$removelist $p"
                   7980:               ;;
                   7981:            *) ;;
                   7982:          esac
                   7983:        done
                   7984:        test -n "$removelist" && \
                   7985:          func_show_eval "${RM}r \$removelist"
                   7986:       fi
                   7987: 
                   7988:       # Now set the variables for building old libraries.
                   7989:       if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
                   7990:        oldlibs="$oldlibs $output_objdir/$libname.$libext"
                   7991: 
                   7992:        # Transform .lo files to .o files.
1.1.1.1.2.3.2  1(misho  7993:4):     oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
1.1       misho    7994:       fi
                   7995: 
                   7996:       # Eliminate all temporary directories.
                   7997:       #for path in $notinst_path; do
1.1.1.1.2.3.2  1(misho  7998:4):       #     lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
                   7999:4):       #     deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
                   8000:4):       #     dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
1.1       misho    8001:       #done
                   8002: 
                   8003:       if test -n "$xrpath"; then
                   8004:        # If the user specified any rpath flags, then add them.
                   8005:        temp_xrpath=
                   8006:        for libdir in $xrpath; do
1.1.1.1.2.3.2  1(misho  8007:4):       func_replace_sysroot "$libdir"
                   8008:4):       temp_xrpath="$temp_xrpath -R$func_replace_sysroot_result"
1.1       misho    8009:          case "$finalize_rpath " in
                   8010:          *" $libdir "*) ;;
                   8011:          *) finalize_rpath="$finalize_rpath $libdir" ;;
                   8012:          esac
                   8013:        done
                   8014:        if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
                   8015:          dependency_libs="$temp_xrpath $dependency_libs"
                   8016:        fi
                   8017:       fi
                   8018: 
                   8019:       # Make sure dlfiles contains only unique files that won't be dlpreopened
                   8020:       old_dlfiles="$dlfiles"
                   8021:       dlfiles=
                   8022:       for lib in $old_dlfiles; do
                   8023:        case " $dlprefiles $dlfiles " in
                   8024:        *" $lib "*) ;;
                   8025:        *) dlfiles="$dlfiles $lib" ;;
                   8026:        esac
                   8027:       done
                   8028: 
                   8029:       # Make sure dlprefiles contains only unique files
                   8030:       old_dlprefiles="$dlprefiles"
                   8031:       dlprefiles=
                   8032:       for lib in $old_dlprefiles; do
                   8033:        case "$dlprefiles " in
                   8034:        *" $lib "*) ;;
                   8035:        *) dlprefiles="$dlprefiles $lib" ;;
                   8036:        esac
                   8037:       done
                   8038: 
                   8039:       if test "$build_libtool_libs" = yes; then
                   8040:        if test -n "$rpath"; then
                   8041:          case $host in
1.1.1.1.2.3.2  1(misho  8042:4):       *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
1.1       misho    8043:            # these systems don't actually have a c library (as such)!
                   8044:            ;;
                   8045:          *-*-rhapsody* | *-*-darwin1.[012])
                   8046:            # Rhapsody C library is in the System framework
                   8047:            deplibs="$deplibs System.ltframework"
                   8048:            ;;
                   8049:          *-*-netbsd*)
                   8050:            # Don't link with libc until the a.out ld.so is fixed.
                   8051:            ;;
                   8052:          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
                   8053:            # Do not include libc due to us having libc/libc_r.
                   8054:            ;;
                   8055:          *-*-sco3.2v5* | *-*-sco5v6*)
                   8056:            # Causes problems with __ctype
                   8057:            ;;
                   8058:          *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
                   8059:            # Compiler inserts libc in the correct place for threads to work
                   8060:            ;;
                   8061:          *)
                   8062:            # Add libc to deplibs on all other systems if necessary.
                   8063:            if test "$build_libtool_need_lc" = "yes"; then
                   8064:              deplibs="$deplibs -lc"
                   8065:            fi
                   8066:            ;;
                   8067:          esac
                   8068:        fi
                   8069: 
                   8070:        # Transform deplibs into only deplibs that can be linked in shared.
                   8071:        name_save=$name
                   8072:        libname_save=$libname
                   8073:        release_save=$release
                   8074:        versuffix_save=$versuffix
                   8075:        major_save=$major
                   8076:        # I'm not sure if I'm treating the release correctly.  I think
                   8077:        # release should show up in the -l (ie -lgmp5) so we don't want to
                   8078:        # add it in twice.  Is that correct?
                   8079:        release=""
                   8080:        versuffix=""
                   8081:        major=""
                   8082:        newdeplibs=
                   8083:        droppeddeps=no
                   8084:        case $deplibs_check_method in
                   8085:        pass_all)
                   8086:          # Don't check for shared/static.  Everything works.
                   8087:          # This might be a little naive.  We might want to check
                   8088:          # whether the library exists or not.  But this is on
                   8089:          # osf3 & osf4 and I'm not really sure... Just
                   8090:          # implementing what was already the behavior.
                   8091:          newdeplibs=$deplibs
                   8092:          ;;
                   8093:        test_compile)
                   8094:          # This code stresses the "libraries are programs" paradigm to its
                   8095:          # limits. Maybe even breaks it.  We compile a program, linking it
                   8096:          # against the deplibs as a proxy for the library.  Then we can check
                   8097:          # whether they linked in statically or dynamically with ldd.
                   8098:          $opt_dry_run || $RM conftest.c
                   8099:          cat > conftest.c <<EOF
                   8100:          int main() { return 0; }
                   8101: EOF
                   8102:          $opt_dry_run || $RM conftest
                   8103:          if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
                   8104:            ldd_output=`ldd conftest`
                   8105:            for i in $deplibs; do
                   8106:              case $i in
                   8107:              -l*)
                   8108:                func_stripname -l '' "$i"
                   8109:                name=$func_stripname_result
                   8110:                if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
                   8111:                  case " $predeps $postdeps " in
                   8112:                  *" $i "*)
                   8113:                    newdeplibs="$newdeplibs $i"
                   8114:                    i=""
                   8115:                    ;;
                   8116:                  esac
                   8117:                fi
                   8118:                if test -n "$i" ; then
                   8119:                  libname=`eval "\\$ECHO \"$libname_spec\""`
                   8120:                  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
                   8121:                  set dummy $deplib_matches; shift
                   8122:                  deplib_match=$1
                   8123:                  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
                   8124:                    newdeplibs="$newdeplibs $i"
                   8125:                  else
                   8126:                    droppeddeps=yes
1.1.1.1.2.3.2  1(misho  8127:4):                 echo
1.1       misho    8128:                    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
1.1.1.1.2.3.2  1(misho  8129:4):                 echo "*** I have the capability to make that library automatically link in when"
                   8130:4):                 echo "*** you link to this library.  But I can only do this if you have a"
                   8131:4):                 echo "*** shared version of the library, which I believe you do not have"
                   8132:4):                 echo "*** because a test_compile did reveal that the linker did not use it for"
                   8133:4):                 echo "*** its dynamic dependency list that programs get resolved with at runtime."
1.1       misho    8134:                  fi
                   8135:                fi
                   8136:                ;;
                   8137:              *)
                   8138:                newdeplibs="$newdeplibs $i"
                   8139:                ;;
                   8140:              esac
                   8141:            done
                   8142:          else
                   8143:            # Error occurred in the first compile.  Let's try to salvage
                   8144:            # the situation: Compile a separate program for each library.
                   8145:            for i in $deplibs; do
                   8146:              case $i in
                   8147:              -l*)
                   8148:                func_stripname -l '' "$i"
                   8149:                name=$func_stripname_result
                   8150:                $opt_dry_run || $RM conftest
                   8151:                if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
                   8152:                  ldd_output=`ldd conftest`
                   8153:                  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
                   8154:                    case " $predeps $postdeps " in
                   8155:                    *" $i "*)
                   8156:                      newdeplibs="$newdeplibs $i"
                   8157:                      i=""
                   8158:                      ;;
                   8159:                    esac
                   8160:                  fi
                   8161:                  if test -n "$i" ; then
                   8162:                    libname=`eval "\\$ECHO \"$libname_spec\""`
                   8163:                    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
                   8164:                    set dummy $deplib_matches; shift
                   8165:                    deplib_match=$1
                   8166:                    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
                   8167:                      newdeplibs="$newdeplibs $i"
                   8168:                    else
                   8169:                      droppeddeps=yes
1.1.1.1.2.3.2  1(misho  8170:4):                   echo
1.1       misho    8171:                      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
1.1.1.1.2.3.2  1(misho  8172:4):                   echo "*** I have the capability to make that library automatically link in when"
                   8173:4):                   echo "*** you link to this library.  But I can only do this if you have a"
                   8174:4):                   echo "*** shared version of the library, which you do not appear to have"
                   8175:4):                   echo "*** because a test_compile did reveal that the linker did not use this one"
                   8176:4):                   echo "*** as a dynamic dependency that programs can get resolved with at runtime."
1.1       misho    8177:                    fi
                   8178:                  fi
                   8179:                else
                   8180:                  droppeddeps=yes
1.1.1.1.2.3.2  1(misho  8181:4):               echo
1.1       misho    8182:                  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
1.1.1.1.2.3.2  1(misho  8183:4):               echo "*** make it link in!  You will probably need to install it or some"
                   8184:4):               echo "*** library that it depends on before this library will be fully"
                   8185:4):               echo "*** functional.  Installing it before continuing would be even better."
1.1       misho    8186:                fi
                   8187:                ;;
                   8188:              *)
                   8189:                newdeplibs="$newdeplibs $i"
                   8190:                ;;
                   8191:              esac
                   8192:            done
                   8193:          fi
                   8194:          ;;
                   8195:        file_magic*)
                   8196:          set dummy $deplibs_check_method; shift
                   8197:          file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
                   8198:          for a_deplib in $deplibs; do
                   8199:            case $a_deplib in
                   8200:            -l*)
                   8201:              func_stripname -l '' "$a_deplib"
                   8202:              name=$func_stripname_result
                   8203:              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
                   8204:                case " $predeps $postdeps " in
                   8205:                *" $a_deplib "*)
                   8206:                  newdeplibs="$newdeplibs $a_deplib"
                   8207:                  a_deplib=""
                   8208:                  ;;
                   8209:                esac
                   8210:              fi
                   8211:              if test -n "$a_deplib" ; then
                   8212:                libname=`eval "\\$ECHO \"$libname_spec\""`
1.1.1.1.2.3.2  1(misho  8213:4):             if test -n "$file_magic_glob"; then
                   8214:4):               libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
                   8215:4):             else
                   8216:4):               libnameglob=$libname
                   8217:4):             fi
                   8218:4):             test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
1.1       misho    8219:                for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
1.1.1.1.2.3.2  1(misho  8220:4):               if test "$want_nocaseglob" = yes; then
                   8221:4):                 shopt -s nocaseglob
                   8222:4):                 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
                   8223:4):                 $nocaseglob
                   8224:4):               else
                   8225:4):                 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
                   8226:4):               fi
1.1       misho    8227:                  for potent_lib in $potential_libs; do
                   8228:                      # Follow soft links.
                   8229:                      if ls -lLd "$potent_lib" 2>/dev/null |
                   8230:                         $GREP " -> " >/dev/null; then
                   8231:                        continue
                   8232:                      fi
                   8233:                      # The statement above tries to avoid entering an
                   8234:                      # endless loop below, in case of cyclic links.
                   8235:                      # We might still enter an endless loop, since a link
                   8236:                      # loop can be closed while we follow links,
                   8237:                      # but so what?
                   8238:                      potlib="$potent_lib"
                   8239:                      while test -h "$potlib" 2>/dev/null; do
                   8240:                        potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
                   8241:                        case $potliblink in
                   8242:                        [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
1.1.1.1.2.3.2  1(misho  8243:4):                     *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
1.1       misho    8244:                        esac
                   8245:                      done
                   8246:                      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
                   8247:                         $SED -e 10q |
                   8248:                         $EGREP "$file_magic_regex" > /dev/null; then
                   8249:                        newdeplibs="$newdeplibs $a_deplib"
                   8250:                        a_deplib=""
                   8251:                        break 2
                   8252:                      fi
                   8253:                  done
                   8254:                done
                   8255:              fi
                   8256:              if test -n "$a_deplib" ; then
                   8257:                droppeddeps=yes
1.1.1.1.2.3.2  1(misho  8258:4):             echo
1.1       misho    8259:                $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
1.1.1.1.2.3.2  1(misho  8260:4):             echo "*** I have the capability to make that library automatically link in when"
                   8261:4):             echo "*** you link to this library.  But I can only do this if you have a"
                   8262:4):             echo "*** shared version of the library, which you do not appear to have"
                   8263:4):             echo "*** because I did check the linker path looking for a file starting"
1.1       misho    8264:                if test -z "$potlib" ; then
                   8265:                  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
                   8266:                else
                   8267:                  $ECHO "*** with $libname and none of the candidates passed a file format test"
                   8268:                  $ECHO "*** using a file magic. Last file checked: $potlib"
                   8269:                fi
                   8270:              fi
                   8271:              ;;
                   8272:            *)
                   8273:              # Add a -L argument.
                   8274:              newdeplibs="$newdeplibs $a_deplib"
                   8275:              ;;
                   8276:            esac
                   8277:          done # Gone through all deplibs.
                   8278:          ;;
                   8279:        match_pattern*)
                   8280:          set dummy $deplibs_check_method; shift
                   8281:          match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
                   8282:          for a_deplib in $deplibs; do
                   8283:            case $a_deplib in
                   8284:            -l*)
                   8285:              func_stripname -l '' "$a_deplib"
                   8286:              name=$func_stripname_result
                   8287:              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
                   8288:                case " $predeps $postdeps " in
                   8289:                *" $a_deplib "*)
                   8290:                  newdeplibs="$newdeplibs $a_deplib"
                   8291:                  a_deplib=""
                   8292:                  ;;
                   8293:                esac
                   8294:              fi
                   8295:              if test -n "$a_deplib" ; then
                   8296:                libname=`eval "\\$ECHO \"$libname_spec\""`
                   8297:                for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
                   8298:                  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
                   8299:                  for potent_lib in $potential_libs; do
                   8300:                    potlib="$potent_lib" # see symlink-check above in file_magic test
1.1.1.1.2.3.2  1(misho  8301:4):                 if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
1.1       misho    8302:                       $EGREP "$match_pattern_regex" > /dev/null; then
                   8303:                      newdeplibs="$newdeplibs $a_deplib"
                   8304:                      a_deplib=""
                   8305:                      break 2
                   8306:                    fi
                   8307:                  done
                   8308:                done
                   8309:              fi
                   8310:              if test -n "$a_deplib" ; then
                   8311:                droppeddeps=yes
1.1.1.1.2.3.2  1(misho  8312:4):             echo
1.1       misho    8313:                $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
1.1.1.1.2.3.2  1(misho  8314:4):             echo "*** I have the capability to make that library automatically link in when"
                   8315:4):             echo "*** you link to this library.  But I can only do this if you have a"
                   8316:4):             echo "*** shared version of the library, which you do not appear to have"
                   8317:4):             echo "*** because I did check the linker path looking for a file starting"
1.1       misho    8318:                if test -z "$potlib" ; then
                   8319:                  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
                   8320:                else
                   8321:                  $ECHO "*** with $libname and none of the candidates passed a file format test"
                   8322:                  $ECHO "*** using a regex pattern. Last file checked: $potlib"
                   8323:                fi
                   8324:              fi
                   8325:              ;;
                   8326:            *)
                   8327:              # Add a -L argument.
                   8328:              newdeplibs="$newdeplibs $a_deplib"
                   8329:              ;;
                   8330:            esac
                   8331:          done # Gone through all deplibs.
                   8332:          ;;
                   8333:        none | unknown | *)
                   8334:          newdeplibs=""
1.1.1.1.2.3.2  1(misho  8335:4):       tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
1.1       misho    8336:          if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
                   8337:            for i in $predeps $postdeps ; do
                   8338:              # can't use Xsed below, because $i might contain '/'
1.1.1.1.2.3.2  1(misho  8339:4):           tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
1.1       misho    8340:            done
                   8341:          fi
1.1.1.1.2.3.2  1(misho  8342:4):       case $tmp_deplibs in
                   8343:4):       *[!\  \ ]*)
                   8344:4):         echo
1.1       misho    8345:            if test "X$deplibs_check_method" = "Xnone"; then
1.1.1.1.2.3.2  1(misho  8346:4):           echo "*** Warning: inter-library dependencies are not supported in this platform."
1.1       misho    8347:            else
1.1.1.1.2.3.2  1(misho  8348:4):           echo "*** Warning: inter-library dependencies are not known to be supported."
1.1       misho    8349:            fi
1.1.1.1.2.3.2  1(misho  8350:4):         echo "*** All declared inter-library dependencies are being dropped."
1.1       misho    8351:            droppeddeps=yes
1.1.1.1.2.3.2  1(misho  8352:4):         ;;
                   8353:4):       esac
1.1       misho    8354:          ;;
                   8355:        esac
                   8356:        versuffix=$versuffix_save
                   8357:        major=$major_save
                   8358:        release=$release_save
                   8359:        libname=$libname_save
                   8360:        name=$name_save
                   8361: 
                   8362:        case $host in
                   8363:        *-*-rhapsody* | *-*-darwin1.[012])
                   8364:          # On Rhapsody replace the C library with the System framework
1.1.1.1.2.3.2  1(misho  8365:4):       newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
1.1       misho    8366:          ;;
                   8367:        esac
                   8368: 
                   8369:        if test "$droppeddeps" = yes; then
                   8370:          if test "$module" = yes; then
1.1.1.1.2.3.2  1(misho  8371:4):         echo
                   8372:4):         echo "*** Warning: libtool could not satisfy all declared inter-library"
1.1       misho    8373:            $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
1.1.1.1.2.3.2  1(misho  8374:4):         echo "*** a static module, that should work as long as the dlopening"
                   8375:4):         echo "*** application is linked with the -dlopen flag."
1.1       misho    8376:            if test -z "$global_symbol_pipe"; then
1.1.1.1.2.3.2  1(misho  8377:4):           echo
                   8378:4):           echo "*** However, this would only work if libtool was able to extract symbol"
                   8379:4):           echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
                   8380:4):           echo "*** not find such a program.  So, this module is probably useless."
                   8381:4):           echo "*** \`nm' from GNU binutils and a full rebuild may help."
1.1       misho    8382:            fi
                   8383:            if test "$build_old_libs" = no; then
                   8384:              oldlibs="$output_objdir/$libname.$libext"
                   8385:              build_libtool_libs=module
                   8386:              build_old_libs=yes
                   8387:            else
                   8388:              build_libtool_libs=no
                   8389:            fi
                   8390:          else
1.1.1.1.2.3.2  1(misho  8391:4):         echo "*** The inter-library dependencies that have been dropped here will be"
                   8392:4):         echo "*** automatically added whenever a program is linked with this library"
                   8393:4):         echo "*** or is declared to -dlopen it."
1.1       misho    8394: 
                   8395:            if test "$allow_undefined" = no; then
1.1.1.1.2.3.2  1(misho  8396:4):           echo
                   8397:4):           echo "*** Since this library must not contain undefined symbols,"
                   8398:4):           echo "*** because either the platform does not support them or"
                   8399:4):           echo "*** it was explicitly requested with -no-undefined,"
                   8400:4):           echo "*** libtool will only create a static version of it."
1.1       misho    8401:              if test "$build_old_libs" = no; then
                   8402:                oldlibs="$output_objdir/$libname.$libext"
                   8403:                build_libtool_libs=module
                   8404:                build_old_libs=yes
                   8405:              else
                   8406:                build_libtool_libs=no
                   8407:              fi
                   8408:            fi
                   8409:          fi
                   8410:        fi
                   8411:        # Done checking deplibs!
                   8412:        deplibs=$newdeplibs
                   8413:       fi
                   8414:       # Time to change all our "foo.ltframework" stuff back to "-framework foo"
                   8415:       case $host in
                   8416:        *-*-darwin*)
1.1.1.1.2.3.2  1(misho  8417:4):       newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
                   8418:4):       new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
                   8419:4):       deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
1.1       misho    8420:          ;;
                   8421:       esac
                   8422: 
                   8423:       # move library search paths that coincide with paths to not yet
                   8424:       # installed libraries to the beginning of the library search list
                   8425:       new_libs=
                   8426:       for path in $notinst_path; do
                   8427:        case " $new_libs " in
                   8428:        *" -L$path/$objdir "*) ;;
                   8429:        *)
                   8430:          case " $deplibs " in
                   8431:          *" -L$path/$objdir "*)
                   8432:            new_libs="$new_libs -L$path/$objdir" ;;
                   8433:          esac
                   8434:          ;;
                   8435:        esac
                   8436:       done
                   8437:       for deplib in $deplibs; do
                   8438:        case $deplib in
                   8439:        -L*)
                   8440:          case " $new_libs " in
                   8441:          *" $deplib "*) ;;
                   8442:          *) new_libs="$new_libs $deplib" ;;
                   8443:          esac
                   8444:          ;;
                   8445:        *) new_libs="$new_libs $deplib" ;;
                   8446:        esac
                   8447:       done
                   8448:       deplibs="$new_libs"
                   8449: 
                   8450:       # All the library-specific variables (install_libdir is set above).
                   8451:       library_names=
                   8452:       old_library=
                   8453:       dlname=
                   8454: 
                   8455:       # Test again, we may have decided not to build it any more
                   8456:       if test "$build_libtool_libs" = yes; then
1.1.1.1.2.3.2  1(misho  8457:4):     # Remove ${wl} instances when linking with ld.
                   8458:4):     # FIXME: should test the right _cmds variable.
                   8459:4):     case $archive_cmds in
                   8460:4):       *\$LD\ *) wl= ;;
                   8461:4):         esac
1.1       misho    8462:        if test "$hardcode_into_libs" = yes; then
                   8463:          # Hardcode the library paths
                   8464:          hardcode_libdirs=
                   8465:          dep_rpath=
                   8466:          rpath="$finalize_rpath"
1.1.1.1.2.3.2  1(misho  8467:4):       test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
1.1       misho    8468:          for libdir in $rpath; do
                   8469:            if test -n "$hardcode_libdir_flag_spec"; then
                   8470:              if test -n "$hardcode_libdir_separator"; then
1.1.1.1.2.3.2  1(misho  8471:4):             func_replace_sysroot "$libdir"
                   8472:4):             libdir=$func_replace_sysroot_result
1.1       misho    8473:                if test -z "$hardcode_libdirs"; then
                   8474:                  hardcode_libdirs="$libdir"
                   8475:                else
                   8476:                  # Just accumulate the unique libdirs.
                   8477:                  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
                   8478:                  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
                   8479:                    ;;
                   8480:                  *)
                   8481:                    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
                   8482:                    ;;
                   8483:                  esac
                   8484:                fi
                   8485:              else
                   8486:                eval flag=\"$hardcode_libdir_flag_spec\"
                   8487:                dep_rpath="$dep_rpath $flag"
                   8488:              fi
                   8489:            elif test -n "$runpath_var"; then
                   8490:              case "$perm_rpath " in
                   8491:              *" $libdir "*) ;;
                   8492:              *) perm_rpath="$perm_rpath $libdir" ;;
                   8493:              esac
                   8494:            fi
                   8495:          done
                   8496:          # Substitute the hardcoded libdirs into the rpath.
                   8497:          if test -n "$hardcode_libdir_separator" &&
                   8498:             test -n "$hardcode_libdirs"; then
                   8499:            libdir="$hardcode_libdirs"
1.1.1.1.2.3.2  1(misho  8500:4):         eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
1.1       misho    8501:          fi
                   8502:          if test -n "$runpath_var" && test -n "$perm_rpath"; then
                   8503:            # We should set the runpath_var.
                   8504:            rpath=
                   8505:            for dir in $perm_rpath; do
                   8506:              rpath="$rpath$dir:"
                   8507:            done
                   8508:            eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
                   8509:          fi
                   8510:          test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
                   8511:        fi
                   8512: 
                   8513:        shlibpath="$finalize_shlibpath"
1.1.1.1.2.3.2  1(misho  8514:4):     test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
1.1       misho    8515:        if test -n "$shlibpath"; then
                   8516:          eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
                   8517:        fi
                   8518: 
                   8519:        # Get the real and link names of the library.
                   8520:        eval shared_ext=\"$shrext_cmds\"
                   8521:        eval library_names=\"$library_names_spec\"
                   8522:        set dummy $library_names
                   8523:        shift
                   8524:        realname="$1"
                   8525:        shift
                   8526: 
                   8527:        if test -n "$soname_spec"; then
                   8528:          eval soname=\"$soname_spec\"
                   8529:        else
                   8530:          soname="$realname"
                   8531:        fi
                   8532:        if test -z "$dlname"; then
                   8533:          dlname=$soname
                   8534:        fi
                   8535: 
                   8536:        lib="$output_objdir/$realname"
                   8537:        linknames=
                   8538:        for link
                   8539:        do
                   8540:          linknames="$linknames $link"
                   8541:        done
                   8542: 
                   8543:        # Use standard objects if they are pic
1.1.1.1.2.3.2  1(misho  8544:4):     test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
1.1       misho    8545:        test "X$libobjs" = "X " && libobjs=
                   8546: 
                   8547:        delfiles=
                   8548:        if test -n "$export_symbols" && test -n "$include_expsyms"; then
                   8549:          $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
                   8550:          export_symbols="$output_objdir/$libname.uexp"
                   8551:          delfiles="$delfiles $export_symbols"
                   8552:        fi
                   8553: 
                   8554:        orig_export_symbols=
                   8555:        case $host_os in
                   8556:        cygwin* | mingw* | cegcc*)
                   8557:          if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
                   8558:            # exporting using user supplied symfile
                   8559:            if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
                   8560:              # and it's NOT already a .def file. Must figure out
                   8561:              # which of the given symbols are data symbols and tag
                   8562:              # them as such. So, trigger use of export_symbols_cmds.
                   8563:              # export_symbols gets reassigned inside the "prepare
                   8564:              # the list of exported symbols" if statement, so the
                   8565:              # include_expsyms logic still works.
                   8566:              orig_export_symbols="$export_symbols"
                   8567:              export_symbols=
                   8568:              always_export_symbols=yes
                   8569:            fi
                   8570:          fi
                   8571:          ;;
                   8572:        esac
                   8573: 
                   8574:        # Prepare the list of exported symbols
                   8575:        if test -z "$export_symbols"; then
                   8576:          if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
                   8577:            func_verbose "generating symbol list for \`$libname.la'"
                   8578:            export_symbols="$output_objdir/$libname.exp"
                   8579:            $opt_dry_run || $RM $export_symbols
                   8580:            cmds=$export_symbols_cmds
                   8581:            save_ifs="$IFS"; IFS='~'
1.1.1.1.2.3.2  1(misho  8582:4):         for cmd1 in $cmds; do
1.1       misho    8583:              IFS="$save_ifs"
1.1.1.1.2.3.2  1(misho  8584:4):           # Take the normal branch if the nm_file_list_spec branch
                   8585:4):           # doesn't work or if tool conversion is not needed.
                   8586:4):           case $nm_file_list_spec~$to_tool_file_cmd in
                   8587:4):             *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
                   8588:4):               try_normal_branch=yes
                   8589:4):               eval cmd=\"$cmd1\"
                   8590:4):               func_len " $cmd"
                   8591:4):               len=$func_len_result
                   8592:4):               ;;
                   8593:4):             *)
                   8594:4):               try_normal_branch=no
                   8595:4):               ;;
                   8596:4):           esac
                   8597:4):           if test "$try_normal_branch" = yes \
                   8598:4):              && { test "$len" -lt "$max_cmd_len" \
                   8599:4):                   || test "$max_cmd_len" -le -1; }
                   8600:4):           then
                   8601:4):             func_show_eval "$cmd" 'exit $?'
                   8602:4):             skipped_export=false
                   8603:4):           elif test -n "$nm_file_list_spec"; then
                   8604:4):             func_basename "$output"
                   8605:4):             output_la=$func_basename_result
                   8606:4):             save_libobjs=$libobjs
                   8607:4):             save_output=$output
                   8608:4):             output=${output_objdir}/${output_la}.nm
                   8609:4):             func_to_tool_file "$output"
                   8610:4):             libobjs=$nm_file_list_spec$func_to_tool_file_result
                   8611:4):             delfiles="$delfiles $output"
                   8612:4):             func_verbose "creating $NM input file list: $output"
                   8613:4):             for obj in $save_libobjs; do
                   8614:4):               func_to_tool_file "$obj"
                   8615:4):               $ECHO "$func_to_tool_file_result"
                   8616:4):             done > "$output"
                   8617:4):             eval cmd=\"$cmd1\"
1.1       misho    8618:                func_show_eval "$cmd" 'exit $?'
1.1.1.1.2.3.2  1(misho  8619:4):             output=$save_output
                   8620:4):             libobjs=$save_libobjs
1.1       misho    8621:                skipped_export=false
                   8622:              else
                   8623:                # The command line is too long to execute in one step.
                   8624:                func_verbose "using reloadable object file for export list..."
                   8625:                skipped_export=:
                   8626:                # Break out early, otherwise skipped_export may be
                   8627:                # set to false by a later but shorter cmd.
                   8628:                break
                   8629:              fi
                   8630:            done
                   8631:            IFS="$save_ifs"
                   8632:            if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
                   8633:              func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
                   8634:              func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
                   8635:            fi
                   8636:          fi
                   8637:        fi
                   8638: 
                   8639:        if test -n "$export_symbols" && test -n "$include_expsyms"; then
                   8640:          tmp_export_symbols="$export_symbols"
                   8641:          test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
1.1.1.1.2.3.2  1(misho  8642:4):       $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
1.1       misho    8643:        fi
                   8644: 
                   8645:        if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
                   8646:          # The given exports_symbols file has to be filtered, so filter it.
                   8647:          func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
                   8648:          # FIXME: $output_objdir/$libname.filter potentially contains lots of
                   8649:          # 's' commands which not all seds can handle. GNU sed should be fine
                   8650:          # though. Also, the filter scales superlinearly with the number of
                   8651:          # global variables. join(1) would be nice here, but unfortunately
                   8652:          # isn't a blessed tool.
                   8653:          $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
                   8654:          delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
                   8655:          export_symbols=$output_objdir/$libname.def
                   8656:          $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
                   8657:        fi
                   8658: 
                   8659:        tmp_deplibs=
                   8660:        for test_deplib in $deplibs; do
                   8661:          case " $convenience " in
                   8662:          *" $test_deplib "*) ;;
                   8663:          *)
                   8664:            tmp_deplibs="$tmp_deplibs $test_deplib"
                   8665:            ;;
                   8666:          esac
                   8667:        done
                   8668:        deplibs="$tmp_deplibs"
                   8669: 
                   8670:        if test -n "$convenience"; then
                   8671:          if test -n "$whole_archive_flag_spec" &&
                   8672:            test "$compiler_needs_object" = yes &&
                   8673:            test -z "$libobjs"; then
                   8674:            # extract the archives, so we have objects to list.
                   8675:            # TODO: could optimize this to just extract one archive.
                   8676:            whole_archive_flag_spec=
                   8677:          fi
                   8678:          if test -n "$whole_archive_flag_spec"; then
                   8679:            save_libobjs=$libobjs
                   8680:            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
                   8681:            test "X$libobjs" = "X " && libobjs=
                   8682:          else
                   8683:            gentop="$output_objdir/${outputname}x"
                   8684:            generated="$generated $gentop"
                   8685: 
                   8686:            func_extract_archives $gentop $convenience
                   8687:            libobjs="$libobjs $func_extract_archives_result"
                   8688:            test "X$libobjs" = "X " && libobjs=
                   8689:          fi
                   8690:        fi
                   8691: 
                   8692:        if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
                   8693:          eval flag=\"$thread_safe_flag_spec\"
                   8694:          linker_flags="$linker_flags $flag"
                   8695:        fi
                   8696: 
                   8697:        # Make a backup of the uninstalled library when relinking
1.1.1.1.2.3.2  1(misho  8698:4):     if test "$opt_mode" = relink; then
1.1       misho    8699:          $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
                   8700:        fi
                   8701: 
                   8702:        # Do each of the archive commands.
                   8703:        if test "$module" = yes && test -n "$module_cmds" ; then
                   8704:          if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
                   8705:            eval test_cmds=\"$module_expsym_cmds\"
                   8706:            cmds=$module_expsym_cmds
                   8707:          else
                   8708:            eval test_cmds=\"$module_cmds\"
                   8709:            cmds=$module_cmds
                   8710:          fi
                   8711:        else
                   8712:          if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
                   8713:            eval test_cmds=\"$archive_expsym_cmds\"
                   8714:            cmds=$archive_expsym_cmds
                   8715:          else
                   8716:            eval test_cmds=\"$archive_cmds\"
                   8717:            cmds=$archive_cmds
                   8718:          fi
                   8719:        fi
                   8720: 
                   8721:        if test "X$skipped_export" != "X:" &&
                   8722:           func_len " $test_cmds" &&
                   8723:           len=$func_len_result &&
                   8724:           test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
                   8725:          :
                   8726:        else
                   8727:          # The command line is too long to link in one step, link piecewise
                   8728:          # or, if using GNU ld and skipped_export is not :, use a linker
                   8729:          # script.
                   8730: 
                   8731:          # Save the value of $output and $libobjs because we want to
                   8732:          # use them later.  If we have whole_archive_flag_spec, we
                   8733:          # want to use save_libobjs as it was before
                   8734:          # whole_archive_flag_spec was expanded, because we can't
                   8735:          # assume the linker understands whole_archive_flag_spec.
                   8736:          # This may have to be revisited, in case too many
                   8737:          # convenience libraries get linked in and end up exceeding
                   8738:          # the spec.
                   8739:          if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
                   8740:            save_libobjs=$libobjs
                   8741:          fi
                   8742:          save_output=$output
1.1.1.1.2.3.2  1(misho  8743:4):       func_basename "$output"
                   8744:4):       output_la=$func_basename_result
1.1       misho    8745: 
                   8746:          # Clear the reloadable object creation command queue and
                   8747:          # initialize k to one.
                   8748:          test_cmds=
                   8749:          concat_cmds=
                   8750:          objlist=
                   8751:          last_robj=
                   8752:          k=1
                   8753: 
                   8754:          if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
                   8755:            output=${output_objdir}/${output_la}.lnkscript
                   8756:            func_verbose "creating GNU ld script: $output"
1.1.1.1.2.3.2  1(misho  8757:4):         echo 'INPUT (' > $output
1.1       misho    8758:            for obj in $save_libobjs
                   8759:            do
1.1.1.1.2.3.2  1(misho  8760:4):           func_to_tool_file "$obj"
                   8761:4):           $ECHO "$func_to_tool_file_result" >> $output
1.1       misho    8762:            done
1.1.1.1.2.3.2  1(misho  8763:4):         echo ')' >> $output
1.1       misho    8764:            delfiles="$delfiles $output"
1.1.1.1.2.3.2  1(misho  8765:4):         func_to_tool_file "$output"
                   8766:4):         output=$func_to_tool_file_result
1.1       misho    8767:          elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
                   8768:            output=${output_objdir}/${output_la}.lnk
                   8769:            func_verbose "creating linker input file list: $output"
                   8770:            : > $output
                   8771:            set x $save_libobjs
                   8772:            shift
                   8773:            firstobj=
                   8774:            if test "$compiler_needs_object" = yes; then
                   8775:              firstobj="$1 "
                   8776:              shift
                   8777:            fi
                   8778:            for obj
                   8779:            do
1.1.1.1.2.3.2  1(misho  8780:4):           func_to_tool_file "$obj"
                   8781:4):           $ECHO "$func_to_tool_file_result" >> $output
1.1       misho    8782:            done
                   8783:            delfiles="$delfiles $output"
1.1.1.1.2.3.2  1(misho  8784:4):         func_to_tool_file "$output"
                   8785:4):         output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
1.1       misho    8786:          else
                   8787:            if test -n "$save_libobjs"; then
                   8788:              func_verbose "creating reloadable object files..."
                   8789:              output=$output_objdir/$output_la-${k}.$objext
                   8790:              eval test_cmds=\"$reload_cmds\"
                   8791:              func_len " $test_cmds"
                   8792:              len0=$func_len_result
                   8793:              len=$len0
                   8794: 
                   8795:              # Loop over the list of objects to be linked.
                   8796:              for obj in $save_libobjs
                   8797:              do
                   8798:                func_len " $obj"
                   8799:                func_arith $len + $func_len_result
                   8800:                len=$func_arith_result
                   8801:                if test "X$objlist" = X ||
                   8802:                   test "$len" -lt "$max_cmd_len"; then
1.1.1.1.2.3.2  1(misho  8803:4):               objlist="$objlist $obj"
1.1       misho    8804:                else
                   8805:                  # The command $test_cmds is almost too long, add a
                   8806:                  # command to the queue.
                   8807:                  if test "$k" -eq 1 ; then
                   8808:                    # The first file doesn't have a previous command to add.
1.1.1.1.2.3.2  1(misho  8809:4):                 reload_objs=$objlist
                   8810:4):                 eval concat_cmds=\"$reload_cmds\"
1.1       misho    8811:                  else
                   8812:                    # All subsequent reloadable object files will link in
                   8813:                    # the last one created.
1.1.1.1.2.3.2  1(misho  8814:4):                 reload_objs="$objlist $last_robj"
                   8815:4):                 eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
1.1       misho    8816:                  fi
                   8817:                  last_robj=$output_objdir/$output_la-${k}.$objext
                   8818:                  func_arith $k + 1
                   8819:                  k=$func_arith_result
                   8820:                  output=$output_objdir/$output_la-${k}.$objext
1.1.1.1.2.3.2  1(misho  8821:4):               objlist=" $obj"
1.1       misho    8822:                  func_len " $last_robj"
                   8823:                  func_arith $len0 + $func_len_result
                   8824:                  len=$func_arith_result
                   8825:                fi
                   8826:              done
                   8827:              # Handle the remaining objects by creating one last
                   8828:              # reloadable object file.  All subsequent reloadable object
                   8829:              # files will link in the last one created.
                   8830:              test -z "$concat_cmds" || concat_cmds=$concat_cmds~
1.1.1.1.2.3.2  1(misho  8831:4):           reload_objs="$objlist $last_robj"
                   8832:4):           eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
1.1       misho    8833:              if test -n "$last_robj"; then
                   8834:                eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
                   8835:              fi
                   8836:              delfiles="$delfiles $output"
                   8837: 
                   8838:            else
                   8839:              output=
                   8840:            fi
                   8841: 
                   8842:            if ${skipped_export-false}; then
                   8843:              func_verbose "generating symbol list for \`$libname.la'"
                   8844:              export_symbols="$output_objdir/$libname.exp"
                   8845:              $opt_dry_run || $RM $export_symbols
                   8846:              libobjs=$output
                   8847:              # Append the command to create the export file.
                   8848:              test -z "$concat_cmds" || concat_cmds=$concat_cmds~
                   8849:              eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
                   8850:              if test -n "$last_robj"; then
                   8851:                eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
                   8852:              fi
                   8853:            fi
                   8854: 
                   8855:            test -n "$save_libobjs" &&
                   8856:              func_verbose "creating a temporary reloadable object file: $output"
                   8857: 
                   8858:            # Loop through the commands generated above and execute them.
                   8859:            save_ifs="$IFS"; IFS='~'
                   8860:            for cmd in $concat_cmds; do
                   8861:              IFS="$save_ifs"
                   8862:              $opt_silent || {
                   8863:                  func_quote_for_expand "$cmd"
                   8864:                  eval "func_echo $func_quote_for_expand_result"
                   8865:              }
                   8866:              $opt_dry_run || eval "$cmd" || {
                   8867:                lt_exit=$?
                   8868: 
                   8869:                # Restore the uninstalled library and exit
1.1.1.1.2.3.2  1(misho  8870:4):             if test "$opt_mode" = relink; then
1.1       misho    8871:                  ( cd "$output_objdir" && \
                   8872:                    $RM "${realname}T" && \
                   8873:                    $MV "${realname}U" "$realname" )
                   8874:                fi
                   8875: 
                   8876:                exit $lt_exit
                   8877:              }
                   8878:            done
                   8879:            IFS="$save_ifs"
                   8880: 
                   8881:            if test -n "$export_symbols_regex" && ${skipped_export-false}; then
                   8882:              func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
                   8883:              func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
                   8884:            fi
                   8885:          fi
                   8886: 
                   8887:           if ${skipped_export-false}; then
                   8888:            if test -n "$export_symbols" && test -n "$include_expsyms"; then
                   8889:              tmp_export_symbols="$export_symbols"
                   8890:              test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
1.1.1.1.2.3.2  1(misho  8891:4):           $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
1.1       misho    8892:            fi
                   8893: 
                   8894:            if test -n "$orig_export_symbols"; then
                   8895:              # The given exports_symbols file has to be filtered, so filter it.
                   8896:              func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
                   8897:              # FIXME: $output_objdir/$libname.filter potentially contains lots of
                   8898:              # 's' commands which not all seds can handle. GNU sed should be fine
                   8899:              # though. Also, the filter scales superlinearly with the number of
                   8900:              # global variables. join(1) would be nice here, but unfortunately
                   8901:              # isn't a blessed tool.
                   8902:              $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
                   8903:              delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
                   8904:              export_symbols=$output_objdir/$libname.def
                   8905:              $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
                   8906:            fi
                   8907:          fi
                   8908: 
                   8909:          libobjs=$output
                   8910:          # Restore the value of output.
                   8911:          output=$save_output
                   8912: 
                   8913:          if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
                   8914:            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
                   8915:            test "X$libobjs" = "X " && libobjs=
                   8916:          fi
                   8917:          # Expand the library linking commands again to reset the
                   8918:          # value of $libobjs for piecewise linking.
                   8919: 
                   8920:          # Do each of the archive commands.
                   8921:          if test "$module" = yes && test -n "$module_cmds" ; then
                   8922:            if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
                   8923:              cmds=$module_expsym_cmds
                   8924:            else
                   8925:              cmds=$module_cmds
                   8926:            fi
                   8927:          else
                   8928:            if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
                   8929:              cmds=$archive_expsym_cmds
                   8930:            else
                   8931:              cmds=$archive_cmds
                   8932:            fi
                   8933:          fi
                   8934:        fi
                   8935: 
                   8936:        if test -n "$delfiles"; then
                   8937:          # Append the command to remove temporary files to $cmds.
                   8938:          eval cmds=\"\$cmds~\$RM $delfiles\"
                   8939:        fi
                   8940: 
                   8941:        # Add any objects from preloaded convenience libraries
                   8942:        if test -n "$dlprefiles"; then
                   8943:          gentop="$output_objdir/${outputname}x"
                   8944:          generated="$generated $gentop"
                   8945: 
                   8946:          func_extract_archives $gentop $dlprefiles
                   8947:          libobjs="$libobjs $func_extract_archives_result"
                   8948:          test "X$libobjs" = "X " && libobjs=
                   8949:        fi
                   8950: 
                   8951:        save_ifs="$IFS"; IFS='~'
                   8952:        for cmd in $cmds; do
                   8953:          IFS="$save_ifs"
                   8954:          eval cmd=\"$cmd\"
                   8955:          $opt_silent || {
                   8956:            func_quote_for_expand "$cmd"
                   8957:            eval "func_echo $func_quote_for_expand_result"
                   8958:          }
                   8959:          $opt_dry_run || eval "$cmd" || {
                   8960:            lt_exit=$?
                   8961: 
                   8962:            # Restore the uninstalled library and exit
1.1.1.1.2.3.2  1(misho  8963:4):         if test "$opt_mode" = relink; then
1.1       misho    8964:              ( cd "$output_objdir" && \
                   8965:                $RM "${realname}T" && \
                   8966:                $MV "${realname}U" "$realname" )
                   8967:            fi
                   8968: 
                   8969:            exit $lt_exit
                   8970:          }
                   8971:        done
                   8972:        IFS="$save_ifs"
                   8973: 
                   8974:        # Restore the uninstalled library and exit
1.1.1.1.2.3.2  1(misho  8975:4):     if test "$opt_mode" = relink; then
1.1       misho    8976:          $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
                   8977: 
                   8978:          if test -n "$convenience"; then
                   8979:            if test -z "$whole_archive_flag_spec"; then
                   8980:              func_show_eval '${RM}r "$gentop"'
                   8981:            fi
                   8982:          fi
                   8983: 
                   8984:          exit $EXIT_SUCCESS
                   8985:        fi
                   8986: 
                   8987:        # Create links to the real library.
                   8988:        for linkname in $linknames; do
                   8989:          if test "$realname" != "$linkname"; then
                   8990:            func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
                   8991:          fi
                   8992:        done
                   8993: 
                   8994:        # If -module or -export-dynamic was specified, set the dlname.
                   8995:        if test "$module" = yes || test "$export_dynamic" = yes; then
                   8996:          # On all known operating systems, these are identical.
                   8997:          dlname="$soname"
                   8998:        fi
                   8999:       fi
                   9000:       ;;
                   9001: 
                   9002:     obj)
                   9003:       if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
                   9004:        func_warning "\`-dlopen' is ignored for objects"
                   9005:       fi
                   9006: 
                   9007:       case " $deplibs" in
                   9008:       *\ -l* | *\ -L*)
                   9009:        func_warning "\`-l' and \`-L' are ignored for objects" ;;
                   9010:       esac
                   9011: 
                   9012:       test -n "$rpath" && \
                   9013:        func_warning "\`-rpath' is ignored for objects"
                   9014: 
                   9015:       test -n "$xrpath" && \
                   9016:        func_warning "\`-R' is ignored for objects"
                   9017: 
                   9018:       test -n "$vinfo" && \
                   9019:        func_warning "\`-version-info' is ignored for objects"
                   9020: 
                   9021:       test -n "$release" && \
                   9022:        func_warning "\`-release' is ignored for objects"
                   9023: 
                   9024:       case $output in
                   9025:       *.lo)
                   9026:        test -n "$objs$old_deplibs" && \
                   9027:          func_fatal_error "cannot build library object \`$output' from non-libtool objects"
                   9028: 
                   9029:        libobj=$output
                   9030:        func_lo2o "$libobj"
                   9031:        obj=$func_lo2o_result
                   9032:        ;;
                   9033:       *)
                   9034:        libobj=
                   9035:        obj="$output"
                   9036:        ;;
                   9037:       esac
                   9038: 
                   9039:       # Delete the old objects.
                   9040:       $opt_dry_run || $RM $obj $libobj
                   9041: 
                   9042:       # Objects from convenience libraries.  This assumes
                   9043:       # single-version convenience libraries.  Whenever we create
                   9044:       # different ones for PIC/non-PIC, this we'll have to duplicate
                   9045:       # the extraction.
                   9046:       reload_conv_objs=
                   9047:       gentop=
                   9048:       # reload_cmds runs $LD directly, so let us get rid of
                   9049:       # -Wl from whole_archive_flag_spec and hope we can get by with
                   9050:       # turning comma into space..
                   9051:       wl=
                   9052: 
                   9053:       if test -n "$convenience"; then
                   9054:        if test -n "$whole_archive_flag_spec"; then
                   9055:          eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
1.1.1.1.2.3.2  1(misho  9056:4):       reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
1.1       misho    9057:        else
                   9058:          gentop="$output_objdir/${obj}x"
                   9059:          generated="$generated $gentop"
                   9060: 
                   9061:          func_extract_archives $gentop $convenience
                   9062:          reload_conv_objs="$reload_objs $func_extract_archives_result"
                   9063:        fi
                   9064:       fi
                   9065: 
1.1.1.1.2.3.2  1(misho  9066:4):       # If we're not building shared, we need to use non_pic_objs
                   9067:4):       test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
                   9068:4): 
1.1       misho    9069:       # Create the old-style object.
1.1.1.1.2.3.2  1(misho  9070:4):       reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
1.1       misho    9071: 
                   9072:       output="$obj"
                   9073:       func_execute_cmds "$reload_cmds" 'exit $?'
                   9074: 
                   9075:       # Exit if we aren't doing a library object file.
                   9076:       if test -z "$libobj"; then
                   9077:        if test -n "$gentop"; then
                   9078:          func_show_eval '${RM}r "$gentop"'
                   9079:        fi
                   9080: 
                   9081:        exit $EXIT_SUCCESS
                   9082:       fi
                   9083: 
                   9084:       if test "$build_libtool_libs" != yes; then
                   9085:        if test -n "$gentop"; then
                   9086:          func_show_eval '${RM}r "$gentop"'
                   9087:        fi
                   9088: 
                   9089:        # Create an invalid libtool object if no PIC, so that we don't
                   9090:        # accidentally link it into a program.
                   9091:        # $show "echo timestamp > $libobj"
                   9092:        # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
                   9093:        exit $EXIT_SUCCESS
                   9094:       fi
                   9095: 
                   9096:       if test -n "$pic_flag" || test "$pic_mode" != default; then
                   9097:        # Only do commands if we really have different PIC objects.
                   9098:        reload_objs="$libobjs $reload_conv_objs"
                   9099:        output="$libobj"
                   9100:        func_execute_cmds "$reload_cmds" 'exit $?'
                   9101:       fi
                   9102: 
                   9103:       if test -n "$gentop"; then
                   9104:        func_show_eval '${RM}r "$gentop"'
                   9105:       fi
                   9106: 
                   9107:       exit $EXIT_SUCCESS
                   9108:       ;;
                   9109: 
                   9110:     prog)
                   9111:       case $host in
                   9112:        *cygwin*) func_stripname '' '.exe' "$output"
                   9113:                  output=$func_stripname_result.exe;;
                   9114:       esac
                   9115:       test -n "$vinfo" && \
                   9116:        func_warning "\`-version-info' is ignored for programs"
                   9117: 
                   9118:       test -n "$release" && \
                   9119:        func_warning "\`-release' is ignored for programs"
                   9120: 
                   9121:       test "$preload" = yes \
                   9122:         && test "$dlopen_support" = unknown \
                   9123:        && test "$dlopen_self" = unknown \
                   9124:        && test "$dlopen_self_static" = unknown && \
                   9125:          func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
                   9126: 
                   9127:       case $host in
                   9128:       *-*-rhapsody* | *-*-darwin1.[012])
                   9129:        # On Rhapsody replace the C library is the System framework
1.1.1.1.2.3.2  1(misho  9130:4):     compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
                   9131:4):     finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
1.1       misho    9132:        ;;
                   9133:       esac
                   9134: 
                   9135:       case $host in
                   9136:       *-*-darwin*)
                   9137:        # Don't allow lazy linking, it breaks C++ global constructors
                   9138:        # But is supposedly fixed on 10.4 or later (yay!).
                   9139:        if test "$tagname" = CXX ; then
                   9140:          case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
                   9141:            10.[0123])
                   9142:              compile_command="$compile_command ${wl}-bind_at_load"
                   9143:              finalize_command="$finalize_command ${wl}-bind_at_load"
                   9144:            ;;
                   9145:          esac
                   9146:        fi
                   9147:        # Time to change all our "foo.ltframework" stuff back to "-framework foo"
1.1.1.1.2.3.2  1(misho  9148:4):     compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
                   9149:4):     finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
1.1       misho    9150:        ;;
                   9151:       esac
                   9152: 
                   9153: 
                   9154:       # move library search paths that coincide with paths to not yet
                   9155:       # installed libraries to the beginning of the library search list
                   9156:       new_libs=
                   9157:       for path in $notinst_path; do
                   9158:        case " $new_libs " in
                   9159:        *" -L$path/$objdir "*) ;;
                   9160:        *)
                   9161:          case " $compile_deplibs " in
                   9162:          *" -L$path/$objdir "*)
                   9163:            new_libs="$new_libs -L$path/$objdir" ;;
                   9164:          esac
                   9165:          ;;
                   9166:        esac
                   9167:       done
                   9168:       for deplib in $compile_deplibs; do
                   9169:        case $deplib in
                   9170:        -L*)
                   9171:          case " $new_libs " in
                   9172:          *" $deplib "*) ;;
                   9173:          *) new_libs="$new_libs $deplib" ;;
                   9174:          esac
                   9175:          ;;
                   9176:        *) new_libs="$new_libs $deplib" ;;
                   9177:        esac
                   9178:       done
                   9179:       compile_deplibs="$new_libs"
                   9180: 
                   9181: 
                   9182:       compile_command="$compile_command $compile_deplibs"
                   9183:       finalize_command="$finalize_command $finalize_deplibs"
                   9184: 
                   9185:       if test -n "$rpath$xrpath"; then
                   9186:        # If the user specified any rpath flags, then add them.
                   9187:        for libdir in $rpath $xrpath; do
                   9188:          # This is the magic to use -rpath.
                   9189:          case "$finalize_rpath " in
                   9190:          *" $libdir "*) ;;
                   9191:          *) finalize_rpath="$finalize_rpath $libdir" ;;
                   9192:          esac
                   9193:        done
                   9194:       fi
                   9195: 
                   9196:       # Now hardcode the library paths
                   9197:       rpath=
                   9198:       hardcode_libdirs=
                   9199:       for libdir in $compile_rpath $finalize_rpath; do
                   9200:        if test -n "$hardcode_libdir_flag_spec"; then
                   9201:          if test -n "$hardcode_libdir_separator"; then
                   9202:            if test -z "$hardcode_libdirs"; then
                   9203:              hardcode_libdirs="$libdir"
                   9204:            else
                   9205:              # Just accumulate the unique libdirs.
                   9206:              case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
                   9207:              *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
                   9208:                ;;
                   9209:              *)
                   9210:                hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
                   9211:                ;;
                   9212:              esac
                   9213:            fi
                   9214:          else
                   9215:            eval flag=\"$hardcode_libdir_flag_spec\"
                   9216:            rpath="$rpath $flag"
                   9217:          fi
                   9218:        elif test -n "$runpath_var"; then
                   9219:          case "$perm_rpath " in
                   9220:          *" $libdir "*) ;;
                   9221:          *) perm_rpath="$perm_rpath $libdir" ;;
                   9222:          esac
                   9223:        fi
                   9224:        case $host in
                   9225:        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
                   9226:          testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
                   9227:          case :$dllsearchpath: in
                   9228:          *":$libdir:"*) ;;
                   9229:          ::) dllsearchpath=$libdir;;
                   9230:          *) dllsearchpath="$dllsearchpath:$libdir";;
                   9231:          esac
                   9232:          case :$dllsearchpath: in
                   9233:          *":$testbindir:"*) ;;
                   9234:          ::) dllsearchpath=$testbindir;;
                   9235:          *) dllsearchpath="$dllsearchpath:$testbindir";;
                   9236:          esac
                   9237:          ;;
                   9238:        esac
                   9239:       done
                   9240:       # Substitute the hardcoded libdirs into the rpath.
                   9241:       if test -n "$hardcode_libdir_separator" &&
                   9242:         test -n "$hardcode_libdirs"; then
                   9243:        libdir="$hardcode_libdirs"
                   9244:        eval rpath=\" $hardcode_libdir_flag_spec\"
                   9245:       fi
                   9246:       compile_rpath="$rpath"
                   9247: 
                   9248:       rpath=
                   9249:       hardcode_libdirs=
                   9250:       for libdir in $finalize_rpath; do
                   9251:        if test -n "$hardcode_libdir_flag_spec"; then
                   9252:          if test -n "$hardcode_libdir_separator"; then
                   9253:            if test -z "$hardcode_libdirs"; then
                   9254:              hardcode_libdirs="$libdir"
                   9255:            else
                   9256:              # Just accumulate the unique libdirs.
                   9257:              case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
                   9258:              *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
                   9259:                ;;
                   9260:              *)
                   9261:                hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
                   9262:                ;;
                   9263:              esac
                   9264:            fi
                   9265:          else
                   9266:            eval flag=\"$hardcode_libdir_flag_spec\"
                   9267:            rpath="$rpath $flag"
                   9268:          fi
                   9269:        elif test -n "$runpath_var"; then
                   9270:          case "$finalize_perm_rpath " in
                   9271:          *" $libdir "*) ;;
                   9272:          *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
                   9273:          esac
                   9274:        fi
                   9275:       done
                   9276:       # Substitute the hardcoded libdirs into the rpath.
                   9277:       if test -n "$hardcode_libdir_separator" &&
                   9278:         test -n "$hardcode_libdirs"; then
                   9279:        libdir="$hardcode_libdirs"
                   9280:        eval rpath=\" $hardcode_libdir_flag_spec\"
                   9281:       fi
                   9282:       finalize_rpath="$rpath"
                   9283: 
                   9284:       if test -n "$libobjs" && test "$build_old_libs" = yes; then
                   9285:        # Transform all the library objects into standard objects.
1.1.1.1.2.3.2  1(misho  9286:4):     compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
                   9287:4):     finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
1.1       misho    9288:       fi
                   9289: 
                   9290:       func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
                   9291: 
                   9292:       # template prelinking step
                   9293:       if test -n "$prelink_cmds"; then
                   9294:        func_execute_cmds "$prelink_cmds" 'exit $?'
                   9295:       fi
                   9296: 
                   9297:       wrappers_required=yes
                   9298:       case $host in
1.1.1.1.2.3.2  1(misho  9299:4):       *cegcc* | *mingw32ce*)
                   9300:4):         # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
                   9301:4):         wrappers_required=no
                   9302:4):         ;;
1.1       misho    9303:       *cygwin* | *mingw* )
                   9304:         if test "$build_libtool_libs" != yes; then
                   9305:           wrappers_required=no
                   9306:         fi
                   9307:         ;;
                   9308:       *)
                   9309:         if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
                   9310:           wrappers_required=no
                   9311:         fi
                   9312:         ;;
                   9313:       esac
                   9314:       if test "$wrappers_required" = no; then
                   9315:        # Replace the output file specification.
1.1.1.1.2.3.2  1(misho  9316:4):     compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
1.1       misho    9317:        link_command="$compile_command$compile_rpath"
                   9318: 
                   9319:        # We have no uninstalled library dependencies, so finalize right now.
                   9320:        exit_status=0
                   9321:        func_show_eval "$link_command" 'exit_status=$?'
                   9322: 
1.1.1.1.2.3.2  1(misho  9323:4):     if test -n "$postlink_cmds"; then
                   9324:4):       func_to_tool_file "$output"
                   9325:4):       postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
                   9326:4):       func_execute_cmds "$postlink_cmds" 'exit $?'
                   9327:4):     fi
                   9328:4): 
1.1       misho    9329:        # Delete the generated files.
                   9330:        if test -f "$output_objdir/${outputname}S.${objext}"; then
                   9331:          func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
                   9332:        fi
                   9333: 
                   9334:        exit $exit_status
                   9335:       fi
                   9336: 
                   9337:       if test -n "$compile_shlibpath$finalize_shlibpath"; then
                   9338:        compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
                   9339:       fi
                   9340:       if test -n "$finalize_shlibpath"; then
                   9341:        finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
                   9342:       fi
                   9343: 
                   9344:       compile_var=
                   9345:       finalize_var=
                   9346:       if test -n "$runpath_var"; then
                   9347:        if test -n "$perm_rpath"; then
                   9348:          # We should set the runpath_var.
                   9349:          rpath=
                   9350:          for dir in $perm_rpath; do
                   9351:            rpath="$rpath$dir:"
                   9352:          done
                   9353:          compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
                   9354:        fi
                   9355:        if test -n "$finalize_perm_rpath"; then
                   9356:          # We should set the runpath_var.
                   9357:          rpath=
                   9358:          for dir in $finalize_perm_rpath; do
                   9359:            rpath="$rpath$dir:"
                   9360:          done
                   9361:          finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
                   9362:        fi
                   9363:       fi
                   9364: 
                   9365:       if test "$no_install" = yes; then
                   9366:        # We don't need to create a wrapper script.
                   9367:        link_command="$compile_var$compile_command$compile_rpath"
                   9368:        # Replace the output file specification.
1.1.1.1.2.3.2  1(misho  9369:4):     link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
1.1       misho    9370:        # Delete the old output file.
                   9371:        $opt_dry_run || $RM $output
                   9372:        # Link the executable and exit
                   9373:        func_show_eval "$link_command" 'exit $?'
1.1.1.1.2.3.2  1(misho  9374:4): 
                   9375:4):     if test -n "$postlink_cmds"; then
                   9376:4):       func_to_tool_file "$output"
                   9377:4):       postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
                   9378:4):       func_execute_cmds "$postlink_cmds" 'exit $?'
                   9379:4):     fi
                   9380:4): 
1.1       misho    9381:        exit $EXIT_SUCCESS
                   9382:       fi
                   9383: 
                   9384:       if test "$hardcode_action" = relink; then
                   9385:        # Fast installation is not supported
                   9386:        link_command="$compile_var$compile_command$compile_rpath"
                   9387:        relink_command="$finalize_var$finalize_command$finalize_rpath"
                   9388: 
                   9389:        func_warning "this platform does not like uninstalled shared libraries"
                   9390:        func_warning "\`$output' will be relinked during installation"
                   9391:       else
                   9392:        if test "$fast_install" != no; then
                   9393:          link_command="$finalize_var$compile_command$finalize_rpath"
                   9394:          if test "$fast_install" = yes; then
1.1.1.1.2.3.2  1(misho  9395:4):         relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
1.1       misho    9396:          else
                   9397:            # fast_install is set to needless
                   9398:            relink_command=
                   9399:          fi
                   9400:        else
                   9401:          link_command="$compile_var$compile_command$compile_rpath"
                   9402:          relink_command="$finalize_var$finalize_command$finalize_rpath"
                   9403:        fi
                   9404:       fi
                   9405: 
                   9406:       # Replace the output file specification.
1.1.1.1.2.3.2  1(misho  9407:4):       link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
1.1       misho    9408: 
                   9409:       # Delete the old output files.
                   9410:       $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
                   9411: 
                   9412:       func_show_eval "$link_command" 'exit $?'
                   9413: 
1.1.1.1.2.3.2  1(misho  9414:4):       if test -n "$postlink_cmds"; then
                   9415:4):     func_to_tool_file "$output_objdir/$outputname"
                   9416:4):     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'`
                   9417:4):     func_execute_cmds "$postlink_cmds" 'exit $?'
                   9418:4):       fi
                   9419:4): 
1.1       misho    9420:       # Now create the wrapper script.
                   9421:       func_verbose "creating $output"
                   9422: 
                   9423:       # Quote the relink command for shipping.
                   9424:       if test -n "$relink_command"; then
                   9425:        # Preserve any variables that may affect compiler behavior
                   9426:        for var in $variables_saved_for_relink; do
                   9427:          if eval test -z \"\${$var+set}\"; then
                   9428:            relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
                   9429:          elif eval var_value=\$$var; test -z "$var_value"; then
                   9430:            relink_command="$var=; export $var; $relink_command"
                   9431:          else
                   9432:            func_quote_for_eval "$var_value"
                   9433:            relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
                   9434:          fi
                   9435:        done
                   9436:        relink_command="(cd `pwd`; $relink_command)"
1.1.1.1.2.3.2  1(misho  9437:4):     relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
1.1       misho    9438:       fi
                   9439: 
                   9440:       # Only actually do things if not in dry run mode.
                   9441:       $opt_dry_run || {
                   9442:        # win32 will think the script is a binary if it has
                   9443:        # a .exe suffix, so we strip it off here.
                   9444:        case $output in
                   9445:          *.exe) func_stripname '' '.exe' "$output"
                   9446:                 output=$func_stripname_result ;;
                   9447:        esac
                   9448:        # test for cygwin because mv fails w/o .exe extensions
                   9449:        case $host in
                   9450:          *cygwin*)
                   9451:            exeext=.exe
                   9452:            func_stripname '' '.exe' "$outputname"
                   9453:            outputname=$func_stripname_result ;;
                   9454:          *) exeext= ;;
                   9455:        esac
                   9456:        case $host in
                   9457:          *cygwin* | *mingw* )
                   9458:            func_dirname_and_basename "$output" "" "."
                   9459:            output_name=$func_basename_result
                   9460:            output_path=$func_dirname_result
                   9461:            cwrappersource="$output_path/$objdir/lt-$output_name.c"
                   9462:            cwrapper="$output_path/$output_name.exe"
                   9463:            $RM $cwrappersource $cwrapper
                   9464:            trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
                   9465: 
                   9466:            func_emit_cwrapperexe_src > $cwrappersource
                   9467: 
                   9468:            # The wrapper executable is built using the $host compiler,
                   9469:            # because it contains $host paths and files. If cross-
                   9470:            # compiling, it, like the target executable, must be
                   9471:            # executed on the $host or under an emulation environment.
                   9472:            $opt_dry_run || {
                   9473:              $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
                   9474:              $STRIP $cwrapper
                   9475:            }
                   9476: 
                   9477:            # Now, create the wrapper script for func_source use:
                   9478:            func_ltwrapper_scriptname $cwrapper
                   9479:            $RM $func_ltwrapper_scriptname_result
                   9480:            trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
                   9481:            $opt_dry_run || {
                   9482:              # note: this script will not be executed, so do not chmod.
                   9483:              if test "x$build" = "x$host" ; then
                   9484:                $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
                   9485:              else
                   9486:                func_emit_wrapper no > $func_ltwrapper_scriptname_result
                   9487:              fi
                   9488:            }
                   9489:          ;;
                   9490:          * )
                   9491:            $RM $output
                   9492:            trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
                   9493: 
                   9494:            func_emit_wrapper no > $output
                   9495:            chmod +x $output
                   9496:          ;;
                   9497:        esac
                   9498:       }
                   9499:       exit $EXIT_SUCCESS
                   9500:       ;;
                   9501:     esac
                   9502: 
                   9503:     # See if we need to build an old-fashioned archive.
                   9504:     for oldlib in $oldlibs; do
                   9505: 
                   9506:       if test "$build_libtool_libs" = convenience; then
                   9507:        oldobjs="$libobjs_save $symfileobj"
                   9508:        addlibs="$convenience"
                   9509:        build_libtool_libs=no
                   9510:       else
                   9511:        if test "$build_libtool_libs" = module; then
                   9512:          oldobjs="$libobjs_save"
                   9513:          build_libtool_libs=no
                   9514:        else
                   9515:          oldobjs="$old_deplibs $non_pic_objects"
                   9516:          if test "$preload" = yes && test -f "$symfileobj"; then
                   9517:            oldobjs="$oldobjs $symfileobj"
                   9518:          fi
                   9519:        fi
                   9520:        addlibs="$old_convenience"
                   9521:       fi
                   9522: 
                   9523:       if test -n "$addlibs"; then
                   9524:        gentop="$output_objdir/${outputname}x"
                   9525:        generated="$generated $gentop"
                   9526: 
                   9527:        func_extract_archives $gentop $addlibs
                   9528:        oldobjs="$oldobjs $func_extract_archives_result"
                   9529:       fi
                   9530: 
                   9531:       # Do each command in the archive commands.
                   9532:       if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
                   9533:        cmds=$old_archive_from_new_cmds
                   9534:       else
                   9535: 
                   9536:        # Add any objects from preloaded convenience libraries
                   9537:        if test -n "$dlprefiles"; then
                   9538:          gentop="$output_objdir/${outputname}x"
                   9539:          generated="$generated $gentop"
                   9540: 
                   9541:          func_extract_archives $gentop $dlprefiles
                   9542:          oldobjs="$oldobjs $func_extract_archives_result"
                   9543:        fi
                   9544: 
                   9545:        # POSIX demands no paths to be encoded in archives.  We have
                   9546:        # to avoid creating archives with duplicate basenames if we
                   9547:        # might have to extract them afterwards, e.g., when creating a
                   9548:        # static archive out of a convenience library, or when linking
                   9549:        # the entirety of a libtool archive into another (currently
                   9550:        # not supported by libtool).
                   9551:        if (for obj in $oldobjs
                   9552:            do
                   9553:              func_basename "$obj"
                   9554:              $ECHO "$func_basename_result"
                   9555:            done | sort | sort -uc >/dev/null 2>&1); then
                   9556:          :
                   9557:        else
1.1.1.1.2.3.2  1(misho  9558:4):       echo "copying selected object files to avoid basename conflicts..."
1.1       misho    9559:          gentop="$output_objdir/${outputname}x"
                   9560:          generated="$generated $gentop"
                   9561:          func_mkdir_p "$gentop"
                   9562:          save_oldobjs=$oldobjs
                   9563:          oldobjs=
                   9564:          counter=1
                   9565:          for obj in $save_oldobjs
                   9566:          do
                   9567:            func_basename "$obj"
                   9568:            objbase="$func_basename_result"
                   9569:            case " $oldobjs " in
                   9570:            " ") oldobjs=$obj ;;
                   9571:            *[\ /]"$objbase "*)
                   9572:              while :; do
                   9573:                # Make sure we don't pick an alternate name that also
                   9574:                # overlaps.
                   9575:                newobj=lt$counter-$objbase
                   9576:                func_arith $counter + 1
                   9577:                counter=$func_arith_result
                   9578:                case " $oldobjs " in
                   9579:                *[\ /]"$newobj "*) ;;
                   9580:                *) if test ! -f "$gentop/$newobj"; then break; fi ;;
                   9581:                esac
                   9582:              done
                   9583:              func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
                   9584:              oldobjs="$oldobjs $gentop/$newobj"
                   9585:              ;;
                   9586:            *) oldobjs="$oldobjs $obj" ;;
                   9587:            esac
                   9588:          done
                   9589:        fi
1.1.1.1.2.3.2  1(misho  9590:4):     func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
                   9591:4):     tool_oldlib=$func_to_tool_file_result
1.1       misho    9592:        eval cmds=\"$old_archive_cmds\"
                   9593: 
                   9594:        func_len " $cmds"
                   9595:        len=$func_len_result
                   9596:        if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
                   9597:          cmds=$old_archive_cmds
1.1.1.1.2.3.2  1(misho  9598:4):     elif test -n "$archiver_list_spec"; then
                   9599:4):       func_verbose "using command file archive linking..."
                   9600:4):       for obj in $oldobjs
                   9601:4):       do
                   9602:4):         func_to_tool_file "$obj"
                   9603:4):         $ECHO "$func_to_tool_file_result"
                   9604:4):       done > $output_objdir/$libname.libcmd
                   9605:4):       func_to_tool_file "$output_objdir/$libname.libcmd"
                   9606:4):       oldobjs=" $archiver_list_spec$func_to_tool_file_result"
                   9607:4):       cmds=$old_archive_cmds
1.1       misho    9608:        else
                   9609:          # the command line is too long to link in one step, link in parts
                   9610:          func_verbose "using piecewise archive linking..."
                   9611:          save_RANLIB=$RANLIB
                   9612:          RANLIB=:
                   9613:          objlist=
                   9614:          concat_cmds=
                   9615:          save_oldobjs=$oldobjs
                   9616:          oldobjs=
                   9617:          # Is there a better way of finding the last object in the list?
                   9618:          for obj in $save_oldobjs
                   9619:          do
                   9620:            last_oldobj=$obj
                   9621:          done
                   9622:          eval test_cmds=\"$old_archive_cmds\"
                   9623:          func_len " $test_cmds"
                   9624:          len0=$func_len_result
                   9625:          len=$len0
                   9626:          for obj in $save_oldobjs
                   9627:          do
                   9628:            func_len " $obj"
                   9629:            func_arith $len + $func_len_result
                   9630:            len=$func_arith_result
1.1.1.1.2.3.2  1(misho  9631:4):         objlist="$objlist $obj"
1.1       misho    9632:            if test "$len" -lt "$max_cmd_len"; then
                   9633:              :
                   9634:            else
                   9635:              # the above command should be used before it gets too long
                   9636:              oldobjs=$objlist
                   9637:              if test "$obj" = "$last_oldobj" ; then
                   9638:                RANLIB=$save_RANLIB
                   9639:              fi
                   9640:              test -z "$concat_cmds" || concat_cmds=$concat_cmds~
                   9641:              eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
                   9642:              objlist=
                   9643:              len=$len0
                   9644:            fi
                   9645:          done
                   9646:          RANLIB=$save_RANLIB
                   9647:          oldobjs=$objlist
                   9648:          if test "X$oldobjs" = "X" ; then
                   9649:            eval cmds=\"\$concat_cmds\"
                   9650:          else
                   9651:            eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
                   9652:          fi
                   9653:        fi
                   9654:       fi
                   9655:       func_execute_cmds "$cmds" 'exit $?'
                   9656:     done
                   9657: 
                   9658:     test -n "$generated" && \
                   9659:       func_show_eval "${RM}r$generated"
                   9660: 
                   9661:     # Now create the libtool archive.
                   9662:     case $output in
                   9663:     *.la)
                   9664:       old_library=
                   9665:       test "$build_old_libs" = yes && old_library="$libname.$libext"
                   9666:       func_verbose "creating $output"
                   9667: 
                   9668:       # Preserve any variables that may affect compiler behavior
                   9669:       for var in $variables_saved_for_relink; do
                   9670:        if eval test -z \"\${$var+set}\"; then
                   9671:          relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
                   9672:        elif eval var_value=\$$var; test -z "$var_value"; then
                   9673:          relink_command="$var=; export $var; $relink_command"
                   9674:        else
                   9675:          func_quote_for_eval "$var_value"
                   9676:          relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
                   9677:        fi
                   9678:       done
                   9679:       # Quote the link command for shipping.
                   9680:       relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
1.1.1.1.2.3.2  1(misho  9681:4):       relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
1.1       misho    9682:       if test "$hardcode_automatic" = yes ; then
                   9683:        relink_command=
                   9684:       fi
                   9685: 
                   9686:       # Only create the output if not a dry run.
                   9687:       $opt_dry_run || {
                   9688:        for installed in no yes; do
                   9689:          if test "$installed" = yes; then
                   9690:            if test -z "$install_libdir"; then
                   9691:              break
                   9692:            fi
                   9693:            output="$output_objdir/$outputname"i
                   9694:            # Replace all uninstalled libtool libraries with the installed ones
                   9695:            newdependency_libs=
                   9696:            for deplib in $dependency_libs; do
                   9697:              case $deplib in
                   9698:              *.la)
                   9699:                func_basename "$deplib"
                   9700:                name="$func_basename_result"
1.1.1.1.2.3.2  1(misho  9701:4):             func_resolve_sysroot "$deplib"
                   9702:4):             eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
1.1       misho    9703:                test -z "$libdir" && \
                   9704:                  func_fatal_error "\`$deplib' is not a valid libtool archive"
1.1.1.1.2.3.2  1(misho  9705:4):             newdependency_libs="$newdependency_libs ${lt_sysroot:+=}$libdir/$name"
                   9706:4):             ;;
                   9707:4):           -L*)
                   9708:4):             func_stripname -L '' "$deplib"
                   9709:4):             func_replace_sysroot "$func_stripname_result"
                   9710:4):             newdependency_libs="$newdependency_libs -L$func_replace_sysroot_result"
                   9711:4):             ;;
                   9712:4):           -R*)
                   9713:4):             func_stripname -R '' "$deplib"
                   9714:4):             func_replace_sysroot "$func_stripname_result"
                   9715:4):             newdependency_libs="$newdependency_libs -R$func_replace_sysroot_result"
1.1       misho    9716:                ;;
                   9717:              *) newdependency_libs="$newdependency_libs $deplib" ;;
                   9718:              esac
                   9719:            done
                   9720:            dependency_libs="$newdependency_libs"
                   9721:            newdlfiles=
                   9722: 
                   9723:            for lib in $dlfiles; do
                   9724:              case $lib in
                   9725:              *.la)
                   9726:                func_basename "$lib"
                   9727:                name="$func_basename_result"
                   9728:                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
                   9729:                test -z "$libdir" && \
                   9730:                  func_fatal_error "\`$lib' is not a valid libtool archive"
1.1.1.1.2.3.2  1(misho  9731:4):             newdlfiles="$newdlfiles ${lt_sysroot:+=}$libdir/$name"
1.1       misho    9732:                ;;
                   9733:              *) newdlfiles="$newdlfiles $lib" ;;
                   9734:              esac
                   9735:            done
                   9736:            dlfiles="$newdlfiles"
                   9737:            newdlprefiles=
                   9738:            for lib in $dlprefiles; do
                   9739:              case $lib in
                   9740:              *.la)
                   9741:                # Only pass preopened files to the pseudo-archive (for
                   9742:                # eventual linking with the app. that links it) if we
                   9743:                # didn't already link the preopened objects directly into
                   9744:                # the library:
                   9745:                func_basename "$lib"
                   9746:                name="$func_basename_result"
                   9747:                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
                   9748:                test -z "$libdir" && \
                   9749:                  func_fatal_error "\`$lib' is not a valid libtool archive"
1.1.1.1.2.3.2  1(misho  9750:4):             newdlprefiles="$newdlprefiles ${lt_sysroot:+=}$libdir/$name"
1.1       misho    9751:                ;;
                   9752:              esac
                   9753:            done
                   9754:            dlprefiles="$newdlprefiles"
                   9755:          else
                   9756:            newdlfiles=
                   9757:            for lib in $dlfiles; do
                   9758:              case $lib in
                   9759:                [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
                   9760:                *) abs=`pwd`"/$lib" ;;
                   9761:              esac
                   9762:              newdlfiles="$newdlfiles $abs"
                   9763:            done
                   9764:            dlfiles="$newdlfiles"
                   9765:            newdlprefiles=
                   9766:            for lib in $dlprefiles; do
                   9767:              case $lib in
                   9768:                [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
                   9769:                *) abs=`pwd`"/$lib" ;;
                   9770:              esac
                   9771:              newdlprefiles="$newdlprefiles $abs"
                   9772:            done
                   9773:            dlprefiles="$newdlprefiles"
                   9774:          fi
                   9775:          $RM $output
                   9776:          # place dlname in correct position for cygwin
1.1.1.1.2.3.2  1(misho  9777:4):       # In fact, it would be nice if we could use this code for all target
                   9778:4):       # systems that can't hard-code library paths into their executables
                   9779:4):       # and that have no shared library path variable independent of PATH,
                   9780:4):       # but it turns out we can't easily determine that from inspecting
                   9781:4):       # libtool variables, so we have to hard-code the OSs to which it
                   9782:4):       # applies here; at the moment, that means platforms that use the PE
                   9783:4):       # object format with DLL files.  See the long comment at the top of
                   9784:4):       # tests/bindir.at for full details.
1.1       misho    9785:          tdlname=$dlname
                   9786:          case $host,$output,$installed,$module,$dlname in
1.1.1.1.2.3.2  1(misho  9787:4):         *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
                   9788:4):           # If a -bindir argument was supplied, place the dll there.
                   9789:4):           if test "x$bindir" != x ;
                   9790:4):           then
                   9791:4):             func_relative_path "$install_libdir" "$bindir"
                   9792:4):             tdlname=$func_relative_path_result$dlname
                   9793:4):           else
                   9794:4):             # Otherwise fall back on heuristic.
                   9795:4):             tdlname=../bin/$dlname
                   9796:4):           fi
                   9797:4):           ;;
1.1       misho    9798:          esac
                   9799:          $ECHO > $output "\
                   9800: # $outputname - a libtool library file
                   9801: # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
                   9802: #
                   9803: # Please DO NOT delete this file!
                   9804: # It is necessary for linking the library.
                   9805: 
                   9806: # The name that we can dlopen(3).
                   9807: dlname='$tdlname'
                   9808: 
                   9809: # Names of this library.
                   9810: library_names='$library_names'
                   9811: 
                   9812: # The name of the static archive.
                   9813: old_library='$old_library'
                   9814: 
                   9815: # Linker flags that can not go in dependency_libs.
                   9816: inherited_linker_flags='$new_inherited_linker_flags'
                   9817: 
                   9818: # Libraries that this one depends upon.
                   9819: dependency_libs='$dependency_libs'
                   9820: 
                   9821: # Names of additional weak libraries provided by this library
                   9822: weak_library_names='$weak_libs'
                   9823: 
                   9824: # Version information for $libname.
                   9825: current=$current
                   9826: age=$age
                   9827: revision=$revision
                   9828: 
                   9829: # Is this an already installed library?
                   9830: installed=$installed
                   9831: 
                   9832: # Should we warn about portability when linking against -modules?
                   9833: shouldnotlink=$module
                   9834: 
                   9835: # Files to dlopen/dlpreopen
                   9836: dlopen='$dlfiles'
                   9837: dlpreopen='$dlprefiles'
                   9838: 
                   9839: # Directory that this library needs to be installed in:
                   9840: libdir='$install_libdir'"
                   9841:          if test "$installed" = no && test "$need_relink" = yes; then
                   9842:            $ECHO >> $output "\
                   9843: relink_command=\"$relink_command\""
                   9844:          fi
                   9845:        done
                   9846:       }
                   9847: 
                   9848:       # Do a symbolic link so that the libtool archive can be found in
                   9849:       # LD_LIBRARY_PATH before the program is installed.
                   9850:       func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
                   9851:       ;;
                   9852:     esac
                   9853:     exit $EXIT_SUCCESS
                   9854: }
                   9855: 
1.1.1.1.2.3.2  1(misho  9856:4): { test "$opt_mode" = link || test "$opt_mode" = relink; } &&
1.1       misho    9857:     func_mode_link ${1+"$@"}
                   9858: 
                   9859: 
                   9860: # func_mode_uninstall arg...
                   9861: func_mode_uninstall ()
                   9862: {
                   9863:     $opt_debug
                   9864:     RM="$nonopt"
                   9865:     files=
                   9866:     rmforce=
                   9867:     exit_status=0
                   9868: 
                   9869:     # This variable tells wrapper scripts just to set variables rather
                   9870:     # than running their programs.
                   9871:     libtool_install_magic="$magic"
                   9872: 
                   9873:     for arg
                   9874:     do
                   9875:       case $arg in
                   9876:       -f) RM="$RM $arg"; rmforce=yes ;;
                   9877:       -*) RM="$RM $arg" ;;
                   9878:       *) files="$files $arg" ;;
                   9879:       esac
                   9880:     done
                   9881: 
                   9882:     test -z "$RM" && \
                   9883:       func_fatal_help "you must specify an RM program"
                   9884: 
                   9885:     rmdirs=
                   9886: 
                   9887:     for file in $files; do
                   9888:       func_dirname "$file" "" "."
                   9889:       dir="$func_dirname_result"
                   9890:       if test "X$dir" = X.; then
1.1.1.1.2.3.2  1(misho  9891:4):     odir="$objdir"
1.1       misho    9892:       else
1.1.1.1.2.3.2  1(misho  9893:4):     odir="$dir/$objdir"
1.1       misho    9894:       fi
                   9895:       func_basename "$file"
                   9896:       name="$func_basename_result"
1.1.1.1.2.3.2  1(misho  9897:4):       test "$opt_mode" = uninstall && odir="$dir"
1.1       misho    9898: 
1.1.1.1.2.3.2  1(misho  9899:4):       # Remember odir for removal later, being careful to avoid duplicates
                   9900:4):       if test "$opt_mode" = clean; then
1.1       misho    9901:        case " $rmdirs " in
1.1.1.1.2.3.2  1(misho  9902:4):       *" $odir "*) ;;
                   9903:4):       *) rmdirs="$rmdirs $odir" ;;
1.1       misho    9904:        esac
                   9905:       fi
                   9906: 
                   9907:       # Don't error if the file doesn't exist and rm -f was used.
                   9908:       if { test -L "$file"; } >/dev/null 2>&1 ||
                   9909:         { test -h "$file"; } >/dev/null 2>&1 ||
                   9910:         test -f "$file"; then
                   9911:        :
                   9912:       elif test -d "$file"; then
                   9913:        exit_status=1
                   9914:        continue
                   9915:       elif test "$rmforce" = yes; then
                   9916:        continue
                   9917:       fi
                   9918: 
                   9919:       rmfiles="$file"
                   9920: 
                   9921:       case $name in
                   9922:       *.la)
                   9923:        # Possibly a libtool archive, so verify it.
                   9924:        if func_lalib_p "$file"; then
                   9925:          func_source $dir/$name
                   9926: 
                   9927:          # Delete the libtool libraries and symlinks.
                   9928:          for n in $library_names; do
1.1.1.1.2.3.2  1(misho  9929:4):         rmfiles="$rmfiles $odir/$n"
1.1       misho    9930:          done
1.1.1.1.2.3.2  1(misho  9931:4):       test -n "$old_library" && rmfiles="$rmfiles $odir/$old_library"
1.1       misho    9932: 
1.1.1.1.2.3.2  1(misho  9933:4):       case "$opt_mode" in
1.1       misho    9934:          clean)
1.1.1.1.2.3.2  1(misho  9935:4):         case " $library_names " in
1.1       misho    9936:            *" $dlname "*) ;;
1.1.1.1.2.3.2  1(misho  9937:4):         *) test -n "$dlname" && rmfiles="$rmfiles $odir/$dlname" ;;
1.1       misho    9938:            esac
1.1.1.1.2.3.2  1(misho  9939:4):         test -n "$libdir" && rmfiles="$rmfiles $odir/$name $odir/${name}i"
1.1       misho    9940:            ;;
                   9941:          uninstall)
                   9942:            if test -n "$library_names"; then
                   9943:              # Do each command in the postuninstall commands.
                   9944:              func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
                   9945:            fi
                   9946: 
                   9947:            if test -n "$old_library"; then
                   9948:              # Do each command in the old_postuninstall commands.
                   9949:              func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
                   9950:            fi
                   9951:            # FIXME: should reinstall the best remaining shared library.
                   9952:            ;;
                   9953:          esac
                   9954:        fi
                   9955:        ;;
                   9956: 
                   9957:       *.lo)
                   9958:        # Possibly a libtool object, so verify it.
                   9959:        if func_lalib_p "$file"; then
                   9960: 
                   9961:          # Read the .lo file
                   9962:          func_source $dir/$name
                   9963: 
                   9964:          # Add PIC object to the list of files to remove.
                   9965:          if test -n "$pic_object" &&
                   9966:             test "$pic_object" != none; then
                   9967:            rmfiles="$rmfiles $dir/$pic_object"
                   9968:          fi
                   9969: 
                   9970:          # Add non-PIC object to the list of files to remove.
                   9971:          if test -n "$non_pic_object" &&
                   9972:             test "$non_pic_object" != none; then
                   9973:            rmfiles="$rmfiles $dir/$non_pic_object"
                   9974:          fi
                   9975:        fi
                   9976:        ;;
                   9977: 
                   9978:       *)
1.1.1.1.2.3.2  1(misho  9979:4):     if test "$opt_mode" = clean ; then
1.1       misho    9980:          noexename=$name
                   9981:          case $file in
                   9982:          *.exe)
                   9983:            func_stripname '' '.exe' "$file"
                   9984:            file=$func_stripname_result
                   9985:            func_stripname '' '.exe' "$name"
                   9986:            noexename=$func_stripname_result
                   9987:            # $file with .exe has already been added to rmfiles,
                   9988:            # add $file without .exe
                   9989:            rmfiles="$rmfiles $file"
                   9990:            ;;
                   9991:          esac
                   9992:          # Do a test to see if this is a libtool program.
                   9993:          if func_ltwrapper_p "$file"; then
                   9994:            if func_ltwrapper_executable_p "$file"; then
                   9995:              func_ltwrapper_scriptname "$file"
                   9996:              relink_command=
                   9997:              func_source $func_ltwrapper_scriptname_result
                   9998:              rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
                   9999:            else
                   10000:              relink_command=
                   10001:              func_source $dir/$noexename
                   10002:            fi
                   10003: 
                   10004:            # note $name still contains .exe if it was in $file originally
                   10005:            # as does the version of $file that was added into $rmfiles
1.1.1.1.2.3.2  1(misho  10006:4):         rmfiles="$rmfiles $odir/$name $odir/${name}S.${objext}"
1.1       misho    10007:            if test "$fast_install" = yes && test -n "$relink_command"; then
1.1.1.1.2.3.2  1(misho  10008:4):           rmfiles="$rmfiles $odir/lt-$name"
1.1       misho    10009:            fi
                   10010:            if test "X$noexename" != "X$name" ; then
1.1.1.1.2.3.2  1(misho  10011:4):           rmfiles="$rmfiles $odir/lt-${noexename}.c"
1.1       misho    10012:            fi
                   10013:          fi
                   10014:        fi
                   10015:        ;;
                   10016:       esac
                   10017:       func_show_eval "$RM $rmfiles" 'exit_status=1'
                   10018:     done
                   10019: 
                   10020:     # Try to remove the ${objdir}s in the directories where we deleted files
                   10021:     for dir in $rmdirs; do
                   10022:       if test -d "$dir"; then
                   10023:        func_show_eval "rmdir $dir >/dev/null 2>&1"
                   10024:       fi
                   10025:     done
                   10026: 
                   10027:     exit $exit_status
                   10028: }
                   10029: 
1.1.1.1.2.3.2  1(misho  10030:4): { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
1.1       misho    10031:     func_mode_uninstall ${1+"$@"}
                   10032: 
1.1.1.1.2.3.2  1(misho  10033:4): test -z "$opt_mode" && {
1.1       misho    10034:   help="$generic_help"
                   10035:   func_fatal_help "you must specify a MODE"
                   10036: }
                   10037: 
                   10038: test -z "$exec_cmd" && \
1.1.1.1.2.3.2  1(misho  10039:4):   func_fatal_help "invalid operation mode \`$opt_mode'"
1.1       misho    10040: 
                   10041: if test -n "$exec_cmd"; then
                   10042:   eval exec "$exec_cmd"
                   10043:   exit $EXIT_FAILURE
                   10044: fi
                   10045: 
                   10046: exit $exit_status
                   10047: 
                   10048: 
                   10049: # The TAGs below are defined such that we never get into a situation
                   10050: # in which we disable both kinds of libraries.  Given conflicting
                   10051: # choices, we go for a static library, that is the most portable,
                   10052: # since we can't tell whether shared libraries were disabled because
                   10053: # the user asked for that or because the platform doesn't support
                   10054: # them.  This is particularly important on AIX, because we don't
                   10055: # support having both static and shared libraries enabled at the same
                   10056: # time on that platform, so we default to a shared-only configuration.
                   10057: # If a disable-shared tag is given, we'll fallback to a static-only
                   10058: # configuration.  But we'll never go from static-only to shared-only.
                   10059: 
                   10060: # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
                   10061: build_libtool_libs=no
                   10062: build_old_libs=yes
                   10063: # ### END LIBTOOL TAG CONFIG: disable-shared
                   10064: 
                   10065: # ### BEGIN LIBTOOL TAG CONFIG: disable-static
                   10066: build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
                   10067: # ### END LIBTOOL TAG CONFIG: disable-static
                   10068: 
                   10069: # Local Variables:
                   10070: # mode:shell-script
                   10071: # sh-indentation:2
                   10072: # End:
                   10073: # vi:sw=2
                   10074: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>