lac : cf3cc51ee72687879e9714a816b3122227fe80d6

     1: #! /bin/sh
     2: # Generated automatically by config.status (lac) 0.1.0
     3: # Libtool was configured on host work:
     4: # NOTE: Changes made to this file will be lost: look at ltmain.sh.
     5: 
     6: # Provide generalized library-building support services.
     7: # Written by Gordon Matzigkeit, 1996
     8: 
     9: # Copyright (C) 2014 Free Software Foundation, Inc.
    10: # This is free software; see the source for copying conditions.  There is NO
    11: # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    12: 
    13: # GNU Libtool is free software; you can redistribute it and/or modify
    14: # it under the terms of the GNU General Public License as published by
    15: # the Free Software Foundation; either version 2 of of the License, or
    16: # (at your option) any later version.
    17: #
    18: # As a special exception to the GNU General Public License, if you
    19: # distribute this file as part of a program or library that is built
    20: # using GNU Libtool, you may include this file under the  same
    21: # distribution terms that you use for the rest of that program.
    22: #
    23: # GNU Libtool is distributed in the hope that it will be useful, but
    24: # WITHOUT ANY WARRANTY; without even the implied warranty of
    25: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    26: # GNU General Public License for more details.
    27: #
    28: # You should have received a copy of the GNU General Public License
    29: # along with this program.  If not, see <http://www.gnu.org/licenses/>.
    30: 
    31: 
    32: # The names of the tagged configurations supported by this script.
    33: available_tags=''
    34: 
    35: # Configured defaults for sys_lib_dlsearch_path munging.
    36: : ${LT_SYS_LIBRARY_PATH=""}
    37: 
    38: # ### BEGIN LIBTOOL CONFIG
    39: 
    40: # Which release of libtool.m4 was used?
    41: macro_version=2.4.6
    42: macro_revision=2.4.6
    43: 
    44: # Whether or not to build shared libraries.
    45: build_libtool_libs=yes
    46: 
    47: # Whether or not to build static libraries.
    48: build_old_libs=yes
    49: 
    50: # What type of objects to build.
    51: pic_mode=default
    52: 
    53: # Whether or not to optimize for fast installation.
    54: fast_install=yes
    55: 
    56: # Shared archive member basename,for filename based shared library versioning on AIX.
    57: shared_archive_member_spec=
    58: 
    59: # Shell to use when invoking shell scripts.
    60: SHELL="/bin/sh"
    61: 
    62: # An echo program that protects backslashes.
    63: ECHO="printf %s\\n"
    64: 
    65: # The PATH separator for the build system.
    66: PATH_SEPARATOR=":"
    67: 
    68: # The host system.
    69: host_alias=
    70: host=x86_64-unknown-linux-gnu
    71: host_os=linux-gnu
    72: 
    73: # The build system.
    74: build_alias=
    75: build=x86_64-unknown-linux-gnu
    76: build_os=linux-gnu
    77: 
    78: # A sed program that does not truncate output.
    79: SED="/usr/bin/sed"
    80: 
    81: # Sed that helps us avoid accidentally triggering echo(1) options like -n.
    82: Xsed="$SED -e 1s/^X//"
    83: 
    84: # A grep program that handles long lines.
    85: GREP="/usr/bin/grep"
    86: 
    87: # An ERE matcher.
    88: EGREP="/usr/bin/grep -E"
    89: 
    90: # A literal string matcher.
    91: FGREP="/usr/bin/grep -F"
    92: 
    93: # A BSD- or MS-compatible name lister.
    94: NM="/usr/bin/nm -B"
    95: 
    96: # Whether we need soft or hard links.
    97: LN_S="ln -s"
    98: 
    99: # What is the maximum length of a command?
   100: max_cmd_len=1572864
   101: 
   102: # Object file suffix (normally "o").
   103: objext=o
   104: 
   105: # Executable file suffix (normally "").
   106: exeext=
   107: 
   108: # whether the shell understands "unset".
   109: lt_unset=unset
   110: 
   111: # turn spaces into newlines.
   112: SP2NL="tr \\040 \\012"
   113: 
   114: # turn newlines into spaces.
   115: NL2SP="tr \\015\\012 \\040\\040"
   116: 
   117: # convert $build file names to $host format.
   118: to_host_file_cmd=func_convert_file_noop
   119: 
   120: # convert $build files to toolchain format.
   121: to_tool_file_cmd=func_convert_file_noop
   122: 
   123: # An object symbol dumper.
   124: OBJDUMP="objdump"
   125: 
   126: # Method to check whether dependent libraries are shared objects.
   127: deplibs_check_method="pass_all"
   128: 
   129: # Command to use when deplibs_check_method = "file_magic".
   130: file_magic_cmd="\$MAGIC_CMD"
   131: 
   132: # How to find potential files when deplibs_check_method = "file_magic".
   133: file_magic_glob=""
   134: 
   135: # Find potential files using nocaseglob when deplibs_check_method = "file_magic".
   136: want_nocaseglob="no"
   137: 
   138: # DLL creation program.
   139: DLLTOOL="false"
   140: 
   141: # Command to associate shared and link libraries.
   142: sharedlib_from_linklib_cmd="printf %s\\n"
   143: 
   144: # The archiver.
   145: AR="ar"
   146: 
   147: # Flags to create an archive.
   148: AR_FLAGS="cru"
   149: 
   150: # How to feed a file listing to the archiver.
   151: archiver_list_spec="@"
   152: 
   153: # A symbol stripping program.
   154: STRIP="strip"
   155: 
   156: # Commands used to install an old-style archive.
   157: RANLIB="ranlib"
   158: old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$tool_oldlib"
   159: old_postuninstall_cmds=""
   160: 
   161: # Whether to use a lock for old archive extraction.
   162: lock_old_archive_extraction=no
   163: 
   164: # A C compiler.
   165: LTCC="gcc"
   166: 
   167: # LTCC compiler flags.
   168: LTCFLAGS="-g -O2"
   169: 
   170: # Take the output of nm and produce a listing of raw symbols and C names.
   171: global_symbol_pipe="sed -n -e 's/^.*[	 ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[	 ][	 ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p' | sed '/ __gnu_lto/d'"
   172: 
   173: # Transform the output of nm in a proper C declaration.
   174: global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'"
   175: 
   176: # Transform the output of nm into a list of symbols to manually relocate.
   177: global_symbol_to_import=""
   178: 
   179: # Transform the output of nm in a C name address pair.
   180: global_symbol_to_c_name_address="sed -n -e 's/^: \\(.*\\) .*\$/  {\"\\1\", (void *) 0},/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(.*\\)\$/  {\"\\1\", (void *) \\&\\1},/p'"
   181: 
   182: # Transform the output of nm in a C name address pair when lib prefix is needed.
   183: global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\(.*\\) .*\$/  {\"\\1\", (void *) 0},/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(lib.*\\)\$/  {\"\\1\", (void *) \\&\\1},/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(.*\\)\$/  {\"lib\\1\", (void *) \\&\\1},/p'"
   184: 
   185: # The name lister interface.
   186: nm_interface="BSD nm"
   187: 
   188: # Specify filename containing input files for $NM.
   189: nm_file_list_spec="@"
   190: 
   191: # The root where to search for dependent libraries,and where our libraries should be installed.
   192: lt_sysroot=
   193: 
   194: # Command to truncate a binary pipe.
   195: lt_truncate_bin="/usr/bin/dd bs=4096 count=1"
   196: 
   197: # The name of the directory that contains temporary libtool files.
   198: objdir=.libs
   199: 
   200: # Used to examine libraries when file_magic_cmd begins with "file".
   201: MAGIC_CMD=file
   202: 
   203: # Must we lock files when doing compilation?
   204: need_locks="no"
   205: 
   206: # Manifest tool.
   207: MANIFEST_TOOL=":"
   208: 
   209: # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
   210: DSYMUTIL=""
   211: 
   212: # Tool to change global to local symbols on Mac OS X.
   213: NMEDIT=""
   214: 
   215: # Tool to manipulate fat objects and archives on Mac OS X.
   216: LIPO=""
   217: 
   218: # ldd/readelf like tool for Mach-O binaries on Mac OS X.
   219: OTOOL=""
   220: 
   221: # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
   222: OTOOL64=""
   223: 
   224: # Old archive suffix (normally "a").
   225: libext=a
   226: 
   227: # Shared library suffix (normally ".so").
   228: shrext_cmds=".so"
   229: 
   230: # The commands to extract the exported symbol list from a shared archive.
   231: extract_expsyms_cmds=""
   232: 
   233: # Variables whose values should be saved in libtool wrapper scripts and
   234: # restored at link time.
   235: variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
   236: 
   237: # Do we need the "lib" prefix for modules?
   238: need_lib_prefix=no
   239: 
   240: # Do we need a version for libraries?
   241: need_version=no
   242: 
   243: # Library versioning type.
   244: version_type=linux
   245: 
   246: # Shared library runtime path variable.
   247: runpath_var=LD_RUN_PATH
   248: 
   249: # Shared library path variable.
   250: shlibpath_var=LD_LIBRARY_PATH
   251: 
   252: # Is shlibpath searched before the hard-coded library search path?
   253: shlibpath_overrides_runpath=no
   254: 
   255: # Format of library name prefix.
   256: libname_spec="lib\$name"
   257: 
   258: # List of archive names.  First name is the real one, the rest are links.
   259: # The last name is the one that the linker finds with -lNAME
   260: library_names_spec="\$libname\$release\$shared_ext\$versuffix \$libname\$release\$shared_ext\$major \$libname\$shared_ext"
   261: 
   262: # The coded name of the library, if different from the real name.
   263: soname_spec="\$libname\$release\$shared_ext\$major"
   264: 
   265: # Permission mode override for installation of shared libraries.
   266: install_override_mode=""
   267: 
   268: # Command to use after installation of a shared archive.
   269: postinstall_cmds=""
   270: 
   271: # Command to use after uninstallation of a shared archive.
   272: postuninstall_cmds=""
   273: 
   274: # Commands used to finish a libtool library installation in a directory.
   275: finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
   276: 
   277: # As "finish_cmds", except a single script fragment to be evaled but
   278: # not shown.
   279: finish_eval=""
   280: 
   281: # Whether we should hardcode library paths into libraries.
   282: hardcode_into_libs=yes
   283: 
   284: # Compile-time system search path for libraries.
   285: sys_lib_search_path_spec="/usr/lib/gcc/x86_64-redhat-linux/5.3.1 /usr/lib64 /lib64 /usr/lib /lib "
   286: 
   287: # Detected run-time system search path for libraries.
   288: sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib /usr/lib64/bind99 /usr/lib64/llvm "
   289: 
   290: # Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
   291: configure_time_lt_sys_library_path=""
   292: 
   293: # Whether dlopen is supported.
   294: dlopen_support=unknown
   295: 
   296: # Whether dlopen of programs is supported.
   297: dlopen_self=unknown
   298: 
   299: # Whether dlopen of statically linked programs is supported.
   300: dlopen_self_static=unknown
   301: 
   302: # Commands to strip libraries.
   303: old_striplib="strip --strip-debug"
   304: striplib="strip --strip-unneeded"
   305: 
   306: 
   307: # The linker used to build libraries.
   308: LD="/usr/bin/ld -m elf_x86_64"
   309: 
   310: # How to create reloadable object files.
   311: reload_flag=" -r"
   312: reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
   313: 
   314: # Commands used to build an old-style archive.
   315: old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
   316: 
   317: # A language specific compiler.
   318: CC="gcc"
   319: 
   320: # Is the compiler the GNU compiler?
   321: with_gcc=yes
   322: 
   323: # Compiler flag to turn off builtin functions.
   324: no_builtin_flag=" -fno-builtin"
   325: 
   326: # Additional compiler flags for building library objects.
   327: pic_flag=" -fPIC -DPIC"
   328: 
   329: # How to pass a linker flag through the compiler.
   330: wl="-Wl,"
   331: 
   332: # Compiler flag to prevent dynamic linking.
   333: link_static_flag=""
   334: 
   335: # Does compiler simultaneously support -c and -o options?
   336: compiler_c_o="yes"
   337: 
   338: # Whether or not to add -lc for building shared libraries.
   339: build_libtool_need_lc=no
   340: 
   341: # Whether or not to disallow shared libs when runtime libs are static.
   342: allow_libtool_libs_with_static_runtimes=no
   343: 
   344: # Compiler flag to allow reflexive dlopens.
   345: export_dynamic_flag_spec="\$wl--export-dynamic"
   346: 
   347: # Compiler flag to generate shared objects directly from archives.
   348: whole_archive_flag_spec="\$wl--whole-archive\$convenience \$wl--no-whole-archive"
   349: 
   350: # Whether the compiler copes with passing no objects directly.
   351: compiler_needs_object="no"
   352: 
   353: # Create an old-style archive from a shared archive.
   354: old_archive_from_new_cmds=""
   355: 
   356: # Create a temporary old-style archive to link instead of a shared archive.
   357: old_archive_from_expsyms_cmds=""
   358: 
   359: # Commands used to build a shared archive.
   360: archive_cmds="\$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \$wl-soname \$wl\$soname -o \$lib"
   361: archive_expsym_cmds="echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
   362:             cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
   363:             echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
   364:             \$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \$wl-soname \$wl\$soname \$wl-version-script \$wl\$output_objdir/\$libname.ver -o \$lib"
   365: 
   366: # Commands used to build a loadable module if different from building
   367: # a shared archive.
   368: module_cmds=""
   369: module_expsym_cmds=""
   370: 
   371: # Whether we are building with GNU ld or not.
   372: with_gnu_ld="yes"
   373: 
   374: # Flag that allows shared libraries with undefined symbols to be built.
   375: allow_undefined_flag=""
   376: 
   377: # Flag that enforces no undefined symbols.
   378: no_undefined_flag=""
   379: 
   380: # Flag to hardcode $libdir into a binary during linking.
   381: # This must work even if $libdir does not exist
   382: hardcode_libdir_flag_spec="\$wl-rpath \$wl\$libdir"
   383: 
   384: # Whether we need a single "-rpath" flag with a separated argument.
   385: hardcode_libdir_separator=""
   386: 
   387: # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
   388: # DIR into the resulting binary.
   389: hardcode_direct=no
   390: 
   391: # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
   392: # DIR into the resulting binary and the resulting library dependency is
   393: # "absolute",i.e impossible to change by setting $shlibpath_var if the
   394: # library is relocated.
   395: hardcode_direct_absolute=no
   396: 
   397: # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
   398: # into the resulting binary.
   399: hardcode_minus_L=no
   400: 
   401: # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
   402: # into the resulting binary.
   403: hardcode_shlibpath_var=unsupported
   404: 
   405: # Set to "yes" if building a shared library automatically hardcodes DIR
   406: # into the library and all subsequent libraries and executables linked
   407: # against it.
   408: hardcode_automatic=no
   409: 
   410: # Set to yes if linker adds runtime paths of dependent libraries
   411: # to runtime path list.
   412: inherit_rpath=no
   413: 
   414: # Whether libtool must link a program against all its dependency libraries.
   415: link_all_deplibs=unknown
   416: 
   417: # Set to "yes" if exported symbols are required.
   418: always_export_symbols=no
   419: 
   420: # The commands to list exported symbols.
   421: export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
   422: 
   423: # Symbols that should not be listed in the preloaded symbols.
   424: exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
   425: 
   426: # Symbols that must always be exported.
   427: include_expsyms=""
   428: 
   429: # Commands necessary for linking programs (against libraries) with templates.
   430: prelink_cmds=""
   431: 
   432: # Commands necessary for finishing linking programs.
   433: postlink_cmds=""
   434: 
   435: # Specify filename containing input files.
   436: file_list_spec=""
   437: 
   438: # How to hardcode a shared library path into an executable.
   439: hardcode_action=immediate
   440: 
   441: # ### END LIBTOOL CONFIG
   442: 
   443: 
   444: # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
   445: 
   446: # func_munge_path_list VARIABLE PATH
   447: # -----------------------------------
   448: # VARIABLE is name of variable containing _space_ separated list of
   449: # directories to be munged by the contents of PATH, which is string
   450: # having a format:
   451: # "DIR[:DIR]:"
   452: #       string "DIR[ DIR]" will be prepended to VARIABLE
   453: # ":DIR[:DIR]"
   454: #       string "DIR[ DIR]" will be appended to VARIABLE
   455: # "DIRP[:DIRP]::[DIRA:]DIRA"
   456: #       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
   457: #       "DIRA[ DIRA]" will be appended to VARIABLE
   458: # "DIR[:DIR]"
   459: #       VARIABLE will be replaced by "DIR[ DIR]"
   460: func_munge_path_list ()
   461: {
   462:     case x$2 in
   463:     x)
   464:         ;;
   465:     *:)
   466:         eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
   467:         ;;
   468:     x:*)
   469:         eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
   470:         ;;
   471:     *::*)
   472:         eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
   473:         eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
   474:         ;;
   475:     *)
   476:         eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
   477:         ;;
   478:     esac
   479: }
   480: 
   481: 
   482: # Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
   483: func_cc_basename ()
   484: {
   485:     for cc_temp in $*""; do
   486:       case $cc_temp in
   487:         compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
   488:         distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
   489:         \-*) ;;
   490:         *) break;;
   491:       esac
   492:     done
   493:     func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
   494: }
   495: 
   496: 
   497: # ### END FUNCTIONS SHARED WITH CONFIGURE
   498: 
   499: #! /bin/sh
   500: ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
   501: ##               by inline-source v2014-01-03.01
   502: 
   503: # libtool (GNU libtool) 2.4.6
   504: # Provide generalized library-building support services.
   505: # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
   506: 
   507: # Copyright (C) 1996-2015 Free Software Foundation, Inc.
   508: # This is free software; see the source for copying conditions.  There is NO
   509: # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   510: 
   511: # GNU Libtool is free software; you can redistribute it and/or modify
   512: # it under the terms of the GNU General Public License as published by
   513: # the Free Software Foundation; either version 2 of the License, or
   514: # (at your option) any later version.
   515: #
   516: # As a special exception to the GNU General Public License,
   517: # if you distribute this file as part of a program or library that
   518: # is built using GNU Libtool, you may include this file under the
   519: # same distribution terms that you use for the rest of that program.
   520: #
   521: # GNU Libtool is distributed in the hope that it will be useful, but
   522: # WITHOUT ANY WARRANTY; without even the implied warranty of
   523: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   524: # General Public License for more details.
   525: #
   526: # You should have received a copy of the GNU General Public License
   527: # along with this program.  If not, see <http://www.gnu.org/licenses/>.
   528: 
   529: 
   530: PROGRAM=libtool
   531: PACKAGE=libtool
   532: VERSION=2.4.6
   533: package_revision=2.4.6
   534: 
   535: 
   536: ## ------ ##
   537: ## Usage. ##
   538: ## ------ ##
   539: 
   540: # Run './libtool --help' for help with using this script from the
   541: # command line.
   542: 
   543: 
   544: ## ------------------------------- ##
   545: ## User overridable command paths. ##
   546: ## ------------------------------- ##
   547: 
   548: # After configure completes, it has a better idea of some of the
   549: # shell tools we need than the defaults used by the functions shared
   550: # with bootstrap, so set those here where they can still be over-
   551: # ridden by the user, but otherwise take precedence.
   552: 
   553: : ${AUTOCONF="autoconf"}
   554: : ${AUTOMAKE="automake"}
   555: 
   556: 
   557: ## -------------------------- ##
   558: ## Source external libraries. ##
   559: ## -------------------------- ##
   560: 
   561: # Much of our low-level functionality needs to be sourced from external
   562: # libraries, which are installed to $pkgauxdir.
   563: 
   564: # Set a version string for this script.
   565: scriptversion=2015-01-20.17; # UTC
   566: 
   567: # General shell script boiler plate, and helper functions.
   568: # Written by Gary V. Vaughan, 2004
   569: 
   570: # Copyright (C) 2004-2015 Free Software Foundation, Inc.
   571: # This is free software; see the source for copying conditions.  There is NO
   572: # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   573: 
   574: # This program is free software; you can redistribute it and/or modify
   575: # it under the terms of the GNU General Public License as published by
   576: # the Free Software Foundation; either version 3 of the License, or
   577: # (at your option) any later version.
   578: 
   579: # As a special exception to the GNU General Public License, if you distribute
   580: # this file as part of a program or library that is built using GNU Libtool,
   581: # you may include this file under the same distribution terms that you use
   582: # for the rest of that program.
   583: 
   584: # This program is distributed in the hope that it will be useful,
   585: # but WITHOUT ANY WARRANTY; without even the implied warranty of
   586: # MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
   587: # General Public License for more details.
   588: 
   589: # You should have received a copy of the GNU General Public License
   590: # along with this program. If not, see <http://www.gnu.org/licenses/>.
   591: 
   592: # Please report bugs or propose patches to gary@gnu.org.
   593: 
   594: 
   595: ## ------ ##
   596: ## Usage. ##
   597: ## ------ ##
   598: 
   599: # Evaluate this file near the top of your script to gain access to
   600: # the functions and variables defined here:
   601: #
   602: #   . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
   603: #
   604: # If you need to override any of the default environment variable
   605: # settings, do that before evaluating this file.
   606: 
   607: 
   608: ## -------------------- ##
   609: ## Shell normalisation. ##
   610: ## -------------------- ##
   611: 
   612: # Some shells need a little help to be as Bourne compatible as possible.
   613: # Before doing anything else, make sure all that help has been provided!
   614: 
   615: DUALCASE=1; export DUALCASE # for MKS sh
   616: if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
   617:   emulate sh
   618:   NULLCMD=:
   619:   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   620:   # is contrary to our usage.  Disable this feature.
   621:   alias -g '${1+"$@"}'='"$@"'
   622:   setopt NO_GLOB_SUBST
   623: else
   624:   case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
   625: fi
   626: 
   627: # NLS nuisances: We save the old values in case they are required later.
   628: _G_user_locale=
   629: _G_safe_locale=
   630: for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
   631: do
   632:   eval "if test set = \"\${$_G_var+set}\"; then
   633:           save_$_G_var=\$$_G_var
   634:           $_G_var=C
   635: 	  export $_G_var
   636: 	  _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
   637: 	  _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
   638: 	fi"
   639: done
   640: 
   641: # CDPATH.
   642: (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
   643: 
   644: # Make sure IFS has a sensible default
   645: sp=' '
   646: nl='
   647: '
   648: IFS="$sp	$nl"
   649: 
   650: # There are apparently some retarded systems that use ';' as a PATH separator!
   651: if test "${PATH_SEPARATOR+set}" != set; then
   652:   PATH_SEPARATOR=:
   653:   (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
   654:     (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
   655:       PATH_SEPARATOR=';'
   656:   }
   657: fi
   658: 
   659: 
   660: 
   661: ## ------------------------- ##
   662: ## Locate command utilities. ##
   663: ## ------------------------- ##
   664: 
   665: 
   666: # func_executable_p FILE
   667: # ----------------------
   668: # Check that FILE is an executable regular file.
   669: func_executable_p ()
   670: {
   671:     test -f "$1" && test -x "$1"
   672: }
   673: 
   674: 
   675: # func_path_progs PROGS_LIST CHECK_FUNC [PATH]
   676: # --------------------------------------------
   677: # Search for either a program that responds to --version with output
   678: # containing "GNU", or else returned by CHECK_FUNC otherwise, by
   679: # trying all the directories in PATH with each of the elements of
   680: # PROGS_LIST.
   681: #
   682: # CHECK_FUNC should accept the path to a candidate program, and
   683: # set $func_check_prog_result if it truncates its output less than
   684: # $_G_path_prog_max characters.
   685: func_path_progs ()
   686: {
   687:     _G_progs_list=$1
   688:     _G_check_func=$2
   689:     _G_PATH=${3-"$PATH"}
   690: 
   691:     _G_path_prog_max=0
   692:     _G_path_prog_found=false
   693:     _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
   694:     for _G_dir in $_G_PATH; do
   695:       IFS=$_G_save_IFS
   696:       test -z "$_G_dir" && _G_dir=.
   697:       for _G_prog_name in $_G_progs_list; do
   698:         for _exeext in '' .EXE; do
   699:           _G_path_prog=$_G_dir/$_G_prog_name$_exeext
   700:           func_executable_p "$_G_path_prog" || continue
   701:           case `"$_G_path_prog" --version 2>&1` in
   702:             *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
   703:             *)     $_G_check_func $_G_path_prog
   704: 		   func_path_progs_result=$func_check_prog_result
   705: 		   ;;
   706:           esac
   707:           $_G_path_prog_found && break 3
   708:         done
   709:       done
   710:     done
   711:     IFS=$_G_save_IFS
   712:     test -z "$func_path_progs_result" && {
   713:       echo "no acceptable sed could be found in \$PATH" >&2
   714:       exit 1
   715:     }
   716: }
   717: 
   718: 
   719: # We want to be able to use the functions in this file before configure
   720: # has figured out where the best binaries are kept, which means we have
   721: # to search for them ourselves - except when the results are already set
   722: # where we skip the searches.
   723: 
   724: # Unless the user overrides by setting SED, search the path for either GNU
   725: # sed, or the sed that truncates its output the least.
   726: test -z "$SED" && {
   727:   _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
   728:   for _G_i in 1 2 3 4 5 6 7; do
   729:     _G_sed_script=$_G_sed_script$nl$_G_sed_script
   730:   done
   731:   echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
   732:   _G_sed_script=
   733: 
   734:   func_check_prog_sed ()
   735:   {
   736:     _G_path_prog=$1
   737: 
   738:     _G_count=0
   739:     printf 0123456789 >conftest.in
   740:     while :
   741:     do
   742:       cat conftest.in conftest.in >conftest.tmp
   743:       mv conftest.tmp conftest.in
   744:       cp conftest.in conftest.nl
   745:       echo '' >> conftest.nl
   746:       "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
   747:       diff conftest.out conftest.nl >/dev/null 2>&1 || break
   748:       _G_count=`expr $_G_count + 1`
   749:       if test "$_G_count" -gt "$_G_path_prog_max"; then
   750:         # Best one so far, save it but keep looking for a better one
   751:         func_check_prog_result=$_G_path_prog
   752:         _G_path_prog_max=$_G_count
   753:       fi
   754:       # 10*(2^10) chars as input seems more than enough
   755:       test 10 -lt "$_G_count" && break
   756:     done
   757:     rm -f conftest.in conftest.tmp conftest.nl conftest.out
   758:   }
   759: 
   760:   func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
   761:   rm -f conftest.sed
   762:   SED=$func_path_progs_result
   763: }
   764: 
   765: 
   766: # Unless the user overrides by setting GREP, search the path for either GNU
   767: # grep, or the grep that truncates its output the least.
   768: test -z "$GREP" && {
   769:   func_check_prog_grep ()
   770:   {
   771:     _G_path_prog=$1
   772: 
   773:     _G_count=0
   774:     _G_path_prog_max=0
   775:     printf 0123456789 >conftest.in
   776:     while :
   777:     do
   778:       cat conftest.in conftest.in >conftest.tmp
   779:       mv conftest.tmp conftest.in
   780:       cp conftest.in conftest.nl
   781:       echo 'GREP' >> conftest.nl
   782:       "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
   783:       diff conftest.out conftest.nl >/dev/null 2>&1 || break
   784:       _G_count=`expr $_G_count + 1`
   785:       if test "$_G_count" -gt "$_G_path_prog_max"; then
   786:         # Best one so far, save it but keep looking for a better one
   787:         func_check_prog_result=$_G_path_prog
   788:         _G_path_prog_max=$_G_count
   789:       fi
   790:       # 10*(2^10) chars as input seems more than enough
   791:       test 10 -lt "$_G_count" && break
   792:     done
   793:     rm -f conftest.in conftest.tmp conftest.nl conftest.out
   794:   }
   795: 
   796:   func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
   797:   GREP=$func_path_progs_result
   798: }
   799: 
   800: 
   801: ## ------------------------------- ##
   802: ## User overridable command paths. ##
   803: ## ------------------------------- ##
   804: 
   805: # All uppercase variable names are used for environment variables.  These
   806: # variables can be overridden by the user before calling a script that
   807: # uses them if a suitable command of that name is not already available
   808: # in the command search PATH.
   809: 
   810: : ${CP="cp -f"}
   811: : ${ECHO="printf %s\n"}
   812: : ${EGREP="$GREP -E"}
   813: : ${FGREP="$GREP -F"}
   814: : ${LN_S="ln -s"}
   815: : ${MAKE="make"}
   816: : ${MKDIR="mkdir"}
   817: : ${MV="mv -f"}
   818: : ${RM="rm -f"}
   819: : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
   820: 
   821: 
   822: ## -------------------- ##
   823: ## Useful sed snippets. ##
   824: ## -------------------- ##
   825: 
   826: sed_dirname='s|/[^/]*$||'
   827: sed_basename='s|^.*/||'
   828: 
   829: # Sed substitution that helps us do robust quoting.  It backslashifies
   830: # metacharacters that are still active within double-quoted strings.
   831: sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
   832: 
   833: # Same as above, but do not quote variable references.
   834: sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
   835: 
   836: # Sed substitution that turns a string into a regex matching for the
   837: # string literally.
   838: sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
   839: 
   840: # Sed substitution that converts a w32 file name or path
   841: # that contains forward slashes, into one that contains
   842: # (escaped) backslashes.  A very naive implementation.
   843: sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
   844: 
   845: # Re-'\' parameter expansions in output of sed_double_quote_subst that
   846: # were '\'-ed in input to the same.  If an odd number of '\' preceded a
   847: # '$' in input to sed_double_quote_subst, that '$' was protected from
   848: # expansion.  Since each input '\' is now two '\'s, look for any number
   849: # of runs of four '\'s followed by two '\'s and then a '$'.  '\' that '$'.
   850: _G_bs='\\'
   851: _G_bs2='\\\\'
   852: _G_bs4='\\\\\\\\'
   853: _G_dollar='\$'
   854: sed_double_backslash="\
   855:   s/$_G_bs4/&\\
   856: /g
   857:   s/^$_G_bs2$_G_dollar/$_G_bs&/
   858:   s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
   859:   s/\n//g"
   860: 
   861: 
   862: ## ----------------- ##
   863: ## Global variables. ##
   864: ## ----------------- ##
   865: 
   866: # Except for the global variables explicitly listed below, the following
   867: # functions in the '^func_' namespace, and the '^require_' namespace
   868: # variables initialised in the 'Resource management' section, sourcing
   869: # this file will not pollute your global namespace with anything
   870: # else. There's no portable way to scope variables in Bourne shell
   871: # though, so actually running these functions will sometimes place
   872: # results into a variable named after the function, and often use
   873: # temporary variables in the '^_G_' namespace. If you are careful to
   874: # avoid using those namespaces casually in your sourcing script, things
   875: # should continue to work as you expect. And, of course, you can freely
   876: # overwrite any of the functions or variables defined here before
   877: # calling anything to customize them.
   878: 
   879: EXIT_SUCCESS=0
   880: EXIT_FAILURE=1
   881: EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
   882: EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
   883: 
   884: # Allow overriding, eg assuming that you follow the convention of
   885: # putting '$debug_cmd' at the start of all your functions, you can get
   886: # bash to show function call trace with:
   887: #
   888: #    debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
   889: debug_cmd=${debug_cmd-":"}
   890: exit_cmd=:
   891: 
   892: # By convention, finish your script with:
   893: #
   894: #    exit $exit_status
   895: #
   896: # so that you can set exit_status to non-zero if you want to indicate
   897: # something went wrong during execution without actually bailing out at
   898: # the point of failure.
   899: exit_status=$EXIT_SUCCESS
   900: 
   901: # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
   902: # is ksh but when the shell is invoked as "sh" and the current value of
   903: # the _XPG environment variable is not equal to 1 (one), the special
   904: # positional parameter $0, within a function call, is the name of the
   905: # function.
   906: progpath=$0
   907: 
   908: # The name of this program.
   909: progname=`$ECHO "$progpath" |$SED "$sed_basename"`
   910: 
   911: # Make sure we have an absolute progpath for reexecution:
   912: case $progpath in
   913:   [\\/]*|[A-Za-z]:\\*) ;;
   914:   *[\\/]*)
   915:      progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
   916:      progdir=`cd "$progdir" && pwd`
   917:      progpath=$progdir/$progname
   918:      ;;
   919:   *)
   920:      _G_IFS=$IFS
   921:      IFS=${PATH_SEPARATOR-:}
   922:      for progdir in $PATH; do
   923:        IFS=$_G_IFS
   924:        test -x "$progdir/$progname" && break
   925:      done
   926:      IFS=$_G_IFS
   927:      test -n "$progdir" || progdir=`pwd`
   928:      progpath=$progdir/$progname
   929:      ;;
   930: esac
   931: 
   932: 
   933: ## ----------------- ##
   934: ## Standard options. ##
   935: ## ----------------- ##
   936: 
   937: # The following options affect the operation of the functions defined
   938: # below, and should be set appropriately depending on run-time para-
   939: # meters passed on the command line.
   940: 
   941: opt_dry_run=false
   942: opt_quiet=false
   943: opt_verbose=false
   944: 
   945: # Categories 'all' and 'none' are always available.  Append any others
   946: # you will pass as the first argument to func_warning from your own
   947: # code.
   948: warning_categories=
   949: 
   950: # By default, display warnings according to 'opt_warning_types'.  Set
   951: # 'warning_func'  to ':' to elide all warnings, or func_fatal_error to
   952: # treat the next displayed warning as a fatal error.
   953: warning_func=func_warn_and_continue
   954: 
   955: # Set to 'all' to display all warnings, 'none' to suppress all
   956: # warnings, or a space delimited list of some subset of
   957: # 'warning_categories' to display only the listed warnings.
   958: opt_warning_types=all
   959: 
   960: 
   961: ## -------------------- ##
   962: ## Resource management. ##
   963: ## -------------------- ##
   964: 
   965: # This section contains definitions for functions that each ensure a
   966: # particular resource (a file, or a non-empty configuration variable for
   967: # example) is available, and if appropriate to extract default values
   968: # from pertinent package files. Call them using their associated
   969: # 'require_*' variable to ensure that they are executed, at most, once.
   970: #
   971: # It's entirely deliberate that calling these functions can set
   972: # variables that don't obey the namespace limitations obeyed by the rest
   973: # of this file, in order that that they be as useful as possible to
   974: # callers.
   975: 
   976: 
   977: # require_term_colors
   978: # -------------------
   979: # Allow display of bold text on terminals that support it.
   980: require_term_colors=func_require_term_colors
   981: func_require_term_colors ()
   982: {
   983:     $debug_cmd
   984: 
   985:     test -t 1 && {
   986:       # COLORTERM and USE_ANSI_COLORS environment variables take
   987:       # precedence, because most terminfo databases neglect to describe
   988:       # whether color sequences are supported.
   989:       test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
   990: 
   991:       if test 1 = "$USE_ANSI_COLORS"; then
   992:         # Standard ANSI escape sequences
   993:         tc_reset=''
   994:         tc_bold='';   tc_standout=''
   995:         tc_red='';   tc_green=''
   996:         tc_blue='';  tc_cyan=''
   997:       else
   998:         # Otherwise trust the terminfo database after all.
   999:         test -n "`tput sgr0 2>/dev/null`" && {
  1000:           tc_reset=`tput sgr0`
  1001:           test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
  1002:           tc_standout=$tc_bold
  1003:           test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
  1004:           test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
  1005:           test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
  1006:           test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
  1007:           test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
  1008:         }
  1009:       fi
  1010:     }
  1011: 
  1012:     require_term_colors=:
  1013: }
  1014: 
  1015: 
  1016: ## ----------------- ##
  1017: ## Function library. ##
  1018: ## ----------------- ##
  1019: 
  1020: # This section contains a variety of useful functions to call in your
  1021: # scripts. Take note of the portable wrappers for features provided by
  1022: # some modern shells, which will fall back to slower equivalents on
  1023: # less featureful shells.
  1024: 
  1025: 
  1026: # func_append VAR VALUE
  1027: # ---------------------
  1028: # Append VALUE onto the existing contents of VAR.
  1029: 
  1030:   # We should try to minimise forks, especially on Windows where they are
  1031:   # unreasonably slow, so skip the feature probes when bash or zsh are
  1032:   # being used:
  1033:   if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
  1034:     : ${_G_HAVE_ARITH_OP="yes"}
  1035:     : ${_G_HAVE_XSI_OPS="yes"}
  1036:     # The += operator was introduced in bash 3.1
  1037:     case $BASH_VERSION in
  1038:       [12].* | 3.0 | 3.0*) ;;
  1039:       *)
  1040:         : ${_G_HAVE_PLUSEQ_OP="yes"}
  1041:         ;;
  1042:     esac
  1043:   fi
  1044: 
  1045:   # _G_HAVE_PLUSEQ_OP
  1046:   # Can be empty, in which case the shell is probed, "yes" if += is
  1047:   # useable or anything else if it does not work.
  1048:   test -z "$_G_HAVE_PLUSEQ_OP" \
  1049:     && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
  1050:     && _G_HAVE_PLUSEQ_OP=yes
  1051: 
  1052: if test yes = "$_G_HAVE_PLUSEQ_OP"
  1053: then
  1054:   # This is an XSI compatible shell, allowing a faster implementation...
  1055:   eval 'func_append ()
  1056:   {
  1057:     $debug_cmd
  1058: 
  1059:     eval "$1+=\$2"
  1060:   }'
  1061: else
  1062:   # ...otherwise fall back to using expr, which is often a shell builtin.
  1063:   func_append ()
  1064:   {
  1065:     $debug_cmd
  1066: 
  1067:     eval "$1=\$$1\$2"
  1068:   }
  1069: fi
  1070: 
  1071: 
  1072: # func_append_quoted VAR VALUE
  1073: # ----------------------------
  1074: # Quote VALUE and append to the end of shell variable VAR, separated
  1075: # by a space.
  1076: if test yes = "$_G_HAVE_PLUSEQ_OP"; then
  1077:   eval 'func_append_quoted ()
  1078:   {
  1079:     $debug_cmd
  1080: 
  1081:     func_quote_for_eval "$2"
  1082:     eval "$1+=\\ \$func_quote_for_eval_result"
  1083:   }'
  1084: else
  1085:   func_append_quoted ()
  1086:   {
  1087:     $debug_cmd
  1088: 
  1089:     func_quote_for_eval "$2"
  1090:     eval "$1=\$$1\\ \$func_quote_for_eval_result"
  1091:   }
  1092: fi
  1093: 
  1094: 
  1095: # func_append_uniq VAR VALUE
  1096: # --------------------------
  1097: # Append unique VALUE onto the existing contents of VAR, assuming
  1098: # entries are delimited by the first character of VALUE.  For example:
  1099: #
  1100: #   func_append_uniq options " --another-option option-argument"
  1101: #
  1102: # will only append to $options if " --another-option option-argument "
  1103: # is not already present somewhere in $options already (note spaces at
  1104: # each end implied by leading space in second argument).
  1105: func_append_uniq ()
  1106: {
  1107:     $debug_cmd
  1108: 
  1109:     eval _G_current_value='`$ECHO $'$1'`'
  1110:     _G_delim=`expr "$2" : '\(.\)'`
  1111: 
  1112:     case $_G_delim$_G_current_value$_G_delim in
  1113:       *"$2$_G_delim"*) ;;
  1114:       *) func_append "$@" ;;
  1115:     esac
  1116: }
  1117: 
  1118: 
  1119: # func_arith TERM...
  1120: # ------------------
  1121: # Set func_arith_result to the result of evaluating TERMs.
  1122:   test -z "$_G_HAVE_ARITH_OP" \
  1123:     && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
  1124:     && _G_HAVE_ARITH_OP=yes
  1125: 
  1126: if test yes = "$_G_HAVE_ARITH_OP"; then
  1127:   eval 'func_arith ()
  1128:   {
  1129:     $debug_cmd
  1130: 
  1131:     func_arith_result=$(( $* ))
  1132:   }'
  1133: else
  1134:   func_arith ()
  1135:   {
  1136:     $debug_cmd
  1137: 
  1138:     func_arith_result=`expr "$@"`
  1139:   }
  1140: fi
  1141: 
  1142: 
  1143: # func_basename FILE
  1144: # ------------------
  1145: # Set func_basename_result to FILE with everything up to and including
  1146: # the last / stripped.
  1147: if test yes = "$_G_HAVE_XSI_OPS"; then
  1148:   # If this shell supports suffix pattern removal, then use it to avoid
  1149:   # forking. Hide the definitions single quotes in case the shell chokes
  1150:   # on unsupported syntax...
  1151:   _b='func_basename_result=${1##*/}'
  1152:   _d='case $1 in
  1153:         */*) func_dirname_result=${1%/*}$2 ;;
  1154:         *  ) func_dirname_result=$3        ;;
  1155:       esac'
  1156: 
  1157: else
  1158:   # ...otherwise fall back to using sed.
  1159:   _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
  1160:   _d='func_dirname_result=`$ECHO "$1"  |$SED "$sed_dirname"`
  1161:       if test "X$func_dirname_result" = "X$1"; then
  1162:         func_dirname_result=$3
  1163:       else
  1164:         func_append func_dirname_result "$2"
  1165:       fi'
  1166: fi
  1167: 
  1168: eval 'func_basename ()
  1169: {
  1170:     $debug_cmd
  1171: 
  1172:     '"$_b"'
  1173: }'
  1174: 
  1175: 
  1176: # func_dirname FILE APPEND NONDIR_REPLACEMENT
  1177: # -------------------------------------------
  1178: # Compute the dirname of FILE.  If nonempty, add APPEND to the result,
  1179: # otherwise set result to NONDIR_REPLACEMENT.
  1180: eval 'func_dirname ()
  1181: {
  1182:     $debug_cmd
  1183: 
  1184:     '"$_d"'
  1185: }'
  1186: 
  1187: 
  1188: # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
  1189: # --------------------------------------------------------
  1190: # Perform func_basename and func_dirname in a single function
  1191: # call:
  1192: #   dirname:  Compute the dirname of FILE.  If nonempty,
  1193: #             add APPEND to the result, otherwise set result
  1194: #             to NONDIR_REPLACEMENT.
  1195: #             value returned in "$func_dirname_result"
  1196: #   basename: Compute filename of FILE.
  1197: #             value retuned in "$func_basename_result"
  1198: # For efficiency, we do not delegate to the functions above but instead
  1199: # duplicate the functionality here.
  1200: eval 'func_dirname_and_basename ()
  1201: {
  1202:     $debug_cmd
  1203: 
  1204:     '"$_b"'
  1205:     '"$_d"'
  1206: }'
  1207: 
  1208: 
  1209: # func_echo ARG...
  1210: # ----------------
  1211: # Echo program name prefixed message.
  1212: func_echo ()
  1213: {
  1214:     $debug_cmd
  1215: 
  1216:     _G_message=$*
  1217: 
  1218:     func_echo_IFS=$IFS
  1219:     IFS=$nl
  1220:     for _G_line in $_G_message; do
  1221:       IFS=$func_echo_IFS
  1222:       $ECHO "$progname: $_G_line"
  1223:     done
  1224:     IFS=$func_echo_IFS
  1225: }
  1226: 
  1227: 
  1228: # func_echo_all ARG...
  1229: # --------------------
  1230: # Invoke $ECHO with all args, space-separated.
  1231: func_echo_all ()
  1232: {
  1233:     $ECHO "$*"
  1234: }
  1235: 
  1236: 
  1237: # func_echo_infix_1 INFIX ARG...
  1238: # ------------------------------
  1239: # Echo program name, followed by INFIX on the first line, with any
  1240: # additional lines not showing INFIX.
  1241: func_echo_infix_1 ()
  1242: {
  1243:     $debug_cmd
  1244: 
  1245:     $require_term_colors
  1246: 
  1247:     _G_infix=$1; shift
  1248:     _G_indent=$_G_infix
  1249:     _G_prefix="$progname: $_G_infix: "
  1250:     _G_message=$*
  1251: 
  1252:     # Strip color escape sequences before counting printable length
  1253:     for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
  1254:     do
  1255:       test -n "$_G_tc" && {
  1256:         _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
  1257:         _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
  1258:       }
  1259:     done
  1260:     _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`"  " ## exclude from sc_prohibit_nested_quotes
  1261: 
  1262:     func_echo_infix_1_IFS=$IFS
  1263:     IFS=$nl
  1264:     for _G_line in $_G_message; do
  1265:       IFS=$func_echo_infix_1_IFS
  1266:       $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
  1267:       _G_prefix=$_G_indent
  1268:     done
  1269:     IFS=$func_echo_infix_1_IFS
  1270: }
  1271: 
  1272: 
  1273: # func_error ARG...
  1274: # -----------------
  1275: # Echo program name prefixed message to standard error.
  1276: func_error ()
  1277: {
  1278:     $debug_cmd
  1279: 
  1280:     $require_term_colors
  1281: 
  1282:     func_echo_infix_1 "  $tc_standout${tc_red}error$tc_reset" "$*" >&2
  1283: }
  1284: 
  1285: 
  1286: # func_fatal_error ARG...
  1287: # -----------------------
  1288: # Echo program name prefixed message to standard error, and exit.
  1289: func_fatal_error ()
  1290: {
  1291:     $debug_cmd
  1292: 
  1293:     func_error "$*"
  1294:     exit $EXIT_FAILURE
  1295: }
  1296: 
  1297: 
  1298: # func_grep EXPRESSION FILENAME
  1299: # -----------------------------
  1300: # Check whether EXPRESSION matches any line of FILENAME, without output.
  1301: func_grep ()
  1302: {
  1303:     $debug_cmd
  1304: 
  1305:     $GREP "$1" "$2" >/dev/null 2>&1
  1306: }
  1307: 
  1308: 
  1309: # func_len STRING
  1310: # ---------------
  1311: # Set func_len_result to the length of STRING. STRING may not
  1312: # start with a hyphen.
  1313:   test -z "$_G_HAVE_XSI_OPS" \
  1314:     && (eval 'x=a/b/c;
  1315:       test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
  1316:     && _G_HAVE_XSI_OPS=yes
  1317: 
  1318: if test yes = "$_G_HAVE_XSI_OPS"; then
  1319:   eval 'func_len ()
  1320:   {
  1321:     $debug_cmd
  1322: 
  1323:     func_len_result=${#1}
  1324:   }'
  1325: else
  1326:   func_len ()
  1327:   {
  1328:     $debug_cmd
  1329: 
  1330:     func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
  1331:   }
  1332: fi
  1333: 
  1334: 
  1335: # func_mkdir_p DIRECTORY-PATH
  1336: # ---------------------------
  1337: # Make sure the entire path to DIRECTORY-PATH is available.
  1338: func_mkdir_p ()
  1339: {
  1340:     $debug_cmd
  1341: 
  1342:     _G_directory_path=$1
  1343:     _G_dir_list=
  1344: 
  1345:     if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
  1346: 
  1347:       # Protect directory names starting with '-'
  1348:       case $_G_directory_path in
  1349:         -*) _G_directory_path=./$_G_directory_path ;;
  1350:       esac
  1351: 
  1352:       # While some portion of DIR does not yet exist...
  1353:       while test ! -d "$_G_directory_path"; do
  1354:         # ...make a list in topmost first order.  Use a colon delimited
  1355: 	# list incase some portion of path contains whitespace.
  1356:         _G_dir_list=$_G_directory_path:$_G_dir_list
  1357: 
  1358:         # If the last portion added has no slash in it, the list is done
  1359:         case $_G_directory_path in */*) ;; *) break ;; esac
  1360: 
  1361:         # ...otherwise throw away the child directory and loop
  1362:         _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
  1363:       done
  1364:       _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
  1365: 
  1366:       func_mkdir_p_IFS=$IFS; IFS=:
  1367:       for _G_dir in $_G_dir_list; do
  1368: 	IFS=$func_mkdir_p_IFS
  1369:         # mkdir can fail with a 'File exist' error if two processes
  1370:         # try to create one of the directories concurrently.  Don't
  1371:         # stop in that case!
  1372:         $MKDIR "$_G_dir" 2>/dev/null || :
  1373:       done
  1374:       IFS=$func_mkdir_p_IFS
  1375: 
  1376:       # Bail out if we (or some other process) failed to create a directory.
  1377:       test -d "$_G_directory_path" || \
  1378:         func_fatal_error "Failed to create '$1'"
  1379:     fi
  1380: }
  1381: 
  1382: 
  1383: # func_mktempdir [BASENAME]
  1384: # -------------------------
  1385: # Make a temporary directory that won't clash with other running
  1386: # libtool processes, and avoids race conditions if possible.  If
  1387: # given, BASENAME is the basename for that directory.
  1388: func_mktempdir ()
  1389: {
  1390:     $debug_cmd
  1391: 
  1392:     _G_template=${TMPDIR-/tmp}/${1-$progname}
  1393: 
  1394:     if test : = "$opt_dry_run"; then
  1395:       # Return a directory name, but don't create it in dry-run mode
  1396:       _G_tmpdir=$_G_template-$$
  1397:     else
  1398: 
  1399:       # If mktemp works, use that first and foremost
  1400:       _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
  1401: 
  1402:       if test ! -d "$_G_tmpdir"; then
  1403:         # Failing that, at least try and use $RANDOM to avoid a race
  1404:         _G_tmpdir=$_G_template-${RANDOM-0}$$
  1405: 
  1406:         func_mktempdir_umask=`umask`
  1407:         umask 0077
  1408:         $MKDIR "$_G_tmpdir"
  1409:         umask $func_mktempdir_umask
  1410:       fi
  1411: 
  1412:       # If we're not in dry-run mode, bomb out on failure
  1413:       test -d "$_G_tmpdir" || \
  1414:         func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
  1415:     fi
  1416: 
  1417:     $ECHO "$_G_tmpdir"
  1418: }
  1419: 
  1420: 
  1421: # func_normal_abspath PATH
  1422: # ------------------------
  1423: # Remove doubled-up and trailing slashes, "." path components,
  1424: # and cancel out any ".." path components in PATH after making
  1425: # it an absolute path.
  1426: func_normal_abspath ()
  1427: {
  1428:     $debug_cmd
  1429: 
  1430:     # These SED scripts presuppose an absolute path with a trailing slash.
  1431:     _G_pathcar='s|^/\([^/]*\).*$|\1|'
  1432:     _G_pathcdr='s|^/[^/]*||'
  1433:     _G_removedotparts=':dotsl
  1434: 		s|/\./|/|g
  1435: 		t dotsl
  1436: 		s|/\.$|/|'
  1437:     _G_collapseslashes='s|/\{1,\}|/|g'
  1438:     _G_finalslash='s|/*$|/|'
  1439: 
  1440:     # Start from root dir and reassemble the path.
  1441:     func_normal_abspath_result=
  1442:     func_normal_abspath_tpath=$1
  1443:     func_normal_abspath_altnamespace=
  1444:     case $func_normal_abspath_tpath in
  1445:       "")
  1446:         # Empty path, that just means $cwd.
  1447:         func_stripname '' '/' "`pwd`"
  1448:         func_normal_abspath_result=$func_stripname_result
  1449:         return
  1450:         ;;
  1451:       # The next three entries are used to spot a run of precisely
  1452:       # two leading slashes without using negated character classes;
  1453:       # we take advantage of case's first-match behaviour.
  1454:       ///*)
  1455:         # Unusual form of absolute path, do nothing.
  1456:         ;;
  1457:       //*)
  1458:         # Not necessarily an ordinary path; POSIX reserves leading '//'
  1459:         # and for example Cygwin uses it to access remote file shares
  1460:         # over CIFS/SMB, so we conserve a leading double slash if found.
  1461:         func_normal_abspath_altnamespace=/
  1462:         ;;
  1463:       /*)
  1464:         # Absolute path, do nothing.
  1465:         ;;
  1466:       *)
  1467:         # Relative path, prepend $cwd.
  1468:         func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
  1469:         ;;
  1470:     esac
  1471: 
  1472:     # Cancel out all the simple stuff to save iterations.  We also want
  1473:     # the path to end with a slash for ease of parsing, so make sure
  1474:     # there is one (and only one) here.
  1475:     func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
  1476:           -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
  1477:     while :; do
  1478:       # Processed it all yet?
  1479:       if test / = "$func_normal_abspath_tpath"; then
  1480:         # If we ascended to the root using ".." the result may be empty now.
  1481:         if test -z "$func_normal_abspath_result"; then
  1482:           func_normal_abspath_result=/
  1483:         fi
  1484:         break
  1485:       fi
  1486:       func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
  1487:           -e "$_G_pathcar"`
  1488:       func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
  1489:           -e "$_G_pathcdr"`
  1490:       # Figure out what to do with it
  1491:       case $func_normal_abspath_tcomponent in
  1492:         "")
  1493:           # Trailing empty path component, ignore it.
  1494:           ;;
  1495:         ..)
  1496:           # Parent dir; strip last assembled component from result.
  1497:           func_dirname "$func_normal_abspath_result"
  1498:           func_normal_abspath_result=$func_dirname_result
  1499:           ;;
  1500:         *)
  1501:           # Actual path component, append it.
  1502:           func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
  1503:           ;;
  1504:       esac
  1505:     done
  1506:     # Restore leading double-slash if one was found on entry.
  1507:     func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
  1508: }
  1509: 
  1510: 
  1511: # func_notquiet ARG...
  1512: # --------------------
  1513: # Echo program name prefixed message only when not in quiet mode.
  1514: func_notquiet ()
  1515: {
  1516:     $debug_cmd
  1517: 
  1518:     $opt_quiet || func_echo ${1+"$@"}
  1519: 
  1520:     # A bug in bash halts the script if the last line of a function
  1521:     # fails when set -e is in force, so we need another command to
  1522:     # work around that:
  1523:     :
  1524: }
  1525: 
  1526: 
  1527: # func_relative_path SRCDIR DSTDIR
  1528: # --------------------------------
  1529: # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
  1530: func_relative_path ()
  1531: {
  1532:     $debug_cmd
  1533: 
  1534:     func_relative_path_result=
  1535:     func_normal_abspath "$1"
  1536:     func_relative_path_tlibdir=$func_normal_abspath_result
  1537:     func_normal_abspath "$2"
  1538:     func_relative_path_tbindir=$func_normal_abspath_result
  1539: 
  1540:     # Ascend the tree starting from libdir
  1541:     while :; do
  1542:       # check if we have found a prefix of bindir
  1543:       case $func_relative_path_tbindir in
  1544:         $func_relative_path_tlibdir)
  1545:           # found an exact match
  1546:           func_relative_path_tcancelled=
  1547:           break
  1548:           ;;
  1549:         $func_relative_path_tlibdir*)
  1550:           # found a matching prefix
  1551:           func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
  1552:           func_relative_path_tcancelled=$func_stripname_result
  1553:           if test -z "$func_relative_path_result"; then
  1554:             func_relative_path_result=.
  1555:           fi
  1556:           break
  1557:           ;;
  1558:         *)
  1559:           func_dirname $func_relative_path_tlibdir
  1560:           func_relative_path_tlibdir=$func_dirname_result
  1561:           if test -z "$func_relative_path_tlibdir"; then
  1562:             # Have to descend all the way to the root!
  1563:             func_relative_path_result=../$func_relative_path_result
  1564:             func_relative_path_tcancelled=$func_relative_path_tbindir
  1565:             break
  1566:           fi
  1567:           func_relative_path_result=../$func_relative_path_result
  1568:           ;;
  1569:       esac
  1570:     done
  1571: 
  1572:     # Now calculate path; take care to avoid doubling-up slashes.
  1573:     func_stripname '' '/' "$func_relative_path_result"
  1574:     func_relative_path_result=$func_stripname_result
  1575:     func_stripname '/' '/' "$func_relative_path_tcancelled"
  1576:     if test -n "$func_stripname_result"; then
  1577:       func_append func_relative_path_result "/$func_stripname_result"
  1578:     fi
  1579: 
  1580:     # Normalisation. If bindir is libdir, return '.' else relative path.
  1581:     if test -n "$func_relative_path_result"; then
  1582:       func_stripname './' '' "$func_relative_path_result"
  1583:       func_relative_path_result=$func_stripname_result
  1584:     fi
  1585: 
  1586:     test -n "$func_relative_path_result" || func_relative_path_result=.
  1587: 
  1588:     :
  1589: }
  1590: 
  1591: 
  1592: # func_quote_for_eval ARG...
  1593: # --------------------------
  1594: # Aesthetically quote ARGs to be evaled later.
  1595: # This function returns two values:
  1596: #   i) func_quote_for_eval_result
  1597: #      double-quoted, suitable for a subsequent eval
  1598: #  ii) func_quote_for_eval_unquoted_result
  1599: #      has all characters that are still active within double
  1600: #      quotes backslashified.
  1601: func_quote_for_eval ()
  1602: {
  1603:     $debug_cmd
  1604: 
  1605:     func_quote_for_eval_unquoted_result=
  1606:     func_quote_for_eval_result=
  1607:     while test 0 -lt $#; do
  1608:       case $1 in
  1609:         *[\\\`\"\$]*)
  1610: 	  _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
  1611:         *)
  1612:           _G_unquoted_arg=$1 ;;
  1613:       esac
  1614:       if test -n "$func_quote_for_eval_unquoted_result"; then
  1615: 	func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
  1616:       else
  1617:         func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
  1618:       fi
  1619: 
  1620:       case $_G_unquoted_arg in
  1621:         # Double-quote args containing shell metacharacters to delay
  1622:         # word splitting, command substitution and variable expansion
  1623:         # for a subsequent eval.
  1624:         # Many Bourne shells cannot handle close brackets correctly
  1625:         # in scan sets, so we specify it separately.
  1626:         *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
  1627:           _G_quoted_arg=\"$_G_unquoted_arg\"
  1628:           ;;
  1629:         *)
  1630:           _G_quoted_arg=$_G_unquoted_arg
  1631: 	  ;;
  1632:       esac
  1633: 
  1634:       if test -n "$func_quote_for_eval_result"; then
  1635: 	func_append func_quote_for_eval_result " $_G_quoted_arg"
  1636:       else
  1637:         func_append func_quote_for_eval_result "$_G_quoted_arg"
  1638:       fi
  1639:       shift
  1640:     done
  1641: }
  1642: 
  1643: 
  1644: # func_quote_for_expand ARG
  1645: # -------------------------
  1646: # Aesthetically quote ARG to be evaled later; same as above,
  1647: # but do not quote variable references.
  1648: func_quote_for_expand ()
  1649: {
  1650:     $debug_cmd
  1651: 
  1652:     case $1 in
  1653:       *[\\\`\"]*)
  1654: 	_G_arg=`$ECHO "$1" | $SED \
  1655: 	    -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
  1656:       *)
  1657:         _G_arg=$1 ;;
  1658:     esac
  1659: 
  1660:     case $_G_arg in
  1661:       # Double-quote args containing shell metacharacters to delay
  1662:       # word splitting and command substitution for a subsequent eval.
  1663:       # Many Bourne shells cannot handle close brackets correctly
  1664:       # in scan sets, so we specify it separately.
  1665:       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
  1666:         _G_arg=\"$_G_arg\"
  1667:         ;;
  1668:     esac
  1669: 
  1670:     func_quote_for_expand_result=$_G_arg
  1671: }
  1672: 
  1673: 
  1674: # func_stripname PREFIX SUFFIX NAME
  1675: # ---------------------------------
  1676: # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
  1677: # PREFIX and SUFFIX must not contain globbing or regex special
  1678: # characters, hashes, percent signs, but SUFFIX may contain a leading
  1679: # dot (in which case that matches only a dot).
  1680: if test yes = "$_G_HAVE_XSI_OPS"; then
  1681:   eval 'func_stripname ()
  1682:   {
  1683:     $debug_cmd
  1684: 
  1685:     # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
  1686:     # positional parameters, so assign one to ordinary variable first.
  1687:     func_stripname_result=$3
  1688:     func_stripname_result=${func_stripname_result#"$1"}
  1689:     func_stripname_result=${func_stripname_result%"$2"}
  1690:   }'
  1691: else
  1692:   func_stripname ()
  1693:   {
  1694:     $debug_cmd
  1695: 
  1696:     case $2 in
  1697:       .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
  1698:       *)  func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
  1699:     esac
  1700:   }
  1701: fi
  1702: 
  1703: 
  1704: # func_show_eval CMD [FAIL_EXP]
  1705: # -----------------------------
  1706: # Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
  1707: # not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
  1708: # is given, then evaluate it.
  1709: func_show_eval ()
  1710: {
  1711:     $debug_cmd
  1712: 
  1713:     _G_cmd=$1
  1714:     _G_fail_exp=${2-':'}
  1715: 
  1716:     func_quote_for_expand "$_G_cmd"
  1717:     eval "func_notquiet $func_quote_for_expand_result"
  1718: 
  1719:     $opt_dry_run || {
  1720:       eval "$_G_cmd"
  1721:       _G_status=$?
  1722:       if test 0 -ne "$_G_status"; then
  1723: 	eval "(exit $_G_status); $_G_fail_exp"
  1724:       fi
  1725:     }
  1726: }
  1727: 
  1728: 
  1729: # func_show_eval_locale CMD [FAIL_EXP]
  1730: # ------------------------------------
  1731: # Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
  1732: # not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
  1733: # is given, then evaluate it.  Use the saved locale for evaluation.
  1734: func_show_eval_locale ()
  1735: {
  1736:     $debug_cmd
  1737: 
  1738:     _G_cmd=$1
  1739:     _G_fail_exp=${2-':'}
  1740: 
  1741:     $opt_quiet || {
  1742:       func_quote_for_expand "$_G_cmd"
  1743:       eval "func_echo $func_quote_for_expand_result"
  1744:     }
  1745: 
  1746:     $opt_dry_run || {
  1747:       eval "$_G_user_locale
  1748: 	    $_G_cmd"
  1749:       _G_status=$?
  1750:       eval "$_G_safe_locale"
  1751:       if test 0 -ne "$_G_status"; then
  1752: 	eval "(exit $_G_status); $_G_fail_exp"
  1753:       fi
  1754:     }
  1755: }
  1756: 
  1757: 
  1758: # func_tr_sh
  1759: # ----------
  1760: # Turn $1 into a string suitable for a shell variable name.
  1761: # Result is stored in $func_tr_sh_result.  All characters
  1762: # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
  1763: # if $1 begins with a digit, a '_' is prepended as well.
  1764: func_tr_sh ()
  1765: {
  1766:     $debug_cmd
  1767: 
  1768:     case $1 in
  1769:     [0-9]* | *[!a-zA-Z0-9_]*)
  1770:       func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
  1771:       ;;
  1772:     * )
  1773:       func_tr_sh_result=$1
  1774:       ;;
  1775:     esac
  1776: }
  1777: 
  1778: 
  1779: # func_verbose ARG...
  1780: # -------------------
  1781: # Echo program name prefixed message in verbose mode only.
  1782: func_verbose ()
  1783: {
  1784:     $debug_cmd
  1785: 
  1786:     $opt_verbose && func_echo "$*"
  1787: 
  1788:     :
  1789: }
  1790: 
  1791: 
  1792: # func_warn_and_continue ARG...
  1793: # -----------------------------
  1794: # Echo program name prefixed warning message to standard error.
  1795: func_warn_and_continue ()
  1796: {
  1797:     $debug_cmd
  1798: 
  1799:     $require_term_colors
  1800: 
  1801:     func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
  1802: }
  1803: 
  1804: 
  1805: # func_warning CATEGORY ARG...
  1806: # ----------------------------
  1807: # Echo program name prefixed warning message to standard error. Warning
  1808: # messages can be filtered according to CATEGORY, where this function
  1809: # elides messages where CATEGORY is not listed in the global variable
  1810: # 'opt_warning_types'.
  1811: func_warning ()
  1812: {
  1813:     $debug_cmd
  1814: 
  1815:     # CATEGORY must be in the warning_categories list!
  1816:     case " $warning_categories " in
  1817:       *" $1 "*) ;;
  1818:       *) func_internal_error "invalid warning category '$1'" ;;
  1819:     esac
  1820: 
  1821:     _G_category=$1
  1822:     shift
  1823: 
  1824:     case " $opt_warning_types " in
  1825:       *" $_G_category "*) $warning_func ${1+"$@"} ;;
  1826:     esac
  1827: }
  1828: 
  1829: 
  1830: # func_sort_ver VER1 VER2
  1831: # -----------------------
  1832: # 'sort -V' is not generally available.
  1833: # Note this deviates from the version comparison in automake
  1834: # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
  1835: # but this should suffice as we won't be specifying old
  1836: # version formats or redundant trailing .0 in bootstrap.conf.
  1837: # If we did want full compatibility then we should probably
  1838: # use m4_version_compare from autoconf.
  1839: func_sort_ver ()
  1840: {
  1841:     $debug_cmd
  1842: 
  1843:     printf '%s\n%s\n' "$1" "$2" \
  1844:       | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
  1845: }
  1846: 
  1847: # func_lt_ver PREV CURR
  1848: # ---------------------
  1849: # Return true if PREV and CURR are in the correct order according to
  1850: # func_sort_ver, otherwise false.  Use it like this:
  1851: #
  1852: #  func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
  1853: func_lt_ver ()
  1854: {
  1855:     $debug_cmd
  1856: 
  1857:     test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
  1858: }
  1859: 
  1860: 
  1861: # Local variables:
  1862: # mode: shell-script
  1863: # sh-indentation: 2
  1864: # eval: (add-hook 'before-save-hook 'time-stamp)
  1865: # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
  1866: # time-stamp-time-zone: "UTC"
  1867: # End:
  1868: #! /bin/sh
  1869: 
  1870: # Set a version string for this script.
  1871: scriptversion=2014-01-07.03; # UTC
  1872: 
  1873: # A portable, pluggable option parser for Bourne shell.
  1874: # Written by Gary V. Vaughan, 2010
  1875: 
  1876: # Copyright (C) 2010-2015 Free Software Foundation, Inc.
  1877: # This is free software; see the source for copying conditions.  There is NO
  1878: # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  1879: 
  1880: # This program is free software: you can redistribute it and/or modify
  1881: # it under the terms of the GNU General Public License as published by
  1882: # the Free Software Foundation, either version 3 of the License, or
  1883: # (at your option) any later version.
  1884: 
  1885: # This program is distributed in the hope that it will be useful,
  1886: # but WITHOUT ANY WARRANTY; without even the implied warranty of
  1887: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1888: # GNU General Public License for more details.
  1889: 
  1890: # You should have received a copy of the GNU General Public License
  1891: # along with this program.  If not, see <http://www.gnu.org/licenses/>.
  1892: 
  1893: # Please report bugs or propose patches to gary@gnu.org.
  1894: 
  1895: 
  1896: ## ------ ##
  1897: ## Usage. ##
  1898: ## ------ ##
  1899: 
  1900: # This file is a library for parsing options in your shell scripts along
  1901: # with assorted other useful supporting features that you can make use
  1902: # of too.
  1903: #
  1904: # For the simplest scripts you might need only:
  1905: #
  1906: #   #!/bin/sh
  1907: #   . relative/path/to/funclib.sh
  1908: #   . relative/path/to/options-parser
  1909: #   scriptversion=1.0
  1910: #   func_options ${1+"$@"}
  1911: #   eval set dummy "$func_options_result"; shift
  1912: #   ...rest of your script...
  1913: #
  1914: # In order for the '--version' option to work, you will need to have a
  1915: # suitably formatted comment like the one at the top of this file
  1916: # starting with '# Written by ' and ending with '# warranty; '.
  1917: #
  1918: # For '-h' and '--help' to work, you will also need a one line
  1919: # description of your script's purpose in a comment directly above the
  1920: # '# Written by ' line, like the one at the top of this file.
  1921: #
  1922: # The default options also support '--debug', which will turn on shell
  1923: # execution tracing (see the comment above debug_cmd below for another
  1924: # use), and '--verbose' and the func_verbose function to allow your script
  1925: # to display verbose messages only when your user has specified
  1926: # '--verbose'.
  1927: #
  1928: # After sourcing this file, you can plug processing for additional
  1929: # options by amending the variables from the 'Configuration' section
  1930: # below, and following the instructions in the 'Option parsing'
  1931: # section further down.
  1932: 
  1933: ## -------------- ##
  1934: ## Configuration. ##
  1935: ## -------------- ##
  1936: 
  1937: # You should override these variables in your script after sourcing this
  1938: # file so that they reflect the customisations you have added to the
  1939: # option parser.
  1940: 
  1941: # The usage line for option parsing errors and the start of '-h' and
  1942: # '--help' output messages. You can embed shell variables for delayed
  1943: # expansion at the time the message is displayed, but you will need to
  1944: # quote other shell meta-characters carefully to prevent them being
  1945: # expanded when the contents are evaled.
  1946: usage='$progpath [OPTION]...'
  1947: 
  1948: # Short help message in response to '-h' and '--help'.  Add to this or
  1949: # override it after sourcing this library to reflect the full set of
  1950: # options your script accepts.
  1951: usage_message="\
  1952:        --debug        enable verbose shell tracing
  1953:    -W, --warnings=CATEGORY
  1954:                       report the warnings falling in CATEGORY [all]
  1955:    -v, --verbose      verbosely report processing
  1956:        --version      print version information and exit
  1957:    -h, --help         print short or long help message and exit
  1958: "
  1959: 
  1960: # Additional text appended to 'usage_message' in response to '--help'.
  1961: long_help_message="
  1962: Warning categories include:
  1963:        'all'          show all warnings
  1964:        'none'         turn off all the warnings
  1965:        'error'        warnings are treated as fatal errors"
  1966: 
  1967: # Help message printed before fatal option parsing errors.
  1968: fatal_help="Try '\$progname --help' for more information."
  1969: 
  1970: 
  1971: 
  1972: ## ------------------------- ##
  1973: ## Hook function management. ##
  1974: ## ------------------------- ##
  1975: 
  1976: # This section contains functions for adding, removing, and running hooks
  1977: # to the main code.  A hook is just a named list of of function, that can
  1978: # be run in order later on.
  1979: 
  1980: # func_hookable FUNC_NAME
  1981: # -----------------------
  1982: # Declare that FUNC_NAME will run hooks added with
  1983: # 'func_add_hook FUNC_NAME ...'.
  1984: func_hookable ()
  1985: {
  1986:     $debug_cmd
  1987: 
  1988:     func_append hookable_fns " $1"
  1989: }
  1990: 
  1991: 
  1992: # func_add_hook FUNC_NAME HOOK_FUNC
  1993: # ---------------------------------
  1994: # Request that FUNC_NAME call HOOK_FUNC before it returns.  FUNC_NAME must
  1995: # first have been declared "hookable" by a call to 'func_hookable'.
  1996: func_add_hook ()
  1997: {
  1998:     $debug_cmd
  1999: 
  2000:     case " $hookable_fns " in
  2001:       *" $1 "*) ;;
  2002:       *) func_fatal_error "'$1' does not accept hook functions." ;;
  2003:     esac
  2004: 
  2005:     eval func_append ${1}_hooks '" $2"'
  2006: }
  2007: 
  2008: 
  2009: # func_remove_hook FUNC_NAME HOOK_FUNC
  2010: # ------------------------------------
  2011: # Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
  2012: func_remove_hook ()
  2013: {
  2014:     $debug_cmd
  2015: 
  2016:     eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
  2017: }
  2018: 
  2019: 
  2020: # func_run_hooks FUNC_NAME [ARG]...
  2021: # ---------------------------------
  2022: # Run all hook functions registered to FUNC_NAME.
  2023: # It is assumed that the list of hook functions contains nothing more
  2024: # than a whitespace-delimited list of legal shell function names, and
  2025: # no effort is wasted trying to catch shell meta-characters or preserve
  2026: # whitespace.
  2027: func_run_hooks ()
  2028: {
  2029:     $debug_cmd
  2030: 
  2031:     case " $hookable_fns " in
  2032:       *" $1 "*) ;;
  2033:       *) func_fatal_error "'$1' does not support hook funcions.n" ;;
  2034:     esac
  2035: 
  2036:     eval _G_hook_fns=\$$1_hooks; shift
  2037: 
  2038:     for _G_hook in $_G_hook_fns; do
  2039:       eval $_G_hook '"$@"'
  2040: 
  2041:       # store returned options list back into positional
  2042:       # parameters for next 'cmd' execution.
  2043:       eval _G_hook_result=\$${_G_hook}_result
  2044:       eval set dummy "$_G_hook_result"; shift
  2045:     done
  2046: 
  2047:     func_quote_for_eval ${1+"$@"}
  2048:     func_run_hooks_result=$func_quote_for_eval_result
  2049: }
  2050: 
  2051: 
  2052: 
  2053: ## --------------- ##
  2054: ## Option parsing. ##
  2055: ## --------------- ##
  2056: 
  2057: # In order to add your own option parsing hooks, you must accept the
  2058: # full positional parameter list in your hook function, remove any
  2059: # options that you action, and then pass back the remaining unprocessed
  2060: # options in '<hooked_function_name>_result', escaped suitably for
  2061: # 'eval'.  Like this:
  2062: #
  2063: #    my_options_prep ()
  2064: #    {
  2065: #        $debug_cmd
  2066: #
  2067: #        # Extend the existing usage message.
  2068: #        usage_message=$usage_message'
  2069: #      -s, --silent       don'\''t print informational messages
  2070: #    '
  2071: #
  2072: #        func_quote_for_eval ${1+"$@"}
  2073: #        my_options_prep_result=$func_quote_for_eval_result
  2074: #    }
  2075: #    func_add_hook func_options_prep my_options_prep
  2076: #
  2077: #
  2078: #    my_silent_option ()
  2079: #    {
  2080: #        $debug_cmd
  2081: #
  2082: #        # Note that for efficiency, we parse as many options as we can
  2083: #        # recognise in a loop before passing the remainder back to the
  2084: #        # caller on the first unrecognised argument we encounter.
  2085: #        while test $# -gt 0; do
  2086: #          opt=$1; shift
  2087: #          case $opt in
  2088: #            --silent|-s) opt_silent=: ;;
  2089: #            # Separate non-argument short options:
  2090: #            -s*)         func_split_short_opt "$_G_opt"
  2091: #                         set dummy "$func_split_short_opt_name" \
  2092: #                             "-$func_split_short_opt_arg" ${1+"$@"}
  2093: #                         shift
  2094: #                         ;;
  2095: #            *)            set dummy "$_G_opt" "$*"; shift; break ;;
  2096: #          esac
  2097: #        done
  2098: #
  2099: #        func_quote_for_eval ${1+"$@"}
  2100: #        my_silent_option_result=$func_quote_for_eval_result
  2101: #    }
  2102: #    func_add_hook func_parse_options my_silent_option
  2103: #
  2104: #
  2105: #    my_option_validation ()
  2106: #    {
  2107: #        $debug_cmd
  2108: #
  2109: #        $opt_silent && $opt_verbose && func_fatal_help "\
  2110: #    '--silent' and '--verbose' options are mutually exclusive."
  2111: #
  2112: #        func_quote_for_eval ${1+"$@"}
  2113: #        my_option_validation_result=$func_quote_for_eval_result
  2114: #    }
  2115: #    func_add_hook func_validate_options my_option_validation
  2116: #
  2117: # You'll alse need to manually amend $usage_message to reflect the extra
  2118: # options you parse.  It's preferable to append if you can, so that
  2119: # multiple option parsing hooks can be added safely.
  2120: 
  2121: 
  2122: # func_options [ARG]...
  2123: # ---------------------
  2124: # All the functions called inside func_options are hookable. See the
  2125: # individual implementations for details.
  2126: func_hookable func_options
  2127: func_options ()
  2128: {
  2129:     $debug_cmd
  2130: 
  2131:     func_options_prep ${1+"$@"}
  2132:     eval func_parse_options \
  2133:         ${func_options_prep_result+"$func_options_prep_result"}
  2134:     eval func_validate_options \
  2135:         ${func_parse_options_result+"$func_parse_options_result"}
  2136: 
  2137:     eval func_run_hooks func_options \
  2138:         ${func_validate_options_result+"$func_validate_options_result"}
  2139: 
  2140:     # save modified positional parameters for caller
  2141:     func_options_result=$func_run_hooks_result
  2142: }
  2143: 
  2144: 
  2145: # func_options_prep [ARG]...
  2146: # --------------------------
  2147: # All initialisations required before starting the option parse loop.
  2148: # Note that when calling hook functions, we pass through the list of
  2149: # positional parameters.  If a hook function modifies that list, and
  2150: # needs to propogate that back to rest of this script, then the complete
  2151: # modified list must be put in 'func_run_hooks_result' before
  2152: # returning.
  2153: func_hookable func_options_prep
  2154: func_options_prep ()
  2155: {
  2156:     $debug_cmd
  2157: 
  2158:     # Option defaults:
  2159:     opt_verbose=false
  2160:     opt_warning_types=
  2161: 
  2162:     func_run_hooks func_options_prep ${1+"$@"}
  2163: 
  2164:     # save modified positional parameters for caller
  2165:     func_options_prep_result=$func_run_hooks_result
  2166: }
  2167: 
  2168: 
  2169: # func_parse_options [ARG]...
  2170: # ---------------------------
  2171: # The main option parsing loop.
  2172: func_hookable func_parse_options
  2173: func_parse_options ()
  2174: {
  2175:     $debug_cmd
  2176: 
  2177:     func_parse_options_result=
  2178: 
  2179:     # this just eases exit handling
  2180:     while test $# -gt 0; do
  2181:       # Defer to hook functions for initial option parsing, so they
  2182:       # get priority in the event of reusing an option name.
  2183:       func_run_hooks func_parse_options ${1+"$@"}
  2184: 
  2185:       # Adjust func_parse_options positional parameters to match
  2186:       eval set dummy "$func_run_hooks_result"; shift
  2187: 
  2188:       # Break out of the loop if we already parsed every option.
  2189:       test $# -gt 0 || break
  2190: 
  2191:       _G_opt=$1
  2192:       shift
  2193:       case $_G_opt in
  2194:         --debug|-x)   debug_cmd='set -x'
  2195:                       func_echo "enabling shell trace mode"
  2196:                       $debug_cmd
  2197:                       ;;
  2198: 
  2199:         --no-warnings|--no-warning|--no-warn)
  2200:                       set dummy --warnings none ${1+"$@"}
  2201:                       shift
  2202: 		      ;;
  2203: 
  2204:         --warnings|--warning|-W)
  2205:                       test $# = 0 && func_missing_arg $_G_opt && break
  2206:                       case " $warning_categories $1" in
  2207:                         *" $1 "*)
  2208:                           # trailing space prevents matching last $1 above
  2209:                           func_append_uniq opt_warning_types " $1"
  2210:                           ;;
  2211:                         *all)
  2212:                           opt_warning_types=$warning_categories
  2213:                           ;;
  2214:                         *none)
  2215:                           opt_warning_types=none
  2216:                           warning_func=:
  2217:                           ;;
  2218:                         *error)
  2219:                           opt_warning_types=$warning_categories
  2220:                           warning_func=func_fatal_error
  2221:                           ;;
  2222:                         *)
  2223:                           func_fatal_error \
  2224:                              "unsupported warning category: '$1'"
  2225:                           ;;
  2226:                       esac
  2227:                       shift
  2228:                       ;;
  2229: 
  2230:         --verbose|-v) opt_verbose=: ;;
  2231:         --version)    func_version ;;
  2232:         -\?|-h)       func_usage ;;
  2233:         --help)       func_help ;;
  2234: 
  2235: 	# Separate optargs to long options (plugins may need this):
  2236: 	--*=*)        func_split_equals "$_G_opt"
  2237: 	              set dummy "$func_split_equals_lhs" \
  2238:                           "$func_split_equals_rhs" ${1+"$@"}
  2239:                       shift
  2240:                       ;;
  2241: 
  2242:        # Separate optargs to short options:
  2243:         -W*)
  2244:                       func_split_short_opt "$_G_opt"
  2245:                       set dummy "$func_split_short_opt_name" \
  2246:                           "$func_split_short_opt_arg" ${1+"$@"}
  2247:                       shift
  2248:                       ;;
  2249: 
  2250:         # Separate non-argument short options:
  2251:         -\?*|-h*|-v*|-x*)
  2252:                       func_split_short_opt "$_G_opt"
  2253:                       set dummy "$func_split_short_opt_name" \
  2254:                           "-$func_split_short_opt_arg" ${1+"$@"}
  2255:                       shift
  2256:                       ;;
  2257: 
  2258:         --)           break ;;
  2259:         -*)           func_fatal_help "unrecognised option: '$_G_opt'" ;;
  2260:         *)            set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
  2261:       esac
  2262:     done
  2263: 
  2264:     # save modified positional parameters for caller
  2265:     func_quote_for_eval ${1+"$@"}
  2266:     func_parse_options_result=$func_quote_for_eval_result
  2267: }
  2268: 
  2269: 
  2270: # func_validate_options [ARG]...
  2271: # ------------------------------
  2272: # Perform any sanity checks on option settings and/or unconsumed
  2273: # arguments.
  2274: func_hookable func_validate_options
  2275: func_validate_options ()
  2276: {
  2277:     $debug_cmd
  2278: 
  2279:     # Display all warnings if -W was not given.
  2280:     test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
  2281: 
  2282:     func_run_hooks func_validate_options ${1+"$@"}
  2283: 
  2284:     # Bail if the options were screwed!
  2285:     $exit_cmd $EXIT_FAILURE
  2286: 
  2287:     # save modified positional parameters for caller
  2288:     func_validate_options_result=$func_run_hooks_result
  2289: }
  2290: 
  2291: 
  2292: 
  2293: ## ----------------- ##
  2294: ## Helper functions. ##
  2295: ## ----------------- ##
  2296: 
  2297: # This section contains the helper functions used by the rest of the
  2298: # hookable option parser framework in ascii-betical order.
  2299: 
  2300: 
  2301: # func_fatal_help ARG...
  2302: # ----------------------
  2303: # Echo program name prefixed message to standard error, followed by
  2304: # a help hint, and exit.
  2305: func_fatal_help ()
  2306: {
  2307:     $debug_cmd
  2308: 
  2309:     eval \$ECHO \""Usage: $usage"\"
  2310:     eval \$ECHO \""$fatal_help"\"
  2311:     func_error ${1+"$@"}
  2312:     exit $EXIT_FAILURE
  2313: }
  2314: 
  2315: 
  2316: # func_help
  2317: # ---------
  2318: # Echo long help message to standard output and exit.
  2319: func_help ()
  2320: {
  2321:     $debug_cmd
  2322: 
  2323:     func_usage_message
  2324:     $ECHO "$long_help_message"
  2325:     exit 0
  2326: }
  2327: 
  2328: 
  2329: # func_missing_arg ARGNAME
  2330: # ------------------------
  2331: # Echo program name prefixed message to standard error and set global
  2332: # exit_cmd.
  2333: func_missing_arg ()
  2334: {
  2335:     $debug_cmd
  2336: 
  2337:     func_error "Missing argument for '$1'."
  2338:     exit_cmd=exit
  2339: }
  2340: 
  2341: 
  2342: # func_split_equals STRING
  2343: # ------------------------
  2344: # Set func_split_equals_lhs and func_split_equals_rhs shell variables after
  2345: # splitting STRING at the '=' sign.
  2346: test -z "$_G_HAVE_XSI_OPS" \
  2347:     && (eval 'x=a/b/c;
  2348:       test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
  2349:     && _G_HAVE_XSI_OPS=yes
  2350: 
  2351: if test yes = "$_G_HAVE_XSI_OPS"
  2352: then
  2353:   # This is an XSI compatible shell, allowing a faster implementation...
  2354:   eval 'func_split_equals ()
  2355:   {
  2356:       $debug_cmd
  2357: 
  2358:       func_split_equals_lhs=${1%%=*}
  2359:       func_split_equals_rhs=${1#*=}
  2360:       test "x$func_split_equals_lhs" = "x$1" \
  2361:         && func_split_equals_rhs=
  2362:   }'
  2363: else
  2364:   # ...otherwise fall back to using expr, which is often a shell builtin.
  2365:   func_split_equals ()
  2366:   {
  2367:       $debug_cmd
  2368: 
  2369:       func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
  2370:       func_split_equals_rhs=
  2371:       test "x$func_split_equals_lhs" = "x$1" \
  2372:         || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
  2373:   }
  2374: fi #func_split_equals
  2375: 
  2376: 
  2377: # func_split_short_opt SHORTOPT
  2378: # -----------------------------
  2379: # Set func_split_short_opt_name and func_split_short_opt_arg shell
  2380: # variables after splitting SHORTOPT after the 2nd character.
  2381: if test yes = "$_G_HAVE_XSI_OPS"
  2382: then
  2383:   # This is an XSI compatible shell, allowing a faster implementation...
  2384:   eval 'func_split_short_opt ()
  2385:   {
  2386:       $debug_cmd
  2387: 
  2388:       func_split_short_opt_arg=${1#??}
  2389:       func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
  2390:   }'
  2391: else
  2392:   # ...otherwise fall back to using expr, which is often a shell builtin.
  2393:   func_split_short_opt ()
  2394:   {
  2395:       $debug_cmd
  2396: 
  2397:       func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
  2398:       func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
  2399:   }
  2400: fi #func_split_short_opt
  2401: 
  2402: 
  2403: # func_usage
  2404: # ----------
  2405: # Echo short help message to standard output and exit.
  2406: func_usage ()
  2407: {
  2408:     $debug_cmd
  2409: 
  2410:     func_usage_message
  2411:     $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
  2412:     exit 0
  2413: }
  2414: 
  2415: 
  2416: # func_usage_message
  2417: # ------------------
  2418: # Echo short help message to standard output.
  2419: func_usage_message ()
  2420: {
  2421:     $debug_cmd
  2422: 
  2423:     eval \$ECHO \""Usage: $usage"\"
  2424:     echo
  2425:     $SED -n 's|^# ||
  2426:         /^Written by/{
  2427:           x;p;x
  2428:         }
  2429: 	h
  2430: 	/^Written by/q' < "$progpath"
  2431:     echo
  2432:     eval \$ECHO \""$usage_message"\"
  2433: }
  2434: 
  2435: 
  2436: # func_version
  2437: # ------------
  2438: # Echo version message to standard output and exit.
  2439: func_version ()
  2440: {
  2441:     $debug_cmd
  2442: 
  2443:     printf '%s\n' "$progname $scriptversion"
  2444:     $SED -n '
  2445:         /(C)/!b go
  2446:         :more
  2447:         /\./!{
  2448:           N
  2449:           s|\n# | |
  2450:           b more
  2451:         }
  2452:         :go
  2453:         /^# Written by /,/# warranty; / {
  2454:           s|^# ||
  2455:           s|^# *$||
  2456:           s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
  2457:           p
  2458:         }
  2459:         /^# Written by / {
  2460:           s|^# ||
  2461:           p
  2462:         }
  2463:         /^warranty; /q' < "$progpath"
  2464: 
  2465:     exit $?
  2466: }
  2467: 
  2468: 
  2469: # Local variables:
  2470: # mode: shell-script
  2471: # sh-indentation: 2
  2472: # eval: (add-hook 'before-save-hook 'time-stamp)
  2473: # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
  2474: # time-stamp-time-zone: "UTC"
  2475: # End:
  2476: 
  2477: # Set a version string.
  2478: scriptversion='(GNU libtool) 2.4.6'
  2479: 
  2480: 
  2481: # func_echo ARG...
  2482: # ----------------
  2483: # Libtool also displays the current mode in messages, so override
  2484: # funclib.sh func_echo with this custom definition.
  2485: func_echo ()
  2486: {
  2487:     $debug_cmd
  2488: 
  2489:     _G_message=$*
  2490: 
  2491:     func_echo_IFS=$IFS
  2492:     IFS=$nl
  2493:     for _G_line in $_G_message; do
  2494:       IFS=$func_echo_IFS
  2495:       $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
  2496:     done
  2497:     IFS=$func_echo_IFS
  2498: }
  2499: 
  2500: 
  2501: # func_warning ARG...
  2502: # -------------------
  2503: # Libtool warnings are not categorized, so override funclib.sh
  2504: # func_warning with this simpler definition.
  2505: func_warning ()
  2506: {
  2507:     $debug_cmd
  2508: 
  2509:     $warning_func ${1+"$@"}
  2510: }
  2511: 
  2512: 
  2513: ## ---------------- ##
  2514: ## Options parsing. ##
  2515: ## ---------------- ##
  2516: 
  2517: # Hook in the functions to make sure our own options are parsed during
  2518: # the option parsing loop.
  2519: 
  2520: usage='$progpath [OPTION]... [MODE-ARG]...'
  2521: 
  2522: # Short help message in response to '-h'.
  2523: usage_message="Options:
  2524:        --config             show all configuration variables
  2525:        --debug              enable verbose shell tracing
  2526:    -n, --dry-run            display commands without modifying any files
  2527:        --features           display basic configuration information and exit
  2528:        --mode=MODE          use operation mode MODE
  2529:        --no-warnings        equivalent to '-Wnone'
  2530:        --preserve-dup-deps  don't remove duplicate dependency libraries
  2531:        --quiet, --silent    don't print informational messages
  2532:        --tag=TAG            use configuration variables from tag TAG
  2533:    -v, --verbose            print more informational messages than default
  2534:        --version            print version information
  2535:    -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [all]
  2536:    -h, --help, --help-all   print short, long, or detailed help message
  2537: "
  2538: 
  2539: # Additional text appended to 'usage_message' in response to '--help'.
  2540: func_help ()
  2541: {
  2542:     $debug_cmd
  2543: 
  2544:     func_usage_message
  2545:     $ECHO "$long_help_message
  2546: 
  2547: MODE must be one of the following:
  2548: 
  2549:        clean           remove files from the build directory
  2550:        compile         compile a source file into a libtool object
  2551:        execute         automatically set library path, then run a program
  2552:        finish          complete the installation of libtool libraries
  2553:        install         install libraries or executables
  2554:        link            create a library or an executable
  2555:        uninstall       remove libraries from an installed directory
  2556: 
  2557: MODE-ARGS vary depending on the MODE.  When passed as first option,
  2558: '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
  2559: Try '$progname --help --mode=MODE' for a more detailed description of MODE.
  2560: 
  2561: When reporting a bug, please describe a test case to reproduce it and
  2562: include the following information:
  2563: 
  2564:        host-triplet:   $host
  2565:        shell:          $SHELL
  2566:        compiler:       $LTCC
  2567:        compiler flags: $LTCFLAGS
  2568:        linker:         $LD (gnu? $with_gnu_ld)
  2569:        version:        $progname (GNU libtool) 2.4.6
  2570:        automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
  2571:        autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
  2572: 
  2573: Report bugs to <bug-libtool@gnu.org>.
  2574: GNU libtool home page: <http://www.gnu.org/software/libtool/>.
  2575: General help using GNU software: <http://www.gnu.org/gethelp/>."
  2576:     exit 0
  2577: }
  2578: 
  2579: 
  2580: # func_lo2o OBJECT-NAME
  2581: # ---------------------
  2582: # Transform OBJECT-NAME from a '.lo' suffix to the platform specific
  2583: # object suffix.
  2584: 
  2585: lo2o=s/\\.lo\$/.$objext/
  2586: o2lo=s/\\.$objext\$/.lo/
  2587: 
  2588: if test yes = "$_G_HAVE_XSI_OPS"; then
  2589:   eval 'func_lo2o ()
  2590:   {
  2591:     case $1 in
  2592:       *.lo) func_lo2o_result=${1%.lo}.$objext ;;
  2593:       *   ) func_lo2o_result=$1               ;;
  2594:     esac
  2595:   }'
  2596: 
  2597:   # func_xform LIBOBJ-OR-SOURCE
  2598:   # ---------------------------
  2599:   # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
  2600:   # suffix to a '.lo' libtool-object suffix.
  2601:   eval 'func_xform ()
  2602:   {
  2603:     func_xform_result=${1%.*}.lo
  2604:   }'
  2605: else
  2606:   # ...otherwise fall back to using sed.
  2607:   func_lo2o ()
  2608:   {
  2609:     func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
  2610:   }
  2611: 
  2612:   func_xform ()
  2613:   {
  2614:     func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
  2615:   }
  2616: fi
  2617: 
  2618: 
  2619: # func_fatal_configuration ARG...
  2620: # -------------------------------
  2621: # Echo program name prefixed message to standard error, followed by
  2622: # a configuration failure hint, and exit.
  2623: func_fatal_configuration ()
  2624: {
  2625:     func__fatal_error ${1+"$@"} \
  2626:       "See the $PACKAGE documentation for more information." \
  2627:       "Fatal configuration error."
  2628: }
  2629: 
  2630: 
  2631: # func_config
  2632: # -----------
  2633: # Display the configuration for all the tags in this script.
  2634: func_config ()
  2635: {
  2636:     re_begincf='^# ### BEGIN LIBTOOL'
  2637:     re_endcf='^# ### END LIBTOOL'
  2638: 
  2639:     # Default configuration.
  2640:     $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
  2641: 
  2642:     # Now print the configurations for the tags.
  2643:     for tagname in $taglist; do
  2644:       $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
  2645:     done
  2646: 
  2647:     exit $?
  2648: }
  2649: 
  2650: 
  2651: # func_features
  2652: # -------------
  2653: # Display the features supported by this script.
  2654: func_features ()
  2655: {
  2656:     echo "host: $host"
  2657:     if test yes = "$build_libtool_libs"; then
  2658:       echo "enable shared libraries"
  2659:     else
  2660:       echo "disable shared libraries"
  2661:     fi
  2662:     if test yes = "$build_old_libs"; then
  2663:       echo "enable static libraries"
  2664:     else
  2665:       echo "disable static libraries"
  2666:     fi
  2667: 
  2668:     exit $?
  2669: }
  2670: 
  2671: 
  2672: # func_enable_tag TAGNAME
  2673: # -----------------------
  2674: # Verify that TAGNAME is valid, and either flag an error and exit, or
  2675: # enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
  2676: # variable here.
  2677: func_enable_tag ()
  2678: {
  2679:     # Global variable:
  2680:     tagname=$1
  2681: 
  2682:     re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
  2683:     re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
  2684:     sed_extractcf=/$re_begincf/,/$re_endcf/p
  2685: 
  2686:     # Validate tagname.
  2687:     case $tagname in
  2688:       *[!-_A-Za-z0-9,/]*)
  2689:         func_fatal_error "invalid tag name: $tagname"
  2690:         ;;
  2691:     esac
  2692: 
  2693:     # Don't test for the "default" C tag, as we know it's
  2694:     # there but not specially marked.
  2695:     case $tagname in
  2696:         CC) ;;
  2697:     *)
  2698:         if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
  2699: 	  taglist="$taglist $tagname"
  2700: 
  2701: 	  # Evaluate the configuration.  Be careful to quote the path
  2702: 	  # and the sed script, to avoid splitting on whitespace, but
  2703: 	  # also don't use non-portable quotes within backquotes within
  2704: 	  # quotes we have to do it in 2 steps:
  2705: 	  extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
  2706: 	  eval "$extractedcf"
  2707:         else
  2708: 	  func_error "ignoring unknown tag $tagname"
  2709:         fi
  2710:         ;;
  2711:     esac
  2712: }
  2713: 
  2714: 
  2715: # func_check_version_match
  2716: # ------------------------
  2717: # Ensure that we are using m4 macros, and libtool script from the same
  2718: # release of libtool.
  2719: func_check_version_match ()
  2720: {
  2721:     if test "$package_revision" != "$macro_revision"; then
  2722:       if test "$VERSION" != "$macro_version"; then
  2723:         if test -z "$macro_version"; then
  2724:           cat >&2 <<_LT_EOF
  2725: $progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
  2726: $progname: definition of this LT_INIT comes from an older release.
  2727: $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
  2728: $progname: and run autoconf again.
  2729: _LT_EOF
  2730:         else
  2731:           cat >&2 <<_LT_EOF
  2732: $progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
  2733: $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
  2734: $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
  2735: $progname: and run autoconf again.
  2736: _LT_EOF
  2737:         fi
  2738:       else
  2739:         cat >&2 <<_LT_EOF
  2740: $progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
  2741: $progname: but the definition of this LT_INIT comes from revision $macro_revision.
  2742: $progname: You should recreate aclocal.m4 with macros from revision $package_revision
  2743: $progname: of $PACKAGE $VERSION and run autoconf again.
  2744: _LT_EOF
  2745:       fi
  2746: 
  2747:       exit $EXIT_MISMATCH
  2748:     fi
  2749: }
  2750: 
  2751: 
  2752: # libtool_options_prep [ARG]...
  2753: # -----------------------------
  2754: # Preparation for options parsed by libtool.
  2755: libtool_options_prep ()
  2756: {
  2757:     $debug_mode
  2758: 
  2759:     # Option defaults:
  2760:     opt_config=false
  2761:     opt_dlopen=
  2762:     opt_dry_run=false
  2763:     opt_help=false
  2764:     opt_mode=
  2765:     opt_preserve_dup_deps=false
  2766:     opt_quiet=false
  2767: 
  2768:     nonopt=
  2769:     preserve_args=
  2770: 
  2771:     # Shorthand for --mode=foo, only valid as the first argument
  2772:     case $1 in
  2773:     clean|clea|cle|cl)
  2774:       shift; set dummy --mode clean ${1+"$@"}; shift
  2775:       ;;
  2776:     compile|compil|compi|comp|com|co|c)
  2777:       shift; set dummy --mode compile ${1+"$@"}; shift
  2778:       ;;
  2779:     execute|execut|execu|exec|exe|ex|e)
  2780:       shift; set dummy --mode execute ${1+"$@"}; shift
  2781:       ;;
  2782:     finish|finis|fini|fin|fi|f)
  2783:       shift; set dummy --mode finish ${1+"$@"}; shift
  2784:       ;;
  2785:     install|instal|insta|inst|ins|in|i)
  2786:       shift; set dummy --mode install ${1+"$@"}; shift
  2787:       ;;
  2788:     link|lin|li|l)
  2789:       shift; set dummy --mode link ${1+"$@"}; shift
  2790:       ;;
  2791:     uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
  2792:       shift; set dummy --mode uninstall ${1+"$@"}; shift
  2793:       ;;
  2794:     esac
  2795: 
  2796:     # Pass back the list of options.
  2797:     func_quote_for_eval ${1+"$@"}
  2798:     libtool_options_prep_result=$func_quote_for_eval_result
  2799: }
  2800: func_add_hook func_options_prep libtool_options_prep
  2801: 
  2802: 
  2803: # libtool_parse_options [ARG]...
  2804: # ---------------------------------
  2805: # Provide handling for libtool specific options.
  2806: libtool_parse_options ()
  2807: {
  2808:     $debug_cmd
  2809: 
  2810:     # Perform our own loop to consume as many options as possible in
  2811:     # each iteration.
  2812:     while test $# -gt 0; do
  2813:       _G_opt=$1
  2814:       shift
  2815:       case $_G_opt in
  2816:         --dry-run|--dryrun|-n)
  2817:                         opt_dry_run=:
  2818:                         ;;
  2819: 
  2820:         --config)       func_config ;;
  2821: 
  2822:         --dlopen|-dlopen)
  2823:                         opt_dlopen="${opt_dlopen+$opt_dlopen
  2824: }$1"
  2825:                         shift
  2826:                         ;;
  2827: 
  2828:         --preserve-dup-deps)
  2829:                         opt_preserve_dup_deps=: ;;
  2830: 
  2831:         --features)     func_features ;;
  2832: 
  2833:         --finish)       set dummy --mode finish ${1+"$@"}; shift ;;
  2834: 
  2835:         --help)         opt_help=: ;;
  2836: 
  2837:         --help-all)     opt_help=': help-all' ;;
  2838: 
  2839:         --mode)         test $# = 0 && func_missing_arg $_G_opt && break
  2840:                         opt_mode=$1
  2841:                         case $1 in
  2842:                           # Valid mode arguments:
  2843:                           clean|compile|execute|finish|install|link|relink|uninstall) ;;
  2844: 
  2845:                           # Catch anything else as an error
  2846:                           *) func_error "invalid argument for $_G_opt"
  2847:                              exit_cmd=exit
  2848:                              break
  2849:                              ;;
  2850:                         esac
  2851:                         shift
  2852:                         ;;
  2853: 
  2854:         --no-silent|--no-quiet)
  2855:                         opt_quiet=false
  2856:                         func_append preserve_args " $_G_opt"
  2857:                         ;;
  2858: 
  2859:         --no-warnings|--no-warning|--no-warn)
  2860:                         opt_warning=false
  2861:                         func_append preserve_args " $_G_opt"
  2862:                         ;;
  2863: 
  2864:         --no-verbose)
  2865:                         opt_verbose=false
  2866:                         func_append preserve_args " $_G_opt"
  2867:                         ;;
  2868: 
  2869:         --silent|--quiet)
  2870:                         opt_quiet=:
  2871:                         opt_verbose=false
  2872:                         func_append preserve_args " $_G_opt"
  2873:                         ;;
  2874: 
  2875:         --tag)          test $# = 0 && func_missing_arg $_G_opt && break
  2876:                         opt_tag=$1
  2877:                         func_append preserve_args " $_G_opt $1"
  2878:                         func_enable_tag "$1"
  2879:                         shift
  2880:                         ;;
  2881: 
  2882:         --verbose|-v)   opt_quiet=false
  2883:                         opt_verbose=:
  2884:                         func_append preserve_args " $_G_opt"
  2885:                         ;;
  2886: 
  2887: 	# An option not handled by this hook function:
  2888:         *)		set dummy "$_G_opt" ${1+"$@"};	shift; break  ;;
  2889:       esac
  2890:     done
  2891: 
  2892: 
  2893:     # save modified positional parameters for caller
  2894:     func_quote_for_eval ${1+"$@"}
  2895:     libtool_parse_options_result=$func_quote_for_eval_result
  2896: }
  2897: func_add_hook func_parse_options libtool_parse_options
  2898: 
  2899: 
  2900: 
  2901: # libtool_validate_options [ARG]...
  2902: # ---------------------------------
  2903: # Perform any sanity checks on option settings and/or unconsumed
  2904: # arguments.
  2905: libtool_validate_options ()
  2906: {
  2907:     # save first non-option argument
  2908:     if test 0 -lt $#; then
  2909:       nonopt=$1
  2910:       shift
  2911:     fi
  2912: 
  2913:     # preserve --debug
  2914:     test : = "$debug_cmd" || func_append preserve_args " --debug"
  2915: 
  2916:     case $host in
  2917:       # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
  2918:       # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
  2919:       *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
  2920:         # don't eliminate duplications in $postdeps and $predeps
  2921:         opt_duplicate_compiler_generated_deps=:
  2922:         ;;
  2923:       *)
  2924:         opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
  2925:         ;;
  2926:     esac
  2927: 
  2928:     $opt_help || {
  2929:       # Sanity checks first:
  2930:       func_check_version_match
  2931: 
  2932:       test yes != "$build_libtool_libs" \
  2933:         && test yes != "$build_old_libs" \
  2934:         && func_fatal_configuration "not configured to build any kind of library"
  2935: 
  2936:       # Darwin sucks
  2937:       eval std_shrext=\"$shrext_cmds\"
  2938: 
  2939:       # Only execute mode is allowed to have -dlopen flags.
  2940:       if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
  2941:         func_error "unrecognized option '-dlopen'"
  2942:         $ECHO "$help" 1>&2
  2943:         exit $EXIT_FAILURE
  2944:       fi
  2945: 
  2946:       # Change the help message to a mode-specific one.
  2947:       generic_help=$help
  2948:       help="Try '$progname --help --mode=$opt_mode' for more information."
  2949:     }
  2950: 
  2951:     # Pass back the unparsed argument list
  2952:     func_quote_for_eval ${1+"$@"}
  2953:     libtool_validate_options_result=$func_quote_for_eval_result
  2954: }
  2955: func_add_hook func_validate_options libtool_validate_options
  2956: 
  2957: 
  2958: # Process options as early as possible so that --help and --version
  2959: # can return quickly.
  2960: func_options ${1+"$@"}
  2961: eval set dummy "$func_options_result"; shift
  2962: 
  2963: 
  2964: 
  2965: ## ----------- ##
  2966: ##    Main.    ##
  2967: ## ----------- ##
  2968: 
  2969: magic='%%%MAGIC variable%%%'
  2970: magic_exe='%%%MAGIC EXE variable%%%'
  2971: 
  2972: # Global variables.
  2973: extracted_archives=
  2974: extracted_serial=0
  2975: 
  2976: # If this variable is set in any of the actions, the command in it
  2977: # will be execed at the end.  This prevents here-documents from being
  2978: # left over by shells.
  2979: exec_cmd=
  2980: 
  2981: 
  2982: # A function that is used when there is no print builtin or printf.
  2983: func_fallback_echo ()
  2984: {
  2985:   eval 'cat <<_LTECHO_EOF
  2986: $1
  2987: _LTECHO_EOF'
  2988: }
  2989: 
  2990: # func_generated_by_libtool
  2991: # True iff stdin has been generated by Libtool. This function is only
  2992: # a basic sanity check; it will hardly flush out determined imposters.
  2993: func_generated_by_libtool_p ()
  2994: {
  2995:   $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
  2996: }
  2997: 
  2998: # func_lalib_p file
  2999: # True iff FILE is a libtool '.la' library or '.lo' object file.
  3000: # This function is only a basic sanity check; it will hardly flush out
  3001: # determined imposters.
  3002: func_lalib_p ()
  3003: {
  3004:     test -f "$1" &&
  3005:       $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
  3006: }
  3007: 
  3008: # func_lalib_unsafe_p file
  3009: # True iff FILE is a libtool '.la' library or '.lo' object file.
  3010: # This function implements the same check as func_lalib_p without
  3011: # resorting to external programs.  To this end, it redirects stdin and
  3012: # closes it afterwards, without saving the original file descriptor.
  3013: # As a safety measure, use it only where a negative result would be
  3014: # fatal anyway.  Works if 'file' does not exist.
  3015: func_lalib_unsafe_p ()
  3016: {
  3017:     lalib_p=no
  3018:     if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
  3019: 	for lalib_p_l in 1 2 3 4
  3020: 	do
  3021: 	    read lalib_p_line
  3022: 	    case $lalib_p_line in
  3023: 		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
  3024: 	    esac
  3025: 	done
  3026: 	exec 0<&5 5<&-
  3027:     fi
  3028:     test yes = "$lalib_p"
  3029: }
  3030: 
  3031: # func_ltwrapper_script_p file
  3032: # True iff FILE is a libtool wrapper script
  3033: # This function is only a basic sanity check; it will hardly flush out
  3034: # determined imposters.
  3035: func_ltwrapper_script_p ()
  3036: {
  3037:     test -f "$1" &&
  3038:       $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
  3039: }
  3040: 
  3041: # func_ltwrapper_executable_p file
  3042: # True iff FILE is a libtool wrapper executable
  3043: # This function is only a basic sanity check; it will hardly flush out
  3044: # determined imposters.
  3045: func_ltwrapper_executable_p ()
  3046: {
  3047:     func_ltwrapper_exec_suffix=
  3048:     case $1 in
  3049:     *.exe) ;;
  3050:     *) func_ltwrapper_exec_suffix=.exe ;;
  3051:     esac
  3052:     $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
  3053: }
  3054: 
  3055: # func_ltwrapper_scriptname file
  3056: # Assumes file is an ltwrapper_executable
  3057: # uses $file to determine the appropriate filename for a
  3058: # temporary ltwrapper_script.
  3059: func_ltwrapper_scriptname ()
  3060: {
  3061:     func_dirname_and_basename "$1" "" "."
  3062:     func_stripname '' '.exe' "$func_basename_result"
  3063:     func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
  3064: }
  3065: 
  3066: # func_ltwrapper_p file
  3067: # True iff FILE is a libtool wrapper script or wrapper executable
  3068: # This function is only a basic sanity check; it will hardly flush out
  3069: # determined imposters.
  3070: func_ltwrapper_p ()
  3071: {
  3072:     func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
  3073: }
  3074: 
  3075: 
  3076: # func_execute_cmds commands fail_cmd
  3077: # Execute tilde-delimited COMMANDS.
  3078: # If FAIL_CMD is given, eval that upon failure.
  3079: # FAIL_CMD may read-access the current command in variable CMD!
  3080: func_execute_cmds ()
  3081: {
  3082:     $debug_cmd
  3083: 
  3084:     save_ifs=$IFS; IFS='~'
  3085:     for cmd in $1; do
  3086:       IFS=$sp$nl
  3087:       eval cmd=\"$cmd\"
  3088:       IFS=$save_ifs
  3089:       func_show_eval "$cmd" "${2-:}"
  3090:     done
  3091:     IFS=$save_ifs
  3092: }
  3093: 
  3094: 
  3095: # func_source file
  3096: # Source FILE, adding directory component if necessary.
  3097: # Note that it is not necessary on cygwin/mingw to append a dot to
  3098: # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
  3099: # behavior happens only for exec(3), not for open(2)!  Also, sourcing
  3100: # 'FILE.' does not work on cygwin managed mounts.
  3101: func_source ()
  3102: {
  3103:     $debug_cmd
  3104: 
  3105:     case $1 in
  3106:     */* | *\\*)	. "$1" ;;
  3107:     *)		. "./$1" ;;
  3108:     esac
  3109: }
  3110: 
  3111: 
  3112: # func_resolve_sysroot PATH
  3113: # Replace a leading = in PATH with a sysroot.  Store the result into
  3114: # func_resolve_sysroot_result
  3115: func_resolve_sysroot ()
  3116: {
  3117:   func_resolve_sysroot_result=$1
  3118:   case $func_resolve_sysroot_result in
  3119:   =*)
  3120:     func_stripname '=' '' "$func_resolve_sysroot_result"
  3121:     func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
  3122:     ;;
  3123:   esac
  3124: }
  3125: 
  3126: # func_replace_sysroot PATH
  3127: # If PATH begins with the sysroot, replace it with = and
  3128: # store the result into func_replace_sysroot_result.
  3129: func_replace_sysroot ()
  3130: {
  3131:   case $lt_sysroot:$1 in
  3132:   ?*:"$lt_sysroot"*)
  3133:     func_stripname "$lt_sysroot" '' "$1"
  3134:     func_replace_sysroot_result='='$func_stripname_result
  3135:     ;;
  3136:   *)
  3137:     # Including no sysroot.
  3138:     func_replace_sysroot_result=$1
  3139:     ;;
  3140:   esac
  3141: }
  3142: 
  3143: # func_infer_tag arg
  3144: # Infer tagged configuration to use if any are available and
  3145: # if one wasn't chosen via the "--tag" command line option.
  3146: # Only attempt this if the compiler in the base compile
  3147: # command doesn't match the default compiler.
  3148: # arg is usually of the form 'gcc ...'
  3149: func_infer_tag ()
  3150: {
  3151:     $debug_cmd
  3152: 
  3153:     if test -n "$available_tags" && test -z "$tagname"; then
  3154:       CC_quoted=
  3155:       for arg in $CC; do
  3156: 	func_append_quoted CC_quoted "$arg"
  3157:       done
  3158:       CC_expanded=`func_echo_all $CC`
  3159:       CC_quoted_expanded=`func_echo_all $CC_quoted`
  3160:       case $@ in
  3161:       # Blanks in the command may have been stripped by the calling shell,
  3162:       # but not from the CC environment variable when configure was run.
  3163:       " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
  3164:       " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
  3165:       # Blanks at the start of $base_compile will cause this to fail
  3166:       # if we don't check for them as well.
  3167:       *)
  3168: 	for z in $available_tags; do
  3169: 	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
  3170: 	    # Evaluate the configuration.
  3171: 	    eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
  3172: 	    CC_quoted=
  3173: 	    for arg in $CC; do
  3174: 	      # Double-quote args containing other shell metacharacters.
  3175: 	      func_append_quoted CC_quoted "$arg"
  3176: 	    done
  3177: 	    CC_expanded=`func_echo_all $CC`
  3178: 	    CC_quoted_expanded=`func_echo_all $CC_quoted`
  3179: 	    case "$@ " in
  3180: 	    " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
  3181: 	    " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
  3182: 	      # The compiler in the base compile command matches
  3183: 	      # the one in the tagged configuration.
  3184: 	      # Assume this is the tagged configuration we want.
  3185: 	      tagname=$z
  3186: 	      break
  3187: 	      ;;
  3188: 	    esac
  3189: 	  fi
  3190: 	done
  3191: 	# If $tagname still isn't set, then no tagged configuration
  3192: 	# was found and let the user know that the "--tag" command
  3193: 	# line option must be used.
  3194: 	if test -z "$tagname"; then
  3195: 	  func_echo "unable to infer tagged configuration"
  3196: 	  func_fatal_error "specify a tag with '--tag'"
  3197: #	else
  3198: #	  func_verbose "using $tagname tagged configuration"
  3199: 	fi
  3200: 	;;
  3201:       esac
  3202:     fi
  3203: }
  3204: 
  3205: 
  3206: 
  3207: # func_write_libtool_object output_name pic_name nonpic_name
  3208: # Create a libtool object file (analogous to a ".la" file),
  3209: # but don't create it if we're doing a dry run.
  3210: func_write_libtool_object ()
  3211: {
  3212:     write_libobj=$1
  3213:     if test yes = "$build_libtool_libs"; then
  3214:       write_lobj=\'$2\'
  3215:     else
  3216:       write_lobj=none
  3217:     fi
  3218: 
  3219:     if test yes = "$build_old_libs"; then
  3220:       write_oldobj=\'$3\'
  3221:     else
  3222:       write_oldobj=none
  3223:     fi
  3224: 
  3225:     $opt_dry_run || {
  3226:       cat >${write_libobj}T <<EOF
  3227: # $write_libobj - a libtool object file
  3228: # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
  3229: #
  3230: # Please DO NOT delete this file!
  3231: # It is necessary for linking the library.
  3232: 
  3233: # Name of the PIC object.
  3234: pic_object=$write_lobj
  3235: 
  3236: # Name of the non-PIC object
  3237: non_pic_object=$write_oldobj
  3238: 
  3239: EOF
  3240:       $MV "${write_libobj}T" "$write_libobj"
  3241:     }
  3242: }
  3243: 
  3244: 
  3245: ##################################################
  3246: # FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
  3247: ##################################################
  3248: 
  3249: # func_convert_core_file_wine_to_w32 ARG
  3250: # Helper function used by file name conversion functions when $build is *nix,
  3251: # and $host is mingw, cygwin, or some other w32 environment. Relies on a
  3252: # correctly configured wine environment available, with the winepath program
  3253: # in $build's $PATH.
  3254: #
  3255: # ARG is the $build file name to be converted to w32 format.
  3256: # Result is available in $func_convert_core_file_wine_to_w32_result, and will
  3257: # be empty on error (or when ARG is empty)
  3258: func_convert_core_file_wine_to_w32 ()
  3259: {
  3260:   $debug_cmd
  3261: 
  3262:   func_convert_core_file_wine_to_w32_result=$1
  3263:   if test -n "$1"; then
  3264:     # Unfortunately, winepath does not exit with a non-zero error code, so we
  3265:     # are forced to check the contents of stdout. On the other hand, if the
  3266:     # command is not found, the shell will set an exit code of 127 and print
  3267:     # *an error message* to stdout. So we must check for both error code of
  3268:     # zero AND non-empty stdout, which explains the odd construction:
  3269:     func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
  3270:     if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
  3271:       func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
  3272:         $SED -e "$sed_naive_backslashify"`
  3273:     else
  3274:       func_convert_core_file_wine_to_w32_result=
  3275:     fi
  3276:   fi
  3277: }
  3278: # end: func_convert_core_file_wine_to_w32
  3279: 
  3280: 
  3281: # func_convert_core_path_wine_to_w32 ARG
  3282: # Helper function used by path conversion functions when $build is *nix, and
  3283: # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
  3284: # configured wine environment available, with the winepath program in $build's
  3285: # $PATH. Assumes ARG has no leading or trailing path separator characters.
  3286: #
  3287: # ARG is path to be converted from $build format to win32.
  3288: # Result is available in $func_convert_core_path_wine_to_w32_result.
  3289: # Unconvertible file (directory) names in ARG are skipped; if no directory names
  3290: # are convertible, then the result may be empty.
  3291: func_convert_core_path_wine_to_w32 ()
  3292: {
  3293:   $debug_cmd
  3294: 
  3295:   # unfortunately, winepath doesn't convert paths, only file names
  3296:   func_convert_core_path_wine_to_w32_result=
  3297:   if test -n "$1"; then
  3298:     oldIFS=$IFS
  3299:     IFS=:
  3300:     for func_convert_core_path_wine_to_w32_f in $1; do
  3301:       IFS=$oldIFS
  3302:       func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
  3303:       if test -n "$func_convert_core_file_wine_to_w32_result"; then
  3304:         if test -z "$func_convert_core_path_wine_to_w32_result"; then
  3305:           func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
  3306:         else
  3307:           func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
  3308:         fi
  3309:       fi
  3310:     done
  3311:     IFS=$oldIFS
  3312:   fi
  3313: }
  3314: # end: func_convert_core_path_wine_to_w32
  3315: 
  3316: 
  3317: # func_cygpath ARGS...
  3318: # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
  3319: # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
  3320: # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
  3321: # (2), returns the Cygwin file name or path in func_cygpath_result (input
  3322: # file name or path is assumed to be in w32 format, as previously converted
  3323: # from $build's *nix or MSYS format). In case (3), returns the w32 file name
  3324: # or path in func_cygpath_result (input file name or path is assumed to be in
  3325: # Cygwin format). Returns an empty string on error.
  3326: #
  3327: # ARGS are passed to cygpath, with the last one being the file name or path to
  3328: # be converted.
  3329: #
  3330: # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
  3331: # environment variable; do not put it in $PATH.
  3332: func_cygpath ()
  3333: {
  3334:   $debug_cmd
  3335: 
  3336:   if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
  3337:     func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
  3338:     if test "$?" -ne 0; then
  3339:       # on failure, ensure result is empty
  3340:       func_cygpath_result=
  3341:     fi
  3342:   else
  3343:     func_cygpath_result=
  3344:     func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
  3345:   fi
  3346: }
  3347: #end: func_cygpath
  3348: 
  3349: 
  3350: # func_convert_core_msys_to_w32 ARG
  3351: # Convert file name or path ARG from MSYS format to w32 format.  Return
  3352: # result in func_convert_core_msys_to_w32_result.
  3353: func_convert_core_msys_to_w32 ()
  3354: {
  3355:   $debug_cmd
  3356: 
  3357:   # awkward: cmd appends spaces to result
  3358:   func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
  3359:     $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
  3360: }
  3361: #end: func_convert_core_msys_to_w32
  3362: 
  3363: 
  3364: # func_convert_file_check ARG1 ARG2
  3365: # Verify that ARG1 (a file name in $build format) was converted to $host
  3366: # format in ARG2. Otherwise, emit an error message, but continue (resetting
  3367: # func_to_host_file_result to ARG1).
  3368: func_convert_file_check ()
  3369: {
  3370:   $debug_cmd
  3371: 
  3372:   if test -z "$2" && test -n "$1"; then
  3373:     func_error "Could not determine host file name corresponding to"
  3374:     func_error "  '$1'"
  3375:     func_error "Continuing, but uninstalled executables may not work."
  3376:     # Fallback:
  3377:     func_to_host_file_result=$1
  3378:   fi
  3379: }
  3380: # end func_convert_file_check
  3381: 
  3382: 
  3383: # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
  3384: # Verify that FROM_PATH (a path in $build format) was converted to $host
  3385: # format in TO_PATH. Otherwise, emit an error message, but continue, resetting
  3386: # func_to_host_file_result to a simplistic fallback value (see below).
  3387: func_convert_path_check ()
  3388: {
  3389:   $debug_cmd
  3390: 
  3391:   if test -z "$4" && test -n "$3"; then
  3392:     func_error "Could not determine the host path corresponding to"
  3393:     func_error "  '$3'"
  3394:     func_error "Continuing, but uninstalled executables may not work."
  3395:     # Fallback.  This is a deliberately simplistic "conversion" and
  3396:     # should not be "improved".  See libtool.info.
  3397:     if test "x$1" != "x$2"; then
  3398:       lt_replace_pathsep_chars="s|$1|$2|g"
  3399:       func_to_host_path_result=`echo "$3" |
  3400:         $SED -e "$lt_replace_pathsep_chars"`
  3401:     else
  3402:       func_to_host_path_result=$3
  3403:     fi
  3404:   fi
  3405: }
  3406: # end func_convert_path_check
  3407: 
  3408: 
  3409: # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
  3410: # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
  3411: # and appending REPL if ORIG matches BACKPAT.
  3412: func_convert_path_front_back_pathsep ()
  3413: {
  3414:   $debug_cmd
  3415: 
  3416:   case $4 in
  3417:   $1 ) func_to_host_path_result=$3$func_to_host_path_result
  3418:     ;;
  3419:   esac
  3420:   case $4 in
  3421:   $2 ) func_append func_to_host_path_result "$3"
  3422:     ;;
  3423:   esac
  3424: }
  3425: # end func_convert_path_front_back_pathsep
  3426: 
  3427: 
  3428: ##################################################
  3429: # $build to $host FILE NAME CONVERSION FUNCTIONS #
  3430: ##################################################
  3431: # invoked via '$to_host_file_cmd ARG'
  3432: #
  3433: # In each case, ARG is the path to be converted from $build to $host format.
  3434: # Result will be available in $func_to_host_file_result.
  3435: 
  3436: 
  3437: # func_to_host_file ARG
  3438: # Converts the file name ARG from $build format to $host format. Return result
  3439: # in func_to_host_file_result.
  3440: func_to_host_file ()
  3441: {
  3442:   $debug_cmd
  3443: 
  3444:   $to_host_file_cmd "$1"
  3445: }
  3446: # end func_to_host_file
  3447: 
  3448: 
  3449: # func_to_tool_file ARG LAZY
  3450: # converts the file name ARG from $build format to toolchain format. Return
  3451: # result in func_to_tool_file_result.  If the conversion in use is listed
  3452: # in (the comma separated) LAZY, no conversion takes place.
  3453: func_to_tool_file ()
  3454: {
  3455:   $debug_cmd
  3456: 
  3457:   case ,$2, in
  3458:     *,"$to_tool_file_cmd",*)
  3459:       func_to_tool_file_result=$1
  3460:       ;;
  3461:     *)
  3462:       $to_tool_file_cmd "$1"
  3463:       func_to_tool_file_result=$func_to_host_file_result
  3464:       ;;
  3465:   esac
  3466: }
  3467: # end func_to_tool_file
  3468: 
  3469: 
  3470: # func_convert_file_noop ARG
  3471: # Copy ARG to func_to_host_file_result.
  3472: func_convert_file_noop ()
  3473: {
  3474:   func_to_host_file_result=$1
  3475: }
  3476: # end func_convert_file_noop
  3477: 
  3478: 
  3479: # func_convert_file_msys_to_w32 ARG
  3480: # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
  3481: # conversion to w32 is not available inside the cwrapper.  Returns result in
  3482: # func_to_host_file_result.
  3483: func_convert_file_msys_to_w32 ()
  3484: {
  3485:   $debug_cmd
  3486: 
  3487:   func_to_host_file_result=$1
  3488:   if test -n "$1"; then
  3489:     func_convert_core_msys_to_w32 "$1"
  3490:     func_to_host_file_result=$func_convert_core_msys_to_w32_result
  3491:   fi
  3492:   func_convert_file_check "$1" "$func_to_host_file_result"
  3493: }
  3494: # end func_convert_file_msys_to_w32
  3495: 
  3496: 
  3497: # func_convert_file_cygwin_to_w32 ARG
  3498: # Convert file name ARG from Cygwin to w32 format.  Returns result in
  3499: # func_to_host_file_result.
  3500: func_convert_file_cygwin_to_w32 ()
  3501: {
  3502:   $debug_cmd
  3503: 
  3504:   func_to_host_file_result=$1
  3505:   if test -n "$1"; then
  3506:     # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
  3507:     # LT_CYGPATH in this case.
  3508:     func_to_host_file_result=`cygpath -m "$1"`
  3509:   fi
  3510:   func_convert_file_check "$1" "$func_to_host_file_result"
  3511: }
  3512: # end func_convert_file_cygwin_to_w32
  3513: 
  3514: 
  3515: # func_convert_file_nix_to_w32 ARG
  3516: # Convert file name ARG from *nix to w32 format.  Requires a wine environment
  3517: # and a working winepath. Returns result in func_to_host_file_result.
  3518: func_convert_file_nix_to_w32 ()
  3519: {
  3520:   $debug_cmd
  3521: 
  3522:   func_to_host_file_result=$1
  3523:   if test -n "$1"; then
  3524:     func_convert_core_file_wine_to_w32 "$1"
  3525:     func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
  3526:   fi
  3527:   func_convert_file_check "$1" "$func_to_host_file_result"
  3528: }
  3529: # end func_convert_file_nix_to_w32
  3530: 
  3531: 
  3532: # func_convert_file_msys_to_cygwin ARG
  3533: # Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
  3534: # Returns result in func_to_host_file_result.
  3535: func_convert_file_msys_to_cygwin ()
  3536: {
  3537:   $debug_cmd
  3538: 
  3539:   func_to_host_file_result=$1
  3540:   if test -n "$1"; then
  3541:     func_convert_core_msys_to_w32 "$1"
  3542:     func_cygpath -u "$func_convert_core_msys_to_w32_result"
  3543:     func_to_host_file_result=$func_cygpath_result
  3544:   fi
  3545:   func_convert_file_check "$1" "$func_to_host_file_result"
  3546: }
  3547: # end func_convert_file_msys_to_cygwin
  3548: 
  3549: 
  3550: # func_convert_file_nix_to_cygwin ARG
  3551: # Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
  3552: # in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
  3553: # in func_to_host_file_result.
  3554: func_convert_file_nix_to_cygwin ()
  3555: {
  3556:   $debug_cmd
  3557: 
  3558:   func_to_host_file_result=$1
  3559:   if test -n "$1"; then
  3560:     # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
  3561:     func_convert_core_file_wine_to_w32 "$1"
  3562:     func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
  3563:     func_to_host_file_result=$func_cygpath_result
  3564:   fi
  3565:   func_convert_file_check "$1" "$func_to_host_file_result"
  3566: }
  3567: # end func_convert_file_nix_to_cygwin
  3568: 
  3569: 
  3570: #############################################
  3571: # $build to $host PATH CONVERSION FUNCTIONS #
  3572: #############################################
  3573: # invoked via '$to_host_path_cmd ARG'
  3574: #
  3575: # In each case, ARG is the path to be converted from $build to $host format.
  3576: # The result will be available in $func_to_host_path_result.
  3577: #
  3578: # Path separators are also converted from $build format to $host format.  If
  3579: # ARG begins or ends with a path separator character, it is preserved (but
  3580: # converted to $host format) on output.
  3581: #
  3582: # All path conversion functions are named using the following convention:
  3583: #   file name conversion function    : func_convert_file_X_to_Y ()
  3584: #   path conversion function         : func_convert_path_X_to_Y ()
  3585: # where, for any given $build/$host combination the 'X_to_Y' value is the
  3586: # same.  If conversion functions are added for new $build/$host combinations,
  3587: # the two new functions must follow this pattern, or func_init_to_host_path_cmd
  3588: # will break.
  3589: 
  3590: 
  3591: # func_init_to_host_path_cmd
  3592: # Ensures that function "pointer" variable $to_host_path_cmd is set to the
  3593: # appropriate value, based on the value of $to_host_file_cmd.
  3594: to_host_path_cmd=
  3595: func_init_to_host_path_cmd ()
  3596: {
  3597:   $debug_cmd
  3598: 
  3599:   if test -z "$to_host_path_cmd"; then
  3600:     func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
  3601:     to_host_path_cmd=func_convert_path_$func_stripname_result
  3602:   fi
  3603: }
  3604: 
  3605: 
  3606: # func_to_host_path ARG
  3607: # Converts the path ARG from $build format to $host format. Return result
  3608: # in func_to_host_path_result.
  3609: func_to_host_path ()
  3610: {
  3611:   $debug_cmd
  3612: 
  3613:   func_init_to_host_path_cmd
  3614:   $to_host_path_cmd "$1"
  3615: }
  3616: # end func_to_host_path
  3617: 
  3618: 
  3619: # func_convert_path_noop ARG
  3620: # Copy ARG to func_to_host_path_result.
  3621: func_convert_path_noop ()
  3622: {
  3623:   func_to_host_path_result=$1
  3624: }
  3625: # end func_convert_path_noop
  3626: 
  3627: 
  3628: # func_convert_path_msys_to_w32 ARG
  3629: # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
  3630: # conversion to w32 is not available inside the cwrapper.  Returns result in
  3631: # func_to_host_path_result.
  3632: func_convert_path_msys_to_w32 ()
  3633: {
  3634:   $debug_cmd
  3635: 
  3636:   func_to_host_path_result=$1
  3637:   if test -n "$1"; then
  3638:     # Remove leading and trailing path separator characters from ARG.  MSYS
  3639:     # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
  3640:     # and winepath ignores them completely.
  3641:     func_stripname : : "$1"
  3642:     func_to_host_path_tmp1=$func_stripname_result
  3643:     func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
  3644:     func_to_host_path_result=$func_convert_core_msys_to_w32_result
  3645:     func_convert_path_check : ";" \
  3646:       "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3647:     func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
  3648:   fi
  3649: }
  3650: # end func_convert_path_msys_to_w32
  3651: 
  3652: 
  3653: # func_convert_path_cygwin_to_w32 ARG
  3654: # Convert path ARG from Cygwin to w32 format.  Returns result in
  3655: # func_to_host_file_result.
  3656: func_convert_path_cygwin_to_w32 ()
  3657: {
  3658:   $debug_cmd
  3659: 
  3660:   func_to_host_path_result=$1
  3661:   if test -n "$1"; then
  3662:     # See func_convert_path_msys_to_w32:
  3663:     func_stripname : : "$1"
  3664:     func_to_host_path_tmp1=$func_stripname_result
  3665:     func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
  3666:     func_convert_path_check : ";" \
  3667:       "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3668:     func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
  3669:   fi
  3670: }
  3671: # end func_convert_path_cygwin_to_w32
  3672: 
  3673: 
  3674: # func_convert_path_nix_to_w32 ARG
  3675: # Convert path ARG from *nix to w32 format.  Requires a wine environment and
  3676: # a working winepath.  Returns result in func_to_host_file_result.
  3677: func_convert_path_nix_to_w32 ()
  3678: {
  3679:   $debug_cmd
  3680: 
  3681:   func_to_host_path_result=$1
  3682:   if test -n "$1"; then
  3683:     # See func_convert_path_msys_to_w32:
  3684:     func_stripname : : "$1"
  3685:     func_to_host_path_tmp1=$func_stripname_result
  3686:     func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
  3687:     func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
  3688:     func_convert_path_check : ";" \
  3689:       "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3690:     func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
  3691:   fi
  3692: }
  3693: # end func_convert_path_nix_to_w32
  3694: 
  3695: 
  3696: # func_convert_path_msys_to_cygwin ARG
  3697: # Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
  3698: # Returns result in func_to_host_file_result.
  3699: func_convert_path_msys_to_cygwin ()
  3700: {
  3701:   $debug_cmd
  3702: 
  3703:   func_to_host_path_result=$1
  3704:   if test -n "$1"; then
  3705:     # See func_convert_path_msys_to_w32:
  3706:     func_stripname : : "$1"
  3707:     func_to_host_path_tmp1=$func_stripname_result
  3708:     func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
  3709:     func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
  3710:     func_to_host_path_result=$func_cygpath_result
  3711:     func_convert_path_check : : \
  3712:       "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3713:     func_convert_path_front_back_pathsep ":*" "*:" : "$1"
  3714:   fi
  3715: }
  3716: # end func_convert_path_msys_to_cygwin
  3717: 
  3718: 
  3719: # func_convert_path_nix_to_cygwin ARG
  3720: # Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
  3721: # a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
  3722: # func_to_host_file_result.
  3723: func_convert_path_nix_to_cygwin ()
  3724: {
  3725:   $debug_cmd
  3726: 
  3727:   func_to_host_path_result=$1
  3728:   if test -n "$1"; then
  3729:     # Remove leading and trailing path separator characters from
  3730:     # ARG. msys behavior is inconsistent here, cygpath turns them
  3731:     # into '.;' and ';.', and winepath ignores them completely.
  3732:     func_stripname : : "$1"
  3733:     func_to_host_path_tmp1=$func_stripname_result
  3734:     func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
  3735:     func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
  3736:     func_to_host_path_result=$func_cygpath_result
  3737:     func_convert_path_check : : \
  3738:       "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3739:     func_convert_path_front_back_pathsep ":*" "*:" : "$1"
  3740:   fi
  3741: }
  3742: # end func_convert_path_nix_to_cygwin
  3743: 
  3744: 
  3745: # func_dll_def_p FILE
  3746: # True iff FILE is a Windows DLL '.def' file.
  3747: # Keep in sync with _LT_DLL_DEF_P in libtool.m4
  3748: func_dll_def_p ()
  3749: {
  3750:   $debug_cmd
  3751: 
  3752:   func_dll_def_p_tmp=`$SED -n \
  3753:     -e 's/^[	 ]*//' \
  3754:     -e '/^\(;.*\)*$/d' \
  3755:     -e 's/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p' \
  3756:     -e q \
  3757:     "$1"`
  3758:   test DEF = "$func_dll_def_p_tmp"
  3759: }
  3760: 
  3761: 
  3762: # func_mode_compile arg...
  3763: func_mode_compile ()
  3764: {
  3765:     $debug_cmd
  3766: 
  3767:     # Get the compilation command and the source file.
  3768:     base_compile=
  3769:     srcfile=$nonopt  #  always keep a non-empty value in "srcfile"
  3770:     suppress_opt=yes
  3771:     suppress_output=
  3772:     arg_mode=normal
  3773:     libobj=
  3774:     later=
  3775:     pie_flag=
  3776: 
  3777:     for arg
  3778:     do
  3779:       case $arg_mode in
  3780:       arg  )
  3781: 	# do not "continue".  Instead, add this to base_compile
  3782: 	lastarg=$arg
  3783: 	arg_mode=normal
  3784: 	;;
  3785: 
  3786:       target )
  3787: 	libobj=$arg
  3788: 	arg_mode=normal
  3789: 	continue
  3790: 	;;
  3791: 
  3792:       normal )
  3793: 	# Accept any command-line options.
  3794: 	case $arg in
  3795: 	-o)
  3796: 	  test -n "$libobj" && \
  3797: 	    func_fatal_error "you cannot specify '-o' more than once"
  3798: 	  arg_mode=target
  3799: 	  continue
  3800: 	  ;;
  3801: 
  3802: 	-pie | -fpie | -fPIE)
  3803:           func_append pie_flag " $arg"
  3804: 	  continue
  3805: 	  ;;
  3806: 
  3807: 	-shared | -static | -prefer-pic | -prefer-non-pic)
  3808: 	  func_append later " $arg"
  3809: 	  continue
  3810: 	  ;;
  3811: 
  3812: 	-no-suppress)
  3813: 	  suppress_opt=no
  3814: 	  continue
  3815: 	  ;;
  3816: 
  3817: 	-Xcompiler)
  3818: 	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
  3819: 	  continue      #  The current "srcfile" will either be retained or
  3820: 	  ;;            #  replaced later.  I would guess that would be a bug.
  3821: 
  3822: 	-Wc,*)
  3823: 	  func_stripname '-Wc,' '' "$arg"
  3824: 	  args=$func_stripname_result
  3825: 	  lastarg=
  3826: 	  save_ifs=$IFS; IFS=,
  3827: 	  for arg in $args; do
  3828: 	    IFS=$save_ifs
  3829: 	    func_append_quoted lastarg "$arg"
  3830: 	  done
  3831: 	  IFS=$save_ifs
  3832: 	  func_stripname ' ' '' "$lastarg"
  3833: 	  lastarg=$func_stripname_result
  3834: 
  3835: 	  # Add the arguments to base_compile.
  3836: 	  func_append base_compile " $lastarg"
  3837: 	  continue
  3838: 	  ;;
  3839: 
  3840: 	*)
  3841: 	  # Accept the current argument as the source file.
  3842: 	  # The previous "srcfile" becomes the current argument.
  3843: 	  #
  3844: 	  lastarg=$srcfile
  3845: 	  srcfile=$arg
  3846: 	  ;;
  3847: 	esac  #  case $arg
  3848: 	;;
  3849:       esac    #  case $arg_mode
  3850: 
  3851:       # Aesthetically quote the previous argument.
  3852:       func_append_quoted base_compile "$lastarg"
  3853:     done # for arg
  3854: 
  3855:     case $arg_mode in
  3856:     arg)
  3857:       func_fatal_error "you must specify an argument for -Xcompile"
  3858:       ;;
  3859:     target)
  3860:       func_fatal_error "you must specify a target with '-o'"
  3861:       ;;
  3862:     *)
  3863:       # Get the name of the library object.
  3864:       test -z "$libobj" && {
  3865: 	func_basename "$srcfile"
  3866: 	libobj=$func_basename_result
  3867:       }
  3868:       ;;
  3869:     esac
  3870: 
  3871:     # Recognize several different file suffixes.
  3872:     # If the user specifies -o file.o, it is replaced with file.lo
  3873:     case $libobj in
  3874:     *.[cCFSifmso] | \
  3875:     *.ada | *.adb | *.ads | *.asm | \
  3876:     *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
  3877:     *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
  3878:       func_xform "$libobj"
  3879:       libobj=$func_xform_result
  3880:       ;;
  3881:     esac
  3882: 
  3883:     case $libobj in
  3884:     *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
  3885:     *)
  3886:       func_fatal_error "cannot determine name of library object from '$libobj'"
  3887:       ;;
  3888:     esac
  3889: 
  3890:     func_infer_tag $base_compile
  3891: 
  3892:     for arg in $later; do
  3893:       case $arg in
  3894:       -shared)
  3895: 	test yes = "$build_libtool_libs" \
  3896: 	  || func_fatal_configuration "cannot build a shared library"
  3897: 	build_old_libs=no
  3898: 	continue
  3899: 	;;
  3900: 
  3901:       -static)
  3902: 	build_libtool_libs=no
  3903: 	build_old_libs=yes
  3904: 	continue
  3905: 	;;
  3906: 
  3907:       -prefer-pic)
  3908: 	pic_mode=yes
  3909: 	continue
  3910: 	;;
  3911: 
  3912:       -prefer-non-pic)
  3913: 	pic_mode=no
  3914: 	continue
  3915: 	;;
  3916:       esac
  3917:     done
  3918: 
  3919:     func_quote_for_eval "$libobj"
  3920:     test "X$libobj" != "X$func_quote_for_eval_result" \
  3921:       && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
  3922:       && func_warning "libobj name '$libobj' may not contain shell special characters."
  3923:     func_dirname_and_basename "$obj" "/" ""
  3924:     objname=$func_basename_result
  3925:     xdir=$func_dirname_result
  3926:     lobj=$xdir$objdir/$objname
  3927: 
  3928:     test -z "$base_compile" && \
  3929:       func_fatal_help "you must specify a compilation command"
  3930: 
  3931:     # Delete any leftover library objects.
  3932:     if test yes = "$build_old_libs"; then
  3933:       removelist="$obj $lobj $libobj ${libobj}T"
  3934:     else
  3935:       removelist="$lobj $libobj ${libobj}T"
  3936:     fi
  3937: 
  3938:     # On Cygwin there's no "real" PIC flag so we must build both object types
  3939:     case $host_os in
  3940:     cygwin* | mingw* | pw32* | os2* | cegcc*)
  3941:       pic_mode=default
  3942:       ;;
  3943:     esac
  3944:     if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
  3945:       # non-PIC code in shared libraries is not supported
  3946:       pic_mode=default
  3947:     fi
  3948: 
  3949:     # Calculate the filename of the output object if compiler does
  3950:     # not support -o with -c
  3951:     if test no = "$compiler_c_o"; then
  3952:       output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
  3953:       lockfile=$output_obj.lock
  3954:     else
  3955:       output_obj=
  3956:       need_locks=no
  3957:       lockfile=
  3958:     fi
  3959: 
  3960:     # Lock this critical section if it is needed
  3961:     # We use this script file to make the link, it avoids creating a new file
  3962:     if test yes = "$need_locks"; then
  3963:       until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
  3964: 	func_echo "Waiting for $lockfile to be removed"
  3965: 	sleep 2
  3966:       done
  3967:     elif test warn = "$need_locks"; then
  3968:       if test -f "$lockfile"; then
  3969: 	$ECHO "\
  3970: *** ERROR, $lockfile exists and contains:
  3971: `cat $lockfile 2>/dev/null`
  3972: 
  3973: This indicates that another process is trying to use the same
  3974: temporary object file, and libtool could not work around it because
  3975: your compiler does not support '-c' and '-o' together.  If you
  3976: repeat this compilation, it may succeed, by chance, but you had better
  3977: avoid parallel builds (make -j) in this platform, or get a better
  3978: compiler."
  3979: 
  3980: 	$opt_dry_run || $RM $removelist
  3981: 	exit $EXIT_FAILURE
  3982:       fi
  3983:       func_append removelist " $output_obj"
  3984:       $ECHO "$srcfile" > "$lockfile"
  3985:     fi
  3986: 
  3987:     $opt_dry_run || $RM $removelist
  3988:     func_append removelist " $lockfile"
  3989:     trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
  3990: 
  3991:     func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
  3992:     srcfile=$func_to_tool_file_result
  3993:     func_quote_for_eval "$srcfile"
  3994:     qsrcfile=$func_quote_for_eval_result
  3995: 
  3996:     # Only build a PIC object if we are building libtool libraries.
  3997:     if test yes = "$build_libtool_libs"; then
  3998:       # Without this assignment, base_compile gets emptied.
  3999:       fbsd_hideous_sh_bug=$base_compile
  4000: 
  4001:       if test no != "$pic_mode"; then
  4002: 	command="$base_compile $qsrcfile $pic_flag"
  4003:       else
  4004: 	# Don't build PIC code
  4005: 	command="$base_compile $qsrcfile"
  4006:       fi
  4007: 
  4008:       func_mkdir_p "$xdir$objdir"
  4009: 
  4010:       if test -z "$output_obj"; then
  4011: 	# Place PIC objects in $objdir
  4012: 	func_append command " -o $lobj"
  4013:       fi
  4014: 
  4015:       func_show_eval_locale "$command"	\
  4016:           'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
  4017: 
  4018:       if test warn = "$need_locks" &&
  4019: 	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  4020: 	$ECHO "\
  4021: *** ERROR, $lockfile contains:
  4022: `cat $lockfile 2>/dev/null`
  4023: 
  4024: but it should contain:
  4025: $srcfile
  4026: 
  4027: This indicates that another process is trying to use the same
  4028: temporary object file, and libtool could not work around it because
  4029: your compiler does not support '-c' and '-o' together.  If you
  4030: repeat this compilation, it may succeed, by chance, but you had better
  4031: avoid parallel builds (make -j) in this platform, or get a better
  4032: compiler."
  4033: 
  4034: 	$opt_dry_run || $RM $removelist
  4035: 	exit $EXIT_FAILURE
  4036:       fi
  4037: 
  4038:       # Just move the object if needed, then go on to compile the next one
  4039:       if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
  4040: 	func_show_eval '$MV "$output_obj" "$lobj"' \
  4041: 	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
  4042:       fi
  4043: 
  4044:       # Allow error messages only from the first compilation.
  4045:       if test yes = "$suppress_opt"; then
  4046: 	suppress_output=' >/dev/null 2>&1'
  4047:       fi
  4048:     fi
  4049: 
  4050:     # Only build a position-dependent object if we build old libraries.
  4051:     if test yes = "$build_old_libs"; then
  4052:       if test yes != "$pic_mode"; then
  4053: 	# Don't build PIC code
  4054: 	command="$base_compile $qsrcfile$pie_flag"
  4055:       else
  4056: 	command="$base_compile $qsrcfile $pic_flag"
  4057:       fi
  4058:       if test yes = "$compiler_c_o"; then
  4059: 	func_append command " -o $obj"
  4060:       fi
  4061: 
  4062:       # Suppress compiler output if we already did a PIC compilation.
  4063:       func_append command "$suppress_output"
  4064:       func_show_eval_locale "$command" \
  4065:         '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
  4066: 
  4067:       if test warn = "$need_locks" &&
  4068: 	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  4069: 	$ECHO "\
  4070: *** ERROR, $lockfile contains:
  4071: `cat $lockfile 2>/dev/null`
  4072: 
  4073: but it should contain:
  4074: $srcfile
  4075: 
  4076: This indicates that another process is trying to use the same
  4077: temporary object file, and libtool could not work around it because
  4078: your compiler does not support '-c' and '-o' together.  If you
  4079: repeat this compilation, it may succeed, by chance, but you had better
  4080: avoid parallel builds (make -j) in this platform, or get a better
  4081: compiler."
  4082: 
  4083: 	$opt_dry_run || $RM $removelist
  4084: 	exit $EXIT_FAILURE
  4085:       fi
  4086: 
  4087:       # Just move the object if needed
  4088:       if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
  4089: 	func_show_eval '$MV "$output_obj" "$obj"' \
  4090: 	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
  4091:       fi
  4092:     fi
  4093: 
  4094:     $opt_dry_run || {
  4095:       func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
  4096: 
  4097:       # Unlock the critical section if it was locked
  4098:       if test no != "$need_locks"; then
  4099: 	removelist=$lockfile
  4100:         $RM "$lockfile"
  4101:       fi
  4102:     }
  4103: 
  4104:     exit $EXIT_SUCCESS
  4105: }
  4106: 
  4107: $opt_help || {
  4108:   test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
  4109: }
  4110: 
  4111: func_mode_help ()
  4112: {
  4113:     # We need to display help for each of the modes.
  4114:     case $opt_mode in
  4115:       "")
  4116:         # Generic help is extracted from the usage comments
  4117:         # at the start of this file.
  4118:         func_help
  4119:         ;;
  4120: 
  4121:       clean)
  4122:         $ECHO \
  4123: "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
  4124: 
  4125: Remove files from the build directory.
  4126: 
  4127: RM is the name of the program to use to delete files associated with each FILE
  4128: (typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
  4129: to RM.
  4130: 
  4131: If FILE is a libtool library, object or program, all the files associated
  4132: with it are deleted. Otherwise, only FILE itself is deleted using RM."
  4133:         ;;
  4134: 
  4135:       compile)
  4136:       $ECHO \
  4137: "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
  4138: 
  4139: Compile a source file into a libtool library object.
  4140: 
  4141: This mode accepts the following additional options:
  4142: 
  4143:   -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
  4144:   -no-suppress      do not suppress compiler output for multiple passes
  4145:   -prefer-pic       try to build PIC objects only
  4146:   -prefer-non-pic   try to build non-PIC objects only
  4147:   -shared           do not build a '.o' file suitable for static linking
  4148:   -static           only build a '.o' file suitable for static linking
  4149:   -Wc,FLAG          pass FLAG directly to the compiler
  4150: 
  4151: COMPILE-COMMAND is a command to be used in creating a 'standard' object file
  4152: from the given SOURCEFILE.
  4153: 
  4154: The output file name is determined by removing the directory component from
  4155: SOURCEFILE, then substituting the C source code suffix '.c' with the
  4156: library object suffix, '.lo'."
  4157:         ;;
  4158: 
  4159:       execute)
  4160:         $ECHO \
  4161: "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
  4162: 
  4163: Automatically set library path, then run a program.
  4164: 
  4165: This mode accepts the following additional options:
  4166: 
  4167:   -dlopen FILE      add the directory containing FILE to the library path
  4168: 
  4169: This mode sets the library path environment variable according to '-dlopen'
  4170: flags.
  4171: 
  4172: If any of the ARGS are libtool executable wrappers, then they are translated
  4173: into their corresponding uninstalled binary, and any of their required library
  4174: directories are added to the library path.
  4175: 
  4176: Then, COMMAND is executed, with ARGS as arguments."
  4177:         ;;
  4178: 
  4179:       finish)
  4180:         $ECHO \
  4181: "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
  4182: 
  4183: Complete the installation of libtool libraries.
  4184: 
  4185: Each LIBDIR is a directory that contains libtool libraries.
  4186: 
  4187: The commands that this mode executes may require superuser privileges.  Use
  4188: the '--dry-run' option if you just want to see what would be executed."
  4189:         ;;
  4190: 
  4191:       install)
  4192:         $ECHO \
  4193: "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
  4194: 
  4195: Install executables or libraries.
  4196: 
  4197: INSTALL-COMMAND is the installation command.  The first component should be
  4198: either the 'install' or 'cp' program.
  4199: 
  4200: The following components of INSTALL-COMMAND are treated specially:
  4201: 
  4202:   -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
  4203: 
  4204: The rest of the components are interpreted as arguments to that command (only
  4205: BSD-compatible install options are recognized)."
  4206:         ;;
  4207: 
  4208:       link)
  4209:         $ECHO \
  4210: "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
  4211: 
  4212: Link object files or libraries together to form another library, or to
  4213: create an executable program.
  4214: 
  4215: LINK-COMMAND is a command using the C compiler that you would use to create
  4216: a program from several object files.
  4217: 
  4218: The following components of LINK-COMMAND are treated specially:
  4219: 
  4220:   -all-static       do not do any dynamic linking at all
  4221:   -avoid-version    do not add a version suffix if possible
  4222:   -bindir BINDIR    specify path to binaries directory (for systems where
  4223:                     libraries must be found in the PATH setting at runtime)
  4224:   -dlopen FILE      '-dlpreopen' FILE if it cannot be dlopened at runtime
  4225:   -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
  4226:   -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
  4227:   -export-symbols SYMFILE
  4228:                     try to export only the symbols listed in SYMFILE
  4229:   -export-symbols-regex REGEX
  4230:                     try to export only the symbols matching REGEX
  4231:   -LLIBDIR          search LIBDIR for required installed libraries
  4232:   -lNAME            OUTPUT-FILE requires the installed library libNAME
  4233:   -module           build a library that can dlopened
  4234:   -no-fast-install  disable the fast-install mode
  4235:   -no-install       link a not-installable executable
  4236:   -no-undefined     declare that a library does not refer to external symbols
  4237:   -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
  4238:   -objectlist FILE  use a list of object files found in FILE to specify objects
  4239:   -os2dllname NAME  force a short DLL name on OS/2 (no effect on other OSes)
  4240:   -precious-files-regex REGEX
  4241:                     don't remove output files matching REGEX
  4242:   -release RELEASE  specify package release information
  4243:   -rpath LIBDIR     the created library will eventually be installed in LIBDIR
  4244:   -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
  4245:   -shared           only do dynamic linking of libtool libraries
  4246:   -shrext SUFFIX    override the standard shared library file extension
  4247:   -static           do not do any dynamic linking of uninstalled libtool libraries
  4248:   -static-libtool-libs
  4249:                     do not do any dynamic linking of libtool libraries
  4250:   -version-info CURRENT[:REVISION[:AGE]]
  4251:                     specify library version info [each variable defaults to 0]
  4252:   -weak LIBNAME     declare that the target provides the LIBNAME interface
  4253:   -Wc,FLAG
  4254:   -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
  4255:   -Wl,FLAG
  4256:   -Xlinker FLAG     pass linker-specific FLAG directly to the linker
  4257:   -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
  4258: 
  4259: All other options (arguments beginning with '-') are ignored.
  4260: 
  4261: Every other argument is treated as a filename.  Files ending in '.la' are
  4262: treated as uninstalled libtool libraries, other files are standard or library
  4263: object files.
  4264: 
  4265: If the OUTPUT-FILE ends in '.la', then a libtool library is created,
  4266: only library objects ('.lo' files) may be specified, and '-rpath' is
  4267: required, except when creating a convenience library.
  4268: 
  4269: If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
  4270: using 'ar' and 'ranlib', or on Windows using 'lib'.
  4271: 
  4272: If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
  4273: is created, otherwise an executable program is created."
  4274:         ;;
  4275: 
  4276:       uninstall)
  4277:         $ECHO \
  4278: "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  4279: 
  4280: Remove libraries from an installation directory.
  4281: 
  4282: RM is the name of the program to use to delete files associated with each FILE
  4283: (typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
  4284: to RM.
  4285: 
  4286: If FILE is a libtool library, all the files associated with it are deleted.
  4287: Otherwise, only FILE itself is deleted using RM."
  4288:         ;;
  4289: 
  4290:       *)
  4291:         func_fatal_help "invalid operation mode '$opt_mode'"
  4292:         ;;
  4293:     esac
  4294: 
  4295:     echo
  4296:     $ECHO "Try '$progname --help' for more information about other modes."
  4297: }
  4298: 
  4299: # Now that we've collected a possible --mode arg, show help if necessary
  4300: if $opt_help; then
  4301:   if test : = "$opt_help"; then
  4302:     func_mode_help
  4303:   else
  4304:     {
  4305:       func_help noexit
  4306:       for opt_mode in compile link execute install finish uninstall clean; do
  4307: 	func_mode_help
  4308:       done
  4309:     } | $SED -n '1p; 2,$s/^Usage:/  or: /p'
  4310:     {
  4311:       func_help noexit
  4312:       for opt_mode in compile link execute install finish uninstall clean; do
  4313: 	echo
  4314: 	func_mode_help
  4315:       done
  4316:     } |
  4317:     $SED '1d
  4318:       /^When reporting/,/^Report/{
  4319: 	H
  4320: 	d
  4321:       }
  4322:       $x
  4323:       /information about other modes/d
  4324:       /more detailed .*MODE/d
  4325:       s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
  4326:   fi
  4327:   exit $?
  4328: fi
  4329: 
  4330: 
  4331: # func_mode_execute arg...
  4332: func_mode_execute ()
  4333: {
  4334:     $debug_cmd
  4335: 
  4336:     # The first argument is the command name.
  4337:     cmd=$nonopt
  4338:     test -z "$cmd" && \
  4339:       func_fatal_help "you must specify a COMMAND"
  4340: 
  4341:     # Handle -dlopen flags immediately.
  4342:     for file in $opt_dlopen; do
  4343:       test -f "$file" \
  4344: 	|| func_fatal_help "'$file' is not a file"
  4345: 
  4346:       dir=
  4347:       case $file in
  4348:       *.la)
  4349: 	func_resolve_sysroot "$file"
  4350: 	file=$func_resolve_sysroot_result
  4351: 
  4352: 	# Check to see that this really is a libtool archive.
  4353: 	func_lalib_unsafe_p "$file" \
  4354: 	  || func_fatal_help "'$lib' is not a valid libtool archive"
  4355: 
  4356: 	# Read the libtool library.
  4357: 	dlname=
  4358: 	library_names=
  4359: 	func_source "$file"
  4360: 
  4361: 	# Skip this library if it cannot be dlopened.
  4362: 	if test -z "$dlname"; then
  4363: 	  # Warn if it was a shared library.
  4364: 	  test -n "$library_names" && \
  4365: 	    func_warning "'$file' was not linked with '-export-dynamic'"
  4366: 	  continue
  4367: 	fi
  4368: 
  4369: 	func_dirname "$file" "" "."
  4370: 	dir=$func_dirname_result
  4371: 
  4372: 	if test -f "$dir/$objdir/$dlname"; then
  4373: 	  func_append dir "/$objdir"
  4374: 	else
  4375: 	  if test ! -f "$dir/$dlname"; then
  4376: 	    func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
  4377: 	  fi
  4378: 	fi
  4379: 	;;
  4380: 
  4381:       *.lo)
  4382: 	# Just add the directory containing the .lo file.
  4383: 	func_dirname "$file" "" "."
  4384: 	dir=$func_dirname_result
  4385: 	;;
  4386: 
  4387:       *)
  4388: 	func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
  4389: 	continue
  4390: 	;;
  4391:       esac
  4392: 
  4393:       # Get the absolute pathname.
  4394:       absdir=`cd "$dir" && pwd`
  4395:       test -n "$absdir" && dir=$absdir
  4396: 
  4397:       # Now add the directory to shlibpath_var.
  4398:       if eval "test -z \"\$$shlibpath_var\""; then
  4399: 	eval "$shlibpath_var=\"\$dir\""
  4400:       else
  4401: 	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
  4402:       fi
  4403:     done
  4404: 
  4405:     # This variable tells wrapper scripts just to set shlibpath_var
  4406:     # rather than running their programs.
  4407:     libtool_execute_magic=$magic
  4408: 
  4409:     # Check if any of the arguments is a wrapper script.
  4410:     args=
  4411:     for file
  4412:     do
  4413:       case $file in
  4414:       -* | *.la | *.lo ) ;;
  4415:       *)
  4416: 	# Do a test to see if this is really a libtool program.
  4417: 	if func_ltwrapper_script_p "$file"; then
  4418: 	  func_source "$file"
  4419: 	  # Transform arg to wrapped name.
  4420: 	  file=$progdir/$program
  4421: 	elif func_ltwrapper_executable_p "$file"; then
  4422: 	  func_ltwrapper_scriptname "$file"
  4423: 	  func_source "$func_ltwrapper_scriptname_result"
  4424: 	  # Transform arg to wrapped name.
  4425: 	  file=$progdir/$program
  4426: 	fi
  4427: 	;;
  4428:       esac
  4429:       # Quote arguments (to preserve shell metacharacters).
  4430:       func_append_quoted args "$file"
  4431:     done
  4432: 
  4433:     if $opt_dry_run; then
  4434:       # Display what would be done.
  4435:       if test -n "$shlibpath_var"; then
  4436: 	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
  4437: 	echo "export $shlibpath_var"
  4438:       fi
  4439:       $ECHO "$cmd$args"
  4440:       exit $EXIT_SUCCESS
  4441:     else
  4442:       if test -n "$shlibpath_var"; then
  4443: 	# Export the shlibpath_var.
  4444: 	eval "export $shlibpath_var"
  4445:       fi
  4446: 
  4447:       # Restore saved environment variables
  4448:       for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
  4449:       do
  4450: 	eval "if test \"\${save_$lt_var+set}\" = set; then
  4451:                 $lt_var=\$save_$lt_var; export $lt_var
  4452: 	      else
  4453: 		$lt_unset $lt_var
  4454: 	      fi"
  4455:       done
  4456: 
  4457:       # Now prepare to actually exec the command.
  4458:       exec_cmd=\$cmd$args
  4459:     fi
  4460: }
  4461: 
  4462: test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
  4463: 
  4464: 
  4465: # func_mode_finish arg...
  4466: func_mode_finish ()
  4467: {
  4468:     $debug_cmd
  4469: 
  4470:     libs=
  4471:     libdirs=
  4472:     admincmds=
  4473: 
  4474:     for opt in "$nonopt" ${1+"$@"}
  4475:     do
  4476:       if test -d "$opt"; then
  4477: 	func_append libdirs " $opt"
  4478: 
  4479:       elif test -f "$opt"; then
  4480: 	if func_lalib_unsafe_p "$opt"; then
  4481: 	  func_append libs " $opt"
  4482: 	else
  4483: 	  func_warning "'$opt' is not a valid libtool archive"
  4484: 	fi
  4485: 
  4486:       else
  4487: 	func_fatal_error "invalid argument '$opt'"
  4488:       fi
  4489:     done
  4490: 
  4491:     if test -n "$libs"; then
  4492:       if test -n "$lt_sysroot"; then
  4493:         sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
  4494:         sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
  4495:       else
  4496:         sysroot_cmd=
  4497:       fi
  4498: 
  4499:       # Remove sysroot references
  4500:       if $opt_dry_run; then
  4501:         for lib in $libs; do
  4502:           echo "removing references to $lt_sysroot and '=' prefixes from $lib"
  4503:         done
  4504:       else
  4505:         tmpdir=`func_mktempdir`
  4506:         for lib in $libs; do
  4507: 	  $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
  4508: 	    > $tmpdir/tmp-la
  4509: 	  mv -f $tmpdir/tmp-la $lib
  4510: 	done
  4511:         ${RM}r "$tmpdir"
  4512:       fi
  4513:     fi
  4514: 
  4515:     if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  4516:       for libdir in $libdirs; do
  4517: 	if test -n "$finish_cmds"; then
  4518: 	  # Do each command in the finish commands.
  4519: 	  func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
  4520: '"$cmd"'"'
  4521: 	fi
  4522: 	if test -n "$finish_eval"; then
  4523: 	  # Do the single finish_eval.
  4524: 	  eval cmds=\"$finish_eval\"
  4525: 	  $opt_dry_run || eval "$cmds" || func_append admincmds "
  4526:        $cmds"
  4527: 	fi
  4528:       done
  4529:     fi
  4530: 
  4531:     # Exit here if they wanted silent mode.
  4532:     $opt_quiet && exit $EXIT_SUCCESS
  4533: 
  4534:     if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  4535:       echo "----------------------------------------------------------------------"
  4536:       echo "Libraries have been installed in:"
  4537:       for libdir in $libdirs; do
  4538: 	$ECHO "   $libdir"
  4539:       done
  4540:       echo
  4541:       echo "If you ever happen to want to link against installed libraries"
  4542:       echo "in a given directory, LIBDIR, you must either use libtool, and"
  4543:       echo "specify the full pathname of the library, or use the '-LLIBDIR'"
  4544:       echo "flag during linking and do at least one of the following:"
  4545:       if test -n "$shlibpath_var"; then
  4546: 	echo "   - add LIBDIR to the '$shlibpath_var' environment variable"
  4547: 	echo "     during execution"
  4548:       fi
  4549:       if test -n "$runpath_var"; then
  4550: 	echo "   - add LIBDIR to the '$runpath_var' environment variable"
  4551: 	echo "     during linking"
  4552:       fi
  4553:       if test -n "$hardcode_libdir_flag_spec"; then
  4554: 	libdir=LIBDIR
  4555: 	eval flag=\"$hardcode_libdir_flag_spec\"
  4556: 
  4557: 	$ECHO "   - use the '$flag' linker flag"
  4558:       fi
  4559:       if test -n "$admincmds"; then
  4560: 	$ECHO "   - have your system administrator run these commands:$admincmds"
  4561:       fi
  4562:       if test -f /etc/ld.so.conf; then
  4563: 	echo "   - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
  4564:       fi
  4565:       echo
  4566: 
  4567:       echo "See any operating system documentation about shared libraries for"
  4568:       case $host in
  4569: 	solaris2.[6789]|solaris2.1[0-9])
  4570: 	  echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
  4571: 	  echo "pages."
  4572: 	  ;;
  4573: 	*)
  4574: 	  echo "more information, such as the ld(1) and ld.so(8) manual pages."
  4575: 	  ;;
  4576:       esac
  4577:       echo "----------------------------------------------------------------------"
  4578:     fi
  4579:     exit $EXIT_SUCCESS
  4580: }
  4581: 
  4582: test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
  4583: 
  4584: 
  4585: # func_mode_install arg...
  4586: func_mode_install ()
  4587: {
  4588:     $debug_cmd
  4589: 
  4590:     # There may be an optional sh(1) argument at the beginning of
  4591:     # install_prog (especially on Windows NT).
  4592:     if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
  4593:        # Allow the use of GNU shtool's install command.
  4594:        case $nonopt in *shtool*) :;; *) false;; esac
  4595:     then
  4596:       # Aesthetically quote it.
  4597:       func_quote_for_eval "$nonopt"
  4598:       install_prog="$func_quote_for_eval_result "
  4599:       arg=$1
  4600:       shift
  4601:     else
  4602:       install_prog=
  4603:       arg=$nonopt
  4604:     fi
  4605: 
  4606:     # The real first argument should be the name of the installation program.
  4607:     # Aesthetically quote it.
  4608:     func_quote_for_eval "$arg"
  4609:     func_append install_prog "$func_quote_for_eval_result"
  4610:     install_shared_prog=$install_prog
  4611:     case " $install_prog " in
  4612:       *[\\\ /]cp\ *) install_cp=: ;;
  4613:       *) install_cp=false ;;
  4614:     esac
  4615: 
  4616:     # We need to accept at least all the BSD install flags.
  4617:     dest=
  4618:     files=
  4619:     opts=
  4620:     prev=
  4621:     install_type=
  4622:     isdir=false
  4623:     stripme=
  4624:     no_mode=:
  4625:     for arg
  4626:     do
  4627:       arg2=
  4628:       if test -n "$dest"; then
  4629: 	func_append files " $dest"
  4630: 	dest=$arg
  4631: 	continue
  4632:       fi
  4633: 
  4634:       case $arg in
  4635:       -d) isdir=: ;;
  4636:       -f)
  4637: 	if $install_cp; then :; else
  4638: 	  prev=$arg
  4639: 	fi
  4640: 	;;
  4641:       -g | -m | -o)
  4642: 	prev=$arg
  4643: 	;;
  4644:       -s)
  4645: 	stripme=" -s"
  4646: 	continue
  4647: 	;;
  4648:       -*)
  4649: 	;;
  4650:       *)
  4651: 	# If the previous option needed an argument, then skip it.
  4652: 	if test -n "$prev"; then
  4653: 	  if test X-m = "X$prev" && test -n "$install_override_mode"; then
  4654: 	    arg2=$install_override_mode
  4655: 	    no_mode=false
  4656: 	  fi
  4657: 	  prev=
  4658: 	else
  4659: 	  dest=$arg
  4660: 	  continue
  4661: 	fi
  4662: 	;;
  4663:       esac
  4664: 
  4665:       # Aesthetically quote the argument.
  4666:       func_quote_for_eval "$arg"
  4667:       func_append install_prog " $func_quote_for_eval_result"
  4668:       if test -n "$arg2"; then
  4669: 	func_quote_for_eval "$arg2"
  4670:       fi
  4671:       func_append install_shared_prog " $func_quote_for_eval_result"
  4672:     done
  4673: 
  4674:     test -z "$install_prog" && \
  4675:       func_fatal_help "you must specify an install program"
  4676: 
  4677:     test -n "$prev" && \
  4678:       func_fatal_help "the '$prev' option requires an argument"
  4679: 
  4680:     if test -n "$install_override_mode" && $no_mode; then
  4681:       if $install_cp; then :; else
  4682: 	func_quote_for_eval "$install_override_mode"
  4683: 	func_append install_shared_prog " -m $func_quote_for_eval_result"
  4684:       fi
  4685:     fi
  4686: 
  4687:     if test -z "$files"; then
  4688:       if test -z "$dest"; then
  4689: 	func_fatal_help "no file or destination specified"
  4690:       else
  4691: 	func_fatal_help "you must specify a destination"
  4692:       fi
  4693:     fi
  4694: 
  4695:     # Strip any trailing slash from the destination.
  4696:     func_stripname '' '/' "$dest"
  4697:     dest=$func_stripname_result
  4698: 
  4699:     # Check to see that the destination is a directory.
  4700:     test -d "$dest" && isdir=:
  4701:     if $isdir; then
  4702:       destdir=$dest
  4703:       destname=
  4704:     else
  4705:       func_dirname_and_basename "$dest" "" "."
  4706:       destdir=$func_dirname_result
  4707:       destname=$func_basename_result
  4708: 
  4709:       # Not a directory, so check to see that there is only one file specified.
  4710:       set dummy $files; shift
  4711:       test "$#" -gt 1 && \
  4712: 	func_fatal_help "'$dest' is not a directory"
  4713:     fi
  4714:     case $destdir in
  4715:     [\\/]* | [A-Za-z]:[\\/]*) ;;
  4716:     *)
  4717:       for file in $files; do
  4718: 	case $file in
  4719: 	*.lo) ;;
  4720: 	*)
  4721: 	  func_fatal_help "'$destdir' must be an absolute directory name"
  4722: 	  ;;
  4723: 	esac
  4724:       done
  4725:       ;;
  4726:     esac
  4727: 
  4728:     # This variable tells wrapper scripts just to set variables rather
  4729:     # than running their programs.
  4730:     libtool_install_magic=$magic
  4731: 
  4732:     staticlibs=
  4733:     future_libdirs=
  4734:     current_libdirs=
  4735:     for file in $files; do
  4736: 
  4737:       # Do each installation.
  4738:       case $file in
  4739:       *.$libext)
  4740: 	# Do the static libraries later.
  4741: 	func_append staticlibs " $file"
  4742: 	;;
  4743: 
  4744:       *.la)
  4745: 	func_resolve_sysroot "$file"
  4746: 	file=$func_resolve_sysroot_result
  4747: 
  4748: 	# Check to see that this really is a libtool archive.
  4749: 	func_lalib_unsafe_p "$file" \
  4750: 	  || func_fatal_help "'$file' is not a valid libtool archive"
  4751: 
  4752: 	library_names=
  4753: 	old_library=
  4754: 	relink_command=
  4755: 	func_source "$file"
  4756: 
  4757: 	# Add the libdir to current_libdirs if it is the destination.
  4758: 	if test "X$destdir" = "X$libdir"; then
  4759: 	  case "$current_libdirs " in
  4760: 	  *" $libdir "*) ;;
  4761: 	  *) func_append current_libdirs " $libdir" ;;
  4762: 	  esac
  4763: 	else
  4764: 	  # Note the libdir as a future libdir.
  4765: 	  case "$future_libdirs " in
  4766: 	  *" $libdir "*) ;;
  4767: 	  *) func_append future_libdirs " $libdir" ;;
  4768: 	  esac
  4769: 	fi
  4770: 
  4771: 	func_dirname "$file" "/" ""
  4772: 	dir=$func_dirname_result
  4773: 	func_append dir "$objdir"
  4774: 
  4775: 	if test -n "$relink_command"; then
  4776: 	  # Determine the prefix the user has applied to our future dir.
  4777: 	  inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
  4778: 
  4779: 	  # Don't allow the user to place us outside of our expected
  4780: 	  # location b/c this prevents finding dependent libraries that
  4781: 	  # are installed to the same prefix.
  4782: 	  # At present, this check doesn't affect windows .dll's that
  4783: 	  # are installed into $libdir/../bin (currently, that works fine)
  4784: 	  # but it's something to keep an eye on.
  4785: 	  test "$inst_prefix_dir" = "$destdir" && \
  4786: 	    func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
  4787: 
  4788: 	  if test -n "$inst_prefix_dir"; then
  4789: 	    # Stick the inst_prefix_dir data into the link command.
  4790: 	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
  4791: 	  else
  4792: 	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
  4793: 	  fi
  4794: 
  4795: 	  func_warning "relinking '$file'"
  4796: 	  func_show_eval "$relink_command" \
  4797: 	    'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
  4798: 	fi
  4799: 
  4800: 	# See the names of the shared library.
  4801: 	set dummy $library_names; shift
  4802: 	if test -n "$1"; then
  4803: 	  realname=$1
  4804: 	  shift
  4805: 
  4806: 	  srcname=$realname
  4807: 	  test -n "$relink_command" && srcname=${realname}T
  4808: 
  4809: 	  # Install the shared library and build the symlinks.
  4810: 	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
  4811: 	      'exit $?'
  4812: 	  tstripme=$stripme
  4813: 	  case $host_os in
  4814: 	  cygwin* | mingw* | pw32* | cegcc*)
  4815: 	    case $realname in
  4816: 	    *.dll.a)
  4817: 	      tstripme=
  4818: 	      ;;
  4819: 	    esac
  4820: 	    ;;
  4821: 	  os2*)
  4822: 	    case $realname in
  4823: 	    *_dll.a)
  4824: 	      tstripme=
  4825: 	      ;;
  4826: 	    esac
  4827: 	    ;;
  4828: 	  esac
  4829: 	  if test -n "$tstripme" && test -n "$striplib"; then
  4830: 	    func_show_eval "$striplib $destdir/$realname" 'exit $?'
  4831: 	  fi
  4832: 
  4833: 	  if test "$#" -gt 0; then
  4834: 	    # Delete the old symlinks, and create new ones.
  4835: 	    # Try 'ln -sf' first, because the 'ln' binary might depend on
  4836: 	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
  4837: 	    # so we also need to try rm && ln -s.
  4838: 	    for linkname
  4839: 	    do
  4840: 	      test "$linkname" != "$realname" \
  4841: 		&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
  4842: 	    done
  4843: 	  fi
  4844: 
  4845: 	  # Do each command in the postinstall commands.
  4846: 	  lib=$destdir/$realname
  4847: 	  func_execute_cmds "$postinstall_cmds" 'exit $?'
  4848: 	fi
  4849: 
  4850: 	# Install the pseudo-library for information purposes.
  4851: 	func_basename "$file"
  4852: 	name=$func_basename_result
  4853: 	instname=$dir/${name}i
  4854: 	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
  4855: 
  4856: 	# Maybe install the static library, too.
  4857: 	test -n "$old_library" && func_append staticlibs " $dir/$old_library"
  4858: 	;;
  4859: 
  4860:       *.lo)
  4861: 	# Install (i.e. copy) a libtool object.
  4862: 
  4863: 	# Figure out destination file name, if it wasn't already specified.
  4864: 	if test -n "$destname"; then
  4865: 	  destfile=$destdir/$destname
  4866: 	else
  4867: 	  func_basename "$file"
  4868: 	  destfile=$func_basename_result
  4869: 	  destfile=$destdir/$destfile
  4870: 	fi
  4871: 
  4872: 	# Deduce the name of the destination old-style object file.
  4873: 	case $destfile in
  4874: 	*.lo)
  4875: 	  func_lo2o "$destfile"
  4876: 	  staticdest=$func_lo2o_result
  4877: 	  ;;
  4878: 	*.$objext)
  4879: 	  staticdest=$destfile
  4880: 	  destfile=
  4881: 	  ;;
  4882: 	*)
  4883: 	  func_fatal_help "cannot copy a libtool object to '$destfile'"
  4884: 	  ;;
  4885: 	esac
  4886: 
  4887: 	# Install the libtool object if requested.
  4888: 	test -n "$destfile" && \
  4889: 	  func_show_eval "$install_prog $file $destfile" 'exit $?'
  4890: 
  4891: 	# Install the old object if enabled.
  4892: 	if test yes = "$build_old_libs"; then
  4893: 	  # Deduce the name of the old-style object file.
  4894: 	  func_lo2o "$file"
  4895: 	  staticobj=$func_lo2o_result
  4896: 	  func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
  4897: 	fi
  4898: 	exit $EXIT_SUCCESS
  4899: 	;;
  4900: 
  4901:       *)
  4902: 	# Figure out destination file name, if it wasn't already specified.
  4903: 	if test -n "$destname"; then
  4904: 	  destfile=$destdir/$destname
  4905: 	else
  4906: 	  func_basename "$file"
  4907: 	  destfile=$func_basename_result
  4908: 	  destfile=$destdir/$destfile
  4909: 	fi
  4910: 
  4911: 	# If the file is missing, and there is a .exe on the end, strip it
  4912: 	# because it is most likely a libtool script we actually want to
  4913: 	# install
  4914: 	stripped_ext=
  4915: 	case $file in
  4916: 	  *.exe)
  4917: 	    if test ! -f "$file"; then
  4918: 	      func_stripname '' '.exe' "$file"
  4919: 	      file=$func_stripname_result
  4920: 	      stripped_ext=.exe
  4921: 	    fi
  4922: 	    ;;
  4923: 	esac
  4924: 
  4925: 	# Do a test to see if this is really a libtool program.
  4926: 	case $host in
  4927: 	*cygwin* | *mingw*)
  4928: 	    if func_ltwrapper_executable_p "$file"; then
  4929: 	      func_ltwrapper_scriptname "$file"
  4930: 	      wrapper=$func_ltwrapper_scriptname_result
  4931: 	    else
  4932: 	      func_stripname '' '.exe' "$file"
  4933: 	      wrapper=$func_stripname_result
  4934: 	    fi
  4935: 	    ;;
  4936: 	*)
  4937: 	    wrapper=$file
  4938: 	    ;;
  4939: 	esac
  4940: 	if func_ltwrapper_script_p "$wrapper"; then
  4941: 	  notinst_deplibs=
  4942: 	  relink_command=
  4943: 
  4944: 	  func_source "$wrapper"
  4945: 
  4946: 	  # Check the variables that should have been set.
  4947: 	  test -z "$generated_by_libtool_version" && \
  4948: 	    func_fatal_error "invalid libtool wrapper script '$wrapper'"
  4949: 
  4950: 	  finalize=:
  4951: 	  for lib in $notinst_deplibs; do
  4952: 	    # Check to see that each library is installed.
  4953: 	    libdir=
  4954: 	    if test -f "$lib"; then
  4955: 	      func_source "$lib"
  4956: 	    fi
  4957: 	    libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
  4958: 	    if test -n "$libdir" && test ! -f "$libfile"; then
  4959: 	      func_warning "'$lib' has not been installed in '$libdir'"
  4960: 	      finalize=false
  4961: 	    fi
  4962: 	  done
  4963: 
  4964: 	  relink_command=
  4965: 	  func_source "$wrapper"
  4966: 
  4967: 	  outputname=
  4968: 	  if test no = "$fast_install" && test -n "$relink_command"; then
  4969: 	    $opt_dry_run || {
  4970: 	      if $finalize; then
  4971: 	        tmpdir=`func_mktempdir`
  4972: 		func_basename "$file$stripped_ext"
  4973: 		file=$func_basename_result
  4974: 	        outputname=$tmpdir/$file
  4975: 	        # Replace the output file specification.
  4976: 	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
  4977: 
  4978: 	        $opt_quiet || {
  4979: 	          func_quote_for_expand "$relink_command"
  4980: 		  eval "func_echo $func_quote_for_expand_result"
  4981: 	        }
  4982: 	        if eval "$relink_command"; then :
  4983: 	          else
  4984: 		  func_error "error: relink '$file' with the above command before installing it"
  4985: 		  $opt_dry_run || ${RM}r "$tmpdir"
  4986: 		  continue
  4987: 	        fi
  4988: 	        file=$outputname
  4989: 	      else
  4990: 	        func_warning "cannot relink '$file'"
  4991: 	      fi
  4992: 	    }
  4993: 	  else
  4994: 	    # Install the binary that we compiled earlier.
  4995: 	    file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
  4996: 	  fi
  4997: 	fi
  4998: 
  4999: 	# remove .exe since cygwin /usr/bin/install will append another
  5000: 	# one anyway
  5001: 	case $install_prog,$host in
  5002: 	*/usr/bin/install*,*cygwin*)
  5003: 	  case $file:$destfile in
  5004: 	  *.exe:*.exe)
  5005: 	    # this is ok
  5006: 	    ;;
  5007: 	  *.exe:*)
  5008: 	    destfile=$destfile.exe
  5009: 	    ;;
  5010: 	  *:*.exe)
  5011: 	    func_stripname '' '.exe' "$destfile"
  5012: 	    destfile=$func_stripname_result
  5013: 	    ;;
  5014: 	  esac
  5015: 	  ;;
  5016: 	esac
  5017: 	func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
  5018: 	$opt_dry_run || if test -n "$outputname"; then
  5019: 	  ${RM}r "$tmpdir"
  5020: 	fi
  5021: 	;;
  5022:       esac
  5023:     done
  5024: 
  5025:     for file in $staticlibs; do
  5026:       func_basename "$file"
  5027:       name=$func_basename_result
  5028: 
  5029:       # Set up the ranlib parameters.
  5030:       oldlib=$destdir/$name
  5031:       func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
  5032:       tool_oldlib=$func_to_tool_file_result
  5033: 
  5034:       func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
  5035: 
  5036:       if test -n "$stripme" && test -n "$old_striplib"; then
  5037: 	func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
  5038:       fi
  5039: 
  5040:       # Do each command in the postinstall commands.
  5041:       func_execute_cmds "$old_postinstall_cmds" 'exit $?'
  5042:     done
  5043: 
  5044:     test -n "$future_libdirs" && \
  5045:       func_warning "remember to run '$progname --finish$future_libdirs'"
  5046: 
  5047:     if test -n "$current_libdirs"; then
  5048:       # Maybe just do a dry run.
  5049:       $opt_dry_run && current_libdirs=" -n$current_libdirs"
  5050:       exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
  5051:     else
  5052:       exit $EXIT_SUCCESS
  5053:     fi
  5054: }
  5055: 
  5056: test install = "$opt_mode" && func_mode_install ${1+"$@"}
  5057: 
  5058: 
  5059: # func_generate_dlsyms outputname originator pic_p
  5060: # Extract symbols from dlprefiles and create ${outputname}S.o with
  5061: # a dlpreopen symbol table.
  5062: func_generate_dlsyms ()
  5063: {
  5064:     $debug_cmd
  5065: 
  5066:     my_outputname=$1
  5067:     my_originator=$2
  5068:     my_pic_p=${3-false}
  5069:     my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
  5070:     my_dlsyms=
  5071: 
  5072:     if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
  5073:       if test -n "$NM" && test -n "$global_symbol_pipe"; then
  5074: 	my_dlsyms=${my_outputname}S.c
  5075:       else
  5076: 	func_error "not configured to extract global symbols from dlpreopened files"
  5077:       fi
  5078:     fi
  5079: 
  5080:     if test -n "$my_dlsyms"; then
  5081:       case $my_dlsyms in
  5082:       "") ;;
  5083:       *.c)
  5084: 	# Discover the nlist of each of the dlfiles.
  5085: 	nlist=$output_objdir/$my_outputname.nm
  5086: 
  5087: 	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
  5088: 
  5089: 	# Parse the name list into a source file.
  5090: 	func_verbose "creating $output_objdir/$my_dlsyms"
  5091: 
  5092: 	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
  5093: /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
  5094: /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
  5095: 
  5096: #ifdef __cplusplus
  5097: extern \"C\" {
  5098: #endif
  5099: 
  5100: #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
  5101: #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
  5102: #endif
  5103: 
  5104: /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
  5105: #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
  5106: /* DATA imports from DLLs on WIN32 can't be const, because runtime
  5107:    relocations are performed -- see ld's documentation on pseudo-relocs.  */
  5108: # define LT_DLSYM_CONST
  5109: #elif defined __osf__
  5110: /* This system does not cope well with relocations in const data.  */
  5111: # define LT_DLSYM_CONST
  5112: #else
  5113: # define LT_DLSYM_CONST const
  5114: #endif
  5115: 
  5116: #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
  5117: 
  5118: /* External symbol declarations for the compiler. */\
  5119: "
  5120: 
  5121: 	if test yes = "$dlself"; then
  5122: 	  func_verbose "generating symbol list for '$output'"
  5123: 
  5124: 	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
  5125: 
  5126: 	  # Add our own program objects to the symbol list.
  5127: 	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
  5128: 	  for progfile in $progfiles; do
  5129: 	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
  5130: 	    func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
  5131: 	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
  5132: 	  done
  5133: 
  5134: 	  if test -n "$exclude_expsyms"; then
  5135: 	    $opt_dry_run || {
  5136: 	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
  5137: 	      eval '$MV "$nlist"T "$nlist"'
  5138: 	    }
  5139: 	  fi
  5140: 
  5141: 	  if test -n "$export_symbols_regex"; then
  5142: 	    $opt_dry_run || {
  5143: 	      eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
  5144: 	      eval '$MV "$nlist"T "$nlist"'
  5145: 	    }
  5146: 	  fi
  5147: 
  5148: 	  # Prepare the list of exported symbols
  5149: 	  if test -z "$export_symbols"; then
  5150: 	    export_symbols=$output_objdir/$outputname.exp
  5151: 	    $opt_dry_run || {
  5152: 	      $RM $export_symbols
  5153: 	      eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
  5154: 	      case $host in
  5155: 	      *cygwin* | *mingw* | *cegcc* )
  5156:                 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
  5157:                 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
  5158: 	        ;;
  5159: 	      esac
  5160: 	    }
  5161: 	  else
  5162: 	    $opt_dry_run || {
  5163: 	      eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
  5164: 	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
  5165: 	      eval '$MV "$nlist"T "$nlist"'
  5166: 	      case $host in
  5167: 	        *cygwin* | *mingw* | *cegcc* )
  5168: 	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
  5169: 	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
  5170: 	          ;;
  5171: 	      esac
  5172: 	    }
  5173: 	  fi
  5174: 	fi
  5175: 
  5176: 	for dlprefile in $dlprefiles; do
  5177: 	  func_verbose "extracting global C symbols from '$dlprefile'"
  5178: 	  func_basename "$dlprefile"
  5179: 	  name=$func_basename_result
  5180:           case $host in
  5181: 	    *cygwin* | *mingw* | *cegcc* )
  5182: 	      # if an import library, we need to obtain dlname
  5183: 	      if func_win32_import_lib_p "$dlprefile"; then
  5184: 	        func_tr_sh "$dlprefile"
  5185: 	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
  5186: 	        dlprefile_dlbasename=
  5187: 	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
  5188: 	          # Use subshell, to avoid clobbering current variable values
  5189: 	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
  5190: 	          if test -n "$dlprefile_dlname"; then
  5191: 	            func_basename "$dlprefile_dlname"
  5192: 	            dlprefile_dlbasename=$func_basename_result
  5193: 	          else
  5194: 	            # no lafile. user explicitly requested -dlpreopen <import library>.
  5195: 	            $sharedlib_from_linklib_cmd "$dlprefile"
  5196: 	            dlprefile_dlbasename=$sharedlib_from_linklib_result
  5197: 	          fi
  5198: 	        fi
  5199: 	        $opt_dry_run || {
  5200: 	          if test -n "$dlprefile_dlbasename"; then
  5201: 	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
  5202: 	          else
  5203: 	            func_warning "Could not compute DLL name from $name"
  5204: 	            eval '$ECHO ": $name " >> "$nlist"'
  5205: 	          fi
  5206: 	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
  5207: 	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
  5208: 	            $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
  5209: 	        }
  5210: 	      else # not an import lib
  5211: 	        $opt_dry_run || {
  5212: 	          eval '$ECHO ": $name " >> "$nlist"'
  5213: 	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
  5214: 	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
  5215: 	        }
  5216: 	      fi
  5217: 	    ;;
  5218: 	    *)
  5219: 	      $opt_dry_run || {
  5220: 	        eval '$ECHO ": $name " >> "$nlist"'
  5221: 	        func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
  5222: 	        eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
  5223: 	      }
  5224: 	    ;;
  5225:           esac
  5226: 	done
  5227: 
  5228: 	$opt_dry_run || {
  5229: 	  # Make sure we have at least an empty file.
  5230: 	  test -f "$nlist" || : > "$nlist"
  5231: 
  5232: 	  if test -n "$exclude_expsyms"; then
  5233: 	    $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
  5234: 	    $MV "$nlist"T "$nlist"
  5235: 	  fi
  5236: 
  5237: 	  # Try sorting and uniquifying the output.
  5238: 	  if $GREP -v "^: " < "$nlist" |
  5239: 	      if sort -k 3 </dev/null >/dev/null 2>&1; then
  5240: 		sort -k 3
  5241: 	      else
  5242: 		sort +2
  5243: 	      fi |
  5244: 	      uniq > "$nlist"S; then
  5245: 	    :
  5246: 	  else
  5247: 	    $GREP -v "^: " < "$nlist" > "$nlist"S
  5248: 	  fi
  5249: 
  5250: 	  if test -f "$nlist"S; then
  5251: 	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
  5252: 	  else
  5253: 	    echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
  5254: 	  fi
  5255: 
  5256: 	  func_show_eval '$RM "${nlist}I"'
  5257: 	  if test -n "$global_symbol_to_import"; then
  5258: 	    eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
  5259: 	  fi
  5260: 
  5261: 	  echo >> "$output_objdir/$my_dlsyms" "\
  5262: 
  5263: /* The mapping between symbol names and symbols.  */
  5264: typedef struct {
  5265:   const char *name;
  5266:   void *address;
  5267: } lt_dlsymlist;
  5268: extern LT_DLSYM_CONST lt_dlsymlist
  5269: lt_${my_prefix}_LTX_preloaded_symbols[];\
  5270: "
  5271: 
  5272: 	  if test -s "$nlist"I; then
  5273: 	    echo >> "$output_objdir/$my_dlsyms" "\
  5274: static void lt_syminit(void)
  5275: {
  5276:   LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
  5277:   for (; symbol->name; ++symbol)
  5278:     {"
  5279: 	    $SED 's/.*/      if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
  5280: 	    echo >> "$output_objdir/$my_dlsyms" "\
  5281:     }
  5282: }"
  5283: 	  fi
  5284: 	  echo >> "$output_objdir/$my_dlsyms" "\
  5285: LT_DLSYM_CONST lt_dlsymlist
  5286: lt_${my_prefix}_LTX_preloaded_symbols[] =
  5287: { {\"$my_originator\", (void *) 0},"
  5288: 
  5289: 	  if test -s "$nlist"I; then
  5290: 	    echo >> "$output_objdir/$my_dlsyms" "\
  5291:   {\"@INIT@\", (void *) <_syminit},"
  5292: 	  fi
  5293: 
  5294: 	  case $need_lib_prefix in
  5295: 	  no)
  5296: 	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
  5297: 	    ;;
  5298: 	  *)
  5299: 	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
  5300: 	    ;;
  5301: 	  esac
  5302: 	  echo >> "$output_objdir/$my_dlsyms" "\
  5303:   {0, (void *) 0}
  5304: };
  5305: 
  5306: /* This works around a problem in FreeBSD linker */
  5307: #ifdef FREEBSD_WORKAROUND
  5308: static const void *lt_preloaded_setup() {
  5309:   return lt_${my_prefix}_LTX_preloaded_symbols;
  5310: }
  5311: #endif
  5312: 
  5313: #ifdef __cplusplus
  5314: }
  5315: #endif\
  5316: "
  5317: 	} # !$opt_dry_run
  5318: 
  5319: 	pic_flag_for_symtable=
  5320: 	case "$compile_command " in
  5321: 	*" -static "*) ;;
  5322: 	*)
  5323: 	  case $host in
  5324: 	  # compiling the symbol table file with pic_flag works around
  5325: 	  # a FreeBSD bug that causes programs to crash when -lm is
  5326: 	  # linked before any other PIC object.  But we must not use
  5327: 	  # pic_flag when linking with -static.  The problem exists in
  5328: 	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
  5329: 	  *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
  5330: 	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
  5331: 	  *-*-hpux*)
  5332: 	    pic_flag_for_symtable=" $pic_flag"  ;;
  5333: 	  *)
  5334: 	    $my_pic_p && pic_flag_for_symtable=" $pic_flag"
  5335: 	    ;;
  5336: 	  esac
  5337: 	  ;;
  5338: 	esac
  5339: 	symtab_cflags=
  5340: 	for arg in $LTCFLAGS; do
  5341: 	  case $arg in
  5342: 	  -pie | -fpie | -fPIE) ;;
  5343: 	  *) func_append symtab_cflags " $arg" ;;
  5344: 	  esac
  5345: 	done
  5346: 
  5347: 	# Now compile the dynamic symbol file.
  5348: 	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
  5349: 
  5350: 	# Clean up the generated files.
  5351: 	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
  5352: 
  5353: 	# Transform the symbol file into the correct name.
  5354: 	symfileobj=$output_objdir/${my_outputname}S.$objext
  5355: 	case $host in
  5356: 	*cygwin* | *mingw* | *cegcc* )
  5357: 	  if test -f "$output_objdir/$my_outputname.def"; then
  5358: 	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
  5359: 	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
  5360: 	  else
  5361: 	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
  5362: 	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
  5363: 	  fi
  5364: 	  ;;
  5365: 	*)
  5366: 	  compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
  5367: 	  finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
  5368: 	  ;;
  5369: 	esac
  5370: 	;;
  5371:       *)
  5372: 	func_fatal_error "unknown suffix for '$my_dlsyms'"
  5373: 	;;
  5374:       esac
  5375:     else
  5376:       # We keep going just in case the user didn't refer to
  5377:       # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
  5378:       # really was required.
  5379: 
  5380:       # Nullify the symbol file.
  5381:       compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
  5382:       finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
  5383:     fi
  5384: }
  5385: 
  5386: # func_cygming_gnu_implib_p ARG
  5387: # This predicate returns with zero status (TRUE) if
  5388: # ARG is a GNU/binutils-style import library. Returns
  5389: # with nonzero status (FALSE) otherwise.
  5390: func_cygming_gnu_implib_p ()
  5391: {
  5392:   $debug_cmd
  5393: 
  5394:   func_to_tool_file "$1" func_convert_file_msys_to_w32
  5395:   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)$'`
  5396:   test -n "$func_cygming_gnu_implib_tmp"
  5397: }
  5398: 
  5399: # func_cygming_ms_implib_p ARG
  5400: # This predicate returns with zero status (TRUE) if
  5401: # ARG is an MS-style import library. Returns
  5402: # with nonzero status (FALSE) otherwise.
  5403: func_cygming_ms_implib_p ()
  5404: {
  5405:   $debug_cmd
  5406: 
  5407:   func_to_tool_file "$1" func_convert_file_msys_to_w32
  5408:   func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
  5409:   test -n "$func_cygming_ms_implib_tmp"
  5410: }
  5411: 
  5412: # func_win32_libid arg
  5413: # return the library type of file 'arg'
  5414: #
  5415: # Need a lot of goo to handle *both* DLLs and import libs
  5416: # Has to be a shell function in order to 'eat' the argument
  5417: # that is supplied when $file_magic_command is called.
  5418: # Despite the name, also deal with 64 bit binaries.
  5419: func_win32_libid ()
  5420: {
  5421:   $debug_cmd
  5422: 
  5423:   win32_libid_type=unknown
  5424:   win32_fileres=`file -L $1 2>/dev/null`
  5425:   case $win32_fileres in
  5426:   *ar\ archive\ import\ library*) # definitely import
  5427:     win32_libid_type="x86 archive import"
  5428:     ;;
  5429:   *ar\ archive*) # could be an import, or static
  5430:     # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
  5431:     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
  5432:        $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
  5433:       case $nm_interface in
  5434:       "MS dumpbin")
  5435: 	if func_cygming_ms_implib_p "$1" ||
  5436: 	   func_cygming_gnu_implib_p "$1"
  5437: 	then
  5438: 	  win32_nmres=import
  5439: 	else
  5440: 	  win32_nmres=
  5441: 	fi
  5442: 	;;
  5443:       *)
  5444: 	func_to_tool_file "$1" func_convert_file_msys_to_w32
  5445: 	win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
  5446: 	  $SED -n -e '
  5447: 	    1,100{
  5448: 		/ I /{
  5449: 		    s|.*|import|
  5450: 		    p
  5451: 		    q
  5452: 		}
  5453: 	    }'`
  5454: 	;;
  5455:       esac
  5456:       case $win32_nmres in
  5457:       import*)  win32_libid_type="x86 archive import";;
  5458:       *)        win32_libid_type="x86 archive static";;
  5459:       esac
  5460:     fi
  5461:     ;;
  5462:   *DLL*)
  5463:     win32_libid_type="x86 DLL"
  5464:     ;;
  5465:   *executable*) # but shell scripts are "executable" too...
  5466:     case $win32_fileres in
  5467:     *MS\ Windows\ PE\ Intel*)
  5468:       win32_libid_type="x86 DLL"
  5469:       ;;
  5470:     esac
  5471:     ;;
  5472:   esac
  5473:   $ECHO "$win32_libid_type"
  5474: }
  5475: 
  5476: # func_cygming_dll_for_implib ARG
  5477: #
  5478: # Platform-specific function to extract the
  5479: # name of the DLL associated with the specified
  5480: # import library ARG.
  5481: # Invoked by eval'ing the libtool variable
  5482: #    $sharedlib_from_linklib_cmd
  5483: # Result is available in the variable
  5484: #    $sharedlib_from_linklib_result
  5485: func_cygming_dll_for_implib ()
  5486: {
  5487:   $debug_cmd
  5488: 
  5489:   sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
  5490: }
  5491: 
  5492: # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
  5493: #
  5494: # The is the core of a fallback implementation of a
  5495: # platform-specific function to extract the name of the
  5496: # DLL associated with the specified import library LIBNAME.
  5497: #
  5498: # SECTION_NAME is either .idata$6 or .idata$7, depending
  5499: # on the platform and compiler that created the implib.
  5500: #
  5501: # Echos the name of the DLL associated with the
  5502: # specified import library.
  5503: func_cygming_dll_for_implib_fallback_core ()
  5504: {
  5505:   $debug_cmd
  5506: 
  5507:   match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
  5508:   $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
  5509:     $SED '/^Contents of section '"$match_literal"':/{
  5510:       # Place marker at beginning of archive member dllname section
  5511:       s/.*/====MARK====/
  5512:       p
  5513:       d
  5514:     }
  5515:     # These lines can sometimes be longer than 43 characters, but
  5516:     # are always uninteresting
  5517:     /:[	 ]*file format pe[i]\{,1\}-/d
  5518:     /^In archive [^:]*:/d
  5519:     # Ensure marker is printed
  5520:     /^====MARK====/p
  5521:     # Remove all lines with less than 43 characters
  5522:     /^.\{43\}/!d
  5523:     # From remaining lines, remove first 43 characters
  5524:     s/^.\{43\}//' |
  5525:     $SED -n '
  5526:       # Join marker and all lines until next marker into a single line
  5527:       /^====MARK====/ b para
  5528:       H
  5529:       $ b para
  5530:       b
  5531:       :para
  5532:       x
  5533:       s/\n//g
  5534:       # Remove the marker
  5535:       s/^====MARK====//
  5536:       # Remove trailing dots and whitespace
  5537:       s/[\. \t]*$//
  5538:       # Print
  5539:       /./p' |
  5540:     # we now have a list, one entry per line, of the stringified
  5541:     # contents of the appropriate section of all members of the
  5542:     # archive that possess that section. Heuristic: eliminate
  5543:     # all those that have a first or second character that is
  5544:     # a '.' (that is, objdump's representation of an unprintable
  5545:     # character.) This should work for all archives with less than
  5546:     # 0x302f exports -- but will fail for DLLs whose name actually
  5547:     # begins with a literal '.' or a single character followed by
  5548:     # a '.'.
  5549:     #
  5550:     # Of those that remain, print the first one.
  5551:     $SED -e '/^\./d;/^.\./d;q'
  5552: }
  5553: 
  5554: # func_cygming_dll_for_implib_fallback ARG
  5555: # Platform-specific function to extract the
  5556: # name of the DLL associated with the specified
  5557: # import library ARG.
  5558: #
  5559: # This fallback implementation is for use when $DLLTOOL
  5560: # does not support the --identify-strict option.
  5561: # Invoked by eval'ing the libtool variable
  5562: #    $sharedlib_from_linklib_cmd
  5563: # Result is available in the variable
  5564: #    $sharedlib_from_linklib_result
  5565: func_cygming_dll_for_implib_fallback ()
  5566: {
  5567:   $debug_cmd
  5568: 
  5569:   if func_cygming_gnu_implib_p "$1"; then
  5570:     # binutils import library
  5571:     sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
  5572:   elif func_cygming_ms_implib_p "$1"; then
  5573:     # ms-generated import library
  5574:     sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
  5575:   else
  5576:     # unknown
  5577:     sharedlib_from_linklib_result=
  5578:   fi
  5579: }
  5580: 
  5581: 
  5582: # func_extract_an_archive dir oldlib
  5583: func_extract_an_archive ()
  5584: {
  5585:     $debug_cmd
  5586: 
  5587:     f_ex_an_ar_dir=$1; shift
  5588:     f_ex_an_ar_oldlib=$1
  5589:     if test yes = "$lock_old_archive_extraction"; then
  5590:       lockfile=$f_ex_an_ar_oldlib.lock
  5591:       until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
  5592: 	func_echo "Waiting for $lockfile to be removed"
  5593: 	sleep 2
  5594:       done
  5595:     fi
  5596:     func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
  5597: 		   'stat=$?; rm -f "$lockfile"; exit $stat'
  5598:     if test yes = "$lock_old_archive_extraction"; then
  5599:       $opt_dry_run || rm -f "$lockfile"
  5600:     fi
  5601:     if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
  5602:      :
  5603:     else
  5604:       func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
  5605:     fi
  5606: }
  5607: 
  5608: 
  5609: # func_extract_archives gentop oldlib ...
  5610: func_extract_archives ()
  5611: {
  5612:     $debug_cmd
  5613: 
  5614:     my_gentop=$1; shift
  5615:     my_oldlibs=${1+"$@"}
  5616:     my_oldobjs=
  5617:     my_xlib=
  5618:     my_xabs=
  5619:     my_xdir=
  5620: 
  5621:     for my_xlib in $my_oldlibs; do
  5622:       # Extract the objects.
  5623:       case $my_xlib in
  5624: 	[\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
  5625: 	*) my_xabs=`pwd`"/$my_xlib" ;;
  5626:       esac
  5627:       func_basename "$my_xlib"
  5628:       my_xlib=$func_basename_result
  5629:       my_xlib_u=$my_xlib
  5630:       while :; do
  5631:         case " $extracted_archives " in
  5632: 	*" $my_xlib_u "*)
  5633: 	  func_arith $extracted_serial + 1
  5634: 	  extracted_serial=$func_arith_result
  5635: 	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
  5636: 	*) break ;;
  5637: 	esac
  5638:       done
  5639:       extracted_archives="$extracted_archives $my_xlib_u"
  5640:       my_xdir=$my_gentop/$my_xlib_u
  5641: 
  5642:       func_mkdir_p "$my_xdir"
  5643: 
  5644:       case $host in
  5645:       *-darwin*)
  5646: 	func_verbose "Extracting $my_xabs"
  5647: 	# Do not bother doing anything if just a dry run
  5648: 	$opt_dry_run || {
  5649: 	  darwin_orig_dir=`pwd`
  5650: 	  cd $my_xdir || exit $?
  5651: 	  darwin_archive=$my_xabs
  5652: 	  darwin_curdir=`pwd`
  5653: 	  func_basename "$darwin_archive"
  5654: 	  darwin_base_archive=$func_basename_result
  5655: 	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
  5656: 	  if test -n "$darwin_arches"; then
  5657: 	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
  5658: 	    darwin_arch=
  5659: 	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
  5660: 	    for darwin_arch in  $darwin_arches; do
  5661: 	      func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
  5662: 	      $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
  5663: 	      cd "unfat-$$/$darwin_base_archive-$darwin_arch"
  5664: 	      func_extract_an_archive "`pwd`" "$darwin_base_archive"
  5665: 	      cd "$darwin_curdir"
  5666: 	      $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
  5667: 	    done # $darwin_arches
  5668:             ## Okay now we've a bunch of thin objects, gotta fatten them up :)
  5669: 	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
  5670: 	    darwin_file=
  5671: 	    darwin_files=
  5672: 	    for darwin_file in $darwin_filelist; do
  5673: 	      darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
  5674: 	      $LIPO -create -output "$darwin_file" $darwin_files
  5675: 	    done # $darwin_filelist
  5676: 	    $RM -rf unfat-$$
  5677: 	    cd "$darwin_orig_dir"
  5678: 	  else
  5679: 	    cd $darwin_orig_dir
  5680: 	    func_extract_an_archive "$my_xdir" "$my_xabs"
  5681: 	  fi # $darwin_arches
  5682: 	} # !$opt_dry_run
  5683: 	;;
  5684:       *)
  5685:         func_extract_an_archive "$my_xdir" "$my_xabs"
  5686: 	;;
  5687:       esac
  5688:       my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
  5689:     done
  5690: 
  5691:     func_extract_archives_result=$my_oldobjs
  5692: }
  5693: 
  5694: 
  5695: # func_emit_wrapper [arg=no]
  5696: #
  5697: # Emit a libtool wrapper script on stdout.
  5698: # Don't directly open a file because we may want to
  5699: # incorporate the script contents within a cygwin/mingw
  5700: # wrapper executable.  Must ONLY be called from within
  5701: # func_mode_link because it depends on a number of variables
  5702: # set therein.
  5703: #
  5704: # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
  5705: # variable will take.  If 'yes', then the emitted script
  5706: # will assume that the directory where it is stored is
  5707: # the $objdir directory.  This is a cygwin/mingw-specific
  5708: # behavior.
  5709: func_emit_wrapper ()
  5710: {
  5711: 	func_emit_wrapper_arg1=${1-no}
  5712: 
  5713: 	$ECHO "\
  5714: #! $SHELL
  5715: 
  5716: # $output - temporary wrapper script for $objdir/$outputname
  5717: # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
  5718: #
  5719: # The $output program cannot be directly executed until all the libtool
  5720: # libraries that it depends on are installed.
  5721: #
  5722: # This wrapper script should never be moved out of the build directory.
  5723: # If it is, it will not operate correctly.
  5724: 
  5725: # Sed substitution that helps us do robust quoting.  It backslashifies
  5726: # metacharacters that are still active within double-quoted strings.
  5727: sed_quote_subst='$sed_quote_subst'
  5728: 
  5729: # Be Bourne compatible
  5730: if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
  5731:   emulate sh
  5732:   NULLCMD=:
  5733:   # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
  5734:   # is contrary to our usage.  Disable this feature.
  5735:   alias -g '\${1+\"\$@\"}'='\"\$@\"'
  5736:   setopt NO_GLOB_SUBST
  5737: else
  5738:   case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
  5739: fi
  5740: BIN_SH=xpg4; export BIN_SH # for Tru64
  5741: DUALCASE=1; export DUALCASE # for MKS sh
  5742: 
  5743: # The HP-UX ksh and POSIX shell print the target directory to stdout
  5744: # if CDPATH is set.
  5745: (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  5746: 
  5747: relink_command=\"$relink_command\"
  5748: 
  5749: # This environment variable determines our operation mode.
  5750: if test \"\$libtool_install_magic\" = \"$magic\"; then
  5751:   # install mode needs the following variables:
  5752:   generated_by_libtool_version='$macro_version'
  5753:   notinst_deplibs='$notinst_deplibs'
  5754: else
  5755:   # When we are sourced in execute mode, \$file and \$ECHO are already set.
  5756:   if test \"\$libtool_execute_magic\" != \"$magic\"; then
  5757:     file=\"\$0\""
  5758: 
  5759:     qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
  5760:     $ECHO "\
  5761: 
  5762: # A function that is used when there is no print builtin or printf.
  5763: func_fallback_echo ()
  5764: {
  5765:   eval 'cat <<_LTECHO_EOF
  5766: \$1
  5767: _LTECHO_EOF'
  5768: }
  5769:     ECHO=\"$qECHO\"
  5770:   fi
  5771: 
  5772: # Very basic option parsing. These options are (a) specific to
  5773: # the libtool wrapper, (b) are identical between the wrapper
  5774: # /script/ and the wrapper /executable/ that is used only on
  5775: # windows platforms, and (c) all begin with the string "--lt-"
  5776: # (application programs are unlikely to have options that match
  5777: # this pattern).
  5778: #
  5779: # There are only two supported options: --lt-debug and
  5780: # --lt-dump-script. There is, deliberately, no --lt-help.
  5781: #
  5782: # The first argument to this parsing function should be the
  5783: # script's $0 value, followed by "$@".
  5784: lt_option_debug=
  5785: func_parse_lt_options ()
  5786: {
  5787:   lt_script_arg0=\$0
  5788:   shift
  5789:   for lt_opt
  5790:   do
  5791:     case \"\$lt_opt\" in
  5792:     --lt-debug) lt_option_debug=1 ;;
  5793:     --lt-dump-script)
  5794:         lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
  5795:         test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
  5796:         lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
  5797:         cat \"\$lt_dump_D/\$lt_dump_F\"
  5798:         exit 0
  5799:       ;;
  5800:     --lt-*)
  5801:         \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
  5802:         exit 1
  5803:       ;;
  5804:     esac
  5805:   done
  5806: 
  5807:   # Print the debug banner immediately:
  5808:   if test -n \"\$lt_option_debug\"; then
  5809:     echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
  5810:   fi
  5811: }
  5812: 
  5813: # Used when --lt-debug. Prints its arguments to stdout
  5814: # (redirection is the responsibility of the caller)
  5815: func_lt_dump_args ()
  5816: {
  5817:   lt_dump_args_N=1;
  5818:   for lt_arg
  5819:   do
  5820:     \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
  5821:     lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
  5822:   done
  5823: }
  5824: 
  5825: # Core function for launching the target application
  5826: func_exec_program_core ()
  5827: {
  5828: "
  5829:   case $host in
  5830:   # Backslashes separate directories on plain windows
  5831:   *-*-mingw | *-*-os2* | *-cegcc*)
  5832:     $ECHO "\
  5833:       if test -n \"\$lt_option_debug\"; then
  5834:         \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
  5835:         func_lt_dump_args \${1+\"\$@\"} 1>&2
  5836:       fi
  5837:       exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
  5838: "
  5839:     ;;
  5840: 
  5841:   *)
  5842:     $ECHO "\
  5843:       if test -n \"\$lt_option_debug\"; then
  5844:         \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
  5845:         func_lt_dump_args \${1+\"\$@\"} 1>&2
  5846:       fi
  5847:       exec \"\$progdir/\$program\" \${1+\"\$@\"}
  5848: "
  5849:     ;;
  5850:   esac
  5851:   $ECHO "\
  5852:       \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
  5853:       exit 1
  5854: }
  5855: 
  5856: # A function to encapsulate launching the target application
  5857: # Strips options in the --lt-* namespace from \$@ and
  5858: # launches target application with the remaining arguments.
  5859: func_exec_program ()
  5860: {
  5861:   case \" \$* \" in
  5862:   *\\ --lt-*)
  5863:     for lt_wr_arg
  5864:     do
  5865:       case \$lt_wr_arg in
  5866:       --lt-*) ;;
  5867:       *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
  5868:       esac
  5869:       shift
  5870:     done ;;
  5871:   esac
  5872:   func_exec_program_core \${1+\"\$@\"}
  5873: }
  5874: 
  5875:   # Parse options
  5876:   func_parse_lt_options \"\$0\" \${1+\"\$@\"}
  5877: 
  5878:   # Find the directory that this script lives in.
  5879:   thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
  5880:   test \"x\$thisdir\" = \"x\$file\" && thisdir=.
  5881: 
  5882:   # Follow symbolic links until we get to the real thisdir.
  5883:   file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
  5884:   while test -n \"\$file\"; do
  5885:     destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
  5886: 
  5887:     # If there was a directory component, then change thisdir.
  5888:     if test \"x\$destdir\" != \"x\$file\"; then
  5889:       case \"\$destdir\" in
  5890:       [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
  5891:       *) thisdir=\"\$thisdir/\$destdir\" ;;
  5892:       esac
  5893:     fi
  5894: 
  5895:     file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
  5896:     file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
  5897:   done
  5898: 
  5899:   # Usually 'no', except on cygwin/mingw when embedded into
  5900:   # the cwrapper.
  5901:   WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
  5902:   if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
  5903:     # special case for '.'
  5904:     if test \"\$thisdir\" = \".\"; then
  5905:       thisdir=\`pwd\`
  5906:     fi
  5907:     # remove .libs from thisdir
  5908:     case \"\$thisdir\" in
  5909:     *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
  5910:     $objdir )   thisdir=. ;;
  5911:     esac
  5912:   fi
  5913: 
  5914:   # Try to get the absolute directory name.
  5915:   absdir=\`cd \"\$thisdir\" && pwd\`
  5916:   test -n \"\$absdir\" && thisdir=\"\$absdir\"
  5917: "
  5918: 
  5919: 	if test yes = "$fast_install"; then
  5920: 	  $ECHO "\
  5921:   program=lt-'$outputname'$exeext
  5922:   progdir=\"\$thisdir/$objdir\"
  5923: 
  5924:   if test ! -f \"\$progdir/\$program\" ||
  5925:      { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
  5926:        test \"X\$file\" != \"X\$progdir/\$program\"; }; then
  5927: 
  5928:     file=\"\$\$-\$program\"
  5929: 
  5930:     if test ! -d \"\$progdir\"; then
  5931:       $MKDIR \"\$progdir\"
  5932:     else
  5933:       $RM \"\$progdir/\$file\"
  5934:     fi"
  5935: 
  5936: 	  $ECHO "\
  5937: 
  5938:     # relink executable if necessary
  5939:     if test -n \"\$relink_command\"; then
  5940:       if relink_command_output=\`eval \$relink_command 2>&1\`; then :
  5941:       else
  5942: 	\$ECHO \"\$relink_command_output\" >&2
  5943: 	$RM \"\$progdir/\$file\"
  5944: 	exit 1
  5945:       fi
  5946:     fi
  5947: 
  5948:     $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  5949:     { $RM \"\$progdir/\$program\";
  5950:       $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
  5951:     $RM \"\$progdir/\$file\"
  5952:   fi"
  5953: 	else
  5954: 	  $ECHO "\
  5955:   program='$outputname'
  5956:   progdir=\"\$thisdir/$objdir\"
  5957: "
  5958: 	fi
  5959: 
  5960: 	$ECHO "\
  5961: 
  5962:   if test -f \"\$progdir/\$program\"; then"
  5963: 
  5964: 	# fixup the dll searchpath if we need to.
  5965: 	#
  5966: 	# Fix the DLL searchpath if we need to.  Do this before prepending
  5967: 	# to shlibpath, because on Windows, both are PATH and uninstalled
  5968: 	# libraries must come first.
  5969: 	if test -n "$dllsearchpath"; then
  5970: 	  $ECHO "\
  5971:     # Add the dll search path components to the executable PATH
  5972:     PATH=$dllsearchpath:\$PATH
  5973: "
  5974: 	fi
  5975: 
  5976: 	# Export our shlibpath_var if we have one.
  5977: 	if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  5978: 	  $ECHO "\
  5979:     # Add our own library path to $shlibpath_var
  5980:     $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
  5981: 
  5982:     # Some systems cannot cope with colon-terminated $shlibpath_var
  5983:     # The second colon is a workaround for a bug in BeOS R4 sed
  5984:     $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
  5985: 
  5986:     export $shlibpath_var
  5987: "
  5988: 	fi
  5989: 
  5990: 	$ECHO "\
  5991:     if test \"\$libtool_execute_magic\" != \"$magic\"; then
  5992:       # Run the actual program with our arguments.
  5993:       func_exec_program \${1+\"\$@\"}
  5994:     fi
  5995:   else
  5996:     # The program doesn't exist.
  5997:     \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
  5998:     \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
  5999:     \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
  6000:     exit 1
  6001:   fi
  6002: fi\
  6003: "
  6004: }
  6005: 
  6006: 
  6007: # func_emit_cwrapperexe_src
  6008: # emit the source code for a wrapper executable on stdout
  6009: # Must ONLY be called from within func_mode_link because
  6010: # it depends on a number of variable set therein.
  6011: func_emit_cwrapperexe_src ()
  6012: {
  6013: 	cat <<EOF
  6014: 
  6015: /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
  6016:    Generated by $PROGRAM (GNU $PACKAGE) $VERSION
  6017: 
  6018:    The $output program cannot be directly executed until all the libtool
  6019:    libraries that it depends on are installed.
  6020: 
  6021:    This wrapper executable should never be moved out of the build directory.
  6022:    If it is, it will not operate correctly.
  6023: */
  6024: EOF
  6025: 	    cat <<"EOF"
  6026: #ifdef _MSC_VER
  6027: # define _CRT_SECURE_NO_DEPRECATE 1
  6028: #endif
  6029: #include <stdio.h>
  6030: #include <stdlib.h>
  6031: #ifdef _MSC_VER
  6032: # include <direct.h>
  6033: # include <process.h>
  6034: # include <io.h>
  6035: #else
  6036: # include <unistd.h>
  6037: # include <stdint.h>
  6038: # ifdef __CYGWIN__
  6039: #  include <io.h>
  6040: # endif
  6041: #endif
  6042: #include <malloc.h>
  6043: #include <stdarg.h>
  6044: #include <assert.h>
  6045: #include <string.h>
  6046: #include <ctype.h>
  6047: #include <errno.h>
  6048: #include <fcntl.h>
  6049: #include <sys/stat.h>
  6050: 
  6051: #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
  6052: 
  6053: /* declarations of non-ANSI functions */
  6054: #if defined __MINGW32__
  6055: # ifdef __STRICT_ANSI__
  6056: int _putenv (const char *);
  6057: # endif
  6058: #elif defined __CYGWIN__
  6059: # ifdef __STRICT_ANSI__
  6060: char *realpath (const char *, char *);
  6061: int putenv (char *);
  6062: int setenv (const char *, const char *, int);
  6063: # endif
  6064: /* #elif defined other_platform || defined ... */
  6065: #endif
  6066: 
  6067: /* portability defines, excluding path handling macros */
  6068: #if defined _MSC_VER
  6069: # define setmode _setmode
  6070: # define stat    _stat
  6071: # define chmod   _chmod
  6072: # define getcwd  _getcwd
  6073: # define putenv  _putenv
  6074: # define S_IXUSR _S_IEXEC
  6075: #elif defined __MINGW32__
  6076: # define setmode _setmode
  6077: # define stat    _stat
  6078: # define chmod   _chmod
  6079: # define getcwd  _getcwd
  6080: # define putenv  _putenv
  6081: #elif defined __CYGWIN__
  6082: # define HAVE_SETENV
  6083: # define FOPEN_WB "wb"
  6084: /* #elif defined other platforms ... */
  6085: #endif
  6086: 
  6087: #if defined PATH_MAX
  6088: # define LT_PATHMAX PATH_MAX
  6089: #elif defined MAXPATHLEN
  6090: # define LT_PATHMAX MAXPATHLEN
  6091: #else
  6092: # define LT_PATHMAX 1024
  6093: #endif
  6094: 
  6095: #ifndef S_IXOTH
  6096: # define S_IXOTH 0
  6097: #endif
  6098: #ifndef S_IXGRP
  6099: # define S_IXGRP 0
  6100: #endif
  6101: 
  6102: /* path handling portability macros */
  6103: #ifndef DIR_SEPARATOR
  6104: # define DIR_SEPARATOR '/'
  6105: # define PATH_SEPARATOR ':'
  6106: #endif
  6107: 
  6108: #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
  6109:   defined __OS2__
  6110: # define HAVE_DOS_BASED_FILE_SYSTEM
  6111: # define FOPEN_WB "wb"
  6112: # ifndef DIR_SEPARATOR_2
  6113: #  define DIR_SEPARATOR_2 '\\'
  6114: # endif
  6115: # ifndef PATH_SEPARATOR_2
  6116: #  define PATH_SEPARATOR_2 ';'
  6117: # endif
  6118: #endif
  6119: 
  6120: #ifndef DIR_SEPARATOR_2
  6121: # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
  6122: #else /* DIR_SEPARATOR_2 */
  6123: # define IS_DIR_SEPARATOR(ch) \
  6124: 	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
  6125: #endif /* DIR_SEPARATOR_2 */
  6126: 
  6127: #ifndef PATH_SEPARATOR_2
  6128: # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
  6129: #else /* PATH_SEPARATOR_2 */
  6130: # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
  6131: #endif /* PATH_SEPARATOR_2 */
  6132: 
  6133: #ifndef FOPEN_WB
  6134: # define FOPEN_WB "w"
  6135: #endif
  6136: #ifndef _O_BINARY
  6137: # define _O_BINARY 0
  6138: #endif
  6139: 
  6140: #define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
  6141: #define XFREE(stale) do { \
  6142:   if (stale) { free (stale); stale = 0; } \
  6143: } while (0)
  6144: 
  6145: #if defined LT_DEBUGWRAPPER
  6146: static int lt_debug = 1;
  6147: #else
  6148: static int lt_debug = 0;
  6149: #endif
  6150: 
  6151: const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
  6152: 
  6153: void *xmalloc (size_t num);
  6154: char *xstrdup (const char *string);
  6155: const char *base_name (const char *name);
  6156: char *find_executable (const char *wrapper);
  6157: char *chase_symlinks (const char *pathspec);
  6158: int make_executable (const char *path);
  6159: int check_executable (const char *path);
  6160: char *strendzap (char *str, const char *pat);
  6161: void lt_debugprintf (const char *file, int line, const char *fmt, ...);
  6162: void lt_fatal (const char *file, int line, const char *message, ...);
  6163: static const char *nonnull (const char *s);
  6164: static const char *nonempty (const char *s);
  6165: void lt_setenv (const char *name, const char *value);
  6166: char *lt_extend_str (const char *orig_value, const char *add, int to_end);
  6167: void lt_update_exe_path (const char *name, const char *value);
  6168: void lt_update_lib_path (const char *name, const char *value);
  6169: char **prepare_spawn (char **argv);
  6170: void lt_dump_script (FILE *f);
  6171: EOF
  6172: 
  6173: 	    cat <<EOF
  6174: #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
  6175: # define externally_visible volatile
  6176: #else
  6177: # define externally_visible __attribute__((externally_visible)) volatile
  6178: #endif
  6179: externally_visible const char * MAGIC_EXE = "$magic_exe";
  6180: const char * LIB_PATH_VARNAME = "$shlibpath_var";
  6181: EOF
  6182: 
  6183: 	    if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  6184:               func_to_host_path "$temp_rpath"
  6185: 	      cat <<EOF
  6186: const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
  6187: EOF
  6188: 	    else
  6189: 	      cat <<"EOF"
  6190: const char * LIB_PATH_VALUE   = "";
  6191: EOF
  6192: 	    fi
  6193: 
  6194: 	    if test -n "$dllsearchpath"; then
  6195:               func_to_host_path "$dllsearchpath:"
  6196: 	      cat <<EOF
  6197: const char * EXE_PATH_VARNAME = "PATH";
  6198: const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
  6199: EOF
  6200: 	    else
  6201: 	      cat <<"EOF"
  6202: const char * EXE_PATH_VARNAME = "";
  6203: const char * EXE_PATH_VALUE   = "";
  6204: EOF
  6205: 	    fi
  6206: 
  6207: 	    if test yes = "$fast_install"; then
  6208: 	      cat <<EOF
  6209: const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
  6210: EOF
  6211: 	    else
  6212: 	      cat <<EOF
  6213: const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
  6214: EOF
  6215: 	    fi
  6216: 
  6217: 
  6218: 	    cat <<"EOF"
  6219: 
  6220: #define LTWRAPPER_OPTION_PREFIX         "--lt-"
  6221: 
  6222: static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
  6223: static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
  6224: static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
  6225: 
  6226: int
  6227: main (int argc, char *argv[])
  6228: {
  6229:   char **newargz;
  6230:   int  newargc;
  6231:   char *tmp_pathspec;
  6232:   char *actual_cwrapper_path;
  6233:   char *actual_cwrapper_name;
  6234:   char *target_name;
  6235:   char *lt_argv_zero;
  6236:   int rval = 127;
  6237: 
  6238:   int i;
  6239: 
  6240:   program_name = (char *) xstrdup (base_name (argv[0]));
  6241:   newargz = XMALLOC (char *, (size_t) argc + 1);
  6242: 
  6243:   /* very simple arg parsing; don't want to rely on getopt
  6244:    * also, copy all non cwrapper options to newargz, except
  6245:    * argz[0], which is handled differently
  6246:    */
  6247:   newargc=0;
  6248:   for (i = 1; i < argc; i++)
  6249:     {
  6250:       if (STREQ (argv[i], dumpscript_opt))
  6251: 	{
  6252: EOF
  6253: 	    case $host in
  6254: 	      *mingw* | *cygwin* )
  6255: 		# make stdout use "unix" line endings
  6256: 		echo "          setmode(1,_O_BINARY);"
  6257: 		;;
  6258: 	      esac
  6259: 
  6260: 	    cat <<"EOF"
  6261: 	  lt_dump_script (stdout);
  6262: 	  return 0;
  6263: 	}
  6264:       if (STREQ (argv[i], debug_opt))
  6265: 	{
  6266:           lt_debug = 1;
  6267:           continue;
  6268: 	}
  6269:       if (STREQ (argv[i], ltwrapper_option_prefix))
  6270:         {
  6271:           /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
  6272:              namespace, but it is not one of the ones we know about and
  6273:              have already dealt with, above (inluding dump-script), then
  6274:              report an error. Otherwise, targets might begin to believe
  6275:              they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
  6276:              namespace. The first time any user complains about this, we'll
  6277:              need to make LTWRAPPER_OPTION_PREFIX a configure-time option
  6278:              or a configure.ac-settable value.
  6279:            */
  6280:           lt_fatal (__FILE__, __LINE__,
  6281: 		    "unrecognized %s option: '%s'",
  6282:                     ltwrapper_option_prefix, argv[i]);
  6283:         }
  6284:       /* otherwise ... */
  6285:       newargz[++newargc] = xstrdup (argv[i]);
  6286:     }
  6287:   newargz[++newargc] = NULL;
  6288: 
  6289: EOF
  6290: 	    cat <<EOF
  6291:   /* The GNU banner must be the first non-error debug message */
  6292:   lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
  6293: EOF
  6294: 	    cat <<"EOF"
  6295:   lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
  6296:   lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
  6297: 
  6298:   tmp_pathspec = find_executable (argv[0]);
  6299:   if (tmp_pathspec == NULL)
  6300:     lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
  6301:   lt_debugprintf (__FILE__, __LINE__,
  6302:                   "(main) found exe (before symlink chase) at: %s\n",
  6303: 		  tmp_pathspec);
  6304: 
  6305:   actual_cwrapper_path = chase_symlinks (tmp_pathspec);
  6306:   lt_debugprintf (__FILE__, __LINE__,
  6307:                   "(main) found exe (after symlink chase) at: %s\n",
  6308: 		  actual_cwrapper_path);
  6309:   XFREE (tmp_pathspec);
  6310: 
  6311:   actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
  6312:   strendzap (actual_cwrapper_path, actual_cwrapper_name);
  6313: 
  6314:   /* wrapper name transforms */
  6315:   strendzap (actual_cwrapper_name, ".exe");
  6316:   tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
  6317:   XFREE (actual_cwrapper_name);
  6318:   actual_cwrapper_name = tmp_pathspec;
  6319:   tmp_pathspec = 0;
  6320: 
  6321:   /* target_name transforms -- use actual target program name; might have lt- prefix */
  6322:   target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
  6323:   strendzap (target_name, ".exe");
  6324:   tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
  6325:   XFREE (target_name);
  6326:   target_name = tmp_pathspec;
  6327:   tmp_pathspec = 0;
  6328: 
  6329:   lt_debugprintf (__FILE__, __LINE__,
  6330: 		  "(main) libtool target name: %s\n",
  6331: 		  target_name);
  6332: EOF
  6333: 
  6334: 	    cat <<EOF
  6335:   newargz[0] =
  6336:     XMALLOC (char, (strlen (actual_cwrapper_path) +
  6337: 		    strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
  6338:   strcpy (newargz[0], actual_cwrapper_path);
  6339:   strcat (newargz[0], "$objdir");
  6340:   strcat (newargz[0], "/");
  6341: EOF
  6342: 
  6343: 	    cat <<"EOF"
  6344:   /* stop here, and copy so we don't have to do this twice */
  6345:   tmp_pathspec = xstrdup (newargz[0]);
  6346: 
  6347:   /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
  6348:   strcat (newargz[0], actual_cwrapper_name);
  6349: 
  6350:   /* DO want the lt- prefix here if it exists, so use target_name */
  6351:   lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
  6352:   XFREE (tmp_pathspec);
  6353:   tmp_pathspec = NULL;
  6354: EOF
  6355: 
  6356: 	    case $host_os in
  6357: 	      mingw*)
  6358: 	    cat <<"EOF"
  6359:   {
  6360:     char* p;
  6361:     while ((p = strchr (newargz[0], '\\')) != NULL)
  6362:       {
  6363: 	*p = '/';
  6364:       }
  6365:     while ((p = strchr (lt_argv_zero, '\\')) != NULL)
  6366:       {
  6367: 	*p = '/';
  6368:       }
  6369:   }
  6370: EOF
  6371: 	    ;;
  6372: 	    esac
  6373: 
  6374: 	    cat <<"EOF"
  6375:   XFREE (target_name);
  6376:   XFREE (actual_cwrapper_path);
  6377:   XFREE (actual_cwrapper_name);
  6378: 
  6379:   lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
  6380:   lt_setenv ("DUALCASE", "1");  /* for MSK sh */
  6381:   /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
  6382:      be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
  6383:      because on Windows, both *_VARNAMEs are PATH but uninstalled
  6384:      libraries must come first. */
  6385:   lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
  6386:   lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
  6387: 
  6388:   lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
  6389: 		  nonnull (lt_argv_zero));
  6390:   for (i = 0; i < newargc; i++)
  6391:     {
  6392:       lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
  6393: 		      i, nonnull (newargz[i]));
  6394:     }
  6395: 
  6396: EOF
  6397: 
  6398: 	    case $host_os in
  6399: 	      mingw*)
  6400: 		cat <<"EOF"
  6401:   /* execv doesn't actually work on mingw as expected on unix */
  6402:   newargz = prepare_spawn (newargz);
  6403:   rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
  6404:   if (rval == -1)
  6405:     {
  6406:       /* failed to start process */
  6407:       lt_debugprintf (__FILE__, __LINE__,
  6408: 		      "(main) failed to launch target \"%s\": %s\n",
  6409: 		      lt_argv_zero, nonnull (strerror (errno)));
  6410:       return 127;
  6411:     }
  6412:   return rval;
  6413: EOF
  6414: 		;;
  6415: 	      *)
  6416: 		cat <<"EOF"
  6417:   execv (lt_argv_zero, newargz);
  6418:   return rval; /* =127, but avoids unused variable warning */
  6419: EOF
  6420: 		;;
  6421: 	    esac
  6422: 
  6423: 	    cat <<"EOF"
  6424: }
  6425: 
  6426: void *
  6427: xmalloc (size_t num)
  6428: {
  6429:   void *p = (void *) malloc (num);
  6430:   if (!p)
  6431:     lt_fatal (__FILE__, __LINE__, "memory exhausted");
  6432: 
  6433:   return p;
  6434: }
  6435: 
  6436: char *
  6437: xstrdup (const char *string)
  6438: {
  6439:   return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
  6440: 			  string) : NULL;
  6441: }
  6442: 
  6443: const char *
  6444: base_name (const char *name)
  6445: {
  6446:   const char *base;
  6447: 
  6448: #if defined HAVE_DOS_BASED_FILE_SYSTEM
  6449:   /* Skip over the disk name in MSDOS pathnames. */
  6450:   if (isalpha ((unsigned char) name[0]) && name[1] == ':')
  6451:     name += 2;
  6452: #endif
  6453: 
  6454:   for (base = name; *name; name++)
  6455:     if (IS_DIR_SEPARATOR (*name))
  6456:       base = name + 1;
  6457:   return base;
  6458: }
  6459: 
  6460: int
  6461: check_executable (const char *path)
  6462: {
  6463:   struct stat st;
  6464: 
  6465:   lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
  6466:                   nonempty (path));
  6467:   if ((!path) || (!*path))
  6468:     return 0;
  6469: 
  6470:   if ((stat (path, &st) >= 0)
  6471:       && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
  6472:     return 1;
  6473:   else
  6474:     return 0;
  6475: }
  6476: 
  6477: int
  6478: make_executable (const char *path)
  6479: {
  6480:   int rval = 0;
  6481:   struct stat st;
  6482: 
  6483:   lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
  6484:                   nonempty (path));
  6485:   if ((!path) || (!*path))
  6486:     return 0;
  6487: 
  6488:   if (stat (path, &st) >= 0)
  6489:     {
  6490:       rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
  6491:     }
  6492:   return rval;
  6493: }
  6494: 
  6495: /* Searches for the full path of the wrapper.  Returns
  6496:    newly allocated full path name if found, NULL otherwise
  6497:    Does not chase symlinks, even on platforms that support them.
  6498: */
  6499: char *
  6500: find_executable (const char *wrapper)
  6501: {
  6502:   int has_slash = 0;
  6503:   const char *p;
  6504:   const char *p_next;
  6505:   /* static buffer for getcwd */
  6506:   char tmp[LT_PATHMAX + 1];
  6507:   size_t tmp_len;
  6508:   char *concat_name;
  6509: 
  6510:   lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
  6511:                   nonempty (wrapper));
  6512: 
  6513:   if ((wrapper == NULL) || (*wrapper == '\0'))
  6514:     return NULL;
  6515: 
  6516:   /* Absolute path? */
  6517: #if defined HAVE_DOS_BASED_FILE_SYSTEM
  6518:   if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
  6519:     {
  6520:       concat_name = xstrdup (wrapper);
  6521:       if (check_executable (concat_name))
  6522: 	return concat_name;
  6523:       XFREE (concat_name);
  6524:     }
  6525:   else
  6526:     {
  6527: #endif
  6528:       if (IS_DIR_SEPARATOR (wrapper[0]))
  6529: 	{
  6530: 	  concat_name = xstrdup (wrapper);
  6531: 	  if (check_executable (concat_name))
  6532: 	    return concat_name;
  6533: 	  XFREE (concat_name);
  6534: 	}
  6535: #if defined HAVE_DOS_BASED_FILE_SYSTEM
  6536:     }
  6537: #endif
  6538: 
  6539:   for (p = wrapper; *p; p++)
  6540:     if (*p == '/')
  6541:       {
  6542: 	has_slash = 1;
  6543: 	break;
  6544:       }
  6545:   if (!has_slash)
  6546:     {
  6547:       /* no slashes; search PATH */
  6548:       const char *path = getenv ("PATH");
  6549:       if (path != NULL)
  6550: 	{
  6551: 	  for (p = path; *p; p = p_next)
  6552: 	    {
  6553: 	      const char *q;
  6554: 	      size_t p_len;
  6555: 	      for (q = p; *q; q++)
  6556: 		if (IS_PATH_SEPARATOR (*q))
  6557: 		  break;
  6558: 	      p_len = (size_t) (q - p);
  6559: 	      p_next = (*q == '\0' ? q : q + 1);
  6560: 	      if (p_len == 0)
  6561: 		{
  6562: 		  /* empty path: current directory */
  6563: 		  if (getcwd (tmp, LT_PATHMAX) == NULL)
  6564: 		    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
  6565:                               nonnull (strerror (errno)));
  6566: 		  tmp_len = strlen (tmp);
  6567: 		  concat_name =
  6568: 		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
  6569: 		  memcpy (concat_name, tmp, tmp_len);
  6570: 		  concat_name[tmp_len] = '/';
  6571: 		  strcpy (concat_name + tmp_len + 1, wrapper);
  6572: 		}
  6573: 	      else
  6574: 		{
  6575: 		  concat_name =
  6576: 		    XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
  6577: 		  memcpy (concat_name, p, p_len);
  6578: 		  concat_name[p_len] = '/';
  6579: 		  strcpy (concat_name + p_len + 1, wrapper);
  6580: 		}
  6581: 	      if (check_executable (concat_name))
  6582: 		return concat_name;
  6583: 	      XFREE (concat_name);
  6584: 	    }
  6585: 	}
  6586:       /* not found in PATH; assume curdir */
  6587:     }
  6588:   /* Relative path | not found in path: prepend cwd */
  6589:   if (getcwd (tmp, LT_PATHMAX) == NULL)
  6590:     lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
  6591:               nonnull (strerror (errno)));
  6592:   tmp_len = strlen (tmp);
  6593:   concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
  6594:   memcpy (concat_name, tmp, tmp_len);
  6595:   concat_name[tmp_len] = '/';
  6596:   strcpy (concat_name + tmp_len + 1, wrapper);
  6597: 
  6598:   if (check_executable (concat_name))
  6599:     return concat_name;
  6600:   XFREE (concat_name);
  6601:   return NULL;
  6602: }
  6603: 
  6604: char *
  6605: chase_symlinks (const char *pathspec)
  6606: {
  6607: #ifndef S_ISLNK
  6608:   return xstrdup (pathspec);
  6609: #else
  6610:   char buf[LT_PATHMAX];
  6611:   struct stat s;
  6612:   char *tmp_pathspec = xstrdup (pathspec);
  6613:   char *p;
  6614:   int has_symlinks = 0;
  6615:   while (strlen (tmp_pathspec) && !has_symlinks)
  6616:     {
  6617:       lt_debugprintf (__FILE__, __LINE__,
  6618: 		      "checking path component for symlinks: %s\n",
  6619: 		      tmp_pathspec);
  6620:       if (lstat (tmp_pathspec, &s) == 0)
  6621: 	{
  6622: 	  if (S_ISLNK (s.st_mode) != 0)
  6623: 	    {
  6624: 	      has_symlinks = 1;
  6625: 	      break;
  6626: 	    }
  6627: 
  6628: 	  /* search backwards for last DIR_SEPARATOR */
  6629: 	  p = tmp_pathspec + strlen (tmp_pathspec) - 1;
  6630: 	  while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
  6631: 	    p--;
  6632: 	  if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
  6633: 	    {
  6634: 	      /* no more DIR_SEPARATORS left */
  6635: 	      break;
  6636: 	    }
  6637: 	  *p = '\0';
  6638: 	}
  6639:       else
  6640: 	{
  6641: 	  lt_fatal (__FILE__, __LINE__,
  6642: 		    "error accessing file \"%s\": %s",
  6643: 		    tmp_pathspec, nonnull (strerror (errno)));
  6644: 	}
  6645:     }
  6646:   XFREE (tmp_pathspec);
  6647: 
  6648:   if (!has_symlinks)
  6649:     {
  6650:       return xstrdup (pathspec);
  6651:     }
  6652: 
  6653:   tmp_pathspec = realpath (pathspec, buf);
  6654:   if (tmp_pathspec == 0)
  6655:     {
  6656:       lt_fatal (__FILE__, __LINE__,
  6657: 		"could not follow symlinks for %s", pathspec);
  6658:     }
  6659:   return xstrdup (tmp_pathspec);
  6660: #endif
  6661: }
  6662: 
  6663: char *
  6664: strendzap (char *str, const char *pat)
  6665: {
  6666:   size_t len, patlen;
  6667: 
  6668:   assert (str != NULL);
  6669:   assert (pat != NULL);
  6670: 
  6671:   len = strlen (str);
  6672:   patlen = strlen (pat);
  6673: 
  6674:   if (patlen <= len)
  6675:     {
  6676:       str += len - patlen;
  6677:       if (STREQ (str, pat))
  6678: 	*str = '\0';
  6679:     }
  6680:   return str;
  6681: }
  6682: 
  6683: void
  6684: lt_debugprintf (const char *file, int line, const char *fmt, ...)
  6685: {
  6686:   va_list args;
  6687:   if (lt_debug)
  6688:     {
  6689:       (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
  6690:       va_start (args, fmt);
  6691:       (void) vfprintf (stderr, fmt, args);
  6692:       va_end (args);
  6693:     }
  6694: }
  6695: 
  6696: static void
  6697: lt_error_core (int exit_status, const char *file,
  6698: 	       int line, const char *mode,
  6699: 	       const char *message, va_list ap)
  6700: {
  6701:   fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
  6702:   vfprintf (stderr, message, ap);
  6703:   fprintf (stderr, ".\n");
  6704: 
  6705:   if (exit_status >= 0)
  6706:     exit (exit_status);
  6707: }
  6708: 
  6709: void
  6710: lt_fatal (const char *file, int line, const char *message, ...)
  6711: {
  6712:   va_list ap;
  6713:   va_start (ap, message);
  6714:   lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
  6715:   va_end (ap);
  6716: }
  6717: 
  6718: static const char *
  6719: nonnull (const char *s)
  6720: {
  6721:   return s ? s : "(null)";
  6722: }
  6723: 
  6724: static const char *
  6725: nonempty (const char *s)
  6726: {
  6727:   return (s && !*s) ? "(empty)" : nonnull (s);
  6728: }
  6729: 
  6730: void
  6731: lt_setenv (const char *name, const char *value)
  6732: {
  6733:   lt_debugprintf (__FILE__, __LINE__,
  6734: 		  "(lt_setenv) setting '%s' to '%s'\n",
  6735:                   nonnull (name), nonnull (value));
  6736:   {
  6737: #ifdef HAVE_SETENV
  6738:     /* always make a copy, for consistency with !HAVE_SETENV */
  6739:     char *str = xstrdup (value);
  6740:     setenv (name, str, 1);
  6741: #else
  6742:     size_t len = strlen (name) + 1 + strlen (value) + 1;
  6743:     char *str = XMALLOC (char, len);
  6744:     sprintf (str, "%s=%s", name, value);
  6745:     if (putenv (str) != EXIT_SUCCESS)
  6746:       {
  6747:         XFREE (str);
  6748:       }
  6749: #endif
  6750:   }
  6751: }
  6752: 
  6753: char *
  6754: lt_extend_str (const char *orig_value, const char *add, int to_end)
  6755: {
  6756:   char *new_value;
  6757:   if (orig_value && *orig_value)
  6758:     {
  6759:       size_t orig_value_len = strlen (orig_value);
  6760:       size_t add_len = strlen (add);
  6761:       new_value = XMALLOC (char, add_len + orig_value_len + 1);
  6762:       if (to_end)
  6763:         {
  6764:           strcpy (new_value, orig_value);
  6765:           strcpy (new_value + orig_value_len, add);
  6766:         }
  6767:       else
  6768:         {
  6769:           strcpy (new_value, add);
  6770:           strcpy (new_value + add_len, orig_value);
  6771:         }
  6772:     }
  6773:   else
  6774:     {
  6775:       new_value = xstrdup (add);
  6776:     }
  6777:   return new_value;
  6778: }
  6779: 
  6780: void
  6781: lt_update_exe_path (const char *name, const char *value)
  6782: {
  6783:   lt_debugprintf (__FILE__, __LINE__,
  6784: 		  "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
  6785:                   nonnull (name), nonnull (value));
  6786: 
  6787:   if (name && *name && value && *value)
  6788:     {
  6789:       char *new_value = lt_extend_str (getenv (name), value, 0);
  6790:       /* some systems can't cope with a ':'-terminated path #' */
  6791:       size_t len = strlen (new_value);
  6792:       while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
  6793:         {
  6794:           new_value[--len] = '\0';
  6795:         }
  6796:       lt_setenv (name, new_value);
  6797:       XFREE (new_value);
  6798:     }
  6799: }
  6800: 
  6801: void
  6802: lt_update_lib_path (const char *name, const char *value)
  6803: {
  6804:   lt_debugprintf (__FILE__, __LINE__,
  6805: 		  "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
  6806:                   nonnull (name), nonnull (value));
  6807: 
  6808:   if (name && *name && value && *value)
  6809:     {
  6810:       char *new_value = lt_extend_str (getenv (name), value, 0);
  6811:       lt_setenv (name, new_value);
  6812:       XFREE (new_value);
  6813:     }
  6814: }
  6815: 
  6816: EOF
  6817: 	    case $host_os in
  6818: 	      mingw*)
  6819: 		cat <<"EOF"
  6820: 
  6821: /* Prepares an argument vector before calling spawn().
  6822:    Note that spawn() does not by itself call the command interpreter
  6823:      (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
  6824:       ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  6825:          GetVersionEx(&v);
  6826:          v.dwPlatformId == VER_PLATFORM_WIN32_NT;
  6827:       }) ? "cmd.exe" : "command.com").
  6828:    Instead it simply concatenates the arguments, separated by ' ', and calls
  6829:    CreateProcess().  We must quote the arguments since Win32 CreateProcess()
  6830:    interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
  6831:    special way:
  6832:    - Space and tab are interpreted as delimiters. They are not treated as
  6833:      delimiters if they are surrounded by double quotes: "...".
  6834:    - Unescaped double quotes are removed from the input. Their only effect is
  6835:      that within double quotes, space and tab are treated like normal
  6836:      characters.
  6837:    - Backslashes not followed by double quotes are not special.
  6838:    - But 2*n+1 backslashes followed by a double quote become
  6839:      n backslashes followed by a double quote (n >= 0):
  6840:        \" -> "
  6841:        \\\" -> \"
  6842:        \\\\\" -> \\"
  6843:  */
  6844: #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"
  6845: #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"
  6846: char **
  6847: prepare_spawn (char **argv)
  6848: {
  6849:   size_t argc;
  6850:   char **new_argv;
  6851:   size_t i;
  6852: 
  6853:   /* Count number of arguments.  */
  6854:   for (argc = 0; argv[argc] != NULL; argc++)
  6855:     ;
  6856: 
  6857:   /* Allocate new argument vector.  */
  6858:   new_argv = XMALLOC (char *, argc + 1);
  6859: 
  6860:   /* Put quoted arguments into the new argument vector.  */
  6861:   for (i = 0; i < argc; i++)
  6862:     {
  6863:       const char *string = argv[i];
  6864: 
  6865:       if (string[0] == '\0')
  6866: 	new_argv[i] = xstrdup ("\"\"");
  6867:       else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
  6868: 	{
  6869: 	  int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
  6870: 	  size_t length;
  6871: 	  unsigned int backslashes;
  6872: 	  const char *s;
  6873: 	  char *quoted_string;
  6874: 	  char *p;
  6875: 
  6876: 	  length = 0;
  6877: 	  backslashes = 0;
  6878: 	  if (quote_around)
  6879: 	    length++;
  6880: 	  for (s = string; *s != '\0'; s++)
  6881: 	    {
  6882: 	      char c = *s;
  6883: 	      if (c == '"')
  6884: 		length += backslashes + 1;
  6885: 	      length++;
  6886: 	      if (c == '\\')
  6887: 		backslashes++;
  6888: 	      else
  6889: 		backslashes = 0;
  6890: 	    }
  6891: 	  if (quote_around)
  6892: 	    length += backslashes + 1;
  6893: 
  6894: 	  quoted_string = XMALLOC (char, length + 1);
  6895: 
  6896: 	  p = quoted_string;
  6897: 	  backslashes = 0;
  6898: 	  if (quote_around)
  6899: 	    *p++ = '"';
  6900: 	  for (s = string; *s != '\0'; s++)
  6901: 	    {
  6902: 	      char c = *s;
  6903: 	      if (c == '"')
  6904: 		{
  6905: 		  unsigned int j;
  6906: 		  for (j = backslashes + 1; j > 0; j--)
  6907: 		    *p++ = '\\';
  6908: 		}
  6909: 	      *p++ = c;
  6910: 	      if (c == '\\')
  6911: 		backslashes++;
  6912: 	      else
  6913: 		backslashes = 0;
  6914: 	    }
  6915: 	  if (quote_around)
  6916: 	    {
  6917: 	      unsigned int j;
  6918: 	      for (j = backslashes; j > 0; j--)
  6919: 		*p++ = '\\';
  6920: 	      *p++ = '"';
  6921: 	    }
  6922: 	  *p = '\0';
  6923: 
  6924: 	  new_argv[i] = quoted_string;
  6925: 	}
  6926:       else
  6927: 	new_argv[i] = (char *) string;
  6928:     }
  6929:   new_argv[argc] = NULL;
  6930: 
  6931:   return new_argv;
  6932: }
  6933: EOF
  6934: 		;;
  6935: 	    esac
  6936: 
  6937:             cat <<"EOF"
  6938: void lt_dump_script (FILE* f)
  6939: {
  6940: EOF
  6941: 	    func_emit_wrapper yes |
  6942: 	      $SED -n -e '
  6943: s/^\(.\{79\}\)\(..*\)/\1\
  6944: \2/
  6945: h
  6946: s/\([\\"]\)/\\\1/g
  6947: s/$/\\n/
  6948: s/\([^\n]*\).*/  fputs ("\1", f);/p
  6949: g
  6950: D'
  6951:             cat <<"EOF"
  6952: }
  6953: EOF
  6954: }
  6955: # end: func_emit_cwrapperexe_src
  6956: 
  6957: # func_win32_import_lib_p ARG
  6958: # True if ARG is an import lib, as indicated by $file_magic_cmd
  6959: func_win32_import_lib_p ()
  6960: {
  6961:     $debug_cmd
  6962: 
  6963:     case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
  6964:     *import*) : ;;
  6965:     *) false ;;
  6966:     esac
  6967: }
  6968: 
  6969: # func_suncc_cstd_abi
  6970: # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
  6971: # Several compiler flags select an ABI that is incompatible with the
  6972: # Cstd library. Avoid specifying it if any are in CXXFLAGS.
  6973: func_suncc_cstd_abi ()
  6974: {
  6975:     $debug_cmd
  6976: 
  6977:     case " $compile_command " in
  6978:     *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
  6979:       suncc_use_cstd_abi=no
  6980:       ;;
  6981:     *)
  6982:       suncc_use_cstd_abi=yes
  6983:       ;;
  6984:     esac
  6985: }
  6986: 
  6987: # func_mode_link arg...
  6988: func_mode_link ()
  6989: {
  6990:     $debug_cmd
  6991: 
  6992:     case $host in
  6993:     *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  6994:       # It is impossible to link a dll without this setting, and
  6995:       # we shouldn't force the makefile maintainer to figure out
  6996:       # what system we are compiling for in order to pass an extra
  6997:       # flag for every libtool invocation.
  6998:       # allow_undefined=no
  6999: 
  7000:       # FIXME: Unfortunately, there are problems with the above when trying
  7001:       # to make a dll that has undefined symbols, in which case not
  7002:       # even a static library is built.  For now, we need to specify
  7003:       # -no-undefined on the libtool link line when we can be certain
  7004:       # that all symbols are satisfied, otherwise we get a static library.
  7005:       allow_undefined=yes
  7006:       ;;
  7007:     *)
  7008:       allow_undefined=yes
  7009:       ;;
  7010:     esac
  7011:     libtool_args=$nonopt
  7012:     base_compile="$nonopt $@"
  7013:     compile_command=$nonopt
  7014:     finalize_command=$nonopt
  7015: 
  7016:     compile_rpath=
  7017:     finalize_rpath=
  7018:     compile_shlibpath=
  7019:     finalize_shlibpath=
  7020:     convenience=
  7021:     old_convenience=
  7022:     deplibs=
  7023:     old_deplibs=
  7024:     compiler_flags=
  7025:     linker_flags=
  7026:     dllsearchpath=
  7027:     lib_search_path=`pwd`
  7028:     inst_prefix_dir=
  7029:     new_inherited_linker_flags=
  7030: 
  7031:     avoid_version=no
  7032:     bindir=
  7033:     dlfiles=
  7034:     dlprefiles=
  7035:     dlself=no
  7036:     export_dynamic=no
  7037:     export_symbols=
  7038:     export_symbols_regex=
  7039:     generated=
  7040:     libobjs=
  7041:     ltlibs=
  7042:     module=no
  7043:     no_install=no
  7044:     objs=
  7045:     os2dllname=
  7046:     non_pic_objects=
  7047:     precious_files_regex=
  7048:     prefer_static_libs=no
  7049:     preload=false
  7050:     prev=
  7051:     prevarg=
  7052:     release=
  7053:     rpath=
  7054:     xrpath=
  7055:     perm_rpath=
  7056:     temp_rpath=
  7057:     thread_safe=no
  7058:     vinfo=
  7059:     vinfo_number=no
  7060:     weak_libs=
  7061:     single_module=$wl-single_module
  7062:     func_infer_tag $base_compile
  7063: 
  7064:     # We need to know -static, to get the right output filenames.
  7065:     for arg
  7066:     do
  7067:       case $arg in
  7068:       -shared)
  7069: 	test yes != "$build_libtool_libs" \
  7070: 	  && func_fatal_configuration "cannot build a shared library"
  7071: 	build_old_libs=no
  7072: 	break
  7073: 	;;
  7074:       -all-static | -static | -static-libtool-libs)
  7075: 	case $arg in
  7076: 	-all-static)
  7077: 	  if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
  7078: 	    func_warning "complete static linking is impossible in this configuration"
  7079: 	  fi
  7080: 	  if test -n "$link_static_flag"; then
  7081: 	    dlopen_self=$dlopen_self_static
  7082: 	  fi
  7083: 	  prefer_static_libs=yes
  7084: 	  ;;
  7085: 	-static)
  7086: 	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
  7087: 	    dlopen_self=$dlopen_self_static
  7088: 	  fi
  7089: 	  prefer_static_libs=built
  7090: 	  ;;
  7091: 	-static-libtool-libs)
  7092: 	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
  7093: 	    dlopen_self=$dlopen_self_static
  7094: 	  fi
  7095: 	  prefer_static_libs=yes
  7096: 	  ;;
  7097: 	esac
  7098: 	build_libtool_libs=no
  7099: 	build_old_libs=yes
  7100: 	break
  7101: 	;;
  7102:       esac
  7103:     done
  7104: 
  7105:     # See if our shared archives depend on static archives.
  7106:     test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  7107: 
  7108:     # Go through the arguments, transforming them on the way.
  7109:     while test "$#" -gt 0; do
  7110:       arg=$1
  7111:       shift
  7112:       func_quote_for_eval "$arg"
  7113:       qarg=$func_quote_for_eval_unquoted_result
  7114:       func_append libtool_args " $func_quote_for_eval_result"
  7115: 
  7116:       # If the previous option needs an argument, assign it.
  7117:       if test -n "$prev"; then
  7118: 	case $prev in
  7119: 	output)
  7120: 	  func_append compile_command " @OUTPUT@"
  7121: 	  func_append finalize_command " @OUTPUT@"
  7122: 	  ;;
  7123: 	esac
  7124: 
  7125: 	case $prev in
  7126: 	bindir)
  7127: 	  bindir=$arg
  7128: 	  prev=
  7129: 	  continue
  7130: 	  ;;
  7131: 	dlfiles|dlprefiles)
  7132: 	  $preload || {
  7133: 	    # Add the symbol object into the linking commands.
  7134: 	    func_append compile_command " @SYMFILE@"
  7135: 	    func_append finalize_command " @SYMFILE@"
  7136: 	    preload=:
  7137: 	  }
  7138: 	  case $arg in
  7139: 	  *.la | *.lo) ;;  # We handle these cases below.
  7140: 	  force)
  7141: 	    if test no = "$dlself"; then
  7142: 	      dlself=needless
  7143: 	      export_dynamic=yes
  7144: 	    fi
  7145: 	    prev=
  7146: 	    continue
  7147: 	    ;;
  7148: 	  self)
  7149: 	    if test dlprefiles = "$prev"; then
  7150: 	      dlself=yes
  7151: 	    elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
  7152: 	      dlself=yes
  7153: 	    else
  7154: 	      dlself=needless
  7155: 	      export_dynamic=yes
  7156: 	    fi
  7157: 	    prev=
  7158: 	    continue
  7159: 	    ;;
  7160: 	  *)
  7161: 	    if test dlfiles = "$prev"; then
  7162: 	      func_append dlfiles " $arg"
  7163: 	    else
  7164: 	      func_append dlprefiles " $arg"
  7165: 	    fi
  7166: 	    prev=
  7167: 	    continue
  7168: 	    ;;
  7169: 	  esac
  7170: 	  ;;
  7171: 	expsyms)
  7172: 	  export_symbols=$arg
  7173: 	  test -f "$arg" \
  7174: 	    || func_fatal_error "symbol file '$arg' does not exist"
  7175: 	  prev=
  7176: 	  continue
  7177: 	  ;;
  7178: 	expsyms_regex)
  7179: 	  export_symbols_regex=$arg
  7180: 	  prev=
  7181: 	  continue
  7182: 	  ;;
  7183: 	framework)
  7184: 	  case $host in
  7185: 	    *-*-darwin*)
  7186: 	      case "$deplibs " in
  7187: 		*" $qarg.ltframework "*) ;;
  7188: 		*) func_append deplibs " $qarg.ltframework" # this is fixed later
  7189: 		   ;;
  7190: 	      esac
  7191: 	      ;;
  7192: 	  esac
  7193: 	  prev=
  7194: 	  continue
  7195: 	  ;;
  7196: 	inst_prefix)
  7197: 	  inst_prefix_dir=$arg
  7198: 	  prev=
  7199: 	  continue
  7200: 	  ;;
  7201: 	mllvm)
  7202: 	  # Clang does not use LLVM to link, so we can simply discard any
  7203: 	  # '-mllvm $arg' options when doing the link step.
  7204: 	  prev=
  7205: 	  continue
  7206: 	  ;;
  7207: 	objectlist)
  7208: 	  if test -f "$arg"; then
  7209: 	    save_arg=$arg
  7210: 	    moreargs=
  7211: 	    for fil in `cat "$save_arg"`
  7212: 	    do
  7213: #	      func_append moreargs " $fil"
  7214: 	      arg=$fil
  7215: 	      # A libtool-controlled object.
  7216: 
  7217: 	      # Check to see that this really is a libtool object.
  7218: 	      if func_lalib_unsafe_p "$arg"; then
  7219: 		pic_object=
  7220: 		non_pic_object=
  7221: 
  7222: 		# Read the .lo file
  7223: 		func_source "$arg"
  7224: 
  7225: 		if test -z "$pic_object" ||
  7226: 		   test -z "$non_pic_object" ||
  7227: 		   test none = "$pic_object" &&
  7228: 		   test none = "$non_pic_object"; then
  7229: 		  func_fatal_error "cannot find name of object for '$arg'"
  7230: 		fi
  7231: 
  7232: 		# Extract subdirectory from the argument.
  7233: 		func_dirname "$arg" "/" ""
  7234: 		xdir=$func_dirname_result
  7235: 
  7236: 		if test none != "$pic_object"; then
  7237: 		  # Prepend the subdirectory the object is found in.
  7238: 		  pic_object=$xdir$pic_object
  7239: 
  7240: 		  if test dlfiles = "$prev"; then
  7241: 		    if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
  7242: 		      func_append dlfiles " $pic_object"
  7243: 		      prev=
  7244: 		      continue
  7245: 		    else
  7246: 		      # If libtool objects are unsupported, then we need to preload.
  7247: 		      prev=dlprefiles
  7248: 		    fi
  7249: 		  fi
  7250: 
  7251: 		  # CHECK ME:  I think I busted this.  -Ossama
  7252: 		  if test dlprefiles = "$prev"; then
  7253: 		    # Preload the old-style object.
  7254: 		    func_append dlprefiles " $pic_object"
  7255: 		    prev=
  7256: 		  fi
  7257: 
  7258: 		  # A PIC object.
  7259: 		  func_append libobjs " $pic_object"
  7260: 		  arg=$pic_object
  7261: 		fi
  7262: 
  7263: 		# Non-PIC object.
  7264: 		if test none != "$non_pic_object"; then
  7265: 		  # Prepend the subdirectory the object is found in.
  7266: 		  non_pic_object=$xdir$non_pic_object
  7267: 
  7268: 		  # A standard non-PIC object
  7269: 		  func_append non_pic_objects " $non_pic_object"
  7270: 		  if test -z "$pic_object" || test none = "$pic_object"; then
  7271: 		    arg=$non_pic_object
  7272: 		  fi
  7273: 		else
  7274: 		  # If the PIC object exists, use it instead.
  7275: 		  # $xdir was prepended to $pic_object above.
  7276: 		  non_pic_object=$pic_object
  7277: 		  func_append non_pic_objects " $non_pic_object"
  7278: 		fi
  7279: 	      else
  7280: 		# Only an error if not doing a dry-run.
  7281: 		if $opt_dry_run; then
  7282: 		  # Extract subdirectory from the argument.
  7283: 		  func_dirname "$arg" "/" ""
  7284: 		  xdir=$func_dirname_result
  7285: 
  7286: 		  func_lo2o "$arg"
  7287: 		  pic_object=$xdir$objdir/$func_lo2o_result
  7288: 		  non_pic_object=$xdir$func_lo2o_result
  7289: 		  func_append libobjs " $pic_object"
  7290: 		  func_append non_pic_objects " $non_pic_object"
  7291: 	        else
  7292: 		  func_fatal_error "'$arg' is not a valid libtool object"
  7293: 		fi
  7294: 	      fi
  7295: 	    done
  7296: 	  else
  7297: 	    func_fatal_error "link input file '$arg' does not exist"
  7298: 	  fi
  7299: 	  arg=$save_arg
  7300: 	  prev=
  7301: 	  continue
  7302: 	  ;;
  7303: 	os2dllname)
  7304: 	  os2dllname=$arg
  7305: 	  prev=
  7306: 	  continue
  7307: 	  ;;
  7308: 	precious_regex)
  7309: 	  precious_files_regex=$arg
  7310: 	  prev=
  7311: 	  continue
  7312: 	  ;;
  7313: 	release)
  7314: 	  release=-$arg
  7315: 	  prev=
  7316: 	  continue
  7317: 	  ;;
  7318: 	rpath | xrpath)
  7319: 	  # We need an absolute path.
  7320: 	  case $arg in
  7321: 	  [\\/]* | [A-Za-z]:[\\/]*) ;;
  7322: 	  *)
  7323: 	    func_fatal_error "only absolute run-paths are allowed"
  7324: 	    ;;
  7325: 	  esac
  7326: 	  if test rpath = "$prev"; then
  7327: 	    case "$rpath " in
  7328: 	    *" $arg "*) ;;
  7329: 	    *) func_append rpath " $arg" ;;
  7330: 	    esac
  7331: 	  else
  7332: 	    case "$xrpath " in
  7333: 	    *" $arg "*) ;;
  7334: 	    *) func_append xrpath " $arg" ;;
  7335: 	    esac
  7336: 	  fi
  7337: 	  prev=
  7338: 	  continue
  7339: 	  ;;
  7340: 	shrext)
  7341: 	  shrext_cmds=$arg
  7342: 	  prev=
  7343: 	  continue
  7344: 	  ;;
  7345: 	weak)
  7346: 	  func_append weak_libs " $arg"
  7347: 	  prev=
  7348: 	  continue
  7349: 	  ;;
  7350: 	xcclinker)
  7351: 	  func_append linker_flags " $qarg"
  7352: 	  func_append compiler_flags " $qarg"
  7353: 	  prev=
  7354: 	  func_append compile_command " $qarg"
  7355: 	  func_append finalize_command " $qarg"
  7356: 	  continue
  7357: 	  ;;
  7358: 	xcompiler)
  7359: 	  func_append compiler_flags " $qarg"
  7360: 	  prev=
  7361: 	  func_append compile_command " $qarg"
  7362: 	  func_append finalize_command " $qarg"
  7363: 	  continue
  7364: 	  ;;
  7365: 	xlinker)
  7366: 	  func_append linker_flags " $qarg"
  7367: 	  func_append compiler_flags " $wl$qarg"
  7368: 	  prev=
  7369: 	  func_append compile_command " $wl$qarg"
  7370: 	  func_append finalize_command " $wl$qarg"
  7371: 	  continue
  7372: 	  ;;
  7373: 	*)
  7374: 	  eval "$prev=\"\$arg\""
  7375: 	  prev=
  7376: 	  continue
  7377: 	  ;;
  7378: 	esac
  7379:       fi # test -n "$prev"
  7380: 
  7381:       prevarg=$arg
  7382: 
  7383:       case $arg in
  7384:       -all-static)
  7385: 	if test -n "$link_static_flag"; then
  7386: 	  # See comment for -static flag below, for more details.
  7387: 	  func_append compile_command " $link_static_flag"
  7388: 	  func_append finalize_command " $link_static_flag"
  7389: 	fi
  7390: 	continue
  7391: 	;;
  7392: 
  7393:       -allow-undefined)
  7394: 	# FIXME: remove this flag sometime in the future.
  7395: 	func_fatal_error "'-allow-undefined' must not be used because it is the default"
  7396: 	;;
  7397: 
  7398:       -avoid-version)
  7399: 	avoid_version=yes
  7400: 	continue
  7401: 	;;
  7402: 
  7403:       -bindir)
  7404: 	prev=bindir
  7405: 	continue
  7406: 	;;
  7407: 
  7408:       -dlopen)
  7409: 	prev=dlfiles
  7410: 	continue
  7411: 	;;
  7412: 
  7413:       -dlpreopen)
  7414: 	prev=dlprefiles
  7415: 	continue
  7416: 	;;
  7417: 
  7418:       -export-dynamic)
  7419: 	export_dynamic=yes
  7420: 	continue
  7421: 	;;
  7422: 
  7423:       -export-symbols | -export-symbols-regex)
  7424: 	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  7425: 	  func_fatal_error "more than one -exported-symbols argument is not allowed"
  7426: 	fi
  7427: 	if test X-export-symbols = "X$arg"; then
  7428: 	  prev=expsyms
  7429: 	else
  7430: 	  prev=expsyms_regex
  7431: 	fi
  7432: 	continue
  7433: 	;;
  7434: 
  7435:       -framework)
  7436: 	prev=framework
  7437: 	continue
  7438: 	;;
  7439: 
  7440:       -inst-prefix-dir)
  7441: 	prev=inst_prefix
  7442: 	continue
  7443: 	;;
  7444: 
  7445:       # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
  7446:       # so, if we see these flags be careful not to treat them like -L
  7447:       -L[A-Z][A-Z]*:*)
  7448: 	case $with_gcc/$host in
  7449: 	no/*-*-irix* | /*-*-irix*)
  7450: 	  func_append compile_command " $arg"
  7451: 	  func_append finalize_command " $arg"
  7452: 	  ;;
  7453: 	esac
  7454: 	continue
  7455: 	;;
  7456: 
  7457:       -L*)
  7458: 	func_stripname "-L" '' "$arg"
  7459: 	if test -z "$func_stripname_result"; then
  7460: 	  if test "$#" -gt 0; then
  7461: 	    func_fatal_error "require no space between '-L' and '$1'"
  7462: 	  else
  7463: 	    func_fatal_error "need path for '-L' option"
  7464: 	  fi
  7465: 	fi
  7466: 	func_resolve_sysroot "$func_stripname_result"
  7467: 	dir=$func_resolve_sysroot_result
  7468: 	# We need an absolute path.
  7469: 	case $dir in
  7470: 	[\\/]* | [A-Za-z]:[\\/]*) ;;
  7471: 	*)
  7472: 	  absdir=`cd "$dir" && pwd`
  7473: 	  test -z "$absdir" && \
  7474: 	    func_fatal_error "cannot determine absolute directory name of '$dir'"
  7475: 	  dir=$absdir
  7476: 	  ;;
  7477: 	esac
  7478: 	case "$deplibs " in
  7479: 	*" -L$dir "* | *" $arg "*)
  7480: 	  # Will only happen for absolute or sysroot arguments
  7481: 	  ;;
  7482: 	*)
  7483: 	  # Preserve sysroot, but never include relative directories
  7484: 	  case $dir in
  7485: 	    [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
  7486: 	    *) func_append deplibs " -L$dir" ;;
  7487: 	  esac
  7488: 	  func_append lib_search_path " $dir"
  7489: 	  ;;
  7490: 	esac
  7491: 	case $host in
  7492: 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  7493: 	  testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
  7494: 	  case :$dllsearchpath: in
  7495: 	  *":$dir:"*) ;;
  7496: 	  ::) dllsearchpath=$dir;;
  7497: 	  *) func_append dllsearchpath ":$dir";;
  7498: 	  esac
  7499: 	  case :$dllsearchpath: in
  7500: 	  *":$testbindir:"*) ;;
  7501: 	  ::) dllsearchpath=$testbindir;;
  7502: 	  *) func_append dllsearchpath ":$testbindir";;
  7503: 	  esac
  7504: 	  ;;
  7505: 	esac
  7506: 	continue
  7507: 	;;
  7508: 
  7509:       -l*)
  7510: 	if test X-lc = "X$arg" || test X-lm = "X$arg"; then
  7511: 	  case $host in
  7512: 	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
  7513: 	    # These systems don't actually have a C or math library (as such)
  7514: 	    continue
  7515: 	    ;;
  7516: 	  *-*-os2*)
  7517: 	    # These systems don't actually have a C library (as such)
  7518: 	    test X-lc = "X$arg" && continue
  7519: 	    ;;
  7520: 	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
  7521: 	    # Do not include libc due to us having libc/libc_r.
  7522: 	    test X-lc = "X$arg" && continue
  7523: 	    ;;
  7524: 	  *-*-rhapsody* | *-*-darwin1.[012])
  7525: 	    # Rhapsody C and math libraries are in the System framework
  7526: 	    func_append deplibs " System.ltframework"
  7527: 	    continue
  7528: 	    ;;
  7529: 	  *-*-sco3.2v5* | *-*-sco5v6*)
  7530: 	    # Causes problems with __ctype
  7531: 	    test X-lc = "X$arg" && continue
  7532: 	    ;;
  7533: 	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  7534: 	    # Compiler inserts libc in the correct place for threads to work
  7535: 	    test X-lc = "X$arg" && continue
  7536: 	    ;;
  7537: 	  esac
  7538: 	elif test X-lc_r = "X$arg"; then
  7539: 	 case $host in
  7540: 	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
  7541: 	   # Do not include libc_r directly, use -pthread flag.
  7542: 	   continue
  7543: 	   ;;
  7544: 	 esac
  7545: 	fi
  7546: 	func_append deplibs " $arg"
  7547: 	continue
  7548: 	;;
  7549: 
  7550:       -mllvm)
  7551: 	prev=mllvm
  7552: 	continue
  7553: 	;;
  7554: 
  7555:       -module)
  7556: 	module=yes
  7557: 	continue
  7558: 	;;
  7559: 
  7560:       # Tru64 UNIX uses -model [arg] to determine the layout of C++
  7561:       # classes, name mangling, and exception handling.
  7562:       # Darwin uses the -arch flag to determine output architecture.
  7563:       -model|-arch|-isysroot|--sysroot)
  7564: 	func_append compiler_flags " $arg"
  7565: 	func_append compile_command " $arg"
  7566: 	func_append finalize_command " $arg"
  7567: 	prev=xcompiler
  7568: 	continue
  7569: 	;;
  7570: 
  7571:       -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
  7572:       |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
  7573: 	func_append compiler_flags " $arg"
  7574: 	func_append compile_command " $arg"
  7575: 	func_append finalize_command " $arg"
  7576: 	case "$new_inherited_linker_flags " in
  7577: 	    *" $arg "*) ;;
  7578: 	    * ) func_append new_inherited_linker_flags " $arg" ;;
  7579: 	esac
  7580: 	continue
  7581: 	;;
  7582: 
  7583:       -multi_module)
  7584: 	single_module=$wl-multi_module
  7585: 	continue
  7586: 	;;
  7587: 
  7588:       -no-fast-install)
  7589: 	fast_install=no
  7590: 	continue
  7591: 	;;
  7592: 
  7593:       -no-install)
  7594: 	case $host in
  7595: 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
  7596: 	  # The PATH hackery in wrapper scripts is required on Windows
  7597: 	  # and Darwin in order for the loader to find any dlls it needs.
  7598: 	  func_warning "'-no-install' is ignored for $host"
  7599: 	  func_warning "assuming '-no-fast-install' instead"
  7600: 	  fast_install=no
  7601: 	  ;;
  7602: 	*) no_install=yes ;;
  7603: 	esac
  7604: 	continue
  7605: 	;;
  7606: 
  7607:       -no-undefined)
  7608: 	allow_undefined=no
  7609: 	continue
  7610: 	;;
  7611: 
  7612:       -objectlist)
  7613: 	prev=objectlist
  7614: 	continue
  7615: 	;;
  7616: 
  7617:       -os2dllname)
  7618: 	prev=os2dllname
  7619: 	continue
  7620: 	;;
  7621: 
  7622:       -o) prev=output ;;
  7623: 
  7624:       -precious-files-regex)
  7625: 	prev=precious_regex
  7626: 	continue
  7627: 	;;
  7628: 
  7629:       -release)
  7630: 	prev=release
  7631: 	continue
  7632: 	;;
  7633: 
  7634:       -rpath)
  7635: 	prev=rpath
  7636: 	continue
  7637: 	;;
  7638: 
  7639:       -R)
  7640: 	prev=xrpath
  7641: 	continue
  7642: 	;;
  7643: 
  7644:       -R*)
  7645: 	func_stripname '-R' '' "$arg"
  7646: 	dir=$func_stripname_result
  7647: 	# We need an absolute path.
  7648: 	case $dir in
  7649: 	[\\/]* | [A-Za-z]:[\\/]*) ;;
  7650: 	=*)
  7651: 	  func_stripname '=' '' "$dir"
  7652: 	  dir=$lt_sysroot$func_stripname_result
  7653: 	  ;;
  7654: 	*)
  7655: 	  func_fatal_error "only absolute run-paths are allowed"
  7656: 	  ;;
  7657: 	esac
  7658: 	case "$xrpath " in
  7659: 	*" $dir "*) ;;
  7660: 	*) func_append xrpath " $dir" ;;
  7661: 	esac
  7662: 	continue
  7663: 	;;
  7664: 
  7665:       -shared)
  7666: 	# The effects of -shared are defined in a previous loop.
  7667: 	continue
  7668: 	;;
  7669: 
  7670:       -shrext)
  7671: 	prev=shrext
  7672: 	continue
  7673: 	;;
  7674: 
  7675:       -static | -static-libtool-libs)
  7676: 	# The effects of -static are defined in a previous loop.
  7677: 	# We used to do the same as -all-static on platforms that
  7678: 	# didn't have a PIC flag, but the assumption that the effects
  7679: 	# would be equivalent was wrong.  It would break on at least
  7680: 	# Digital Unix and AIX.
  7681: 	continue
  7682: 	;;
  7683: 
  7684:       -thread-safe)
  7685: 	thread_safe=yes
  7686: 	continue
  7687: 	;;
  7688: 
  7689:       -version-info)
  7690: 	prev=vinfo
  7691: 	continue
  7692: 	;;
  7693: 
  7694:       -version-number)
  7695: 	prev=vinfo
  7696: 	vinfo_number=yes
  7697: 	continue
  7698: 	;;
  7699: 
  7700:       -weak)
  7701:         prev=weak
  7702: 	continue
  7703: 	;;
  7704: 
  7705:       -Wc,*)
  7706: 	func_stripname '-Wc,' '' "$arg"
  7707: 	args=$func_stripname_result
  7708: 	arg=
  7709: 	save_ifs=$IFS; IFS=,
  7710: 	for flag in $args; do
  7711: 	  IFS=$save_ifs
  7712:           func_quote_for_eval "$flag"
  7713: 	  func_append arg " $func_quote_for_eval_result"
  7714: 	  func_append compiler_flags " $func_quote_for_eval_result"
  7715: 	done
  7716: 	IFS=$save_ifs
  7717: 	func_stripname ' ' '' "$arg"
  7718: 	arg=$func_stripname_result
  7719: 	;;
  7720: 
  7721:       -Wl,*)
  7722: 	func_stripname '-Wl,' '' "$arg"
  7723: 	args=$func_stripname_result
  7724: 	arg=
  7725: 	save_ifs=$IFS; IFS=,
  7726: 	for flag in $args; do
  7727: 	  IFS=$save_ifs
  7728:           func_quote_for_eval "$flag"
  7729: 	  func_append arg " $wl$func_quote_for_eval_result"
  7730: 	  func_append compiler_flags " $wl$func_quote_for_eval_result"
  7731: 	  func_append linker_flags " $func_quote_for_eval_result"
  7732: 	done
  7733: 	IFS=$save_ifs
  7734: 	func_stripname ' ' '' "$arg"
  7735: 	arg=$func_stripname_result
  7736: 	;;
  7737: 
  7738:       -Xcompiler)
  7739: 	prev=xcompiler
  7740: 	continue
  7741: 	;;
  7742: 
  7743:       -Xlinker)
  7744: 	prev=xlinker
  7745: 	continue
  7746: 	;;
  7747: 
  7748:       -XCClinker)
  7749: 	prev=xcclinker
  7750: 	continue
  7751: 	;;
  7752: 
  7753:       # -msg_* for osf cc
  7754:       -msg_*)
  7755: 	func_quote_for_eval "$arg"
  7756: 	arg=$func_quote_for_eval_result
  7757: 	;;
  7758: 
  7759:       # Flags to be passed through unchanged, with rationale:
  7760:       # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
  7761:       # -r[0-9][0-9]*        specify processor for the SGI compiler
  7762:       # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
  7763:       # +DA*, +DD*           enable 64-bit mode for the HP compiler
  7764:       # -q*                  compiler args for the IBM compiler
  7765:       # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
  7766:       # -F/path              path to uninstalled frameworks, gcc on darwin
  7767:       # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
  7768:       # -fstack-protector*   stack protector flags for GCC
  7769:       # @file                GCC response files
  7770:       # -tp=*                Portland pgcc target processor selection
  7771:       # --sysroot=*          for sysroot support
  7772:       # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
  7773:       # -stdlib=*            select c++ std lib with clang
  7774:       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
  7775:       -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
  7776:       -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
  7777:         func_quote_for_eval "$arg"
  7778: 	arg=$func_quote_for_eval_result
  7779:         func_append compile_command " $arg"
  7780:         func_append finalize_command " $arg"
  7781:         func_append compiler_flags " $arg"
  7782:         continue
  7783:         ;;
  7784: 
  7785:       -Z*)
  7786:         if test os2 = "`expr $host : '.*\(os2\)'`"; then
  7787:           # OS/2 uses -Zxxx to specify OS/2-specific options
  7788: 	  compiler_flags="$compiler_flags $arg"
  7789: 	  func_append compile_command " $arg"
  7790: 	  func_append finalize_command " $arg"
  7791: 	  case $arg in
  7792: 	  -Zlinker | -Zstack)
  7793: 	    prev=xcompiler
  7794: 	    ;;
  7795: 	  esac
  7796: 	  continue
  7797:         else
  7798: 	  # Otherwise treat like 'Some other compiler flag' below
  7799: 	  func_quote_for_eval "$arg"
  7800: 	  arg=$func_quote_for_eval_result
  7801:         fi
  7802: 	;;
  7803: 
  7804:       # Some other compiler flag.
  7805:       -* | +*)
  7806:         func_quote_for_eval "$arg"
  7807: 	arg=$func_quote_for_eval_result
  7808: 	;;
  7809: 
  7810:       *.$objext)
  7811: 	# A standard object.
  7812: 	func_append objs " $arg"
  7813: 	;;
  7814: 
  7815:       *.lo)
  7816: 	# A libtool-controlled object.
  7817: 
  7818: 	# Check to see that this really is a libtool object.
  7819: 	if func_lalib_unsafe_p "$arg"; then
  7820: 	  pic_object=
  7821: 	  non_pic_object=
  7822: 
  7823: 	  # Read the .lo file
  7824: 	  func_source "$arg"
  7825: 
  7826: 	  if test -z "$pic_object" ||
  7827: 	     test -z "$non_pic_object" ||
  7828: 	     test none = "$pic_object" &&
  7829: 	     test none = "$non_pic_object"; then
  7830: 	    func_fatal_error "cannot find name of object for '$arg'"
  7831: 	  fi
  7832: 
  7833: 	  # Extract subdirectory from the argument.
  7834: 	  func_dirname "$arg" "/" ""
  7835: 	  xdir=$func_dirname_result
  7836: 
  7837: 	  test none = "$pic_object" || {
  7838: 	    # Prepend the subdirectory the object is found in.
  7839: 	    pic_object=$xdir$pic_object
  7840: 
  7841: 	    if test dlfiles = "$prev"; then
  7842: 	      if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
  7843: 		func_append dlfiles " $pic_object"
  7844: 		prev=
  7845: 		continue
  7846: 	      else
  7847: 		# If libtool objects are unsupported, then we need to preload.
  7848: 		prev=dlprefiles
  7849: 	      fi
  7850: 	    fi
  7851: 
  7852: 	    # CHECK ME:  I think I busted this.  -Ossama
  7853: 	    if test dlprefiles = "$prev"; then
  7854: 	      # Preload the old-style object.
  7855: 	      func_append dlprefiles " $pic_object"
  7856: 	      prev=
  7857: 	    fi
  7858: 
  7859: 	    # A PIC object.
  7860: 	    func_append libobjs " $pic_object"
  7861: 	    arg=$pic_object
  7862: 	  }
  7863: 
  7864: 	  # Non-PIC object.
  7865: 	  if test none != "$non_pic_object"; then
  7866: 	    # Prepend the subdirectory the object is found in.
  7867: 	    non_pic_object=$xdir$non_pic_object
  7868: 
  7869: 	    # A standard non-PIC object
  7870: 	    func_append non_pic_objects " $non_pic_object"
  7871: 	    if test -z "$pic_object" || test none = "$pic_object"; then
  7872: 	      arg=$non_pic_object
  7873: 	    fi
  7874: 	  else
  7875: 	    # If the PIC object exists, use it instead.
  7876: 	    # $xdir was prepended to $pic_object above.
  7877: 	    non_pic_object=$pic_object
  7878: 	    func_append non_pic_objects " $non_pic_object"
  7879: 	  fi
  7880: 	else
  7881: 	  # Only an error if not doing a dry-run.
  7882: 	  if $opt_dry_run; then
  7883: 	    # Extract subdirectory from the argument.
  7884: 	    func_dirname "$arg" "/" ""
  7885: 	    xdir=$func_dirname_result
  7886: 
  7887: 	    func_lo2o "$arg"
  7888: 	    pic_object=$xdir$objdir/$func_lo2o_result
  7889: 	    non_pic_object=$xdir$func_lo2o_result
  7890: 	    func_append libobjs " $pic_object"
  7891: 	    func_append non_pic_objects " $non_pic_object"
  7892: 	  else
  7893: 	    func_fatal_error "'$arg' is not a valid libtool object"
  7894: 	  fi
  7895: 	fi
  7896: 	;;
  7897: 
  7898:       *.$libext)
  7899: 	# An archive.
  7900: 	func_append deplibs " $arg"
  7901: 	func_append old_deplibs " $arg"
  7902: 	continue
  7903: 	;;
  7904: 
  7905:       *.la)
  7906: 	# A libtool-controlled library.
  7907: 
  7908: 	func_resolve_sysroot "$arg"
  7909: 	if test dlfiles = "$prev"; then
  7910: 	  # This library was specified with -dlopen.
  7911: 	  func_append dlfiles " $func_resolve_sysroot_result"
  7912: 	  prev=
  7913: 	elif test dlprefiles = "$prev"; then
  7914: 	  # The library was specified with -dlpreopen.
  7915: 	  func_append dlprefiles " $func_resolve_sysroot_result"
  7916: 	  prev=
  7917: 	else
  7918: 	  func_append deplibs " $func_resolve_sysroot_result"
  7919: 	fi
  7920: 	continue
  7921: 	;;
  7922: 
  7923:       # Some other compiler argument.
  7924:       *)
  7925: 	# Unknown arguments in both finalize_command and compile_command need
  7926: 	# to be aesthetically quoted because they are evaled later.
  7927: 	func_quote_for_eval "$arg"
  7928: 	arg=$func_quote_for_eval_result
  7929: 	;;
  7930:       esac # arg
  7931: 
  7932:       # Now actually substitute the argument into the commands.
  7933:       if test -n "$arg"; then
  7934: 	func_append compile_command " $arg"
  7935: 	func_append finalize_command " $arg"
  7936:       fi
  7937:     done # argument parsing loop
  7938: 
  7939:     test -n "$prev" && \
  7940:       func_fatal_help "the '$prevarg' option requires an argument"
  7941: 
  7942:     if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
  7943:       eval arg=\"$export_dynamic_flag_spec\"
  7944:       func_append compile_command " $arg"
  7945:       func_append finalize_command " $arg"
  7946:     fi
  7947: 
  7948:     oldlibs=
  7949:     # calculate the name of the file, without its directory
  7950:     func_basename "$output"
  7951:     outputname=$func_basename_result
  7952:     libobjs_save=$libobjs
  7953: 
  7954:     if test -n "$shlibpath_var"; then
  7955:       # get the directories listed in $shlibpath_var
  7956:       eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
  7957:     else
  7958:       shlib_search_path=
  7959:     fi
  7960:     eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
  7961:     eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  7962: 
  7963:     # Definition is injected by LT_CONFIG during libtool generation.
  7964:     func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
  7965: 
  7966:     func_dirname "$output" "/" ""
  7967:     output_objdir=$func_dirname_result$objdir
  7968:     func_to_tool_file "$output_objdir/"
  7969:     tool_output_objdir=$func_to_tool_file_result
  7970:     # Create the object directory.
  7971:     func_mkdir_p "$output_objdir"
  7972: 
  7973:     # Determine the type of output
  7974:     case $output in
  7975:     "")
  7976:       func_fatal_help "you must specify an output file"
  7977:       ;;
  7978:     *.$libext) linkmode=oldlib ;;
  7979:     *.lo | *.$objext) linkmode=obj ;;
  7980:     *.la) linkmode=lib ;;
  7981:     *) linkmode=prog ;; # Anything else should be a program.
  7982:     esac
  7983: 
  7984:     specialdeplibs=
  7985: 
  7986:     libs=
  7987:     # Find all interdependent deplibs by searching for libraries
  7988:     # that are linked more than once (e.g. -la -lb -la)
  7989:     for deplib in $deplibs; do
  7990:       if $opt_preserve_dup_deps; then
  7991: 	case "$libs " in
  7992: 	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
  7993: 	esac
  7994:       fi
  7995:       func_append libs " $deplib"
  7996:     done
  7997: 
  7998:     if test lib = "$linkmode"; then
  7999:       libs="$predeps $libs $compiler_lib_search_path $postdeps"
  8000: 
  8001:       # Compute libraries that are listed more than once in $predeps
  8002:       # $postdeps and mark them as special (i.e., whose duplicates are
  8003:       # not to be eliminated).
  8004:       pre_post_deps=
  8005:       if $opt_duplicate_compiler_generated_deps; then
  8006: 	for pre_post_dep in $predeps $postdeps; do
  8007: 	  case "$pre_post_deps " in
  8008: 	  *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
  8009: 	  esac
  8010: 	  func_append pre_post_deps " $pre_post_dep"
  8011: 	done
  8012:       fi
  8013:       pre_post_deps=
  8014:     fi
  8015: 
  8016:     deplibs=
  8017:     newdependency_libs=
  8018:     newlib_search_path=
  8019:     need_relink=no # whether we're linking any uninstalled libtool libraries
  8020:     notinst_deplibs= # not-installed libtool libraries
  8021:     notinst_path= # paths that contain not-installed libtool libraries
  8022: 
  8023:     case $linkmode in
  8024:     lib)
  8025: 	passes="conv dlpreopen link"
  8026: 	for file in $dlfiles $dlprefiles; do
  8027: 	  case $file in
  8028: 	  *.la) ;;
  8029: 	  *)
  8030: 	    func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
  8031: 	    ;;
  8032: 	  esac
  8033: 	done
  8034: 	;;
  8035:     prog)
  8036: 	compile_deplibs=
  8037: 	finalize_deplibs=
  8038: 	alldeplibs=false
  8039: 	newdlfiles=
  8040: 	newdlprefiles=
  8041: 	passes="conv scan dlopen dlpreopen link"
  8042: 	;;
  8043:     *)  passes="conv"
  8044: 	;;
  8045:     esac
  8046: 
  8047:     for pass in $passes; do
  8048:       # The preopen pass in lib mode reverses $deplibs; put it back here
  8049:       # so that -L comes before libs that need it for instance...
  8050:       if test lib,link = "$linkmode,$pass"; then
  8051: 	## FIXME: Find the place where the list is rebuilt in the wrong
  8052: 	##        order, and fix it there properly
  8053:         tmp_deplibs=
  8054: 	for deplib in $deplibs; do
  8055: 	  tmp_deplibs="$deplib $tmp_deplibs"
  8056: 	done
  8057: 	deplibs=$tmp_deplibs
  8058:       fi
  8059: 
  8060:       if test lib,link = "$linkmode,$pass" ||
  8061: 	 test prog,scan = "$linkmode,$pass"; then
  8062: 	libs=$deplibs
  8063: 	deplibs=
  8064:       fi
  8065:       if test prog = "$linkmode"; then
  8066: 	case $pass in
  8067: 	dlopen) libs=$dlfiles ;;
  8068: 	dlpreopen) libs=$dlprefiles ;;
  8069: 	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
  8070: 	esac
  8071:       fi
  8072:       if test lib,dlpreopen = "$linkmode,$pass"; then
  8073: 	# Collect and forward deplibs of preopened libtool libs
  8074: 	for lib in $dlprefiles; do
  8075: 	  # Ignore non-libtool-libs
  8076: 	  dependency_libs=
  8077: 	  func_resolve_sysroot "$lib"
  8078: 	  case $lib in
  8079: 	  *.la)	func_source "$func_resolve_sysroot_result" ;;
  8080: 	  esac
  8081: 
  8082: 	  # Collect preopened libtool deplibs, except any this library
  8083: 	  # has declared as weak libs
  8084: 	  for deplib in $dependency_libs; do
  8085: 	    func_basename "$deplib"
  8086:             deplib_base=$func_basename_result
  8087: 	    case " $weak_libs " in
  8088: 	    *" $deplib_base "*) ;;
  8089: 	    *) func_append deplibs " $deplib" ;;
  8090: 	    esac
  8091: 	  done
  8092: 	done
  8093: 	libs=$dlprefiles
  8094:       fi
  8095:       if test dlopen = "$pass"; then
  8096: 	# Collect dlpreopened libraries
  8097: 	save_deplibs=$deplibs
  8098: 	deplibs=
  8099:       fi
  8100: 
  8101:       for deplib in $libs; do
  8102: 	lib=
  8103: 	found=false
  8104: 	case $deplib in
  8105: 	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
  8106:         |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
  8107: 	  if test prog,link = "$linkmode,$pass"; then
  8108: 	    compile_deplibs="$deplib $compile_deplibs"
  8109: 	    finalize_deplibs="$deplib $finalize_deplibs"
  8110: 	  else
  8111: 	    func_append compiler_flags " $deplib"
  8112: 	    if test lib = "$linkmode"; then
  8113: 		case "$new_inherited_linker_flags " in
  8114: 		    *" $deplib "*) ;;
  8115: 		    * ) func_append new_inherited_linker_flags " $deplib" ;;
  8116: 		esac
  8117: 	    fi
  8118: 	  fi
  8119: 	  continue
  8120: 	  ;;
  8121: 	-l*)
  8122: 	  if test lib != "$linkmode" && test prog != "$linkmode"; then
  8123: 	    func_warning "'-l' is ignored for archives/objects"
  8124: 	    continue
  8125: 	  fi
  8126: 	  func_stripname '-l' '' "$deplib"
  8127: 	  name=$func_stripname_result
  8128: 	  if test lib = "$linkmode"; then
  8129: 	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
  8130: 	  else
  8131: 	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
  8132: 	  fi
  8133: 	  for searchdir in $searchdirs; do
  8134: 	    for search_ext in .la $std_shrext .so .a; do
  8135: 	      # Search the libtool library
  8136: 	      lib=$searchdir/lib$name$search_ext
  8137: 	      if test -f "$lib"; then
  8138: 		if test .la = "$search_ext"; then
  8139: 		  found=:
  8140: 		else
  8141: 		  found=false
  8142: 		fi
  8143: 		break 2
  8144: 	      fi
  8145: 	    done
  8146: 	  done
  8147: 	  if $found; then
  8148: 	    # deplib is a libtool library
  8149: 	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
  8150: 	    # We need to do some special things here, and not later.
  8151: 	    if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  8152: 	      case " $predeps $postdeps " in
  8153: 	      *" $deplib "*)
  8154: 		if func_lalib_p "$lib"; then
  8155: 		  library_names=
  8156: 		  old_library=
  8157: 		  func_source "$lib"
  8158: 		  for l in $old_library $library_names; do
  8159: 		    ll=$l
  8160: 		  done
  8161: 		  if test "X$ll" = "X$old_library"; then # only static version available
  8162: 		    found=false
  8163: 		    func_dirname "$lib" "" "."
  8164: 		    ladir=$func_dirname_result
  8165: 		    lib=$ladir/$old_library
  8166: 		    if test prog,link = "$linkmode,$pass"; then
  8167: 		      compile_deplibs="$deplib $compile_deplibs"
  8168: 		      finalize_deplibs="$deplib $finalize_deplibs"
  8169: 		    else
  8170: 		      deplibs="$deplib $deplibs"
  8171: 		      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
  8172: 		    fi
  8173: 		    continue
  8174: 		  fi
  8175: 		fi
  8176: 		;;
  8177: 	      *) ;;
  8178: 	      esac
  8179: 	    fi
  8180: 	  else
  8181: 	    # deplib doesn't seem to be a libtool library
  8182: 	    if test prog,link = "$linkmode,$pass"; then
  8183: 	      compile_deplibs="$deplib $compile_deplibs"
  8184: 	      finalize_deplibs="$deplib $finalize_deplibs"
  8185: 	    else
  8186: 	      deplibs="$deplib $deplibs"
  8187: 	      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
  8188: 	    fi
  8189: 	    continue
  8190: 	  fi
  8191: 	  ;; # -l
  8192: 	*.ltframework)
  8193: 	  if test prog,link = "$linkmode,$pass"; then
  8194: 	    compile_deplibs="$deplib $compile_deplibs"
  8195: 	    finalize_deplibs="$deplib $finalize_deplibs"
  8196: 	  else
  8197: 	    deplibs="$deplib $deplibs"
  8198: 	    if test lib = "$linkmode"; then
  8199: 		case "$new_inherited_linker_flags " in
  8200: 		    *" $deplib "*) ;;
  8201: 		    * ) func_append new_inherited_linker_flags " $deplib" ;;
  8202: 		esac
  8203: 	    fi
  8204: 	  fi
  8205: 	  continue
  8206: 	  ;;
  8207: 	-L*)
  8208: 	  case $linkmode in
  8209: 	  lib)
  8210: 	    deplibs="$deplib $deplibs"
  8211: 	    test conv = "$pass" && continue
  8212: 	    newdependency_libs="$deplib $newdependency_libs"
  8213: 	    func_stripname '-L' '' "$deplib"
  8214: 	    func_resolve_sysroot "$func_stripname_result"
  8215: 	    func_append newlib_search_path " $func_resolve_sysroot_result"
  8216: 	    ;;
  8217: 	  prog)
  8218: 	    if test conv = "$pass"; then
  8219: 	      deplibs="$deplib $deplibs"
  8220: 	      continue
  8221: 	    fi
  8222: 	    if test scan = "$pass"; then
  8223: 	      deplibs="$deplib $deplibs"
  8224: 	    else
  8225: 	      compile_deplibs="$deplib $compile_deplibs"
  8226: 	      finalize_deplibs="$deplib $finalize_deplibs"
  8227: 	    fi
  8228: 	    func_stripname '-L' '' "$deplib"
  8229: 	    func_resolve_sysroot "$func_stripname_result"
  8230: 	    func_append newlib_search_path " $func_resolve_sysroot_result"
  8231: 	    ;;
  8232: 	  *)
  8233: 	    func_warning "'-L' is ignored for archives/objects"
  8234: 	    ;;
  8235: 	  esac # linkmode
  8236: 	  continue
  8237: 	  ;; # -L
  8238: 	-R*)
  8239: 	  if test link = "$pass"; then
  8240: 	    func_stripname '-R' '' "$deplib"
  8241: 	    func_resolve_sysroot "$func_stripname_result"
  8242: 	    dir=$func_resolve_sysroot_result
  8243: 	    # Make sure the xrpath contains only unique directories.
  8244: 	    case "$xrpath " in
  8245: 	    *" $dir "*) ;;
  8246: 	    *) func_append xrpath " $dir" ;;
  8247: 	    esac
  8248: 	  fi
  8249: 	  deplibs="$deplib $deplibs"
  8250: 	  continue
  8251: 	  ;;
  8252: 	*.la)
  8253: 	  func_resolve_sysroot "$deplib"
  8254: 	  lib=$func_resolve_sysroot_result
  8255: 	  ;;
  8256: 	*.$libext)
  8257: 	  if test conv = "$pass"; then
  8258: 	    deplibs="$deplib $deplibs"
  8259: 	    continue
  8260: 	  fi
  8261: 	  case $linkmode in
  8262: 	  lib)
  8263: 	    # Linking convenience modules into shared libraries is allowed,
  8264: 	    # but linking other static libraries is non-portable.
  8265: 	    case " $dlpreconveniencelibs " in
  8266: 	    *" $deplib "*) ;;
  8267: 	    *)
  8268: 	      valid_a_lib=false
  8269: 	      case $deplibs_check_method in
  8270: 		match_pattern*)
  8271: 		  set dummy $deplibs_check_method; shift
  8272: 		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  8273: 		  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
  8274: 		    | $EGREP "$match_pattern_regex" > /dev/null; then
  8275: 		    valid_a_lib=:
  8276: 		  fi
  8277: 		;;
  8278: 		pass_all)
  8279: 		  valid_a_lib=:
  8280: 		;;
  8281: 	      esac
  8282: 	      if $valid_a_lib; then
  8283: 		echo
  8284: 		$ECHO "*** Warning: Linking the shared library $output against the"
  8285: 		$ECHO "*** static library $deplib is not portable!"
  8286: 		deplibs="$deplib $deplibs"
  8287: 	      else
  8288: 		echo
  8289: 		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
  8290: 		echo "*** I have the capability to make that library automatically link in when"
  8291: 		echo "*** you link to this library.  But I can only do this if you have a"
  8292: 		echo "*** shared version of the library, which you do not appear to have"
  8293: 		echo "*** because the file extensions .$libext of this argument makes me believe"
  8294: 		echo "*** that it is just a static archive that I should not use here."
  8295: 	      fi
  8296: 	      ;;
  8297: 	    esac
  8298: 	    continue
  8299: 	    ;;
  8300: 	  prog)
  8301: 	    if test link != "$pass"; then
  8302: 	      deplibs="$deplib $deplibs"
  8303: 	    else
  8304: 	      compile_deplibs="$deplib $compile_deplibs"
  8305: 	      finalize_deplibs="$deplib $finalize_deplibs"
  8306: 	    fi
  8307: 	    continue
  8308: 	    ;;
  8309: 	  esac # linkmode
  8310: 	  ;; # *.$libext
  8311: 	*.lo | *.$objext)
  8312: 	  if test conv = "$pass"; then
  8313: 	    deplibs="$deplib $deplibs"
  8314: 	  elif test prog = "$linkmode"; then
  8315: 	    if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
  8316: 	      # If there is no dlopen support or we're linking statically,
  8317: 	      # we need to preload.
  8318: 	      func_append newdlprefiles " $deplib"
  8319: 	      compile_deplibs="$deplib $compile_deplibs"
  8320: 	      finalize_deplibs="$deplib $finalize_deplibs"
  8321: 	    else
  8322: 	      func_append newdlfiles " $deplib"
  8323: 	    fi
  8324: 	  fi
  8325: 	  continue
  8326: 	  ;;
  8327: 	%DEPLIBS%)
  8328: 	  alldeplibs=:
  8329: 	  continue
  8330: 	  ;;
  8331: 	esac # case $deplib
  8332: 
  8333: 	$found || test -f "$lib" \
  8334: 	  || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
  8335: 
  8336: 	# Check to see that this really is a libtool archive.
  8337: 	func_lalib_unsafe_p "$lib" \
  8338: 	  || func_fatal_error "'$lib' is not a valid libtool archive"
  8339: 
  8340: 	func_dirname "$lib" "" "."
  8341: 	ladir=$func_dirname_result
  8342: 
  8343: 	dlname=
  8344: 	dlopen=
  8345: 	dlpreopen=
  8346: 	libdir=
  8347: 	library_names=
  8348: 	old_library=
  8349: 	inherited_linker_flags=
  8350: 	# If the library was installed with an old release of libtool,
  8351: 	# it will not redefine variables installed, or shouldnotlink
  8352: 	installed=yes
  8353: 	shouldnotlink=no
  8354: 	avoidtemprpath=
  8355: 
  8356: 
  8357: 	# Read the .la file
  8358: 	func_source "$lib"
  8359: 
  8360: 	# Convert "-framework foo" to "foo.ltframework"
  8361: 	if test -n "$inherited_linker_flags"; then
  8362: 	  tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
  8363: 	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
  8364: 	    case " $new_inherited_linker_flags " in
  8365: 	      *" $tmp_inherited_linker_flag "*) ;;
  8366: 	      *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
  8367: 	    esac
  8368: 	  done
  8369: 	fi
  8370: 	dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  8371: 	if test lib,link = "$linkmode,$pass" ||
  8372: 	   test prog,scan = "$linkmode,$pass" ||
  8373: 	   { test prog != "$linkmode" && test lib != "$linkmode"; }; then
  8374: 	  test -n "$dlopen" && func_append dlfiles " $dlopen"
  8375: 	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
  8376: 	fi
  8377: 
  8378: 	if test conv = "$pass"; then
  8379: 	  # Only check for convenience libraries
  8380: 	  deplibs="$lib $deplibs"
  8381: 	  if test -z "$libdir"; then
  8382: 	    if test -z "$old_library"; then
  8383: 	      func_fatal_error "cannot find name of link library for '$lib'"
  8384: 	    fi
  8385: 	    # It is a libtool convenience library, so add in its objects.
  8386: 	    func_append convenience " $ladir/$objdir/$old_library"
  8387: 	    func_append old_convenience " $ladir/$objdir/$old_library"
  8388: 	  elif test prog != "$linkmode" && test lib != "$linkmode"; then
  8389: 	    func_fatal_error "'$lib' is not a convenience library"
  8390: 	  fi
  8391: 	  tmp_libs=
  8392: 	  for deplib in $dependency_libs; do
  8393: 	    deplibs="$deplib $deplibs"
  8394: 	    if $opt_preserve_dup_deps; then
  8395: 	      case "$tmp_libs " in
  8396: 	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
  8397: 	      esac
  8398: 	    fi
  8399: 	    func_append tmp_libs " $deplib"
  8400: 	  done
  8401: 	  continue
  8402: 	fi # $pass = conv
  8403: 
  8404: 
  8405: 	# Get the name of the library we link against.
  8406: 	linklib=
  8407: 	if test -n "$old_library" &&
  8408: 	   { test yes = "$prefer_static_libs" ||
  8409: 	     test built,no = "$prefer_static_libs,$installed"; }; then
  8410: 	  linklib=$old_library
  8411: 	else
  8412: 	  for l in $old_library $library_names; do
  8413: 	    linklib=$l
  8414: 	  done
  8415: 	fi
  8416: 	if test -z "$linklib"; then
  8417: 	  func_fatal_error "cannot find name of link library for '$lib'"
  8418: 	fi
  8419: 
  8420: 	# This library was specified with -dlopen.
  8421: 	if test dlopen = "$pass"; then
  8422: 	  test -z "$libdir" \
  8423: 	    && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
  8424: 	  if test -z "$dlname" ||
  8425: 	     test yes != "$dlopen_support" ||
  8426: 	     test no = "$build_libtool_libs"
  8427: 	  then
  8428: 	    # If there is no dlname, no dlopen support or we're linking
  8429: 	    # statically, we need to preload.  We also need to preload any
  8430: 	    # dependent libraries so libltdl's deplib preloader doesn't
  8431: 	    # bomb out in the load deplibs phase.
  8432: 	    func_append dlprefiles " $lib $dependency_libs"
  8433: 	  else
  8434: 	    func_append newdlfiles " $lib"
  8435: 	  fi
  8436: 	  continue
  8437: 	fi # $pass = dlopen
  8438: 
  8439: 	# We need an absolute path.
  8440: 	case $ladir in
  8441: 	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
  8442: 	*)
  8443: 	  abs_ladir=`cd "$ladir" && pwd`
  8444: 	  if test -z "$abs_ladir"; then
  8445: 	    func_warning "cannot determine absolute directory name of '$ladir'"
  8446: 	    func_warning "passing it literally to the linker, although it might fail"
  8447: 	    abs_ladir=$ladir
  8448: 	  fi
  8449: 	  ;;
  8450: 	esac
  8451: 	func_basename "$lib"
  8452: 	laname=$func_basename_result
  8453: 
  8454: 	# Find the relevant object directory and library name.
  8455: 	if test yes = "$installed"; then
  8456: 	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  8457: 	    func_warning "library '$lib' was moved."
  8458: 	    dir=$ladir
  8459: 	    absdir=$abs_ladir
  8460: 	    libdir=$abs_ladir
  8461: 	  else
  8462: 	    dir=$lt_sysroot$libdir
  8463: 	    absdir=$lt_sysroot$libdir
  8464: 	  fi
  8465: 	  test yes = "$hardcode_automatic" && avoidtemprpath=yes
  8466: 	else
  8467: 	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  8468: 	    dir=$ladir
  8469: 	    absdir=$abs_ladir
  8470: 	    # Remove this search path later
  8471: 	    func_append notinst_path " $abs_ladir"
  8472: 	  else
  8473: 	    dir=$ladir/$objdir
  8474: 	    absdir=$abs_ladir/$objdir
  8475: 	    # Remove this search path later
  8476: 	    func_append notinst_path " $abs_ladir"
  8477: 	  fi
  8478: 	fi # $installed = yes
  8479: 	func_stripname 'lib' '.la' "$laname"
  8480: 	name=$func_stripname_result
  8481: 
  8482: 	# This library was specified with -dlpreopen.
  8483: 	if test dlpreopen = "$pass"; then
  8484: 	  if test -z "$libdir" && test prog = "$linkmode"; then
  8485: 	    func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
  8486: 	  fi
  8487: 	  case $host in
  8488: 	    # special handling for platforms with PE-DLLs.
  8489: 	    *cygwin* | *mingw* | *cegcc* )
  8490: 	      # Linker will automatically link against shared library if both
  8491: 	      # static and shared are present.  Therefore, ensure we extract
  8492: 	      # symbols from the import library if a shared library is present
  8493: 	      # (otherwise, the dlopen module name will be incorrect).  We do
  8494: 	      # this by putting the import library name into $newdlprefiles.
  8495: 	      # We recover the dlopen module name by 'saving' the la file
  8496: 	      # name in a special purpose variable, and (later) extracting the
  8497: 	      # dlname from the la file.
  8498: 	      if test -n "$dlname"; then
  8499: 	        func_tr_sh "$dir/$linklib"
  8500: 	        eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
  8501: 	        func_append newdlprefiles " $dir/$linklib"
  8502: 	      else
  8503: 	        func_append newdlprefiles " $dir/$old_library"
  8504: 	        # Keep a list of preopened convenience libraries to check
  8505: 	        # that they are being used correctly in the link pass.
  8506: 	        test -z "$libdir" && \
  8507: 	          func_append dlpreconveniencelibs " $dir/$old_library"
  8508: 	      fi
  8509: 	    ;;
  8510: 	    * )
  8511: 	      # Prefer using a static library (so that no silly _DYNAMIC symbols
  8512: 	      # are required to link).
  8513: 	      if test -n "$old_library"; then
  8514: 	        func_append newdlprefiles " $dir/$old_library"
  8515: 	        # Keep a list of preopened convenience libraries to check
  8516: 	        # that they are being used correctly in the link pass.
  8517: 	        test -z "$libdir" && \
  8518: 	          func_append dlpreconveniencelibs " $dir/$old_library"
  8519: 	      # Otherwise, use the dlname, so that lt_dlopen finds it.
  8520: 	      elif test -n "$dlname"; then
  8521: 	        func_append newdlprefiles " $dir/$dlname"
  8522: 	      else
  8523: 	        func_append newdlprefiles " $dir/$linklib"
  8524: 	      fi
  8525: 	    ;;
  8526: 	  esac
  8527: 	fi # $pass = dlpreopen
  8528: 
  8529: 	if test -z "$libdir"; then
  8530: 	  # Link the convenience library
  8531: 	  if test lib = "$linkmode"; then
  8532: 	    deplibs="$dir/$old_library $deplibs"
  8533: 	  elif test prog,link = "$linkmode,$pass"; then
  8534: 	    compile_deplibs="$dir/$old_library $compile_deplibs"
  8535: 	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
  8536: 	  else
  8537: 	    deplibs="$lib $deplibs" # used for prog,scan pass
  8538: 	  fi
  8539: 	  continue
  8540: 	fi
  8541: 
  8542: 
  8543: 	if test prog = "$linkmode" && test link != "$pass"; then
  8544: 	  func_append newlib_search_path " $ladir"
  8545: 	  deplibs="$lib $deplibs"
  8546: 
  8547: 	  linkalldeplibs=false
  8548: 	  if test no != "$link_all_deplibs" || test -z "$library_names" ||
  8549: 	     test no = "$build_libtool_libs"; then
  8550: 	    linkalldeplibs=:
  8551: 	  fi
  8552: 
  8553: 	  tmp_libs=
  8554: 	  for deplib in $dependency_libs; do
  8555: 	    case $deplib in
  8556: 	    -L*) func_stripname '-L' '' "$deplib"
  8557: 	         func_resolve_sysroot "$func_stripname_result"
  8558: 	         func_append newlib_search_path " $func_resolve_sysroot_result"
  8559: 		 ;;
  8560: 	    esac
  8561: 	    # Need to link against all dependency_libs?
  8562: 	    if $linkalldeplibs; then
  8563: 	      deplibs="$deplib $deplibs"
  8564: 	    else
  8565: 	      # Need to hardcode shared library paths
  8566: 	      # or/and link against static libraries
  8567: 	      newdependency_libs="$deplib $newdependency_libs"
  8568: 	    fi
  8569: 	    if $opt_preserve_dup_deps; then
  8570: 	      case "$tmp_libs " in
  8571: 	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
  8572: 	      esac
  8573: 	    fi
  8574: 	    func_append tmp_libs " $deplib"
  8575: 	  done # for deplib
  8576: 	  continue
  8577: 	fi # $linkmode = prog...
  8578: 
  8579: 	if test prog,link = "$linkmode,$pass"; then
  8580: 	  if test -n "$library_names" &&
  8581: 	     { { test no = "$prefer_static_libs" ||
  8582: 	         test built,yes = "$prefer_static_libs,$installed"; } ||
  8583: 	       test -z "$old_library"; }; then
  8584: 	    # We need to hardcode the library path
  8585: 	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
  8586: 	      # Make sure the rpath contains only unique directories.
  8587: 	      case $temp_rpath: in
  8588: 	      *"$absdir:"*) ;;
  8589: 	      *) func_append temp_rpath "$absdir:" ;;
  8590: 	      esac
  8591: 	    fi
  8592: 
  8593: 	    # Hardcode the library path.
  8594: 	    # Skip directories that are in the system default run-time
  8595: 	    # search path.
  8596: 	    case " $sys_lib_dlsearch_path " in
  8597: 	    *" $absdir "*) ;;
  8598: 	    *)
  8599: 	      case "$compile_rpath " in
  8600: 	      *" $absdir "*) ;;
  8601: 	      *) func_append compile_rpath " $absdir" ;;
  8602: 	      esac
  8603: 	      ;;
  8604: 	    esac
  8605: 	    case " $sys_lib_dlsearch_path " in
  8606: 	    *" $libdir "*) ;;
  8607: 	    *)
  8608: 	      case "$finalize_rpath " in
  8609: 	      *" $libdir "*) ;;
  8610: 	      *) func_append finalize_rpath " $libdir" ;;
  8611: 	      esac
  8612: 	      ;;
  8613: 	    esac
  8614: 	  fi # $linkmode,$pass = prog,link...
  8615: 
  8616: 	  if $alldeplibs &&
  8617: 	     { test pass_all = "$deplibs_check_method" ||
  8618: 	       { test yes = "$build_libtool_libs" &&
  8619: 		 test -n "$library_names"; }; }; then
  8620: 	    # We only need to search for static libraries
  8621: 	    continue
  8622: 	  fi
  8623: 	fi
  8624: 
  8625: 	link_static=no # Whether the deplib will be linked statically
  8626: 	use_static_libs=$prefer_static_libs
  8627: 	if test built = "$use_static_libs" && test yes = "$installed"; then
  8628: 	  use_static_libs=no
  8629: 	fi
  8630: 	if test -n "$library_names" &&
  8631: 	   { test no = "$use_static_libs" || test -z "$old_library"; }; then
  8632: 	  case $host in
  8633: 	  *cygwin* | *mingw* | *cegcc* | *os2*)
  8634: 	      # No point in relinking DLLs because paths are not encoded
  8635: 	      func_append notinst_deplibs " $lib"
  8636: 	      need_relink=no
  8637: 	    ;;
  8638: 	  *)
  8639: 	    if test no = "$installed"; then
  8640: 	      func_append notinst_deplibs " $lib"
  8641: 	      need_relink=yes
  8642: 	    fi
  8643: 	    ;;
  8644: 	  esac
  8645: 	  # This is a shared library
  8646: 
  8647: 	  # Warn about portability, can't link against -module's on some
  8648: 	  # systems (darwin).  Don't bleat about dlopened modules though!
  8649: 	  dlopenmodule=
  8650: 	  for dlpremoduletest in $dlprefiles; do
  8651: 	    if test "X$dlpremoduletest" = "X$lib"; then
  8652: 	      dlopenmodule=$dlpremoduletest
  8653: 	      break
  8654: 	    fi
  8655: 	  done
  8656: 	  if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
  8657: 	    echo
  8658: 	    if test prog = "$linkmode"; then
  8659: 	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
  8660: 	    else
  8661: 	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
  8662: 	    fi
  8663: 	    $ECHO "*** $linklib is not portable!"
  8664: 	  fi
  8665: 	  if test lib = "$linkmode" &&
  8666: 	     test yes = "$hardcode_into_libs"; then
  8667: 	    # Hardcode the library path.
  8668: 	    # Skip directories that are in the system default run-time
  8669: 	    # search path.
  8670: 	    case " $sys_lib_dlsearch_path " in
  8671: 	    *" $absdir "*) ;;
  8672: 	    *)
  8673: 	      case "$compile_rpath " in
  8674: 	      *" $absdir "*) ;;
  8675: 	      *) func_append compile_rpath " $absdir" ;;
  8676: 	      esac
  8677: 	      ;;
  8678: 	    esac
  8679: 	    case " $sys_lib_dlsearch_path " in
  8680: 	    *" $libdir "*) ;;
  8681: 	    *)
  8682: 	      case "$finalize_rpath " in
  8683: 	      *" $libdir "*) ;;
  8684: 	      *) func_append finalize_rpath " $libdir" ;;
  8685: 	      esac
  8686: 	      ;;
  8687: 	    esac
  8688: 	  fi
  8689: 
  8690: 	  if test -n "$old_archive_from_expsyms_cmds"; then
  8691: 	    # figure out the soname
  8692: 	    set dummy $library_names
  8693: 	    shift
  8694: 	    realname=$1
  8695: 	    shift
  8696: 	    libname=`eval "\\$ECHO \"$libname_spec\""`
  8697: 	    # use dlname if we got it. it's perfectly good, no?
  8698: 	    if test -n "$dlname"; then
  8699: 	      soname=$dlname
  8700: 	    elif test -n "$soname_spec"; then
  8701: 	      # bleh windows
  8702: 	      case $host in
  8703: 	      *cygwin* | mingw* | *cegcc* | *os2*)
  8704: 	        func_arith $current - $age
  8705: 		major=$func_arith_result
  8706: 		versuffix=-$major
  8707: 		;;
  8708: 	      esac
  8709: 	      eval soname=\"$soname_spec\"
  8710: 	    else
  8711: 	      soname=$realname
  8712: 	    fi
  8713: 
  8714: 	    # Make a new name for the extract_expsyms_cmds to use
  8715: 	    soroot=$soname
  8716: 	    func_basename "$soroot"
  8717: 	    soname=$func_basename_result
  8718: 	    func_stripname 'lib' '.dll' "$soname"
  8719: 	    newlib=libimp-$func_stripname_result.a
  8720: 
  8721: 	    # If the library has no export list, then create one now
  8722: 	    if test -f "$output_objdir/$soname-def"; then :
  8723: 	    else
  8724: 	      func_verbose "extracting exported symbol list from '$soname'"
  8725: 	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
  8726: 	    fi
  8727: 
  8728: 	    # Create $newlib
  8729: 	    if test -f "$output_objdir/$newlib"; then :; else
  8730: 	      func_verbose "generating import library for '$soname'"
  8731: 	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
  8732: 	    fi
  8733: 	    # make sure the library variables are pointing to the new library
  8734: 	    dir=$output_objdir
  8735: 	    linklib=$newlib
  8736: 	  fi # test -n "$old_archive_from_expsyms_cmds"
  8737: 
  8738: 	  if test prog = "$linkmode" || test relink != "$opt_mode"; then
  8739: 	    add_shlibpath=
  8740: 	    add_dir=
  8741: 	    add=
  8742: 	    lib_linked=yes
  8743: 	    case $hardcode_action in
  8744: 	    immediate | unsupported)
  8745: 	      if test no = "$hardcode_direct"; then
  8746: 		add=$dir/$linklib
  8747: 		case $host in
  8748: 		  *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
  8749: 		  *-*-sysv4*uw2*) add_dir=-L$dir ;;
  8750: 		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
  8751: 		    *-*-unixware7*) add_dir=-L$dir ;;
  8752: 		  *-*-darwin* )
  8753: 		    # if the lib is a (non-dlopened) module then we cannot
  8754: 		    # link against it, someone is ignoring the earlier warnings
  8755: 		    if /usr/bin/file -L $add 2> /dev/null |
  8756: 			 $GREP ": [^:]* bundle" >/dev/null; then
  8757: 		      if test "X$dlopenmodule" != "X$lib"; then
  8758: 			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
  8759: 			if test -z "$old_library"; then
  8760: 			  echo
  8761: 			  echo "*** And there doesn't seem to be a static archive available"
  8762: 			  echo "*** The link will probably fail, sorry"
  8763: 			else
  8764: 			  add=$dir/$old_library
  8765: 			fi
  8766: 		      elif test -n "$old_library"; then
  8767: 			add=$dir/$old_library
  8768: 		      fi
  8769: 		    fi
  8770: 		esac
  8771: 	      elif test no = "$hardcode_minus_L"; then
  8772: 		case $host in
  8773: 		*-*-sunos*) add_shlibpath=$dir ;;
  8774: 		esac
  8775: 		add_dir=-L$dir
  8776: 		add=-l$name
  8777: 	      elif test no = "$hardcode_shlibpath_var"; then
  8778: 		add_shlibpath=$dir
  8779: 		add=-l$name
  8780: 	      else
  8781: 		lib_linked=no
  8782: 	      fi
  8783: 	      ;;
  8784: 	    relink)
  8785: 	      if test yes = "$hardcode_direct" &&
  8786: 	         test no = "$hardcode_direct_absolute"; then
  8787: 		add=$dir/$linklib
  8788: 	      elif test yes = "$hardcode_minus_L"; then
  8789: 		add_dir=-L$absdir
  8790: 		# Try looking first in the location we're being installed to.
  8791: 		if test -n "$inst_prefix_dir"; then
  8792: 		  case $libdir in
  8793: 		    [\\/]*)
  8794: 		      func_append add_dir " -L$inst_prefix_dir$libdir"
  8795: 		      ;;
  8796: 		  esac
  8797: 		fi
  8798: 		add=-l$name
  8799: 	      elif test yes = "$hardcode_shlibpath_var"; then
  8800: 		add_shlibpath=$dir
  8801: 		add=-l$name
  8802: 	      else
  8803: 		lib_linked=no
  8804: 	      fi
  8805: 	      ;;
  8806: 	    *) lib_linked=no ;;
  8807: 	    esac
  8808: 
  8809: 	    if test yes != "$lib_linked"; then
  8810: 	      func_fatal_configuration "unsupported hardcode properties"
  8811: 	    fi
  8812: 
  8813: 	    if test -n "$add_shlibpath"; then
  8814: 	      case :$compile_shlibpath: in
  8815: 	      *":$add_shlibpath:"*) ;;
  8816: 	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
  8817: 	      esac
  8818: 	    fi
  8819: 	    if test prog = "$linkmode"; then
  8820: 	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
  8821: 	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
  8822: 	    else
  8823: 	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
  8824: 	      test -n "$add" && deplibs="$add $deplibs"
  8825: 	      if test yes != "$hardcode_direct" &&
  8826: 		 test yes != "$hardcode_minus_L" &&
  8827: 		 test yes = "$hardcode_shlibpath_var"; then
  8828: 		case :$finalize_shlibpath: in
  8829: 		*":$libdir:"*) ;;
  8830: 		*) func_append finalize_shlibpath "$libdir:" ;;
  8831: 		esac
  8832: 	      fi
  8833: 	    fi
  8834: 	  fi
  8835: 
  8836: 	  if test prog = "$linkmode" || test relink = "$opt_mode"; then
  8837: 	    add_shlibpath=
  8838: 	    add_dir=
  8839: 	    add=
  8840: 	    # Finalize command for both is simple: just hardcode it.
  8841: 	    if test yes = "$hardcode_direct" &&
  8842: 	       test no = "$hardcode_direct_absolute"; then
  8843: 	      add=$libdir/$linklib
  8844: 	    elif test yes = "$hardcode_minus_L"; then
  8845: 	      add_dir=-L$libdir
  8846: 	      add=-l$name
  8847: 	    elif test yes = "$hardcode_shlibpath_var"; then
  8848: 	      case :$finalize_shlibpath: in
  8849: 	      *":$libdir:"*) ;;
  8850: 	      *) func_append finalize_shlibpath "$libdir:" ;;
  8851: 	      esac
  8852: 	      add=-l$name
  8853: 	    elif test yes = "$hardcode_automatic"; then
  8854: 	      if test -n "$inst_prefix_dir" &&
  8855: 		 test -f "$inst_prefix_dir$libdir/$linklib"; then
  8856: 		add=$inst_prefix_dir$libdir/$linklib
  8857: 	      else
  8858: 		add=$libdir/$linklib
  8859: 	      fi
  8860: 	    else
  8861: 	      # We cannot seem to hardcode it, guess we'll fake it.
  8862: 	      add_dir=-L$libdir
  8863: 	      # Try looking first in the location we're being installed to.
  8864: 	      if test -n "$inst_prefix_dir"; then
  8865: 		case $libdir in
  8866: 		  [\\/]*)
  8867: 		    func_append add_dir " -L$inst_prefix_dir$libdir"
  8868: 		    ;;
  8869: 		esac
  8870: 	      fi
  8871: 	      add=-l$name
  8872: 	    fi
  8873: 
  8874: 	    if test prog = "$linkmode"; then
  8875: 	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
  8876: 	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
  8877: 	    else
  8878: 	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
  8879: 	      test -n "$add" && deplibs="$add $deplibs"
  8880: 	    fi
  8881: 	  fi
  8882: 	elif test prog = "$linkmode"; then
  8883: 	  # Here we assume that one of hardcode_direct or hardcode_minus_L
  8884: 	  # is not unsupported.  This is valid on all known static and
  8885: 	  # shared platforms.
  8886: 	  if test unsupported != "$hardcode_direct"; then
  8887: 	    test -n "$old_library" && linklib=$old_library
  8888: 	    compile_deplibs="$dir/$linklib $compile_deplibs"
  8889: 	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
  8890: 	  else
  8891: 	    compile_deplibs="-l$name -L$dir $compile_deplibs"
  8892: 	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
  8893: 	  fi
  8894: 	elif test yes = "$build_libtool_libs"; then
  8895: 	  # Not a shared library
  8896: 	  if test pass_all != "$deplibs_check_method"; then
  8897: 	    # We're trying link a shared library against a static one
  8898: 	    # but the system doesn't support it.
  8899: 
  8900: 	    # Just print a warning and add the library to dependency_libs so
  8901: 	    # that the program can be linked against the static library.
  8902: 	    echo
  8903: 	    $ECHO "*** Warning: This system cannot link to static lib archive $lib."
  8904: 	    echo "*** I have the capability to make that library automatically link in when"
  8905: 	    echo "*** you link to this library.  But I can only do this if you have a"
  8906: 	    echo "*** shared version of the library, which you do not appear to have."
  8907: 	    if test yes = "$module"; then
  8908: 	      echo "*** But as you try to build a module library, libtool will still create "
  8909: 	      echo "*** a static module, that should work as long as the dlopening application"
  8910: 	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
  8911: 	      if test -z "$global_symbol_pipe"; then
  8912: 		echo
  8913: 		echo "*** However, this would only work if libtool was able to extract symbol"
  8914: 		echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
  8915: 		echo "*** not find such a program.  So, this module is probably useless."
  8916: 		echo "*** 'nm' from GNU binutils and a full rebuild may help."
  8917: 	      fi
  8918: 	      if test no = "$build_old_libs"; then
  8919: 		build_libtool_libs=module
  8920: 		build_old_libs=yes
  8921: 	      else
  8922: 		build_libtool_libs=no
  8923: 	      fi
  8924: 	    fi
  8925: 	  else
  8926: 	    deplibs="$dir/$old_library $deplibs"
  8927: 	    link_static=yes
  8928: 	  fi
  8929: 	fi # link shared/static library?
  8930: 
  8931: 	if test lib = "$linkmode"; then
  8932: 	  if test -n "$dependency_libs" &&
  8933: 	     { test yes != "$hardcode_into_libs" ||
  8934: 	       test yes = "$build_old_libs" ||
  8935: 	       test yes = "$link_static"; }; then
  8936: 	    # Extract -R from dependency_libs
  8937: 	    temp_deplibs=
  8938: 	    for libdir in $dependency_libs; do
  8939: 	      case $libdir in
  8940: 	      -R*) func_stripname '-R' '' "$libdir"
  8941: 	           temp_xrpath=$func_stripname_result
  8942: 		   case " $xrpath " in
  8943: 		   *" $temp_xrpath "*) ;;
  8944: 		   *) func_append xrpath " $temp_xrpath";;
  8945: 		   esac;;
  8946: 	      *) func_append temp_deplibs " $libdir";;
  8947: 	      esac
  8948: 	    done
  8949: 	    dependency_libs=$temp_deplibs
  8950: 	  fi
  8951: 
  8952: 	  func_append newlib_search_path " $absdir"
  8953: 	  # Link against this library
  8954: 	  test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
  8955: 	  # ... and its dependency_libs
  8956: 	  tmp_libs=
  8957: 	  for deplib in $dependency_libs; do
  8958: 	    newdependency_libs="$deplib $newdependency_libs"
  8959: 	    case $deplib in
  8960:               -L*) func_stripname '-L' '' "$deplib"
  8961:                    func_resolve_sysroot "$func_stripname_result";;
  8962:               *) func_resolve_sysroot "$deplib" ;;
  8963:             esac
  8964: 	    if $opt_preserve_dup_deps; then
  8965: 	      case "$tmp_libs " in
  8966: 	      *" $func_resolve_sysroot_result "*)
  8967:                 func_append specialdeplibs " $func_resolve_sysroot_result" ;;
  8968: 	      esac
  8969: 	    fi
  8970: 	    func_append tmp_libs " $func_resolve_sysroot_result"
  8971: 	  done
  8972: 
  8973: 	  if test no != "$link_all_deplibs"; then
  8974: 	    # Add the search paths of all dependency libraries
  8975: 	    for deplib in $dependency_libs; do
  8976: 	      path=
  8977: 	      case $deplib in
  8978: 	      -L*) path=$deplib ;;
  8979: 	      *.la)
  8980: 	        func_resolve_sysroot "$deplib"
  8981: 	        deplib=$func_resolve_sysroot_result
  8982: 	        func_dirname "$deplib" "" "."
  8983: 		dir=$func_dirname_result
  8984: 		# We need an absolute path.
  8985: 		case $dir in
  8986: 		[\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
  8987: 		*)
  8988: 		  absdir=`cd "$dir" && pwd`
  8989: 		  if test -z "$absdir"; then
  8990: 		    func_warning "cannot determine absolute directory name of '$dir'"
  8991: 		    absdir=$dir
  8992: 		  fi
  8993: 		  ;;
  8994: 		esac
  8995: 		if $GREP "^installed=no" $deplib > /dev/null; then
  8996: 		case $host in
  8997: 		*-*-darwin*)
  8998: 		  depdepl=
  8999: 		  eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
  9000: 		  if test -n "$deplibrary_names"; then
  9001: 		    for tmp in $deplibrary_names; do
  9002: 		      depdepl=$tmp
  9003: 		    done
  9004: 		    if test -f "$absdir/$objdir/$depdepl"; then
  9005: 		      depdepl=$absdir/$objdir/$depdepl
  9006: 		      darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
  9007:                       if test -z "$darwin_install_name"; then
  9008:                           darwin_install_name=`$OTOOL64 -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
  9009:                       fi
  9010: 		      func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
  9011: 		      func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
  9012: 		      path=
  9013: 		    fi
  9014: 		  fi
  9015: 		  ;;
  9016: 		*)
  9017: 		  path=-L$absdir/$objdir
  9018: 		  ;;
  9019: 		esac
  9020: 		else
  9021: 		  eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  9022: 		  test -z "$libdir" && \
  9023: 		    func_fatal_error "'$deplib' is not a valid libtool archive"
  9024: 		  test "$absdir" != "$libdir" && \
  9025: 		    func_warning "'$deplib' seems to be moved"
  9026: 
  9027: 		  path=-L$absdir
  9028: 		fi
  9029: 		;;
  9030: 	      esac
  9031: 	      case " $deplibs " in
  9032: 	      *" $path "*) ;;
  9033: 	      *) deplibs="$path $deplibs" ;;
  9034: 	      esac
  9035: 	    done
  9036: 	  fi # link_all_deplibs != no
  9037: 	fi # linkmode = lib
  9038:       done # for deplib in $libs
  9039:       if test link = "$pass"; then
  9040: 	if test prog = "$linkmode"; then
  9041: 	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
  9042: 	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
  9043: 	else
  9044: 	  compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  9045: 	fi
  9046:       fi
  9047:       dependency_libs=$newdependency_libs
  9048:       if test dlpreopen = "$pass"; then
  9049: 	# Link the dlpreopened libraries before other libraries
  9050: 	for deplib in $save_deplibs; do
  9051: 	  deplibs="$deplib $deplibs"
  9052: 	done
  9053:       fi
  9054:       if test dlopen != "$pass"; then
  9055: 	test conv = "$pass" || {
  9056: 	  # Make sure lib_search_path contains only unique directories.
  9057: 	  lib_search_path=
  9058: 	  for dir in $newlib_search_path; do
  9059: 	    case "$lib_search_path " in
  9060: 	    *" $dir "*) ;;
  9061: 	    *) func_append lib_search_path " $dir" ;;
  9062: 	    esac
  9063: 	  done
  9064: 	  newlib_search_path=
  9065: 	}
  9066: 
  9067: 	if test prog,link = "$linkmode,$pass"; then
  9068: 	  vars="compile_deplibs finalize_deplibs"
  9069: 	else
  9070: 	  vars=deplibs
  9071: 	fi
  9072: 	for var in $vars dependency_libs; do
  9073: 	  # Add libraries to $var in reverse order
  9074: 	  eval tmp_libs=\"\$$var\"
  9075: 	  new_libs=
  9076: 	  for deplib in $tmp_libs; do
  9077: 	    # FIXME: Pedantically, this is the right thing to do, so
  9078: 	    #        that some nasty dependency loop isn't accidentally
  9079: 	    #        broken:
  9080: 	    #new_libs="$deplib $new_libs"
  9081: 	    # Pragmatically, this seems to cause very few problems in
  9082: 	    # practice:
  9083: 	    case $deplib in
  9084: 	    -L*) new_libs="$deplib $new_libs" ;;
  9085: 	    -R*) ;;
  9086: 	    *)
  9087: 	      # And here is the reason: when a library appears more
  9088: 	      # than once as an explicit dependence of a library, or
  9089: 	      # is implicitly linked in more than once by the
  9090: 	      # compiler, it is considered special, and multiple
  9091: 	      # occurrences thereof are not removed.  Compare this
  9092: 	      # with having the same library being listed as a
  9093: 	      # dependency of multiple other libraries: in this case,
  9094: 	      # we know (pedantically, we assume) the library does not
  9095: 	      # need to be listed more than once, so we keep only the
  9096: 	      # last copy.  This is not always right, but it is rare
  9097: 	      # enough that we require users that really mean to play
  9098: 	      # such unportable linking tricks to link the library
  9099: 	      # using -Wl,-lname, so that libtool does not consider it
  9100: 	      # for duplicate removal.
  9101: 	      case " $specialdeplibs " in
  9102: 	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
  9103: 	      *)
  9104: 		case " $new_libs " in
  9105: 		*" $deplib "*) ;;
  9106: 		*) new_libs="$deplib $new_libs" ;;
  9107: 		esac
  9108: 		;;
  9109: 	      esac
  9110: 	      ;;
  9111: 	    esac
  9112: 	  done
  9113: 	  tmp_libs=
  9114: 	  for deplib in $new_libs; do
  9115: 	    case $deplib in
  9116: 	    -L*)
  9117: 	      case " $tmp_libs " in
  9118: 	      *" $deplib "*) ;;
  9119: 	      *) func_append tmp_libs " $deplib" ;;
  9120: 	      esac
  9121: 	      ;;
  9122: 	    *) func_append tmp_libs " $deplib" ;;
  9123: 	    esac
  9124: 	  done
  9125: 	  eval $var=\"$tmp_libs\"
  9126: 	done # for var
  9127:       fi
  9128: 
  9129:       # Add Sun CC postdeps if required:
  9130:       test CXX = "$tagname" && {
  9131:         case $host_os in
  9132:         linux*)
  9133:           case `$CC -V 2>&1 | sed 5q` in
  9134:           *Sun\ C*) # Sun C++ 5.9
  9135:             func_suncc_cstd_abi
  9136: 
  9137:             if test no != "$suncc_use_cstd_abi"; then
  9138:               func_append postdeps ' -library=Cstd -library=Crun'
  9139:             fi
  9140:             ;;
  9141:           esac
  9142:           ;;
  9143: 
  9144:         solaris*)
  9145:           func_cc_basename "$CC"
  9146:           case $func_cc_basename_result in
  9147:           CC* | sunCC*)
  9148:             func_suncc_cstd_abi
  9149: 
  9150:             if test no != "$suncc_use_cstd_abi"; then
  9151:               func_append postdeps ' -library=Cstd -library=Crun'
  9152:             fi
  9153:             ;;
  9154:           esac
  9155:           ;;
  9156:         esac
  9157:       }
  9158: 
  9159:       # Last step: remove runtime libs from dependency_libs
  9160:       # (they stay in deplibs)
  9161:       tmp_libs=
  9162:       for i in $dependency_libs; do
  9163: 	case " $predeps $postdeps $compiler_lib_search_path " in
  9164: 	*" $i "*)
  9165: 	  i=
  9166: 	  ;;
  9167: 	esac
  9168: 	if test -n "$i"; then
  9169: 	  func_append tmp_libs " $i"
  9170: 	fi
  9171:       done
  9172:       dependency_libs=$tmp_libs
  9173:     done # for pass
  9174:     if test prog = "$linkmode"; then
  9175:       dlfiles=$newdlfiles
  9176:     fi
  9177:     if test prog = "$linkmode" || test lib = "$linkmode"; then
  9178:       dlprefiles=$newdlprefiles
  9179:     fi
  9180: 
  9181:     case $linkmode in
  9182:     oldlib)
  9183:       if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
  9184: 	func_warning "'-dlopen' is ignored for archives"
  9185:       fi
  9186: 
  9187:       case " $deplibs" in
  9188:       *\ -l* | *\ -L*)
  9189: 	func_warning "'-l' and '-L' are ignored for archives" ;;
  9190:       esac
  9191: 
  9192:       test -n "$rpath" && \
  9193: 	func_warning "'-rpath' is ignored for archives"
  9194: 
  9195:       test -n "$xrpath" && \
  9196: 	func_warning "'-R' is ignored for archives"
  9197: 
  9198:       test -n "$vinfo" && \
  9199: 	func_warning "'-version-info/-version-number' is ignored for archives"
  9200: 
  9201:       test -n "$release" && \
  9202: 	func_warning "'-release' is ignored for archives"
  9203: 
  9204:       test -n "$export_symbols$export_symbols_regex" && \
  9205: 	func_warning "'-export-symbols' is ignored for archives"
  9206: 
  9207:       # Now set the variables for building old libraries.
  9208:       build_libtool_libs=no
  9209:       oldlibs=$output
  9210:       func_append objs "$old_deplibs"
  9211:       ;;
  9212: 
  9213:     lib)
  9214:       # Make sure we only generate libraries of the form 'libNAME.la'.
  9215:       case $outputname in
  9216:       lib*)
  9217: 	func_stripname 'lib' '.la' "$outputname"
  9218: 	name=$func_stripname_result
  9219: 	eval shared_ext=\"$shrext_cmds\"
  9220: 	eval libname=\"$libname_spec\"
  9221: 	;;
  9222:       *)
  9223: 	test no = "$module" \
  9224: 	  && func_fatal_help "libtool library '$output' must begin with 'lib'"
  9225: 
  9226: 	if test no != "$need_lib_prefix"; then
  9227: 	  # Add the "lib" prefix for modules if required
  9228: 	  func_stripname '' '.la' "$outputname"
  9229: 	  name=$func_stripname_result
  9230: 	  eval shared_ext=\"$shrext_cmds\"
  9231: 	  eval libname=\"$libname_spec\"
  9232: 	else
  9233: 	  func_stripname '' '.la' "$outputname"
  9234: 	  libname=$func_stripname_result
  9235: 	fi
  9236: 	;;
  9237:       esac
  9238: 
  9239:       if test -n "$objs"; then
  9240: 	if test pass_all != "$deplibs_check_method"; then
  9241: 	  func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
  9242: 	else
  9243: 	  echo
  9244: 	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
  9245: 	  $ECHO "*** objects $objs is not portable!"
  9246: 	  func_append libobjs " $objs"
  9247: 	fi
  9248:       fi
  9249: 
  9250:       test no = "$dlself" \
  9251: 	|| func_warning "'-dlopen self' is ignored for libtool libraries"
  9252: 
  9253:       set dummy $rpath
  9254:       shift
  9255:       test 1 -lt "$#" \
  9256: 	&& func_warning "ignoring multiple '-rpath's for a libtool library"
  9257: 
  9258:       install_libdir=$1
  9259: 
  9260:       oldlibs=
  9261:       if test -z "$rpath"; then
  9262: 	if test yes = "$build_libtool_libs"; then
  9263: 	  # Building a libtool convenience library.
  9264: 	  # Some compilers have problems with a '.al' extension so
  9265: 	  # convenience libraries should have the same extension an
  9266: 	  # archive normally would.
  9267: 	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
  9268: 	  build_libtool_libs=convenience
  9269: 	  build_old_libs=yes
  9270: 	fi
  9271: 
  9272: 	test -n "$vinfo" && \
  9273: 	  func_warning "'-version-info/-version-number' is ignored for convenience libraries"
  9274: 
  9275: 	test -n "$release" && \
  9276: 	  func_warning "'-release' is ignored for convenience libraries"
  9277:       else
  9278: 
  9279: 	# Parse the version information argument.
  9280: 	save_ifs=$IFS; IFS=:
  9281: 	set dummy $vinfo 0 0 0
  9282: 	shift
  9283: 	IFS=$save_ifs
  9284: 
  9285: 	test -n "$7" && \
  9286: 	  func_fatal_help "too many parameters to '-version-info'"
  9287: 
  9288: 	# convert absolute version numbers to libtool ages
  9289: 	# this retains compatibility with .la files and attempts
  9290: 	# to make the code below a bit more comprehensible
  9291: 
  9292: 	case $vinfo_number in
  9293: 	yes)
  9294: 	  number_major=$1
  9295: 	  number_minor=$2
  9296: 	  number_revision=$3
  9297: 	  #
  9298: 	  # There are really only two kinds -- those that
  9299: 	  # use the current revision as the major version
  9300: 	  # and those that subtract age and use age as
  9301: 	  # a minor version.  But, then there is irix
  9302: 	  # that has an extra 1 added just for fun
  9303: 	  #
  9304: 	  case $version_type in
  9305: 	  # correct linux to gnu/linux during the next big refactor
  9306: 	  darwin|freebsd-elf|linux|osf|windows|none)
  9307: 	    func_arith $number_major + $number_minor
  9308: 	    current=$func_arith_result
  9309: 	    age=$number_minor
  9310: 	    revision=$number_revision
  9311: 	    ;;
  9312: 	  freebsd-aout|qnx|sunos)
  9313: 	    current=$number_major
  9314: 	    revision=$number_minor
  9315: 	    age=0
  9316: 	    ;;
  9317: 	  irix|nonstopux)
  9318: 	    func_arith $number_major + $number_minor
  9319: 	    current=$func_arith_result
  9320: 	    age=$number_minor
  9321: 	    revision=$number_minor
  9322: 	    lt_irix_increment=no
  9323: 	    ;;
  9324: 	  esac
  9325: 	  ;;
  9326: 	no)
  9327: 	  current=$1
  9328: 	  revision=$2
  9329: 	  age=$3
  9330: 	  ;;
  9331: 	esac
  9332: 
  9333: 	# Check that each of the things are valid numbers.
  9334: 	case $current in
  9335: 	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]) ;;
  9336: 	*)
  9337: 	  func_error "CURRENT '$current' must be a nonnegative integer"
  9338: 	  func_fatal_error "'$vinfo' is not valid version information"
  9339: 	  ;;
  9340: 	esac
  9341: 
  9342: 	case $revision in
  9343: 	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]) ;;
  9344: 	*)
  9345: 	  func_error "REVISION '$revision' must be a nonnegative integer"
  9346: 	  func_fatal_error "'$vinfo' is not valid version information"
  9347: 	  ;;
  9348: 	esac
  9349: 
  9350: 	case $age in
  9351: 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
  9352: 	*)
  9353: 	  func_error "AGE '$age' must be a nonnegative integer"
  9354: 	  func_fatal_error "'$vinfo' is not valid version information"
  9355: 	  ;;
  9356: 	esac
  9357: 
  9358: 	if test "$age" -gt "$current"; then
  9359: 	  func_error "AGE '$age' is greater than the current interface number '$current'"
  9360: 	  func_fatal_error "'$vinfo' is not valid version information"
  9361: 	fi
  9362: 
  9363: 	# Calculate the version variables.
  9364: 	major=
  9365: 	versuffix=
  9366: 	verstring=
  9367: 	case $version_type in
  9368: 	none) ;;
  9369: 
  9370: 	darwin)
  9371: 	  # Like Linux, but with the current version available in
  9372: 	  # verstring for coding it into the library header
  9373: 	  func_arith $current - $age
  9374: 	  major=.$func_arith_result
  9375: 	  versuffix=$major.$age.$revision
  9376: 	  # Darwin ld doesn't like 0 for these options...
  9377: 	  func_arith $current + 1
  9378: 	  minor_current=$func_arith_result
  9379: 	  xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
  9380: 	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
  9381:           # On Darwin other compilers
  9382:           case $CC in
  9383:               nagfor*)
  9384:                   verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
  9385:                   ;;
  9386:               *)
  9387:                   verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
  9388:                   ;;
  9389:           esac
  9390: 	  ;;
  9391: 
  9392: 	freebsd-aout)
  9393: 	  major=.$current
  9394: 	  versuffix=.$current.$revision
  9395: 	  ;;
  9396: 
  9397: 	freebsd-elf)
  9398: 	  func_arith $current - $age
  9399: 	  major=.$func_arith_result
  9400: 	  versuffix=$major.$age.$revision
  9401: 	  ;;
  9402: 
  9403: 	irix | nonstopux)
  9404: 	  if test no = "$lt_irix_increment"; then
  9405: 	    func_arith $current - $age
  9406: 	  else
  9407: 	    func_arith $current - $age + 1
  9408: 	  fi
  9409: 	  major=$func_arith_result
  9410: 
  9411: 	  case $version_type in
  9412: 	    nonstopux) verstring_prefix=nonstopux ;;
  9413: 	    *)         verstring_prefix=sgi ;;
  9414: 	  esac
  9415: 	  verstring=$verstring_prefix$major.$revision
  9416: 
  9417: 	  # Add in all the interfaces that we are compatible with.
  9418: 	  loop=$revision
  9419: 	  while test 0 -ne "$loop"; do
  9420: 	    func_arith $revision - $loop
  9421: 	    iface=$func_arith_result
  9422: 	    func_arith $loop - 1
  9423: 	    loop=$func_arith_result
  9424: 	    verstring=$verstring_prefix$major.$iface:$verstring
  9425: 	  done
  9426: 
  9427: 	  # Before this point, $major must not contain '.'.
  9428: 	  major=.$major
  9429: 	  versuffix=$major.$revision
  9430: 	  ;;
  9431: 
  9432: 	linux) # correct to gnu/linux during the next big refactor
  9433: 	  func_arith $current - $age
  9434: 	  major=.$func_arith_result
  9435: 	  versuffix=$major.$age.$revision
  9436: 	  ;;
  9437: 
  9438: 	osf)
  9439: 	  func_arith $current - $age
  9440: 	  major=.$func_arith_result
  9441: 	  versuffix=.$current.$age.$revision
  9442: 	  verstring=$current.$age.$revision
  9443: 
  9444: 	  # Add in all the interfaces that we are compatible with.
  9445: 	  loop=$age
  9446: 	  while test 0 -ne "$loop"; do
  9447: 	    func_arith $current - $loop
  9448: 	    iface=$func_arith_result
  9449: 	    func_arith $loop - 1
  9450: 	    loop=$func_arith_result
  9451: 	    verstring=$verstring:$iface.0
  9452: 	  done
  9453: 
  9454: 	  # Make executables depend on our current version.
  9455: 	  func_append verstring ":$current.0"
  9456: 	  ;;
  9457: 
  9458: 	qnx)
  9459: 	  major=.$current
  9460: 	  versuffix=.$current
  9461: 	  ;;
  9462: 
  9463: 	sco)
  9464: 	  major=.$current
  9465: 	  versuffix=.$current
  9466: 	  ;;
  9467: 
  9468: 	sunos)
  9469: 	  major=.$current
  9470: 	  versuffix=.$current.$revision
  9471: 	  ;;
  9472: 
  9473: 	windows)
  9474: 	  # Use '-' rather than '.', since we only want one
  9475: 	  # extension on DOS 8.3 file systems.
  9476: 	  func_arith $current - $age
  9477: 	  major=$func_arith_result
  9478: 	  versuffix=-$major
  9479: 	  ;;
  9480: 
  9481: 	*)
  9482: 	  func_fatal_configuration "unknown library version type '$version_type'"
  9483: 	  ;;
  9484: 	esac
  9485: 
  9486: 	# Clear the version info if we defaulted, and they specified a release.
  9487: 	if test -z "$vinfo" && test -n "$release"; then
  9488: 	  major=
  9489: 	  case $version_type in
  9490: 	  darwin)
  9491: 	    # we can't check for "0.0" in archive_cmds due to quoting
  9492: 	    # problems, so we reset it completely
  9493: 	    verstring=
  9494: 	    ;;
  9495: 	  *)
  9496: 	    verstring=0.0
  9497: 	    ;;
  9498: 	  esac
  9499: 	  if test no = "$need_version"; then
  9500: 	    versuffix=
  9501: 	  else
  9502: 	    versuffix=.0.0
  9503: 	  fi
  9504: 	fi
  9505: 
  9506: 	# Remove version info from name if versioning should be avoided
  9507: 	if test yes,no = "$avoid_version,$need_version"; then
  9508: 	  major=
  9509: 	  versuffix=
  9510: 	  verstring=
  9511: 	fi
  9512: 
  9513: 	# Check to see if the archive will have undefined symbols.
  9514: 	if test yes = "$allow_undefined"; then
  9515: 	  if test unsupported = "$allow_undefined_flag"; then
  9516: 	    if test yes = "$build_old_libs"; then
  9517: 	      func_warning "undefined symbols not allowed in $host shared libraries; building static only"
  9518: 	      build_libtool_libs=no
  9519: 	    else
  9520: 	      func_fatal_error "can't build $host shared library unless -no-undefined is specified"
  9521: 	    fi
  9522: 	  fi
  9523: 	else
  9524: 	  # Don't allow undefined symbols.
  9525: 	  allow_undefined_flag=$no_undefined_flag
  9526: 	fi
  9527: 
  9528:       fi
  9529: 
  9530:       func_generate_dlsyms "$libname" "$libname" :
  9531:       func_append libobjs " $symfileobj"
  9532:       test " " = "$libobjs" && libobjs=
  9533: 
  9534:       if test relink != "$opt_mode"; then
  9535: 	# Remove our outputs, but don't remove object files since they
  9536: 	# may have been created when compiling PIC objects.
  9537: 	removelist=
  9538: 	tempremovelist=`$ECHO "$output_objdir/*"`
  9539: 	for p in $tempremovelist; do
  9540: 	  case $p in
  9541: 	    *.$objext | *.gcno)
  9542: 	       ;;
  9543: 	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
  9544: 	       if test -n "$precious_files_regex"; then
  9545: 		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
  9546: 		 then
  9547: 		   continue
  9548: 		 fi
  9549: 	       fi
  9550: 	       func_append removelist " $p"
  9551: 	       ;;
  9552: 	    *) ;;
  9553: 	  esac
  9554: 	done
  9555: 	test -n "$removelist" && \
  9556: 	  func_show_eval "${RM}r \$removelist"
  9557:       fi
  9558: 
  9559:       # Now set the variables for building old libraries.
  9560:       if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
  9561: 	func_append oldlibs " $output_objdir/$libname.$libext"
  9562: 
  9563: 	# Transform .lo files to .o files.
  9564: 	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
  9565:       fi
  9566: 
  9567:       # Eliminate all temporary directories.
  9568:       #for path in $notinst_path; do
  9569:       #	lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
  9570:       #	deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
  9571:       #	dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
  9572:       #done
  9573: 
  9574:       if test -n "$xrpath"; then
  9575: 	# If the user specified any rpath flags, then add them.
  9576: 	temp_xrpath=
  9577: 	for libdir in $xrpath; do
  9578: 	  func_replace_sysroot "$libdir"
  9579: 	  func_append temp_xrpath " -R$func_replace_sysroot_result"
  9580: 	  case "$finalize_rpath " in
  9581: 	  *" $libdir "*) ;;
  9582: 	  *) func_append finalize_rpath " $libdir" ;;
  9583: 	  esac
  9584: 	done
  9585: 	if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
  9586: 	  dependency_libs="$temp_xrpath $dependency_libs"
  9587: 	fi
  9588:       fi
  9589: 
  9590:       # Make sure dlfiles contains only unique files that won't be dlpreopened
  9591:       old_dlfiles=$dlfiles
  9592:       dlfiles=
  9593:       for lib in $old_dlfiles; do
  9594: 	case " $dlprefiles $dlfiles " in
  9595: 	*" $lib "*) ;;
  9596: 	*) func_append dlfiles " $lib" ;;
  9597: 	esac
  9598:       done
  9599: 
  9600:       # Make sure dlprefiles contains only unique files
  9601:       old_dlprefiles=$dlprefiles
  9602:       dlprefiles=
  9603:       for lib in $old_dlprefiles; do
  9604: 	case "$dlprefiles " in
  9605: 	*" $lib "*) ;;
  9606: 	*) func_append dlprefiles " $lib" ;;
  9607: 	esac
  9608:       done
  9609: 
  9610:       if test yes = "$build_libtool_libs"; then
  9611: 	if test -n "$rpath"; then
  9612: 	  case $host in
  9613: 	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
  9614: 	    # these systems don't actually have a c library (as such)!
  9615: 	    ;;
  9616: 	  *-*-rhapsody* | *-*-darwin1.[012])
  9617: 	    # Rhapsody C library is in the System framework
  9618: 	    func_append deplibs " System.ltframework"
  9619: 	    ;;
  9620: 	  *-*-netbsd*)
  9621: 	    # Don't link with libc until the a.out ld.so is fixed.
  9622: 	    ;;
  9623: 	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  9624: 	    # Do not include libc due to us having libc/libc_r.
  9625: 	    ;;
  9626: 	  *-*-sco3.2v5* | *-*-sco5v6*)
  9627: 	    # Causes problems with __ctype
  9628: 	    ;;
  9629: 	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  9630: 	    # Compiler inserts libc in the correct place for threads to work
  9631: 	    ;;
  9632: 	  *)
  9633: 	    # Add libc to deplibs on all other systems if necessary.
  9634: 	    if test yes = "$build_libtool_need_lc"; then
  9635: 	      func_append deplibs " -lc"
  9636: 	    fi
  9637: 	    ;;
  9638: 	  esac
  9639: 	fi
  9640: 
  9641: 	# Transform deplibs into only deplibs that can be linked in shared.
  9642: 	name_save=$name
  9643: 	libname_save=$libname
  9644: 	release_save=$release
  9645: 	versuffix_save=$versuffix
  9646: 	major_save=$major
  9647: 	# I'm not sure if I'm treating the release correctly.  I think
  9648: 	# release should show up in the -l (ie -lgmp5) so we don't want to
  9649: 	# add it in twice.  Is that correct?
  9650: 	release=
  9651: 	versuffix=
  9652: 	major=
  9653: 	newdeplibs=
  9654: 	droppeddeps=no
  9655: 	case $deplibs_check_method in
  9656: 	pass_all)
  9657: 	  # Don't check for shared/static.  Everything works.
  9658: 	  # This might be a little naive.  We might want to check
  9659: 	  # whether the library exists or not.  But this is on
  9660: 	  # osf3 & osf4 and I'm not really sure... Just
  9661: 	  # implementing what was already the behavior.
  9662: 	  newdeplibs=$deplibs
  9663: 	  ;;
  9664: 	test_compile)
  9665: 	  # This code stresses the "libraries are programs" paradigm to its
  9666: 	  # limits. Maybe even breaks it.  We compile a program, linking it
  9667: 	  # against the deplibs as a proxy for the library.  Then we can check
  9668: 	  # whether they linked in statically or dynamically with ldd.
  9669: 	  $opt_dry_run || $RM conftest.c
  9670: 	  cat > conftest.c <<EOF
  9671: 	  int main() { return 0; }
  9672: EOF
  9673: 	  $opt_dry_run || $RM conftest
  9674: 	  if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
  9675: 	    ldd_output=`ldd conftest`
  9676: 	    for i in $deplibs; do
  9677: 	      case $i in
  9678: 	      -l*)
  9679: 		func_stripname -l '' "$i"
  9680: 		name=$func_stripname_result
  9681: 		if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  9682: 		  case " $predeps $postdeps " in
  9683: 		  *" $i "*)
  9684: 		    func_append newdeplibs " $i"
  9685: 		    i=
  9686: 		    ;;
  9687: 		  esac
  9688: 		fi
  9689: 		if test -n "$i"; then
  9690: 		  libname=`eval "\\$ECHO \"$libname_spec\""`
  9691: 		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
  9692: 		  set dummy $deplib_matches; shift
  9693: 		  deplib_match=$1
  9694: 		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
  9695: 		    func_append newdeplibs " $i"
  9696: 		  else
  9697: 		    droppeddeps=yes
  9698: 		    echo
  9699: 		    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
  9700: 		    echo "*** I have the capability to make that library automatically link in when"
  9701: 		    echo "*** you link to this library.  But I can only do this if you have a"
  9702: 		    echo "*** shared version of the library, which I believe you do not have"
  9703: 		    echo "*** because a test_compile did reveal that the linker did not use it for"
  9704: 		    echo "*** its dynamic dependency list that programs get resolved with at runtime."
  9705: 		  fi
  9706: 		fi
  9707: 		;;
  9708: 	      *)
  9709: 		func_append newdeplibs " $i"
  9710: 		;;
  9711: 	      esac
  9712: 	    done
  9713: 	  else
  9714: 	    # Error occurred in the first compile.  Let's try to salvage
  9715: 	    # the situation: Compile a separate program for each library.
  9716: 	    for i in $deplibs; do
  9717: 	      case $i in
  9718: 	      -l*)
  9719: 		func_stripname -l '' "$i"
  9720: 		name=$func_stripname_result
  9721: 		$opt_dry_run || $RM conftest
  9722: 		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
  9723: 		  ldd_output=`ldd conftest`
  9724: 		  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  9725: 		    case " $predeps $postdeps " in
  9726: 		    *" $i "*)
  9727: 		      func_append newdeplibs " $i"
  9728: 		      i=
  9729: 		      ;;
  9730: 		    esac
  9731: 		  fi
  9732: 		  if test -n "$i"; then
  9733: 		    libname=`eval "\\$ECHO \"$libname_spec\""`
  9734: 		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
  9735: 		    set dummy $deplib_matches; shift
  9736: 		    deplib_match=$1
  9737: 		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
  9738: 		      func_append newdeplibs " $i"
  9739: 		    else
  9740: 		      droppeddeps=yes
  9741: 		      echo
  9742: 		      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
  9743: 		      echo "*** I have the capability to make that library automatically link in when"
  9744: 		      echo "*** you link to this library.  But I can only do this if you have a"
  9745: 		      echo "*** shared version of the library, which you do not appear to have"
  9746: 		      echo "*** because a test_compile did reveal that the linker did not use this one"
  9747: 		      echo "*** as a dynamic dependency that programs can get resolved with at runtime."
  9748: 		    fi
  9749: 		  fi
  9750: 		else
  9751: 		  droppeddeps=yes
  9752: 		  echo
  9753: 		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
  9754: 		  echo "*** make it link in!  You will probably need to install it or some"
  9755: 		  echo "*** library that it depends on before this library will be fully"
  9756: 		  echo "*** functional.  Installing it before continuing would be even better."
  9757: 		fi
  9758: 		;;
  9759: 	      *)
  9760: 		func_append newdeplibs " $i"
  9761: 		;;
  9762: 	      esac
  9763: 	    done
  9764: 	  fi
  9765: 	  ;;
  9766: 	file_magic*)
  9767: 	  set dummy $deplibs_check_method; shift
  9768: 	  file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  9769: 	  for a_deplib in $deplibs; do
  9770: 	    case $a_deplib in
  9771: 	    -l*)
  9772: 	      func_stripname -l '' "$a_deplib"
  9773: 	      name=$func_stripname_result
  9774: 	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  9775: 		case " $predeps $postdeps " in
  9776: 		*" $a_deplib "*)
  9777: 		  func_append newdeplibs " $a_deplib"
  9778: 		  a_deplib=
  9779: 		  ;;
  9780: 		esac
  9781: 	      fi
  9782: 	      if test -n "$a_deplib"; then
  9783: 		libname=`eval "\\$ECHO \"$libname_spec\""`
  9784: 		if test -n "$file_magic_glob"; then
  9785: 		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
  9786: 		else
  9787: 		  libnameglob=$libname
  9788: 		fi
  9789: 		test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
  9790: 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  9791: 		  if test yes = "$want_nocaseglob"; then
  9792: 		    shopt -s nocaseglob
  9793: 		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
  9794: 		    $nocaseglob
  9795: 		  else
  9796: 		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
  9797: 		  fi
  9798: 		  for potent_lib in $potential_libs; do
  9799: 		      # Follow soft links.
  9800: 		      if ls -lLd "$potent_lib" 2>/dev/null |
  9801: 			 $GREP " -> " >/dev/null; then
  9802: 			continue
  9803: 		      fi
  9804: 		      # The statement above tries to avoid entering an
  9805: 		      # endless loop below, in case of cyclic links.
  9806: 		      # We might still enter an endless loop, since a link
  9807: 		      # loop can be closed while we follow links,
  9808: 		      # but so what?
  9809: 		      potlib=$potent_lib
  9810: 		      while test -h "$potlib" 2>/dev/null; do
  9811: 			potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
  9812: 			case $potliblink in
  9813: 			[\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
  9814: 			*) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
  9815: 			esac
  9816: 		      done
  9817: 		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
  9818: 			 $SED -e 10q |
  9819: 			 $EGREP "$file_magic_regex" > /dev/null; then
  9820: 			func_append newdeplibs " $a_deplib"
  9821: 			a_deplib=
  9822: 			break 2
  9823: 		      fi
  9824: 		  done
  9825: 		done
  9826: 	      fi
  9827: 	      if test -n "$a_deplib"; then
  9828: 		droppeddeps=yes
  9829: 		echo
  9830: 		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
  9831: 		echo "*** I have the capability to make that library automatically link in when"
  9832: 		echo "*** you link to this library.  But I can only do this if you have a"
  9833: 		echo "*** shared version of the library, which you do not appear to have"
  9834: 		echo "*** because I did check the linker path looking for a file starting"
  9835: 		if test -z "$potlib"; then
  9836: 		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
  9837: 		else
  9838: 		  $ECHO "*** with $libname and none of the candidates passed a file format test"
  9839: 		  $ECHO "*** using a file magic. Last file checked: $potlib"
  9840: 		fi
  9841: 	      fi
  9842: 	      ;;
  9843: 	    *)
  9844: 	      # Add a -L argument.
  9845: 	      func_append newdeplibs " $a_deplib"
  9846: 	      ;;
  9847: 	    esac
  9848: 	  done # Gone through all deplibs.
  9849: 	  ;;
  9850: 	match_pattern*)
  9851: 	  set dummy $deplibs_check_method; shift
  9852: 	  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  9853: 	  for a_deplib in $deplibs; do
  9854: 	    case $a_deplib in
  9855: 	    -l*)
  9856: 	      func_stripname -l '' "$a_deplib"
  9857: 	      name=$func_stripname_result
  9858: 	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  9859: 		case " $predeps $postdeps " in
  9860: 		*" $a_deplib "*)
  9861: 		  func_append newdeplibs " $a_deplib"
  9862: 		  a_deplib=
  9863: 		  ;;
  9864: 		esac
  9865: 	      fi
  9866: 	      if test -n "$a_deplib"; then
  9867: 		libname=`eval "\\$ECHO \"$libname_spec\""`
  9868: 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  9869: 		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  9870: 		  for potent_lib in $potential_libs; do
  9871: 		    potlib=$potent_lib # see symlink-check above in file_magic test
  9872: 		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
  9873: 		       $EGREP "$match_pattern_regex" > /dev/null; then
  9874: 		      func_append newdeplibs " $a_deplib"
  9875: 		      a_deplib=
  9876: 		      break 2
  9877: 		    fi
  9878: 		  done
  9879: 		done
  9880: 	      fi
  9881: 	      if test -n "$a_deplib"; then
  9882: 		droppeddeps=yes
  9883: 		echo
  9884: 		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
  9885: 		echo "*** I have the capability to make that library automatically link in when"
  9886: 		echo "*** you link to this library.  But I can only do this if you have a"
  9887: 		echo "*** shared version of the library, which you do not appear to have"
  9888: 		echo "*** because I did check the linker path looking for a file starting"
  9889: 		if test -z "$potlib"; then
  9890: 		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
  9891: 		else
  9892: 		  $ECHO "*** with $libname and none of the candidates passed a file format test"
  9893: 		  $ECHO "*** using a regex pattern. Last file checked: $potlib"
  9894: 		fi
  9895: 	      fi
  9896: 	      ;;
  9897: 	    *)
  9898: 	      # Add a -L argument.
  9899: 	      func_append newdeplibs " $a_deplib"
  9900: 	      ;;
  9901: 	    esac
  9902: 	  done # Gone through all deplibs.
  9903: 	  ;;
  9904: 	none | unknown | *)
  9905: 	  newdeplibs=
  9906: 	  tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
  9907: 	  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  9908: 	    for i in $predeps $postdeps; do
  9909: 	      # can't use Xsed below, because $i might contain '/'
  9910: 	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
  9911: 	    done
  9912: 	  fi
  9913: 	  case $tmp_deplibs in
  9914: 	  *[!\	\ ]*)
  9915: 	    echo
  9916: 	    if test none = "$deplibs_check_method"; then
  9917: 	      echo "*** Warning: inter-library dependencies are not supported in this platform."
  9918: 	    else
  9919: 	      echo "*** Warning: inter-library dependencies are not known to be supported."
  9920: 	    fi
  9921: 	    echo "*** All declared inter-library dependencies are being dropped."
  9922: 	    droppeddeps=yes
  9923: 	    ;;
  9924: 	  esac
  9925: 	  ;;
  9926: 	esac
  9927: 	versuffix=$versuffix_save
  9928: 	major=$major_save
  9929: 	release=$release_save
  9930: 	libname=$libname_save
  9931: 	name=$name_save
  9932: 
  9933: 	case $host in
  9934: 	*-*-rhapsody* | *-*-darwin1.[012])
  9935: 	  # On Rhapsody replace the C library with the System framework
  9936: 	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
  9937: 	  ;;
  9938: 	esac
  9939: 
  9940: 	if test yes = "$droppeddeps"; then
  9941: 	  if test yes = "$module"; then
  9942: 	    echo
  9943: 	    echo "*** Warning: libtool could not satisfy all declared inter-library"
  9944: 	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
  9945: 	    echo "*** a static module, that should work as long as the dlopening"
  9946: 	    echo "*** application is linked with the -dlopen flag."
  9947: 	    if test -z "$global_symbol_pipe"; then
  9948: 	      echo
  9949: 	      echo "*** However, this would only work if libtool was able to extract symbol"
  9950: 	      echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
  9951: 	      echo "*** not find such a program.  So, this module is probably useless."
  9952: 	      echo "*** 'nm' from GNU binutils and a full rebuild may help."
  9953: 	    fi
  9954: 	    if test no = "$build_old_libs"; then
  9955: 	      oldlibs=$output_objdir/$libname.$libext
  9956: 	      build_libtool_libs=module
  9957: 	      build_old_libs=yes
  9958: 	    else
  9959: 	      build_libtool_libs=no
  9960: 	    fi
  9961: 	  else
  9962: 	    echo "*** The inter-library dependencies that have been dropped here will be"
  9963: 	    echo "*** automatically added whenever a program is linked with this library"
  9964: 	    echo "*** or is declared to -dlopen it."
  9965: 
  9966: 	    if test no = "$allow_undefined"; then
  9967: 	      echo
  9968: 	      echo "*** Since this library must not contain undefined symbols,"
  9969: 	      echo "*** because either the platform does not support them or"
  9970: 	      echo "*** it was explicitly requested with -no-undefined,"
  9971: 	      echo "*** libtool will only create a static version of it."
  9972: 	      if test no = "$build_old_libs"; then
  9973: 		oldlibs=$output_objdir/$libname.$libext
  9974: 		build_libtool_libs=module
  9975: 		build_old_libs=yes
  9976: 	      else
  9977: 		build_libtool_libs=no
  9978: 	      fi
  9979: 	    fi
  9980: 	  fi
  9981: 	fi
  9982: 	# Done checking deplibs!
  9983: 	deplibs=$newdeplibs
  9984:       fi
  9985:       # Time to change all our "foo.ltframework" stuff back to "-framework foo"
  9986:       case $host in
  9987: 	*-*-darwin*)
  9988: 	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  9989: 	  new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  9990: 	  deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  9991: 	  ;;
  9992:       esac
  9993: 
  9994:       # move library search paths that coincide with paths to not yet
  9995:       # installed libraries to the beginning of the library search list
  9996:       new_libs=
  9997:       for path in $notinst_path; do
  9998: 	case " $new_libs " in
  9999: 	*" -L$path/$objdir "*) ;;
 10000: 	*)
 10001: 	  case " $deplibs " in
 10002: 	  *" -L$path/$objdir "*)
 10003: 	    func_append new_libs " -L$path/$objdir" ;;
 10004: 	  esac
 10005: 	  ;;
 10006: 	esac
 10007:       done
 10008:       for deplib in $deplibs; do
 10009: 	case $deplib in
 10010: 	-L*)
 10011: 	  case " $new_libs " in
 10012: 	  *" $deplib "*) ;;
 10013: 	  *) func_append new_libs " $deplib" ;;
 10014: 	  esac
 10015: 	  ;;
 10016: 	*) func_append new_libs " $deplib" ;;
 10017: 	esac
 10018:       done
 10019:       deplibs=$new_libs
 10020: 
 10021:       # All the library-specific variables (install_libdir is set above).
 10022:       library_names=
 10023:       old_library=
 10024:       dlname=
 10025: 
 10026:       # Test again, we may have decided not to build it any more
 10027:       if test yes = "$build_libtool_libs"; then
 10028: 	# Remove $wl instances when linking with ld.
 10029: 	# FIXME: should test the right _cmds variable.
 10030: 	case $archive_cmds in
 10031: 	  *\$LD\ *) wl= ;;
 10032:         esac
 10033: 	if test yes = "$hardcode_into_libs"; then
 10034: 	  # Hardcode the library paths
 10035: 	  hardcode_libdirs=
 10036: 	  dep_rpath=
 10037: 	  rpath=$finalize_rpath
 10038: 	  test relink = "$opt_mode" || rpath=$compile_rpath$rpath
 10039: 	  for libdir in $rpath; do
 10040: 	    if test -n "$hardcode_libdir_flag_spec"; then
 10041: 	      if test -n "$hardcode_libdir_separator"; then
 10042: 		func_replace_sysroot "$libdir"
 10043: 		libdir=$func_replace_sysroot_result
 10044: 		if test -z "$hardcode_libdirs"; then
 10045: 		  hardcode_libdirs=$libdir
 10046: 		else
 10047: 		  # Just accumulate the unique libdirs.
 10048: 		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
 10049: 		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
 10050: 		    ;;
 10051: 		  *)
 10052: 		    func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
 10053: 		    ;;
 10054: 		  esac
 10055: 		fi
 10056: 	      else
 10057: 		eval flag=\"$hardcode_libdir_flag_spec\"
 10058: 		func_append dep_rpath " $flag"
 10059: 	      fi
 10060: 	    elif test -n "$runpath_var"; then
 10061: 	      case "$perm_rpath " in
 10062: 	      *" $libdir "*) ;;
 10063: 	      *) func_append perm_rpath " $libdir" ;;
 10064: 	      esac
 10065: 	    fi
 10066: 	  done
 10067: 	  # Substitute the hardcoded libdirs into the rpath.
 10068: 	  if test -n "$hardcode_libdir_separator" &&
 10069: 	     test -n "$hardcode_libdirs"; then
 10070: 	    libdir=$hardcode_libdirs
 10071: 	    eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
 10072: 	  fi
 10073: 	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
 10074: 	    # We should set the runpath_var.
 10075: 	    rpath=
 10076: 	    for dir in $perm_rpath; do
 10077: 	      func_append rpath "$dir:"
 10078: 	    done
 10079: 	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
 10080: 	  fi
 10081: 	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
 10082: 	fi
 10083: 
 10084: 	shlibpath=$finalize_shlibpath
 10085: 	test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
 10086: 	if test -n "$shlibpath"; then
 10087: 	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
 10088: 	fi
 10089: 
 10090: 	# Get the real and link names of the library.
 10091: 	eval shared_ext=\"$shrext_cmds\"
 10092: 	eval library_names=\"$library_names_spec\"
 10093: 	set dummy $library_names
 10094: 	shift
 10095: 	realname=$1
 10096: 	shift
 10097: 
 10098: 	if test -n "$soname_spec"; then
 10099: 	  eval soname=\"$soname_spec\"
 10100: 	else
 10101: 	  soname=$realname
 10102: 	fi
 10103: 	if test -z "$dlname"; then
 10104: 	  dlname=$soname
 10105: 	fi
 10106: 
 10107: 	lib=$output_objdir/$realname
 10108: 	linknames=
 10109: 	for link
 10110: 	do
 10111: 	  func_append linknames " $link"
 10112: 	done
 10113: 
 10114: 	# Use standard objects if they are pic
 10115: 	test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
 10116: 	test "X$libobjs" = "X " && libobjs=
 10117: 
 10118: 	delfiles=
 10119: 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
 10120: 	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
 10121: 	  export_symbols=$output_objdir/$libname.uexp
 10122: 	  func_append delfiles " $export_symbols"
 10123: 	fi
 10124: 
 10125: 	orig_export_symbols=
 10126: 	case $host_os in
 10127: 	cygwin* | mingw* | cegcc*)
 10128: 	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
 10129: 	    # exporting using user supplied symfile
 10130: 	    func_dll_def_p "$export_symbols" || {
 10131: 	      # and it's NOT already a .def file. Must figure out
 10132: 	      # which of the given symbols are data symbols and tag
 10133: 	      # them as such. So, trigger use of export_symbols_cmds.
 10134: 	      # export_symbols gets reassigned inside the "prepare
 10135: 	      # the list of exported symbols" if statement, so the
 10136: 	      # include_expsyms logic still works.
 10137: 	      orig_export_symbols=$export_symbols
 10138: 	      export_symbols=
 10139: 	      always_export_symbols=yes
 10140: 	    }
 10141: 	  fi
 10142: 	  ;;
 10143: 	esac
 10144: 
 10145: 	# Prepare the list of exported symbols
 10146: 	if test -z "$export_symbols"; then
 10147: 	  if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
 10148: 	    func_verbose "generating symbol list for '$libname.la'"
 10149: 	    export_symbols=$output_objdir/$libname.exp
 10150: 	    $opt_dry_run || $RM $export_symbols
 10151: 	    cmds=$export_symbols_cmds
 10152: 	    save_ifs=$IFS; IFS='~'
 10153: 	    for cmd1 in $cmds; do
 10154: 	      IFS=$save_ifs
 10155: 	      # Take the normal branch if the nm_file_list_spec branch
 10156: 	      # doesn't work or if tool conversion is not needed.
 10157: 	      case $nm_file_list_spec~$to_tool_file_cmd in
 10158: 		*~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
 10159: 		  try_normal_branch=yes
 10160: 		  eval cmd=\"$cmd1\"
 10161: 		  func_len " $cmd"
 10162: 		  len=$func_len_result
 10163: 		  ;;
 10164: 		*)
 10165: 		  try_normal_branch=no
 10166: 		  ;;
 10167: 	      esac
 10168: 	      if test yes = "$try_normal_branch" \
 10169: 		 && { test "$len" -lt "$max_cmd_len" \
 10170: 		      || test "$max_cmd_len" -le -1; }
 10171: 	      then
 10172: 		func_show_eval "$cmd" 'exit $?'
 10173: 		skipped_export=false
 10174: 	      elif test -n "$nm_file_list_spec"; then
 10175: 		func_basename "$output"
 10176: 		output_la=$func_basename_result
 10177: 		save_libobjs=$libobjs
 10178: 		save_output=$output
 10179: 		output=$output_objdir/$output_la.nm
 10180: 		func_to_tool_file "$output"
 10181: 		libobjs=$nm_file_list_spec$func_to_tool_file_result
 10182: 		func_append delfiles " $output"
 10183: 		func_verbose "creating $NM input file list: $output"
 10184: 		for obj in $save_libobjs; do
 10185: 		  func_to_tool_file "$obj"
 10186: 		  $ECHO "$func_to_tool_file_result"
 10187: 		done > "$output"
 10188: 		eval cmd=\"$cmd1\"
 10189: 		func_show_eval "$cmd" 'exit $?'
 10190: 		output=$save_output
 10191: 		libobjs=$save_libobjs
 10192: 		skipped_export=false
 10193: 	      else
 10194: 		# The command line is too long to execute in one step.
 10195: 		func_verbose "using reloadable object file for export list..."
 10196: 		skipped_export=:
 10197: 		# Break out early, otherwise skipped_export may be
 10198: 		# set to false by a later but shorter cmd.
 10199: 		break
 10200: 	      fi
 10201: 	    done
 10202: 	    IFS=$save_ifs
 10203: 	    if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
 10204: 	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
 10205: 	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
 10206: 	    fi
 10207: 	  fi
 10208: 	fi
 10209: 
 10210: 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
 10211: 	  tmp_export_symbols=$export_symbols
 10212: 	  test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
 10213: 	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
 10214: 	fi
 10215: 
 10216: 	if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
 10217: 	  # The given exports_symbols file has to be filtered, so filter it.
 10218: 	  func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
 10219: 	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
 10220: 	  # 's' commands, which not all seds can handle. GNU sed should be fine
 10221: 	  # though. Also, the filter scales superlinearly with the number of
 10222: 	  # global variables. join(1) would be nice here, but unfortunately
 10223: 	  # isn't a blessed tool.
 10224: 	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
 10225: 	  func_append delfiles " $export_symbols $output_objdir/$libname.filter"
 10226: 	  export_symbols=$output_objdir/$libname.def
 10227: 	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
 10228: 	fi
 10229: 
 10230: 	tmp_deplibs=
 10231: 	for test_deplib in $deplibs; do
 10232: 	  case " $convenience " in
 10233: 	  *" $test_deplib "*) ;;
 10234: 	  *)
 10235: 	    func_append tmp_deplibs " $test_deplib"
 10236: 	    ;;
 10237: 	  esac
 10238: 	done
 10239: 	deplibs=$tmp_deplibs
 10240: 
 10241: 	if test -n "$convenience"; then
 10242: 	  if test -n "$whole_archive_flag_spec" &&
 10243: 	    test yes = "$compiler_needs_object" &&
 10244: 	    test -z "$libobjs"; then
 10245: 	    # extract the archives, so we have objects to list.
 10246: 	    # TODO: could optimize this to just extract one archive.
 10247: 	    whole_archive_flag_spec=
 10248: 	  fi
 10249: 	  if test -n "$whole_archive_flag_spec"; then
 10250: 	    save_libobjs=$libobjs
 10251: 	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
 10252: 	    test "X$libobjs" = "X " && libobjs=
 10253: 	  else
 10254: 	    gentop=$output_objdir/${outputname}x
 10255: 	    func_append generated " $gentop"
 10256: 
 10257: 	    func_extract_archives $gentop $convenience
 10258: 	    func_append libobjs " $func_extract_archives_result"
 10259: 	    test "X$libobjs" = "X " && libobjs=
 10260: 	  fi
 10261: 	fi
 10262: 
 10263: 	if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
 10264: 	  eval flag=\"$thread_safe_flag_spec\"
 10265: 	  func_append linker_flags " $flag"
 10266: 	fi
 10267: 
 10268: 	# Make a backup of the uninstalled library when relinking
 10269: 	if test relink = "$opt_mode"; then
 10270: 	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
 10271: 	fi
 10272: 
 10273: 	# Do each of the archive commands.
 10274: 	if test yes = "$module" && test -n "$module_cmds"; then
 10275: 	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
 10276: 	    eval test_cmds=\"$module_expsym_cmds\"
 10277: 	    cmds=$module_expsym_cmds
 10278: 	  else
 10279: 	    eval test_cmds=\"$module_cmds\"
 10280: 	    cmds=$module_cmds
 10281: 	  fi
 10282: 	else
 10283: 	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
 10284: 	    eval test_cmds=\"$archive_expsym_cmds\"
 10285: 	    cmds=$archive_expsym_cmds
 10286: 	  else
 10287: 	    eval test_cmds=\"$archive_cmds\"
 10288: 	    cmds=$archive_cmds
 10289: 	  fi
 10290: 	fi
 10291: 
 10292: 	if test : != "$skipped_export" &&
 10293: 	   func_len " $test_cmds" &&
 10294: 	   len=$func_len_result &&
 10295: 	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
 10296: 	  :
 10297: 	else
 10298: 	  # The command line is too long to link in one step, link piecewise
 10299: 	  # or, if using GNU ld and skipped_export is not :, use a linker
 10300: 	  # script.
 10301: 
 10302: 	  # Save the value of $output and $libobjs because we want to
 10303: 	  # use them later.  If we have whole_archive_flag_spec, we
 10304: 	  # want to use save_libobjs as it was before
 10305: 	  # whole_archive_flag_spec was expanded, because we can't
 10306: 	  # assume the linker understands whole_archive_flag_spec.
 10307: 	  # This may have to be revisited, in case too many
 10308: 	  # convenience libraries get linked in and end up exceeding
 10309: 	  # the spec.
 10310: 	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
 10311: 	    save_libobjs=$libobjs
 10312: 	  fi
 10313: 	  save_output=$output
 10314: 	  func_basename "$output"
 10315: 	  output_la=$func_basename_result
 10316: 
 10317: 	  # Clear the reloadable object creation command queue and
 10318: 	  # initialize k to one.
 10319: 	  test_cmds=
 10320: 	  concat_cmds=
 10321: 	  objlist=
 10322: 	  last_robj=
 10323: 	  k=1
 10324: 
 10325: 	  if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
 10326: 	    output=$output_objdir/$output_la.lnkscript
 10327: 	    func_verbose "creating GNU ld script: $output"
 10328: 	    echo 'INPUT (' > $output
 10329: 	    for obj in $save_libobjs
 10330: 	    do
 10331: 	      func_to_tool_file "$obj"
 10332: 	      $ECHO "$func_to_tool_file_result" >> $output
 10333: 	    done
 10334: 	    echo ')' >> $output
 10335: 	    func_append delfiles " $output"
 10336: 	    func_to_tool_file "$output"
 10337: 	    output=$func_to_tool_file_result
 10338: 	  elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
 10339: 	    output=$output_objdir/$output_la.lnk
 10340: 	    func_verbose "creating linker input file list: $output"
 10341: 	    : > $output
 10342: 	    set x $save_libobjs
 10343: 	    shift
 10344: 	    firstobj=
 10345: 	    if test yes = "$compiler_needs_object"; then
 10346: 	      firstobj="$1 "
 10347: 	      shift
 10348: 	    fi
 10349: 	    for obj
 10350: 	    do
 10351: 	      func_to_tool_file "$obj"
 10352: 	      $ECHO "$func_to_tool_file_result" >> $output
 10353: 	    done
 10354: 	    func_append delfiles " $output"
 10355: 	    func_to_tool_file "$output"
 10356: 	    output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
 10357: 	  else
 10358: 	    if test -n "$save_libobjs"; then
 10359: 	      func_verbose "creating reloadable object files..."
 10360: 	      output=$output_objdir/$output_la-$k.$objext
 10361: 	      eval test_cmds=\"$reload_cmds\"
 10362: 	      func_len " $test_cmds"
 10363: 	      len0=$func_len_result
 10364: 	      len=$len0
 10365: 
 10366: 	      # Loop over the list of objects to be linked.
 10367: 	      for obj in $save_libobjs
 10368: 	      do
 10369: 		func_len " $obj"
 10370: 		func_arith $len + $func_len_result
 10371: 		len=$func_arith_result
 10372: 		if test -z "$objlist" ||
 10373: 		   test "$len" -lt "$max_cmd_len"; then
 10374: 		  func_append objlist " $obj"
 10375: 		else
 10376: 		  # The command $test_cmds is almost too long, add a
 10377: 		  # command to the queue.
 10378: 		  if test 1 -eq "$k"; then
 10379: 		    # The first file doesn't have a previous command to add.
 10380: 		    reload_objs=$objlist
 10381: 		    eval concat_cmds=\"$reload_cmds\"
 10382: 		  else
 10383: 		    # All subsequent reloadable object files will link in
 10384: 		    # the last one created.
 10385: 		    reload_objs="$objlist $last_robj"
 10386: 		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
 10387: 		  fi
 10388: 		  last_robj=$output_objdir/$output_la-$k.$objext
 10389: 		  func_arith $k + 1
 10390: 		  k=$func_arith_result
 10391: 		  output=$output_objdir/$output_la-$k.$objext
 10392: 		  objlist=" $obj"
 10393: 		  func_len " $last_robj"
 10394: 		  func_arith $len0 + $func_len_result
 10395: 		  len=$func_arith_result
 10396: 		fi
 10397: 	      done
 10398: 	      # Handle the remaining objects by creating one last
 10399: 	      # reloadable object file.  All subsequent reloadable object
 10400: 	      # files will link in the last one created.
 10401: 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
 10402: 	      reload_objs="$objlist $last_robj"
 10403: 	      eval concat_cmds=\"\$concat_cmds$reload_cmds\"
 10404: 	      if test -n "$last_robj"; then
 10405: 	        eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
 10406: 	      fi
 10407: 	      func_append delfiles " $output"
 10408: 
 10409: 	    else
 10410: 	      output=
 10411: 	    fi
 10412: 
 10413: 	    ${skipped_export-false} && {
 10414: 	      func_verbose "generating symbol list for '$libname.la'"
 10415: 	      export_symbols=$output_objdir/$libname.exp
 10416: 	      $opt_dry_run || $RM $export_symbols
 10417: 	      libobjs=$output
 10418: 	      # Append the command to create the export file.
 10419: 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
 10420: 	      eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
 10421: 	      if test -n "$last_robj"; then
 10422: 		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
 10423: 	      fi
 10424: 	    }
 10425: 
 10426: 	    test -n "$save_libobjs" &&
 10427: 	      func_verbose "creating a temporary reloadable object file: $output"
 10428: 
 10429: 	    # Loop through the commands generated above and execute them.
 10430: 	    save_ifs=$IFS; IFS='~'
 10431: 	    for cmd in $concat_cmds; do
 10432: 	      IFS=$save_ifs
 10433: 	      $opt_quiet || {
 10434: 		  func_quote_for_expand "$cmd"
 10435: 		  eval "func_echo $func_quote_for_expand_result"
 10436: 	      }
 10437: 	      $opt_dry_run || eval "$cmd" || {
 10438: 		lt_exit=$?
 10439: 
 10440: 		# Restore the uninstalled library and exit
 10441: 		if test relink = "$opt_mode"; then
 10442: 		  ( cd "$output_objdir" && \
 10443: 		    $RM "${realname}T" && \
 10444: 		    $MV "${realname}U" "$realname" )
 10445: 		fi
 10446: 
 10447: 		exit $lt_exit
 10448: 	      }
 10449: 	    done
 10450: 	    IFS=$save_ifs
 10451: 
 10452: 	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
 10453: 	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
 10454: 	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
 10455: 	    fi
 10456: 	  fi
 10457: 
 10458:           ${skipped_export-false} && {
 10459: 	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
 10460: 	      tmp_export_symbols=$export_symbols
 10461: 	      test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
 10462: 	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
 10463: 	    fi
 10464: 
 10465: 	    if test -n "$orig_export_symbols"; then
 10466: 	      # The given exports_symbols file has to be filtered, so filter it.
 10467: 	      func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
 10468: 	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
 10469: 	      # 's' commands, which not all seds can handle. GNU sed should be fine
 10470: 	      # though. Also, the filter scales superlinearly with the number of
 10471: 	      # global variables. join(1) would be nice here, but unfortunately
 10472: 	      # isn't a blessed tool.
 10473: 	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
 10474: 	      func_append delfiles " $export_symbols $output_objdir/$libname.filter"
 10475: 	      export_symbols=$output_objdir/$libname.def
 10476: 	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
 10477: 	    fi
 10478: 	  }
 10479: 
 10480: 	  libobjs=$output
 10481: 	  # Restore the value of output.
 10482: 	  output=$save_output
 10483: 
 10484: 	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
 10485: 	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
 10486: 	    test "X$libobjs" = "X " && libobjs=
 10487: 	  fi
 10488: 	  # Expand the library linking commands again to reset the
 10489: 	  # value of $libobjs for piecewise linking.
 10490: 
 10491: 	  # Do each of the archive commands.
 10492: 	  if test yes = "$module" && test -n "$module_cmds"; then
 10493: 	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
 10494: 	      cmds=$module_expsym_cmds
 10495: 	    else
 10496: 	      cmds=$module_cmds
 10497: 	    fi
 10498: 	  else
 10499: 	    if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
 10500: 	      cmds=$archive_expsym_cmds
 10501: 	    else
 10502: 	      cmds=$archive_cmds
 10503: 	    fi
 10504: 	  fi
 10505: 	fi
 10506: 
 10507: 	if test -n "$delfiles"; then
 10508: 	  # Append the command to remove temporary files to $cmds.
 10509: 	  eval cmds=\"\$cmds~\$RM $delfiles\"
 10510: 	fi
 10511: 
 10512: 	# Add any objects from preloaded convenience libraries
 10513: 	if test -n "$dlprefiles"; then
 10514: 	  gentop=$output_objdir/${outputname}x
 10515: 	  func_append generated " $gentop"
 10516: 
 10517: 	  func_extract_archives $gentop $dlprefiles
 10518: 	  func_append libobjs " $func_extract_archives_result"
 10519: 	  test "X$libobjs" = "X " && libobjs=
 10520: 	fi
 10521: 
 10522: 	save_ifs=$IFS; IFS='~'
 10523: 	for cmd in $cmds; do
 10524: 	  IFS=$sp$nl
 10525: 	  eval cmd=\"$cmd\"
 10526: 	  IFS=$save_ifs
 10527: 	  $opt_quiet || {
 10528: 	    func_quote_for_expand "$cmd"
 10529: 	    eval "func_echo $func_quote_for_expand_result"
 10530: 	  }
 10531: 	  $opt_dry_run || eval "$cmd" || {
 10532: 	    lt_exit=$?
 10533: 
 10534: 	    # Restore the uninstalled library and exit
 10535: 	    if test relink = "$opt_mode"; then
 10536: 	      ( cd "$output_objdir" && \
 10537: 	        $RM "${realname}T" && \
 10538: 		$MV "${realname}U" "$realname" )
 10539: 	    fi
 10540: 
 10541: 	    exit $lt_exit
 10542: 	  }
 10543: 	done
 10544: 	IFS=$save_ifs
 10545: 
 10546: 	# Restore the uninstalled library and exit
 10547: 	if test relink = "$opt_mode"; then
 10548: 	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
 10549: 
 10550: 	  if test -n "$convenience"; then
 10551: 	    if test -z "$whole_archive_flag_spec"; then
 10552: 	      func_show_eval '${RM}r "$gentop"'
 10553: 	    fi
 10554: 	  fi
 10555: 
 10556: 	  exit $EXIT_SUCCESS
 10557: 	fi
 10558: 
 10559: 	# Create links to the real library.
 10560: 	for linkname in $linknames; do
 10561: 	  if test "$realname" != "$linkname"; then
 10562: 	    func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
 10563: 	  fi
 10564: 	done
 10565: 
 10566: 	# If -module or -export-dynamic was specified, set the dlname.
 10567: 	if test yes = "$module" || test yes = "$export_dynamic"; then
 10568: 	  # On all known operating systems, these are identical.
 10569: 	  dlname=$soname
 10570: 	fi
 10571:       fi
 10572:       ;;
 10573: 
 10574:     obj)
 10575:       if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
 10576: 	func_warning "'-dlopen' is ignored for objects"
 10577:       fi
 10578: 
 10579:       case " $deplibs" in
 10580:       *\ -l* | *\ -L*)
 10581: 	func_warning "'-l' and '-L' are ignored for objects" ;;
 10582:       esac
 10583: 
 10584:       test -n "$rpath" && \
 10585: 	func_warning "'-rpath' is ignored for objects"
 10586: 
 10587:       test -n "$xrpath" && \
 10588: 	func_warning "'-R' is ignored for objects"
 10589: 
 10590:       test -n "$vinfo" && \
 10591: 	func_warning "'-version-info' is ignored for objects"
 10592: 
 10593:       test -n "$release" && \
 10594: 	func_warning "'-release' is ignored for objects"
 10595: 
 10596:       case $output in
 10597:       *.lo)
 10598: 	test -n "$objs$old_deplibs" && \
 10599: 	  func_fatal_error "cannot build library object '$output' from non-libtool objects"
 10600: 
 10601: 	libobj=$output
 10602: 	func_lo2o "$libobj"
 10603: 	obj=$func_lo2o_result
 10604: 	;;
 10605:       *)
 10606: 	libobj=
 10607: 	obj=$output
 10608: 	;;
 10609:       esac
 10610: 
 10611:       # Delete the old objects.
 10612:       $opt_dry_run || $RM $obj $libobj
 10613: 
 10614:       # Objects from convenience libraries.  This assumes
 10615:       # single-version convenience libraries.  Whenever we create
 10616:       # different ones for PIC/non-PIC, this we'll have to duplicate
 10617:       # the extraction.
 10618:       reload_conv_objs=
 10619:       gentop=
 10620:       # if reload_cmds runs $LD directly, get rid of -Wl from
 10621:       # whole_archive_flag_spec and hope we can get by with turning comma
 10622:       # into space.
 10623:       case $reload_cmds in
 10624:         *\$LD[\ \$]*) wl= ;;
 10625:       esac
 10626:       if test -n "$convenience"; then
 10627: 	if test -n "$whole_archive_flag_spec"; then
 10628: 	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
 10629: 	  test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
 10630: 	  reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
 10631: 	else
 10632: 	  gentop=$output_objdir/${obj}x
 10633: 	  func_append generated " $gentop"
 10634: 
 10635: 	  func_extract_archives $gentop $convenience
 10636: 	  reload_conv_objs="$reload_objs $func_extract_archives_result"
 10637: 	fi
 10638:       fi
 10639: 
 10640:       # If we're not building shared, we need to use non_pic_objs
 10641:       test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
 10642: 
 10643:       # Create the old-style object.
 10644:       reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
 10645: 
 10646:       output=$obj
 10647:       func_execute_cmds "$reload_cmds" 'exit $?'
 10648: 
 10649:       # Exit if we aren't doing a library object file.
 10650:       if test -z "$libobj"; then
 10651: 	if test -n "$gentop"; then
 10652: 	  func_show_eval '${RM}r "$gentop"'
 10653: 	fi
 10654: 
 10655: 	exit $EXIT_SUCCESS
 10656:       fi
 10657: 
 10658:       test yes = "$build_libtool_libs" || {
 10659: 	if test -n "$gentop"; then
 10660: 	  func_show_eval '${RM}r "$gentop"'
 10661: 	fi
 10662: 
 10663: 	# Create an invalid libtool object if no PIC, so that we don't
 10664: 	# accidentally link it into a program.
 10665: 	# $show "echo timestamp > $libobj"
 10666: 	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
 10667: 	exit $EXIT_SUCCESS
 10668:       }
 10669: 
 10670:       if test -n "$pic_flag" || test default != "$pic_mode"; then
 10671: 	# Only do commands if we really have different PIC objects.
 10672: 	reload_objs="$libobjs $reload_conv_objs"
 10673: 	output=$libobj
 10674: 	func_execute_cmds "$reload_cmds" 'exit $?'
 10675:       fi
 10676: 
 10677:       if test -n "$gentop"; then
 10678: 	func_show_eval '${RM}r "$gentop"'
 10679:       fi
 10680: 
 10681:       exit $EXIT_SUCCESS
 10682:       ;;
 10683: 
 10684:     prog)
 10685:       case $host in
 10686: 	*cygwin*) func_stripname '' '.exe' "$output"
 10687: 	          output=$func_stripname_result.exe;;
 10688:       esac
 10689:       test -n "$vinfo" && \
 10690: 	func_warning "'-version-info' is ignored for programs"
 10691: 
 10692:       test -n "$release" && \
 10693: 	func_warning "'-release' is ignored for programs"
 10694: 
 10695:       $preload \
 10696: 	&& test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
 10697: 	&& func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
 10698: 
 10699:       case $host in
 10700:       *-*-rhapsody* | *-*-darwin1.[012])
 10701: 	# On Rhapsody replace the C library is the System framework
 10702: 	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
 10703: 	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
 10704: 	;;
 10705:       esac
 10706: 
 10707:       case $host in
 10708:       *-*-darwin*)
 10709: 	# Don't allow lazy linking, it breaks C++ global constructors
 10710: 	# But is supposedly fixed on 10.4 or later (yay!).
 10711: 	if test CXX = "$tagname"; then
 10712: 	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
 10713: 	    10.[0123])
 10714: 	      func_append compile_command " $wl-bind_at_load"
 10715: 	      func_append finalize_command " $wl-bind_at_load"
 10716: 	    ;;
 10717: 	  esac
 10718: 	fi
 10719: 	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
 10720: 	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 10721: 	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 10722: 	;;
 10723:       esac
 10724: 
 10725: 
 10726:       # move library search paths that coincide with paths to not yet
 10727:       # installed libraries to the beginning of the library search list
 10728:       new_libs=
 10729:       for path in $notinst_path; do
 10730: 	case " $new_libs " in
 10731: 	*" -L$path/$objdir "*) ;;
 10732: 	*)
 10733: 	  case " $compile_deplibs " in
 10734: 	  *" -L$path/$objdir "*)
 10735: 	    func_append new_libs " -L$path/$objdir" ;;
 10736: 	  esac
 10737: 	  ;;
 10738: 	esac
 10739:       done
 10740:       for deplib in $compile_deplibs; do
 10741: 	case $deplib in
 10742: 	-L*)
 10743: 	  case " $new_libs " in
 10744: 	  *" $deplib "*) ;;
 10745: 	  *) func_append new_libs " $deplib" ;;
 10746: 	  esac
 10747: 	  ;;
 10748: 	*) func_append new_libs " $deplib" ;;
 10749: 	esac
 10750:       done
 10751:       compile_deplibs=$new_libs
 10752: 
 10753: 
 10754:       func_append compile_command " $compile_deplibs"
 10755:       func_append finalize_command " $finalize_deplibs"
 10756: 
 10757:       if test -n "$rpath$xrpath"; then
 10758: 	# If the user specified any rpath flags, then add them.
 10759: 	for libdir in $rpath $xrpath; do
 10760: 	  # This is the magic to use -rpath.
 10761: 	  case "$finalize_rpath " in
 10762: 	  *" $libdir "*) ;;
 10763: 	  *) func_append finalize_rpath " $libdir" ;;
 10764: 	  esac
 10765: 	done
 10766:       fi
 10767: 
 10768:       # Now hardcode the library paths
 10769:       rpath=
 10770:       hardcode_libdirs=
 10771:       for libdir in $compile_rpath $finalize_rpath; do
 10772: 	if test -n "$hardcode_libdir_flag_spec"; then
 10773: 	  if test -n "$hardcode_libdir_separator"; then
 10774: 	    if test -z "$hardcode_libdirs"; then
 10775: 	      hardcode_libdirs=$libdir
 10776: 	    else
 10777: 	      # Just accumulate the unique libdirs.
 10778: 	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
 10779: 	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
 10780: 		;;
 10781: 	      *)
 10782: 		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
 10783: 		;;
 10784: 	      esac
 10785: 	    fi
 10786: 	  else
 10787: 	    eval flag=\"$hardcode_libdir_flag_spec\"
 10788: 	    func_append rpath " $flag"
 10789: 	  fi
 10790: 	elif test -n "$runpath_var"; then
 10791: 	  case "$perm_rpath " in
 10792: 	  *" $libdir "*) ;;
 10793: 	  *) func_append perm_rpath " $libdir" ;;
 10794: 	  esac
 10795: 	fi
 10796: 	case $host in
 10797: 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
 10798: 	  testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
 10799: 	  case :$dllsearchpath: in
 10800: 	  *":$libdir:"*) ;;
 10801: 	  ::) dllsearchpath=$libdir;;
 10802: 	  *) func_append dllsearchpath ":$libdir";;
 10803: 	  esac
 10804: 	  case :$dllsearchpath: in
 10805: 	  *":$testbindir:"*) ;;
 10806: 	  ::) dllsearchpath=$testbindir;;
 10807: 	  *) func_append dllsearchpath ":$testbindir";;
 10808: 	  esac
 10809: 	  ;;
 10810: 	esac
 10811:       done
 10812:       # Substitute the hardcoded libdirs into the rpath.
 10813:       if test -n "$hardcode_libdir_separator" &&
 10814: 	 test -n "$hardcode_libdirs"; then
 10815: 	libdir=$hardcode_libdirs
 10816: 	eval rpath=\" $hardcode_libdir_flag_spec\"
 10817:       fi
 10818:       compile_rpath=$rpath
 10819: 
 10820:       rpath=
 10821:       hardcode_libdirs=
 10822:       for libdir in $finalize_rpath; do
 10823: 	if test -n "$hardcode_libdir_flag_spec"; then
 10824: 	  if test -n "$hardcode_libdir_separator"; then
 10825: 	    if test -z "$hardcode_libdirs"; then
 10826: 	      hardcode_libdirs=$libdir
 10827: 	    else
 10828: 	      # Just accumulate the unique libdirs.
 10829: 	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
 10830: 	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
 10831: 		;;
 10832: 	      *)
 10833: 		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
 10834: 		;;
 10835: 	      esac
 10836: 	    fi
 10837: 	  else
 10838: 	    eval flag=\"$hardcode_libdir_flag_spec\"
 10839: 	    func_append rpath " $flag"
 10840: 	  fi
 10841: 	elif test -n "$runpath_var"; then
 10842: 	  case "$finalize_perm_rpath " in
 10843: 	  *" $libdir "*) ;;
 10844: 	  *) func_append finalize_perm_rpath " $libdir" ;;
 10845: 	  esac
 10846: 	fi
 10847:       done
 10848:       # Substitute the hardcoded libdirs into the rpath.
 10849:       if test -n "$hardcode_libdir_separator" &&
 10850: 	 test -n "$hardcode_libdirs"; then
 10851: 	libdir=$hardcode_libdirs
 10852: 	eval rpath=\" $hardcode_libdir_flag_spec\"
 10853:       fi
 10854:       finalize_rpath=$rpath
 10855: 
 10856:       if test -n "$libobjs" && test yes = "$build_old_libs"; then
 10857: 	# Transform all the library objects into standard objects.
 10858: 	compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
 10859: 	finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
 10860:       fi
 10861: 
 10862:       func_generate_dlsyms "$outputname" "@PROGRAM@" false
 10863: 
 10864:       # template prelinking step
 10865:       if test -n "$prelink_cmds"; then
 10866: 	func_execute_cmds "$prelink_cmds" 'exit $?'
 10867:       fi
 10868: 
 10869:       wrappers_required=:
 10870:       case $host in
 10871:       *cegcc* | *mingw32ce*)
 10872:         # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
 10873:         wrappers_required=false
 10874:         ;;
 10875:       *cygwin* | *mingw* )
 10876:         test yes = "$build_libtool_libs" || wrappers_required=false
 10877:         ;;
 10878:       *)
 10879:         if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
 10880:           wrappers_required=false
 10881:         fi
 10882:         ;;
 10883:       esac
 10884:       $wrappers_required || {
 10885: 	# Replace the output file specification.
 10886: 	compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
 10887: 	link_command=$compile_command$compile_rpath
 10888: 
 10889: 	# We have no uninstalled library dependencies, so finalize right now.
 10890: 	exit_status=0
 10891: 	func_show_eval "$link_command" 'exit_status=$?'
 10892: 
 10893: 	if test -n "$postlink_cmds"; then
 10894: 	  func_to_tool_file "$output"
 10895: 	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
 10896: 	  func_execute_cmds "$postlink_cmds" 'exit $?'
 10897: 	fi
 10898: 
 10899: 	# Delete the generated files.
 10900: 	if test -f "$output_objdir/${outputname}S.$objext"; then
 10901: 	  func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
 10902: 	fi
 10903: 
 10904: 	exit $exit_status
 10905:       }
 10906: 
 10907:       if test -n "$compile_shlibpath$finalize_shlibpath"; then
 10908: 	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
 10909:       fi
 10910:       if test -n "$finalize_shlibpath"; then
 10911: 	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
 10912:       fi
 10913: 
 10914:       compile_var=
 10915:       finalize_var=
 10916:       if test -n "$runpath_var"; then
 10917: 	if test -n "$perm_rpath"; then
 10918: 	  # We should set the runpath_var.
 10919: 	  rpath=
 10920: 	  for dir in $perm_rpath; do
 10921: 	    func_append rpath "$dir:"
 10922: 	  done
 10923: 	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
 10924: 	fi
 10925: 	if test -n "$finalize_perm_rpath"; then
 10926: 	  # We should set the runpath_var.
 10927: 	  rpath=
 10928: 	  for dir in $finalize_perm_rpath; do
 10929: 	    func_append rpath "$dir:"
 10930: 	  done
 10931: 	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
 10932: 	fi
 10933:       fi
 10934: 
 10935:       if test yes = "$no_install"; then
 10936: 	# We don't need to create a wrapper script.
 10937: 	link_command=$compile_var$compile_command$compile_rpath
 10938: 	# Replace the output file specification.
 10939: 	link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
 10940: 	# Delete the old output file.
 10941: 	$opt_dry_run || $RM $output
 10942: 	# Link the executable and exit
 10943: 	func_show_eval "$link_command" 'exit $?'
 10944: 
 10945: 	if test -n "$postlink_cmds"; then
 10946: 	  func_to_tool_file "$output"
 10947: 	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
 10948: 	  func_execute_cmds "$postlink_cmds" 'exit $?'
 10949: 	fi
 10950: 
 10951: 	exit $EXIT_SUCCESS
 10952:       fi
 10953: 
 10954:       case $hardcode_action,$fast_install in
 10955:         relink,*)
 10956: 	  # Fast installation is not supported
 10957: 	  link_command=$compile_var$compile_command$compile_rpath
 10958: 	  relink_command=$finalize_var$finalize_command$finalize_rpath
 10959: 
 10960: 	  func_warning "this platform does not like uninstalled shared libraries"
 10961: 	  func_warning "'$output' will be relinked during installation"
 10962: 	  ;;
 10963:         *,yes)
 10964: 	  link_command=$finalize_var$compile_command$finalize_rpath
 10965: 	  relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
 10966:           ;;
 10967: 	*,no)
 10968: 	  link_command=$compile_var$compile_command$compile_rpath
 10969: 	  relink_command=$finalize_var$finalize_command$finalize_rpath
 10970:           ;;
 10971: 	*,needless)
 10972: 	  link_command=$finalize_var$compile_command$finalize_rpath
 10973: 	  relink_command=
 10974:           ;;
 10975:       esac
 10976: 
 10977:       # Replace the output file specification.
 10978:       link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
 10979: 
 10980:       # Delete the old output files.
 10981:       $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
 10982: 
 10983:       func_show_eval "$link_command" 'exit $?'
 10984: 
 10985:       if test -n "$postlink_cmds"; then
 10986: 	func_to_tool_file "$output_objdir/$outputname"
 10987: 	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'`
 10988: 	func_execute_cmds "$postlink_cmds" 'exit $?'
 10989:       fi
 10990: 
 10991:       # Now create the wrapper script.
 10992:       func_verbose "creating $output"
 10993: 
 10994:       # Quote the relink command for shipping.
 10995:       if test -n "$relink_command"; then
 10996: 	# Preserve any variables that may affect compiler behavior
 10997: 	for var in $variables_saved_for_relink; do
 10998: 	  if eval test -z \"\${$var+set}\"; then
 10999: 	    relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
 11000: 	  elif eval var_value=\$$var; test -z "$var_value"; then
 11001: 	    relink_command="$var=; export $var; $relink_command"
 11002: 	  else
 11003: 	    func_quote_for_eval "$var_value"
 11004: 	    relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
 11005: 	  fi
 11006: 	done
 11007: 	relink_command="(cd `pwd`; $relink_command)"
 11008: 	relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
 11009:       fi
 11010: 
 11011:       # Only actually do things if not in dry run mode.
 11012:       $opt_dry_run || {
 11013: 	# win32 will think the script is a binary if it has
 11014: 	# a .exe suffix, so we strip it off here.
 11015: 	case $output in
 11016: 	  *.exe) func_stripname '' '.exe' "$output"
 11017: 	         output=$func_stripname_result ;;
 11018: 	esac
 11019: 	# test for cygwin because mv fails w/o .exe extensions
 11020: 	case $host in
 11021: 	  *cygwin*)
 11022: 	    exeext=.exe
 11023: 	    func_stripname '' '.exe' "$outputname"
 11024: 	    outputname=$func_stripname_result ;;
 11025: 	  *) exeext= ;;
 11026: 	esac
 11027: 	case $host in
 11028: 	  *cygwin* | *mingw* )
 11029: 	    func_dirname_and_basename "$output" "" "."
 11030: 	    output_name=$func_basename_result
 11031: 	    output_path=$func_dirname_result
 11032: 	    cwrappersource=$output_path/$objdir/lt-$output_name.c
 11033: 	    cwrapper=$output_path/$output_name.exe
 11034: 	    $RM $cwrappersource $cwrapper
 11035: 	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
 11036: 
 11037: 	    func_emit_cwrapperexe_src > $cwrappersource
 11038: 
 11039: 	    # The wrapper executable is built using the $host compiler,
 11040: 	    # because it contains $host paths and files. If cross-
 11041: 	    # compiling, it, like the target executable, must be
 11042: 	    # executed on the $host or under an emulation environment.
 11043: 	    $opt_dry_run || {
 11044: 	      $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
 11045: 	      $STRIP $cwrapper
 11046: 	    }
 11047: 
 11048: 	    # Now, create the wrapper script for func_source use:
 11049: 	    func_ltwrapper_scriptname $cwrapper
 11050: 	    $RM $func_ltwrapper_scriptname_result
 11051: 	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
 11052: 	    $opt_dry_run || {
 11053: 	      # note: this script will not be executed, so do not chmod.
 11054: 	      if test "x$build" = "x$host"; then
 11055: 		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
 11056: 	      else
 11057: 		func_emit_wrapper no > $func_ltwrapper_scriptname_result
 11058: 	      fi
 11059: 	    }
 11060: 	  ;;
 11061: 	  * )
 11062: 	    $RM $output
 11063: 	    trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
 11064: 
 11065: 	    func_emit_wrapper no > $output
 11066: 	    chmod +x $output
 11067: 	  ;;
 11068: 	esac
 11069:       }
 11070:       exit $EXIT_SUCCESS
 11071:       ;;
 11072:     esac
 11073: 
 11074:     # See if we need to build an old-fashioned archive.
 11075:     for oldlib in $oldlibs; do
 11076: 
 11077:       case $build_libtool_libs in
 11078:         convenience)
 11079: 	  oldobjs="$libobjs_save $symfileobj"
 11080: 	  addlibs=$convenience
 11081: 	  build_libtool_libs=no
 11082: 	  ;;
 11083: 	module)
 11084: 	  oldobjs=$libobjs_save
 11085: 	  addlibs=$old_convenience
 11086: 	  build_libtool_libs=no
 11087:           ;;
 11088: 	*)
 11089: 	  oldobjs="$old_deplibs $non_pic_objects"
 11090: 	  $preload && test -f "$symfileobj" \
 11091: 	    && func_append oldobjs " $symfileobj"
 11092: 	  addlibs=$old_convenience
 11093: 	  ;;
 11094:       esac
 11095: 
 11096:       if test -n "$addlibs"; then
 11097: 	gentop=$output_objdir/${outputname}x
 11098: 	func_append generated " $gentop"
 11099: 
 11100: 	func_extract_archives $gentop $addlibs
 11101: 	func_append oldobjs " $func_extract_archives_result"
 11102:       fi
 11103: 
 11104:       # Do each command in the archive commands.
 11105:       if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
 11106: 	cmds=$old_archive_from_new_cmds
 11107:       else
 11108: 
 11109: 	# Add any objects from preloaded convenience libraries
 11110: 	if test -n "$dlprefiles"; then
 11111: 	  gentop=$output_objdir/${outputname}x
 11112: 	  func_append generated " $gentop"
 11113: 
 11114: 	  func_extract_archives $gentop $dlprefiles
 11115: 	  func_append oldobjs " $func_extract_archives_result"
 11116: 	fi
 11117: 
 11118: 	# POSIX demands no paths to be encoded in archives.  We have
 11119: 	# to avoid creating archives with duplicate basenames if we
 11120: 	# might have to extract them afterwards, e.g., when creating a
 11121: 	# static archive out of a convenience library, or when linking
 11122: 	# the entirety of a libtool archive into another (currently
 11123: 	# not supported by libtool).
 11124: 	if (for obj in $oldobjs
 11125: 	    do
 11126: 	      func_basename "$obj"
 11127: 	      $ECHO "$func_basename_result"
 11128: 	    done | sort | sort -uc >/dev/null 2>&1); then
 11129: 	  :
 11130: 	else
 11131: 	  echo "copying selected object files to avoid basename conflicts..."
 11132: 	  gentop=$output_objdir/${outputname}x
 11133: 	  func_append generated " $gentop"
 11134: 	  func_mkdir_p "$gentop"
 11135: 	  save_oldobjs=$oldobjs
 11136: 	  oldobjs=
 11137: 	  counter=1
 11138: 	  for obj in $save_oldobjs
 11139: 	  do
 11140: 	    func_basename "$obj"
 11141: 	    objbase=$func_basename_result
 11142: 	    case " $oldobjs " in
 11143: 	    " ") oldobjs=$obj ;;
 11144: 	    *[\ /]"$objbase "*)
 11145: 	      while :; do
 11146: 		# Make sure we don't pick an alternate name that also
 11147: 		# overlaps.
 11148: 		newobj=lt$counter-$objbase
 11149: 		func_arith $counter + 1
 11150: 		counter=$func_arith_result
 11151: 		case " $oldobjs " in
 11152: 		*[\ /]"$newobj "*) ;;
 11153: 		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
 11154: 		esac
 11155: 	      done
 11156: 	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
 11157: 	      func_append oldobjs " $gentop/$newobj"
 11158: 	      ;;
 11159: 	    *) func_append oldobjs " $obj" ;;
 11160: 	    esac
 11161: 	  done
 11162: 	fi
 11163: 	func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
 11164: 	tool_oldlib=$func_to_tool_file_result
 11165: 	eval cmds=\"$old_archive_cmds\"
 11166: 
 11167: 	func_len " $cmds"
 11168: 	len=$func_len_result
 11169: 	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
 11170: 	  cmds=$old_archive_cmds
 11171: 	elif test -n "$archiver_list_spec"; then
 11172: 	  func_verbose "using command file archive linking..."
 11173: 	  for obj in $oldobjs
 11174: 	  do
 11175: 	    func_to_tool_file "$obj"
 11176: 	    $ECHO "$func_to_tool_file_result"
 11177: 	  done > $output_objdir/$libname.libcmd
 11178: 	  func_to_tool_file "$output_objdir/$libname.libcmd"
 11179: 	  oldobjs=" $archiver_list_spec$func_to_tool_file_result"
 11180: 	  cmds=$old_archive_cmds
 11181: 	else
 11182: 	  # the command line is too long to link in one step, link in parts
 11183: 	  func_verbose "using piecewise archive linking..."
 11184: 	  save_RANLIB=$RANLIB
 11185: 	  RANLIB=:
 11186: 	  objlist=
 11187: 	  concat_cmds=
 11188: 	  save_oldobjs=$oldobjs
 11189: 	  oldobjs=
 11190: 	  # Is there a better way of finding the last object in the list?
 11191: 	  for obj in $save_oldobjs
 11192: 	  do
 11193: 	    last_oldobj=$obj
 11194: 	  done
 11195: 	  eval test_cmds=\"$old_archive_cmds\"
 11196: 	  func_len " $test_cmds"
 11197: 	  len0=$func_len_result
 11198: 	  len=$len0
 11199: 	  for obj in $save_oldobjs
 11200: 	  do
 11201: 	    func_len " $obj"
 11202: 	    func_arith $len + $func_len_result
 11203: 	    len=$func_arith_result
 11204: 	    func_append objlist " $obj"
 11205: 	    if test "$len" -lt "$max_cmd_len"; then
 11206: 	      :
 11207: 	    else
 11208: 	      # the above command should be used before it gets too long
 11209: 	      oldobjs=$objlist
 11210: 	      if test "$obj" = "$last_oldobj"; then
 11211: 		RANLIB=$save_RANLIB
 11212: 	      fi
 11213: 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
 11214: 	      eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
 11215: 	      objlist=
 11216: 	      len=$len0
 11217: 	    fi
 11218: 	  done
 11219: 	  RANLIB=$save_RANLIB
 11220: 	  oldobjs=$objlist
 11221: 	  if test -z "$oldobjs"; then
 11222: 	    eval cmds=\"\$concat_cmds\"
 11223: 	  else
 11224: 	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
 11225: 	  fi
 11226: 	fi
 11227:       fi
 11228:       func_execute_cmds "$cmds" 'exit $?'
 11229:     done
 11230: 
 11231:     test -n "$generated" && \
 11232:       func_show_eval "${RM}r$generated"
 11233: 
 11234:     # Now create the libtool archive.
 11235:     case $output in
 11236:     *.la)
 11237:       old_library=
 11238:       test yes = "$build_old_libs" && old_library=$libname.$libext
 11239:       func_verbose "creating $output"
 11240: 
 11241:       # Preserve any variables that may affect compiler behavior
 11242:       for var in $variables_saved_for_relink; do
 11243: 	if eval test -z \"\${$var+set}\"; then
 11244: 	  relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
 11245: 	elif eval var_value=\$$var; test -z "$var_value"; then
 11246: 	  relink_command="$var=; export $var; $relink_command"
 11247: 	else
 11248: 	  func_quote_for_eval "$var_value"
 11249: 	  relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
 11250: 	fi
 11251:       done
 11252:       # Quote the link command for shipping.
 11253:       relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
 11254:       relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
 11255:       if test yes = "$hardcode_automatic"; then
 11256: 	relink_command=
 11257:       fi
 11258: 
 11259:       # Only create the output if not a dry run.
 11260:       $opt_dry_run || {
 11261: 	for installed in no yes; do
 11262: 	  if test yes = "$installed"; then
 11263: 	    if test -z "$install_libdir"; then
 11264: 	      break
 11265: 	    fi
 11266: 	    output=$output_objdir/${outputname}i
 11267: 	    # Replace all uninstalled libtool libraries with the installed ones
 11268: 	    newdependency_libs=
 11269: 	    for deplib in $dependency_libs; do
 11270: 	      case $deplib in
 11271: 	      *.la)
 11272: 		func_basename "$deplib"
 11273: 		name=$func_basename_result
 11274: 		func_resolve_sysroot "$deplib"
 11275: 		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
 11276: 		test -z "$libdir" && \
 11277: 		  func_fatal_error "'$deplib' is not a valid libtool archive"
 11278: 		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
 11279: 		;;
 11280: 	      -L*)
 11281: 		func_stripname -L '' "$deplib"
 11282: 		func_replace_sysroot "$func_stripname_result"
 11283: 		func_append newdependency_libs " -L$func_replace_sysroot_result"
 11284: 		;;
 11285: 	      -R*)
 11286: 		func_stripname -R '' "$deplib"
 11287: 		func_replace_sysroot "$func_stripname_result"
 11288: 		func_append newdependency_libs " -R$func_replace_sysroot_result"
 11289: 		;;
 11290: 	      *) func_append newdependency_libs " $deplib" ;;
 11291: 	      esac
 11292: 	    done
 11293: 	    dependency_libs=$newdependency_libs
 11294: 	    newdlfiles=
 11295: 
 11296: 	    for lib in $dlfiles; do
 11297: 	      case $lib in
 11298: 	      *.la)
 11299: 	        func_basename "$lib"
 11300: 		name=$func_basename_result
 11301: 		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 11302: 		test -z "$libdir" && \
 11303: 		  func_fatal_error "'$lib' is not a valid libtool archive"
 11304: 		func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
 11305: 		;;
 11306: 	      *) func_append newdlfiles " $lib" ;;
 11307: 	      esac
 11308: 	    done
 11309: 	    dlfiles=$newdlfiles
 11310: 	    newdlprefiles=
 11311: 	    for lib in $dlprefiles; do
 11312: 	      case $lib in
 11313: 	      *.la)
 11314: 		# Only pass preopened files to the pseudo-archive (for
 11315: 		# eventual linking with the app. that links it) if we
 11316: 		# didn't already link the preopened objects directly into
 11317: 		# the library:
 11318: 		func_basename "$lib"
 11319: 		name=$func_basename_result
 11320: 		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 11321: 		test -z "$libdir" && \
 11322: 		  func_fatal_error "'$lib' is not a valid libtool archive"
 11323: 		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
 11324: 		;;
 11325: 	      esac
 11326: 	    done
 11327: 	    dlprefiles=$newdlprefiles
 11328: 	  else
 11329: 	    newdlfiles=
 11330: 	    for lib in $dlfiles; do
 11331: 	      case $lib in
 11332: 		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
 11333: 		*) abs=`pwd`"/$lib" ;;
 11334: 	      esac
 11335: 	      func_append newdlfiles " $abs"
 11336: 	    done
 11337: 	    dlfiles=$newdlfiles
 11338: 	    newdlprefiles=
 11339: 	    for lib in $dlprefiles; do
 11340: 	      case $lib in
 11341: 		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
 11342: 		*) abs=`pwd`"/$lib" ;;
 11343: 	      esac
 11344: 	      func_append newdlprefiles " $abs"
 11345: 	    done
 11346: 	    dlprefiles=$newdlprefiles
 11347: 	  fi
 11348: 	  $RM $output
 11349: 	  # place dlname in correct position for cygwin
 11350: 	  # In fact, it would be nice if we could use this code for all target
 11351: 	  # systems that can't hard-code library paths into their executables
 11352: 	  # and that have no shared library path variable independent of PATH,
 11353: 	  # but it turns out we can't easily determine that from inspecting
 11354: 	  # libtool variables, so we have to hard-code the OSs to which it
 11355: 	  # applies here; at the moment, that means platforms that use the PE
 11356: 	  # object format with DLL files.  See the long comment at the top of
 11357: 	  # tests/bindir.at for full details.
 11358: 	  tdlname=$dlname
 11359: 	  case $host,$output,$installed,$module,$dlname in
 11360: 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
 11361: 	      # If a -bindir argument was supplied, place the dll there.
 11362: 	      if test -n "$bindir"; then
 11363: 		func_relative_path "$install_libdir" "$bindir"
 11364: 		tdlname=$func_relative_path_result/$dlname
 11365: 	      else
 11366: 		# Otherwise fall back on heuristic.
 11367: 		tdlname=../bin/$dlname
 11368: 	      fi
 11369: 	      ;;
 11370: 	  esac
 11371: 	  $ECHO > $output "\
 11372: # $outputname - a libtool library file
 11373: # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 11374: #
 11375: # Please DO NOT delete this file!
 11376: # It is necessary for linking the library.
 11377: 
 11378: # The name that we can dlopen(3).
 11379: dlname='$tdlname'
 11380: 
 11381: # Names of this library.
 11382: library_names='$library_names'
 11383: 
 11384: # The name of the static archive.
 11385: old_library='$old_library'
 11386: 
 11387: # Linker flags that cannot go in dependency_libs.
 11388: inherited_linker_flags='$new_inherited_linker_flags'
 11389: 
 11390: # Libraries that this one depends upon.
 11391: dependency_libs='$dependency_libs'
 11392: 
 11393: # Names of additional weak libraries provided by this library
 11394: weak_library_names='$weak_libs'
 11395: 
 11396: # Version information for $libname.
 11397: current=$current
 11398: age=$age
 11399: revision=$revision
 11400: 
 11401: # Is this an already installed library?
 11402: installed=$installed
 11403: 
 11404: # Should we warn about portability when linking against -modules?
 11405: shouldnotlink=$module
 11406: 
 11407: # Files to dlopen/dlpreopen
 11408: dlopen='$dlfiles'
 11409: dlpreopen='$dlprefiles'
 11410: 
 11411: # Directory that this library needs to be installed in:
 11412: libdir='$install_libdir'"
 11413: 	  if test no,yes = "$installed,$need_relink"; then
 11414: 	    $ECHO >> $output "\
 11415: relink_command=\"$relink_command\""
 11416: 	  fi
 11417: 	done
 11418:       }
 11419: 
 11420:       # Do a symbolic link so that the libtool archive can be found in
 11421:       # LD_LIBRARY_PATH before the program is installed.
 11422:       func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
 11423:       ;;
 11424:     esac
 11425:     exit $EXIT_SUCCESS
 11426: }
 11427: 
 11428: if test link = "$opt_mode" || test relink = "$opt_mode"; then
 11429:   func_mode_link ${1+"$@"}
 11430: fi
 11431: 
 11432: 
 11433: # func_mode_uninstall arg...
 11434: func_mode_uninstall ()
 11435: {
 11436:     $debug_cmd
 11437: 
 11438:     RM=$nonopt
 11439:     files=
 11440:     rmforce=false
 11441:     exit_status=0
 11442: 
 11443:     # This variable tells wrapper scripts just to set variables rather
 11444:     # than running their programs.
 11445:     libtool_install_magic=$magic
 11446: 
 11447:     for arg
 11448:     do
 11449:       case $arg in
 11450:       -f) func_append RM " $arg"; rmforce=: ;;
 11451:       -*) func_append RM " $arg" ;;
 11452:       *) func_append files " $arg" ;;
 11453:       esac
 11454:     done
 11455: 
 11456:     test -z "$RM" && \
 11457:       func_fatal_help "you must specify an RM program"
 11458: 
 11459:     rmdirs=
 11460: 
 11461:     for file in $files; do
 11462:       func_dirname "$file" "" "."
 11463:       dir=$func_dirname_result
 11464:       if test . = "$dir"; then
 11465: 	odir=$objdir
 11466:       else
 11467: 	odir=$dir/$objdir
 11468:       fi
 11469:       func_basename "$file"
 11470:       name=$func_basename_result
 11471:       test uninstall = "$opt_mode" && odir=$dir
 11472: 
 11473:       # Remember odir for removal later, being careful to avoid duplicates
 11474:       if test clean = "$opt_mode"; then
 11475: 	case " $rmdirs " in
 11476: 	  *" $odir "*) ;;
 11477: 	  *) func_append rmdirs " $odir" ;;
 11478: 	esac
 11479:       fi
 11480: 
 11481:       # Don't error if the file doesn't exist and rm -f was used.
 11482:       if { test -L "$file"; } >/dev/null 2>&1 ||
 11483: 	 { test -h "$file"; } >/dev/null 2>&1 ||
 11484: 	 test -f "$file"; then
 11485: 	:
 11486:       elif test -d "$file"; then
 11487: 	exit_status=1
 11488: 	continue
 11489:       elif $rmforce; then
 11490: 	continue
 11491:       fi
 11492: 
 11493:       rmfiles=$file
 11494: 
 11495:       case $name in
 11496:       *.la)
 11497: 	# Possibly a libtool archive, so verify it.
 11498: 	if func_lalib_p "$file"; then
 11499: 	  func_source $dir/$name
 11500: 
 11501: 	  # Delete the libtool libraries and symlinks.
 11502: 	  for n in $library_names; do
 11503: 	    func_append rmfiles " $odir/$n"
 11504: 	  done
 11505: 	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
 11506: 
 11507: 	  case $opt_mode in
 11508: 	  clean)
 11509: 	    case " $library_names " in
 11510: 	    *" $dlname "*) ;;
 11511: 	    *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
 11512: 	    esac
 11513: 	    test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
 11514: 	    ;;
 11515: 	  uninstall)
 11516: 	    if test -n "$library_names"; then
 11517: 	      # Do each command in the postuninstall commands.
 11518: 	      func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
 11519: 	    fi
 11520: 
 11521: 	    if test -n "$old_library"; then
 11522: 	      # Do each command in the old_postuninstall commands.
 11523: 	      func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
 11524: 	    fi
 11525: 	    # FIXME: should reinstall the best remaining shared library.
 11526: 	    ;;
 11527: 	  esac
 11528: 	fi
 11529: 	;;
 11530: 
 11531:       *.lo)
 11532: 	# Possibly a libtool object, so verify it.
 11533: 	if func_lalib_p "$file"; then
 11534: 
 11535: 	  # Read the .lo file
 11536: 	  func_source $dir/$name
 11537: 
 11538: 	  # Add PIC object to the list of files to remove.
 11539: 	  if test -n "$pic_object" && test none != "$pic_object"; then
 11540: 	    func_append rmfiles " $dir/$pic_object"
 11541: 	  fi
 11542: 
 11543: 	  # Add non-PIC object to the list of files to remove.
 11544: 	  if test -n "$non_pic_object" && test none != "$non_pic_object"; then
 11545: 	    func_append rmfiles " $dir/$non_pic_object"
 11546: 	  fi
 11547: 	fi
 11548: 	;;
 11549: 
 11550:       *)
 11551: 	if test clean = "$opt_mode"; then
 11552: 	  noexename=$name
 11553: 	  case $file in
 11554: 	  *.exe)
 11555: 	    func_stripname '' '.exe' "$file"
 11556: 	    file=$func_stripname_result
 11557: 	    func_stripname '' '.exe' "$name"
 11558: 	    noexename=$func_stripname_result
 11559: 	    # $file with .exe has already been added to rmfiles,
 11560: 	    # add $file without .exe
 11561: 	    func_append rmfiles " $file"
 11562: 	    ;;
 11563: 	  esac
 11564: 	  # Do a test to see if this is a libtool program.
 11565: 	  if func_ltwrapper_p "$file"; then
 11566: 	    if func_ltwrapper_executable_p "$file"; then
 11567: 	      func_ltwrapper_scriptname "$file"
 11568: 	      relink_command=
 11569: 	      func_source $func_ltwrapper_scriptname_result
 11570: 	      func_append rmfiles " $func_ltwrapper_scriptname_result"
 11571: 	    else
 11572: 	      relink_command=
 11573: 	      func_source $dir/$noexename
 11574: 	    fi
 11575: 
 11576: 	    # note $name still contains .exe if it was in $file originally
 11577: 	    # as does the version of $file that was added into $rmfiles
 11578: 	    func_append rmfiles " $odir/$name $odir/${name}S.$objext"
 11579: 	    if test yes = "$fast_install" && test -n "$relink_command"; then
 11580: 	      func_append rmfiles " $odir/lt-$name"
 11581: 	    fi
 11582: 	    if test "X$noexename" != "X$name"; then
 11583: 	      func_append rmfiles " $odir/lt-$noexename.c"
 11584: 	    fi
 11585: 	  fi
 11586: 	fi
 11587: 	;;
 11588:       esac
 11589:       func_show_eval "$RM $rmfiles" 'exit_status=1'
 11590:     done
 11591: 
 11592:     # Try to remove the $objdir's in the directories where we deleted files
 11593:     for dir in $rmdirs; do
 11594:       if test -d "$dir"; then
 11595: 	func_show_eval "rmdir $dir >/dev/null 2>&1"
 11596:       fi
 11597:     done
 11598: 
 11599:     exit $exit_status
 11600: }
 11601: 
 11602: if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
 11603:   func_mode_uninstall ${1+"$@"}
 11604: fi
 11605: 
 11606: test -z "$opt_mode" && {
 11607:   help=$generic_help
 11608:   func_fatal_help "you must specify a MODE"
 11609: }
 11610: 
 11611: test -z "$exec_cmd" && \
 11612:   func_fatal_help "invalid operation mode '$opt_mode'"
 11613: 
 11614: if test -n "$exec_cmd"; then
 11615:   eval exec "$exec_cmd"
 11616:   exit $EXIT_FAILURE
 11617: fi
 11618: 
 11619: exit $exit_status
 11620: 
 11621: 
 11622: # The TAGs below are defined such that we never get into a situation
 11623: # where we disable both kinds of libraries.  Given conflicting
 11624: # choices, we go for a static library, that is the most portable,
 11625: # since we can't tell whether shared libraries were disabled because
 11626: # the user asked for that or because the platform doesn't support
 11627: # them.  This is particularly important on AIX, because we don't
 11628: # support having both static and shared libraries enabled at the same
 11629: # time on that platform, so we default to a shared-only configuration.
 11630: # If a disable-shared tag is given, we'll fallback to a static-only
 11631: # configuration.  But we'll never go from static-only to shared-only.
 11632: 
 11633: # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
 11634: build_libtool_libs=no
 11635: build_old_libs=yes
 11636: # ### END LIBTOOL TAG CONFIG: disable-shared
 11637: 
 11638: # ### BEGIN LIBTOOL TAG CONFIG: disable-static
 11639: build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
 11640: # ### END LIBTOOL TAG CONFIG: disable-static
 11641: 
 11642: # Local Variables:
 11643: # mode:shell-script
 11644: # sh-indentation:2
 11645: # End:

Generated by git2html.