PageRenderTime 1295ms CodeModel.GetById 633ms app.highlight 292ms RepoModel.GetById 120ms app.codeStats 4ms

/libtool

http://github.com/fizx/parsley
Shell | 8890 lines | 7043 code | 726 blank | 1121 comment | 833 complexity | 49bf31347fbe76c3a8350a685f6d89eb MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1#! /bin/sh
   2
   3# libtool - Provide generalized library-building support services.
   4# Generated automatically by config.status (parsleyc) 1.0
   5# Libtool was configured on host Eugenes-MacBook-Air-2.local:
   6# NOTE: Changes made to this file will be lost: look at ltmain.sh.
   7#
   8#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
   9#                 2006, 2007, 2008 Free Software Foundation, Inc.
  10#   Written by Gordon Matzigkeit, 1996
  11#
  12#   This file is part of GNU Libtool.
  13#
  14# GNU Libtool is free software; you can redistribute it and/or
  15# modify it under the terms of the GNU General Public License as
  16# published by the Free Software Foundation; either version 2 of
  17# the License, or (at your option) any later version.
  18#
  19# As a special exception to the GNU General Public License,
  20# if you distribute this file as part of a program or library that
  21# is built using GNU Libtool, you may include this file under the
  22# same distribution terms that you use for the rest of that program.
  23#
  24# GNU Libtool is distributed in the hope that it will be useful,
  25# but WITHOUT ANY WARRANTY; without even the implied warranty of
  26# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  27# GNU General Public License for more details.
  28#
  29# You should have received a copy of the GNU General Public License
  30# along with GNU Libtool; see the file COPYING.  If not, a copy
  31# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
  32# obtained by writing to the Free Software Foundation, Inc.,
  33# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  34
  35
  36# The names of the tagged configurations supported by this script.
  37available_tags=""
  38
  39# ### BEGIN LIBTOOL CONFIG
  40
  41# Which release of libtool.m4 was used?
  42macro_version=2.2.6
  43macro_revision=1.3012
  44
  45# Whether or not to build shared libraries.
  46build_libtool_libs=yes
  47
  48# Whether or not to build static libraries.
  49build_old_libs=yes
  50
  51# What type of objects to build.
  52pic_mode=default
  53
  54# Whether or not to optimize for fast installation.
  55fast_install=needless
  56
  57# The host system.
  58host_alias=
  59host=i386-apple-darwin12.4.0
  60host_os=darwin12.4.0
  61
  62# The build system.
  63build_alias=
  64build=i386-apple-darwin12.4.0
  65build_os=darwin12.4.0
  66
  67# A sed program that does not truncate output.
  68SED="/usr/bin/sed"
  69
  70# Sed that helps us avoid accidentally triggering echo(1) options like -n.
  71Xsed="$SED -e 1s/^X//"
  72
  73# A grep program that handles long lines.
  74GREP="/usr/bin/grep"
  75
  76# An ERE matcher.
  77EGREP="/usr/bin/grep -E"
  78
  79# A literal string matcher.
  80FGREP="/usr/bin/grep -F"
  81
  82# A BSD- or MS-compatible name lister.
  83NM="/usr/bin/nm"
  84
  85# Whether we need soft or hard links.
  86LN_S="ln -s"
  87
  88# What is the maximum length of a command?
  89max_cmd_len=196608
  90
  91# Object file suffix (normally "o").
  92objext=o
  93
  94# Executable file suffix (normally "").
  95exeext=
  96
  97# whether the shell understands "unset".
  98lt_unset=unset
  99
 100# turn spaces into newlines.
 101SP2NL="tr \\040 \\012"
 102
 103# turn newlines into spaces.
 104NL2SP="tr \\015\\012 \\040\\040"
 105
 106# How to create reloadable object files.
 107reload_flag=" -r"
 108reload_cmds="\$LTCC \$LTCFLAGS -nostdlib \${wl}-r -o \$output\$reload_objs"
 109
 110# An object symbol dumper.
 111OBJDUMP="false"
 112
 113# Method to check whether dependent libraries are shared objects.
 114deplibs_check_method="pass_all"
 115
 116# Command to use when deplibs_check_method == "file_magic".
 117file_magic_cmd="\$MAGIC_CMD"
 118
 119# The archiver.
 120AR="ar"
 121AR_FLAGS="cru"
 122
 123# A symbol stripping program.
 124STRIP="strip"
 125
 126# Commands used to install an old-style archive.
 127RANLIB="ranlib"
 128old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
 129old_postuninstall_cmds=""
 130
 131# A C compiler.
 132LTCC="gcc -std=gnu99"
 133
 134# LTCC compiler flags.
 135LTCFLAGS="-g -O2"
 136
 137# Take the output of nm and produce a listing of raw symbols and C names.
 138global_symbol_pipe="sed -n -e 's/^.*[	 ]\\([BCDEGRST][BCDEGRST]*\\)[	 ][	 ]*_\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 _\\2 \\2/p'"
 139
 140# Transform the output of nm in a proper C declaration.
 141global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[BCDEGRST]* .* \\(.*\\)\$/extern char \\1;/p'"
 142
 143# Transform the output of nm in a C name address pair.
 144global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/  {\\\"\\1\\\", (void *) 0},/p' -e 's/^[BCDEGRST]* \\([^ ]*\\) \\([^ ]*\\)\$/  {\"\\2\", (void *) \\&\\2},/p'"
 145
 146# Transform the output of nm in a C name address pair when lib prefix is needed.
 147global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\([^ ]*\\) \$/  {\\\"\\1\\\", (void *) 0},/p' -e 's/^[BCDEGRST]* \\([^ ]*\\) \\(lib[^ ]*\\)\$/  {\"\\2\", (void *) \\&\\2},/p' -e 's/^[BCDEGRST]* \\([^ ]*\\) \\([^ ]*\\)\$/  {\"lib\\2\", (void *) \\&\\2},/p'"
 148
 149# The name of the directory that contains temporary libtool files.
 150objdir=.libs
 151
 152# Shell to use when invoking shell scripts.
 153SHELL="/bin/sh"
 154
 155# An echo program that does not interpret backslashes.
 156ECHO="/bin/echo"
 157
 158# Used to examine libraries when file_magic_cmd begins with "file".
 159MAGIC_CMD=file
 160
 161# Must we lock files when doing compilation?
 162need_locks="no"
 163
 164# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
 165DSYMUTIL="dsymutil"
 166
 167# Tool to change global to local symbols on Mac OS X.
 168NMEDIT="nmedit"
 169
 170# Tool to manipulate fat objects and archives on Mac OS X.
 171LIPO="lipo"
 172
 173# ldd/readelf like tool for Mach-O binaries on Mac OS X.
 174OTOOL="otool"
 175
 176# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
 177OTOOL64=":"
 178
 179# Old archive suffix (normally "a").
 180libext=a
 181
 182# Shared library suffix (normally ".so").
 183shrext_cmds="\`test .\$module = .yes && echo .so || echo .dylib\`"
 184
 185# The commands to extract the exported symbol list from a shared archive.
 186extract_expsyms_cmds=""
 187
 188# Variables whose values should be saved in libtool wrapper scripts and
 189# restored at link time.
 190variables_saved_for_relink="PATH DYLD_LIBRARY_PATH  GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
 191
 192# Do we need the "lib" prefix for modules?
 193need_lib_prefix=no
 194
 195# Do we need a version for libraries?
 196need_version=no
 197
 198# Library versioning type.
 199version_type=darwin
 200
 201# Shared library runtime path variable.
 202runpath_var=
 203
 204# Shared library path variable.
 205shlibpath_var=DYLD_LIBRARY_PATH
 206
 207# Is shlibpath searched before the hard-coded library search path?
 208shlibpath_overrides_runpath=yes
 209
 210# Format of library name prefix.
 211libname_spec="lib\$name"
 212
 213# List of archive names.  First name is the real one, the rest are links.
 214# The last name is the one that the linker finds with -lNAME
 215library_names_spec="\${libname}\${release}\${major}\$shared_ext \${libname}\$shared_ext"
 216
 217# The coded name of the library, if different from the real name.
 218soname_spec="\${libname}\${release}\${major}\$shared_ext"
 219
 220# Command to use after installation of a shared archive.
 221postinstall_cmds=""
 222
 223# Command to use after uninstallation of a shared archive.
 224postuninstall_cmds=""
 225
 226# Commands used to finish a libtool library installation in a directory.
 227finish_cmds=""
 228
 229# As "finish_cmds", except a single script fragment to be evaled but
 230# not shown.
 231finish_eval=""
 232
 233# Whether we should hardcode library paths into libraries.
 234hardcode_into_libs=no
 235
 236# Compile-time system search path for libraries.
 237sys_lib_search_path_spec="/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/x86_64 /Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/x86_64 /usr/lib /usr/llvm-gcc-4.2/lib/gcc /usr/llvm-gcc-4.2/lib /Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib /usr/local/lib"
 238
 239# Run-time system search path for libraries.
 240sys_lib_dlsearch_path_spec="/usr/local/lib /lib /usr/lib"
 241
 242# Whether dlopen is supported.
 243dlopen_support=unknown
 244
 245# Whether dlopen of programs is supported.
 246dlopen_self=unknown
 247
 248# Whether dlopen of statically linked programs is supported.
 249dlopen_self_static=unknown
 250
 251# Commands to strip libraries.
 252old_striplib="strip -S"
 253striplib="strip -x"
 254
 255
 256# The linker used to build libraries.
 257LD="/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld"
 258
 259# Commands used to build an old-style archive.
 260old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
 261
 262# A language specific compiler.
 263CC="gcc -std=gnu99"
 264
 265# Is the compiler the GNU compiler?
 266with_gcc=yes
 267
 268# Compiler flag to turn off builtin functions.
 269no_builtin_flag=" -fno-builtin"
 270
 271# How to pass a linker flag through the compiler.
 272wl="-Wl,"
 273
 274# Additional compiler flags for building library objects.
 275pic_flag=" -fno-common -DPIC"
 276
 277# Compiler flag to prevent dynamic linking.
 278link_static_flag=""
 279
 280# Does compiler simultaneously support -c and -o options?
 281compiler_c_o="yes"
 282
 283# Whether or not to add -lc for building shared libraries.
 284build_libtool_need_lc=no
 285
 286# Whether or not to disallow shared libs when runtime libs are static.
 287allow_libtool_libs_with_static_runtimes=no
 288
 289# Compiler flag to allow reflexive dlopens.
 290export_dynamic_flag_spec=""
 291
 292# Compiler flag to generate shared objects directly from archives.
 293whole_archive_flag_spec=""
 294
 295# Whether the compiler copes with passing no objects directly.
 296compiler_needs_object="no"
 297
 298# Create an old-style archive from a shared archive.
 299old_archive_from_new_cmds=""
 300
 301# Create a temporary old-style archive to link instead of a shared archive.
 302old_archive_from_expsyms_cmds=""
 303
 304# Commands used to build a shared archive.
 305archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ~\$DSYMUTIL \$lib || :"
 306archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring  \${wl}-exported_symbols_list,\$output_objdir/\${libname}-symbols.expsym~\$DSYMUTIL \$lib || :"
 307
 308# Commands used to build a loadable module if different from building
 309# a shared archive.
 310module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags~\$DSYMUTIL \$lib || :"
 311module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags \${wl}-exported_symbols_list,\$output_objdir/\${libname}-symbols.expsym~\$DSYMUTIL \$lib || :"
 312
 313# Whether we are building with GNU ld or not.
 314with_gnu_ld="no"
 315
 316# Flag that allows shared libraries with undefined symbols to be built.
 317allow_undefined_flag="\${wl}-undefined \${wl}dynamic_lookup"
 318
 319# Flag that enforces no undefined symbols.
 320no_undefined_flag=""
 321
 322# Flag to hardcode $libdir into a binary during linking.
 323# This must work even if $libdir does not exist
 324hardcode_libdir_flag_spec=""
 325
 326# If ld is used when linking, flag to hardcode $libdir into a binary
 327# during linking.  This must work even if $libdir does not exist.
 328hardcode_libdir_flag_spec_ld=""
 329
 330# Whether we need a single "-rpath" flag with a separated argument.
 331hardcode_libdir_separator=""
 332
 333# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
 334# DIR into the resulting binary.
 335hardcode_direct=no
 336
 337# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
 338# DIR into the resulting binary and the resulting library dependency is
 339# "absolute",i.e impossible to change by setting ${shlibpath_var} if the
 340# library is relocated.
 341hardcode_direct_absolute=no
 342
 343# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
 344# into the resulting binary.
 345hardcode_minus_L=no
 346
 347# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
 348# into the resulting binary.
 349hardcode_shlibpath_var=unsupported
 350
 351# Set to "yes" if building a shared library automatically hardcodes DIR
 352# into the library and all subsequent libraries and executables linked
 353# against it.
 354hardcode_automatic=yes
 355
 356# Set to yes if linker adds runtime paths of dependent libraries
 357# to runtime path list.
 358inherit_rpath=no
 359
 360# Whether libtool must link a program against all its dependency libraries.
 361link_all_deplibs=yes
 362
 363# Fix the shell variable $srcfile for the compiler.
 364fix_srcfile_path=""
 365
 366# Set to "yes" if exported symbols are required.
 367always_export_symbols=no
 368
 369# The commands to list exported symbols.
 370export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
 371
 372# Symbols that should not be listed in the preloaded symbols.
 373exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
 374
 375# Symbols that must always be exported.
 376include_expsyms=""
 377
 378# Commands necessary for linking programs (against libraries) with templates.
 379prelink_cmds=""
 380
 381# Specify filename containing input files.
 382file_list_spec=""
 383
 384# How to hardcode a shared library path into an executable.
 385hardcode_action=immediate
 386
 387# ### END LIBTOOL CONFIG
 388
 389# Generated from ltmain.m4sh.
 390
 391# ltmain.sh (GNU libtool) 2.2.6
 392# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 393
 394# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
 395# This is free software; see the source for copying conditions.  There is NO
 396# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 397
 398# GNU Libtool is free software; you can redistribute it and/or modify
 399# it under the terms of the GNU General Public License as published by
 400# the Free Software Foundation; either version 2 of the License, or
 401# (at your option) any later version.
 402#
 403# As a special exception to the GNU General Public License,
 404# if you distribute this file as part of a program or library that
 405# is built using GNU Libtool, you may include this file under the
 406# same distribution terms that you use for the rest of that program.
 407#
 408# GNU Libtool is distributed in the hope that it will be useful, but
 409# WITHOUT ANY WARRANTY; without even the implied warranty of
 410# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 411# General Public License for more details.
 412#
 413# You should have received a copy of the GNU General Public License
 414# along with GNU Libtool; see the file COPYING.  If not, a copy
 415# can be downloaded from http://www.gnu.org/licenses/gpl.html,
 416# or obtained by writing to the Free Software Foundation, Inc.,
 417# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 418
 419# Usage: $progname [OPTION]... [MODE-ARG]...
 420#
 421# Provide generalized library-building support services.
 422#
 423#     --config             show all configuration variables
 424#     --debug              enable verbose shell tracing
 425# -n, --dry-run            display commands without modifying any files
 426#     --features           display basic configuration information and exit
 427#     --mode=MODE          use operation mode MODE
 428#     --preserve-dup-deps  don't remove duplicate dependency libraries
 429#     --quiet, --silent    don't print informational messages
 430#     --tag=TAG            use configuration variables from tag TAG
 431# -v, --verbose            print informational messages (default)
 432#     --version            print version information
 433# -h, --help               print short or long help message
 434#
 435# MODE must be one of the following:
 436#
 437#       clean              remove files from the build directory
 438#       compile            compile a source file into a libtool object
 439#       execute            automatically set library path, then run a program
 440#       finish             complete the installation of libtool libraries
 441#       install            install libraries or executables
 442#       link               create a library or an executable
 443#       uninstall          remove libraries from an installed directory
 444#
 445# MODE-ARGS vary depending on the MODE.
 446# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
 447#
 448# When reporting a bug, please describe a test case to reproduce it and
 449# include the following information:
 450#
 451#       host-triplet:	$host
 452#       shell:		$SHELL
 453#       compiler:		$LTCC
 454#       compiler flags:		$LTCFLAGS
 455#       linker:		$LD (gnu? $with_gnu_ld)
 456#       $progname:		(GNU libtool) 2.2.6
 457#       automake:		$automake_version
 458#       autoconf:		$autoconf_version
 459#
 460# Report bugs to <bug-libtool@gnu.org>.
 461
 462PROGRAM=ltmain.sh
 463PACKAGE=libtool
 464VERSION=2.2.6
 465TIMESTAMP=""
 466package_revision=1.3012
 467
 468# Be Bourne compatible
 469if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
 470  emulate sh
 471  NULLCMD=:
 472  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
 473  # is contrary to our usage.  Disable this feature.
 474  alias -g '${1+"$@"}'='"$@"'
 475  setopt NO_GLOB_SUBST
 476else
 477  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
 478fi
 479BIN_SH=xpg4; export BIN_SH # for Tru64
 480DUALCASE=1; export DUALCASE # for MKS sh
 481
 482# NLS nuisances: We save the old values to restore during execute mode.
 483# Only set LANG and LC_ALL to C if already set.
 484# These must not be set unconditionally because not all systems understand
 485# e.g. LANG=C (notably SCO).
 486lt_user_locale=
 487lt_safe_locale=
 488for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
 489do
 490  eval "if test \"\${$lt_var+set}\" = set; then
 491          save_$lt_var=\$$lt_var
 492          $lt_var=C
 493	  export $lt_var
 494	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
 495	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
 496	fi"
 497done
 498
 499$lt_unset CDPATH
 500
 501
 502
 503
 504
 505: ${CP="cp -f"}
 506: ${ECHO="echo"}
 507: ${EGREP="/usr/bin/grep -E"}
 508: ${FGREP="/usr/bin/grep -F"}
 509: ${GREP="/usr/bin/grep"}
 510: ${LN_S="ln -s"}
 511: ${MAKE="make"}
 512: ${MKDIR="mkdir"}
 513: ${MV="mv -f"}
 514: ${RM="rm -f"}
 515: ${SED="/opt/local/bin/gsed"}
 516: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
 517: ${Xsed="$SED -e 1s/^X//"}
 518
 519# Global variables:
 520EXIT_SUCCESS=0
 521EXIT_FAILURE=1
 522EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
 523EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
 524
 525exit_status=$EXIT_SUCCESS
 526
 527# Make sure IFS has a sensible default
 528lt_nl='
 529'
 530IFS=" 	$lt_nl"
 531
 532dirname="s,/[^/]*$,,"
 533basename="s,^.*/,,"
 534
 535# func_dirname_and_basename file append nondir_replacement
 536# perform func_basename and func_dirname in a single function
 537# call:
 538#   dirname:  Compute the dirname of FILE.  If nonempty,
 539#             add APPEND to the result, otherwise set result
 540#             to NONDIR_REPLACEMENT.
 541#             value returned in "$func_dirname_result"
 542#   basename: Compute filename of FILE.
 543#             value retuned in "$func_basename_result"
 544# Implementation must be kept synchronized with func_dirname
 545# and func_basename. For efficiency, we do not delegate to
 546# those functions but instead duplicate the functionality here.
 547func_dirname_and_basename ()
 548{
 549  # Extract subdirectory from the argument.
 550  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
 551  if test "X$func_dirname_result" = "X${1}"; then
 552    func_dirname_result="${3}"
 553  else
 554    func_dirname_result="$func_dirname_result${2}"
 555  fi
 556  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
 557}
 558
 559# Generated shell functions inserted here.
 560
 561# func_dirname file append nondir_replacement
 562# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
 563# otherwise set result to NONDIR_REPLACEMENT.
 564func_dirname ()
 565{
 566  case ${1} in
 567    */*) func_dirname_result="${1%/*}${2}" ;;
 568    *  ) func_dirname_result="${3}" ;;
 569  esac
 570}
 571
 572# func_basename file
 573func_basename ()
 574{
 575  func_basename_result="${1##*/}"
 576}
 577
 578# func_dirname_and_basename file append nondir_replacement
 579# perform func_basename and func_dirname in a single function
 580# call:
 581#   dirname:  Compute the dirname of FILE.  If nonempty,
 582#             add APPEND to the result, otherwise set result
 583#             to NONDIR_REPLACEMENT.
 584#             value returned in "$func_dirname_result"
 585#   basename: Compute filename of FILE.
 586#             value retuned in "$func_basename_result"
 587# Implementation must be kept synchronized with func_dirname
 588# and func_basename. For efficiency, we do not delegate to
 589# those functions but instead duplicate the functionality here.
 590func_dirname_and_basename ()
 591{
 592  case ${1} in
 593    */*) func_dirname_result="${1%/*}${2}" ;;
 594    *  ) func_dirname_result="${3}" ;;
 595  esac
 596  func_basename_result="${1##*/}"
 597}
 598
 599# func_stripname prefix suffix name
 600# strip PREFIX and SUFFIX off of NAME.
 601# PREFIX and SUFFIX must not contain globbing or regex special
 602# characters, hashes, percent signs, but SUFFIX may contain a leading
 603# dot (in which case that matches only a dot).
 604func_stripname ()
 605{
 606  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
 607  # positional parameters, so assign one to ordinary parameter first.
 608  func_stripname_result=${3}
 609  func_stripname_result=${func_stripname_result#"${1}"}
 610  func_stripname_result=${func_stripname_result%"${2}"}
 611}
 612
 613# func_opt_split
 614func_opt_split ()
 615{
 616  func_opt_split_opt=${1%%=*}
 617  func_opt_split_arg=${1#*=}
 618}
 619
 620# func_lo2o object
 621func_lo2o ()
 622{
 623  case ${1} in
 624    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
 625    *)    func_lo2o_result=${1} ;;
 626  esac
 627}
 628
 629# func_xform libobj-or-source
 630func_xform ()
 631{
 632  func_xform_result=${1%.*}.lo
 633}
 634
 635# func_arith arithmetic-term...
 636func_arith ()
 637{
 638  func_arith_result=$(( $* ))
 639}
 640
 641# func_len string
 642# STRING may not start with a hyphen.
 643func_len ()
 644{
 645  func_len_result=${#1}
 646}
 647
 648
 649# func_append var value
 650# Append VALUE to the end of shell variable VAR.
 651func_append ()
 652{
 653  eval "$1+=\$2"
 654}
 655# Generated shell functions inserted here.
 656
 657# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
 658# is ksh but when the shell is invoked as "sh" and the current value of
 659# the _XPG environment variable is not equal to 1 (one), the special
 660# positional parameter $0, within a function call, is the name of the
 661# function.
 662progpath="$0"
 663
 664# The name of this program:
 665# In the unlikely event $progname began with a '-', it would play havoc with
 666# func_echo (imagine progname=-n), so we prepend ./ in that case:
 667func_dirname_and_basename "$progpath"
 668progname=$func_basename_result
 669case $progname in
 670  -*) progname=./$progname ;;
 671esac
 672
 673# Make sure we have an absolute path for reexecution:
 674case $progpath in
 675  [\\/]*|[A-Za-z]:\\*) ;;
 676  *[\\/]*)
 677     progdir=$func_dirname_result
 678     progdir=`cd "$progdir" && pwd`
 679     progpath="$progdir/$progname"
 680     ;;
 681  *)
 682     save_IFS="$IFS"
 683     IFS=:
 684     for progdir in $PATH; do
 685       IFS="$save_IFS"
 686       test -x "$progdir/$progname" && break
 687     done
 688     IFS="$save_IFS"
 689     test -n "$progdir" || progdir=`pwd`
 690     progpath="$progdir/$progname"
 691     ;;
 692esac
 693
 694# Sed substitution that helps us do robust quoting.  It backslashifies
 695# metacharacters that are still active within double-quoted strings.
 696Xsed="${SED}"' -e 1s/^X//'
 697sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
 698
 699# Same as above, but do not quote variable references.
 700double_quote_subst='s/\(["`\\]\)/\\\1/g'
 701
 702# Re-`\' parameter expansions in output of double_quote_subst that were
 703# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
 704# in input to double_quote_subst, that '$' was protected from expansion.
 705# Since each input `\' is now two `\'s, look for any number of runs of
 706# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
 707bs='\\'
 708bs2='\\\\'
 709bs4='\\\\\\\\'
 710dollar='\$'
 711sed_double_backslash="\
 712  s/$bs4/&\\
 713/g
 714  s/^$bs2$dollar/$bs&/
 715  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
 716  s/\n//g"
 717
 718# Standard options:
 719opt_dry_run=false
 720opt_help=false
 721opt_quiet=false
 722opt_verbose=false
 723opt_warning=:
 724
 725# func_echo arg...
 726# Echo program name prefixed message, along with the current mode
 727# name if it has been set yet.
 728func_echo ()
 729{
 730    $ECHO "$progname${mode+: }$mode: $*"
 731}
 732
 733# func_verbose arg...
 734# Echo program name prefixed message in verbose mode only.
 735func_verbose ()
 736{
 737    $opt_verbose && func_echo ${1+"$@"}
 738
 739    # A bug in bash halts the script if the last line of a function
 740    # fails when set -e is in force, so we need another command to
 741    # work around that:
 742    :
 743}
 744
 745# func_error arg...
 746# Echo program name prefixed message to standard error.
 747func_error ()
 748{
 749    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
 750}
 751
 752# func_warning arg...
 753# Echo program name prefixed warning message to standard error.
 754func_warning ()
 755{
 756    $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
 757
 758    # bash bug again:
 759    :
 760}
 761
 762# func_fatal_error arg...
 763# Echo program name prefixed message to standard error, and exit.
 764func_fatal_error ()
 765{
 766    func_error ${1+"$@"}
 767    exit $EXIT_FAILURE
 768}
 769
 770# func_fatal_help arg...
 771# Echo program name prefixed message to standard error, followed by
 772# a help hint, and exit.
 773func_fatal_help ()
 774{
 775    func_error ${1+"$@"}
 776    func_fatal_error "$help"
 777}
 778help="Try \`$progname --help' for more information."  ## default
 779
 780
 781# func_grep expression filename
 782# Check whether EXPRESSION matches any line of FILENAME, without output.
 783func_grep ()
 784{
 785    $GREP "$1" "$2" >/dev/null 2>&1
 786}
 787
 788
 789# func_mkdir_p directory-path
 790# Make sure the entire path to DIRECTORY-PATH is available.
 791func_mkdir_p ()
 792{
 793    my_directory_path="$1"
 794    my_dir_list=
 795
 796    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
 797
 798      # Protect directory names starting with `-'
 799      case $my_directory_path in
 800        -*) my_directory_path="./$my_directory_path" ;;
 801      esac
 802
 803      # While some portion of DIR does not yet exist...
 804      while test ! -d "$my_directory_path"; do
 805        # ...make a list in topmost first order.  Use a colon delimited
 806	# list incase some portion of path contains whitespace.
 807        my_dir_list="$my_directory_path:$my_dir_list"
 808
 809        # If the last portion added has no slash in it, the list is done
 810        case $my_directory_path in */*) ;; *) break ;; esac
 811
 812        # ...otherwise throw away the child directory and loop
 813        my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
 814      done
 815      my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
 816
 817      save_mkdir_p_IFS="$IFS"; IFS=':'
 818      for my_dir in $my_dir_list; do
 819	IFS="$save_mkdir_p_IFS"
 820        # mkdir can fail with a `File exist' error if two processes
 821        # try to create one of the directories concurrently.  Don't
 822        # stop in that case!
 823        $MKDIR "$my_dir" 2>/dev/null || :
 824      done
 825      IFS="$save_mkdir_p_IFS"
 826
 827      # Bail out if we (or some other process) failed to create a directory.
 828      test -d "$my_directory_path" || \
 829        func_fatal_error "Failed to create \`$1'"
 830    fi
 831}
 832
 833
 834# func_mktempdir [string]
 835# Make a temporary directory that won't clash with other running
 836# libtool processes, and avoids race conditions if possible.  If
 837# given, STRING is the basename for that directory.
 838func_mktempdir ()
 839{
 840    my_template="${TMPDIR-/tmp}/${1-$progname}"
 841
 842    if test "$opt_dry_run" = ":"; then
 843      # Return a directory name, but don't create it in dry-run mode
 844      my_tmpdir="${my_template}-$$"
 845    else
 846
 847      # If mktemp works, use that first and foremost
 848      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
 849
 850      if test ! -d "$my_tmpdir"; then
 851        # Failing that, at least try and use $RANDOM to avoid a race
 852        my_tmpdir="${my_template}-${RANDOM-0}$$"
 853
 854        save_mktempdir_umask=`umask`
 855        umask 0077
 856        $MKDIR "$my_tmpdir"
 857        umask $save_mktempdir_umask
 858      fi
 859
 860      # If we're not in dry-run mode, bomb out on failure
 861      test -d "$my_tmpdir" || \
 862        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
 863    fi
 864
 865    $ECHO "X$my_tmpdir" | $Xsed
 866}
 867
 868
 869# func_quote_for_eval arg
 870# Aesthetically quote ARG to be evaled later.
 871# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
 872# is double-quoted, suitable for a subsequent eval, whereas
 873# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
 874# which are still active within double quotes backslashified.
 875func_quote_for_eval ()
 876{
 877    case $1 in
 878      *[\\\`\"\$]*)
 879	func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
 880      *)
 881        func_quote_for_eval_unquoted_result="$1" ;;
 882    esac
 883
 884    case $func_quote_for_eval_unquoted_result in
 885      # Double-quote args containing shell metacharacters to delay
 886      # word splitting, command substitution and and variable
 887      # expansion for a subsequent eval.
 888      # Many Bourne shells cannot handle close brackets correctly
 889      # in scan sets, so we specify it separately.
 890      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
 891        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
 892        ;;
 893      *)
 894        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
 895    esac
 896}
 897
 898
 899# func_quote_for_expand arg
 900# Aesthetically quote ARG to be evaled later; same as above,
 901# but do not quote variable references.
 902func_quote_for_expand ()
 903{
 904    case $1 in
 905      *[\\\`\"]*)
 906	my_arg=`$ECHO "X$1" | $Xsed \
 907	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
 908      *)
 909        my_arg="$1" ;;
 910    esac
 911
 912    case $my_arg in
 913      # Double-quote args containing shell metacharacters to delay
 914      # word splitting and command substitution for a subsequent eval.
 915      # Many Bourne shells cannot handle close brackets correctly
 916      # in scan sets, so we specify it separately.
 917      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
 918        my_arg="\"$my_arg\""
 919        ;;
 920    esac
 921
 922    func_quote_for_expand_result="$my_arg"
 923}
 924
 925
 926# func_show_eval cmd [fail_exp]
 927# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
 928# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
 929# is given, then evaluate it.
 930func_show_eval ()
 931{
 932    my_cmd="$1"
 933    my_fail_exp="${2-:}"
 934
 935    ${opt_silent-false} || {
 936      func_quote_for_expand "$my_cmd"
 937      eval "func_echo $func_quote_for_expand_result"
 938    }
 939
 940    if ${opt_dry_run-false}; then :; else
 941      eval "$my_cmd"
 942      my_status=$?
 943      if test "$my_status" -eq 0; then :; else
 944	eval "(exit $my_status); $my_fail_exp"
 945      fi
 946    fi
 947}
 948
 949
 950# func_show_eval_locale cmd [fail_exp]
 951# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
 952# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
 953# is given, then evaluate it.  Use the saved locale for evaluation.
 954func_show_eval_locale ()
 955{
 956    my_cmd="$1"
 957    my_fail_exp="${2-:}"
 958
 959    ${opt_silent-false} || {
 960      func_quote_for_expand "$my_cmd"
 961      eval "func_echo $func_quote_for_expand_result"
 962    }
 963
 964    if ${opt_dry_run-false}; then :; else
 965      eval "$lt_user_locale
 966	    $my_cmd"
 967      my_status=$?
 968      eval "$lt_safe_locale"
 969      if test "$my_status" -eq 0; then :; else
 970	eval "(exit $my_status); $my_fail_exp"
 971      fi
 972    fi
 973}
 974
 975
 976
 977
 978
 979# func_version
 980# Echo version message to standard output and exit.
 981func_version ()
 982{
 983    $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
 984        s/^# //
 985	s/^# *$//
 986        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
 987        p
 988     }' < "$progpath"
 989     exit $?
 990}
 991
 992# func_usage
 993# Echo short help message to standard output and exit.
 994func_usage ()
 995{
 996    $SED -n '/^# Usage:/,/# -h/ {
 997        s/^# //
 998	s/^# *$//
 999	s/\$progname/'$progname'/
1000	p
1001    }' < "$progpath"
1002    $ECHO
1003    $ECHO "run \`$progname --help | more' for full usage"
1004    exit $?
1005}
1006
1007# func_help
1008# Echo long help message to standard output and exit.
1009func_help ()
1010{
1011    $SED -n '/^# Usage:/,/# Report bugs to/ {
1012        s/^# //
1013	s/^# *$//
1014	s*\$progname*'$progname'*
1015	s*\$host*'"$host"'*
1016	s*\$SHELL*'"$SHELL"'*
1017	s*\$LTCC*'"$LTCC"'*
1018	s*\$LTCFLAGS*'"$LTCFLAGS"'*
1019	s*\$LD*'"$LD"'*
1020	s/\$with_gnu_ld/'"$with_gnu_ld"'/
1021	s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
1022	s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
1023	p
1024     }' < "$progpath"
1025    exit $?
1026}
1027
1028# func_missing_arg argname
1029# Echo program name prefixed message to standard error and set global
1030# exit_cmd.
1031func_missing_arg ()
1032{
1033    func_error "missing argument for $1"
1034    exit_cmd=exit
1035}
1036
1037exit_cmd=:
1038
1039
1040
1041
1042
1043# Check that we have a working $ECHO.
1044if test "X$1" = X--no-reexec; then
1045  # Discard the --no-reexec flag, and continue.
1046  shift
1047elif test "X$1" = X--fallback-echo; then
1048  # Avoid inline document here, it may be left over
1049  :
1050elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
1051  # Yippee, $ECHO works!
1052  :
1053else
1054  # Restart under the correct shell, and then maybe $ECHO will work.
1055  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
1056fi
1057
1058if test "X$1" = X--fallback-echo; then
1059  # used as fallback echo
1060  shift
1061  cat <<EOF
1062$*
1063EOF
1064  exit $EXIT_SUCCESS
1065fi
1066
1067magic="%%%MAGIC variable%%%"
1068magic_exe="%%%MAGIC EXE variable%%%"
1069
1070# Global variables.
1071# $mode is unset
1072nonopt=
1073execute_dlfiles=
1074preserve_args=
1075lo2o="s/\\.lo\$/.${objext}/"
1076o2lo="s/\\.${objext}\$/.lo/"
1077extracted_archives=
1078extracted_serial=0
1079
1080opt_dry_run=false
1081opt_duplicate_deps=false
1082opt_silent=false
1083opt_debug=:
1084
1085# If this variable is set in any of the actions, the command in it
1086# will be execed at the end.  This prevents here-documents from being
1087# left over by shells.
1088exec_cmd=
1089
1090# func_fatal_configuration arg...
1091# Echo program name prefixed message to standard error, followed by
1092# a configuration failure hint, and exit.
1093func_fatal_configuration ()
1094{
1095    func_error ${1+"$@"}
1096    func_error "See the $PACKAGE documentation for more information."
1097    func_fatal_error "Fatal configuration error."
1098}
1099
1100
1101# func_config
1102# Display the configuration for all the tags in this script.
1103func_config ()
1104{
1105    re_begincf='^# ### BEGIN LIBTOOL'
1106    re_endcf='^# ### END LIBTOOL'
1107
1108    # Default configuration.
1109    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
1110
1111    # Now print the configurations for the tags.
1112    for tagname in $taglist; do
1113      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
1114    done
1115
1116    exit $?
1117}
1118
1119# func_features
1120# Display the features supported by this script.
1121func_features ()
1122{
1123    $ECHO "host: $host"
1124    if test "$build_libtool_libs" = yes; then
1125      $ECHO "enable shared libraries"
1126    else
1127      $ECHO "disable shared libraries"
1128    fi
1129    if test "$build_old_libs" = yes; then
1130      $ECHO "enable static libraries"
1131    else
1132      $ECHO "disable static libraries"
1133    fi
1134
1135    exit $?
1136}
1137
1138# func_enable_tag tagname
1139# Verify that TAGNAME is valid, and either flag an error and exit, or
1140# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
1141# variable here.
1142func_enable_tag ()
1143{
1144  # Global variable:
1145  tagname="$1"
1146
1147  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
1148  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
1149  sed_extractcf="/$re_begincf/,/$re_endcf/p"
1150
1151  # Validate tagname.
1152  case $tagname in
1153    *[!-_A-Za-z0-9,/]*)
1154      func_fatal_error "invalid tag name: $tagname"
1155      ;;
1156  esac
1157
1158  # Don't test for the "default" C tag, as we know it's
1159  # there but not specially marked.
1160  case $tagname in
1161    CC) ;;
1162    *)
1163      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
1164	taglist="$taglist $tagname"
1165
1166	# Evaluate the configuration.  Be careful to quote the path
1167	# and the sed script, to avoid splitting on whitespace, but
1168	# also don't use non-portable quotes within backquotes within
1169	# quotes we have to do it in 2 steps:
1170	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
1171	eval "$extractedcf"
1172      else
1173	func_error "ignoring unknown tag $tagname"
1174      fi
1175      ;;
1176  esac
1177}
1178
1179# Parse options once, thoroughly.  This comes as soon as possible in
1180# the script to make things like `libtool --version' happen quickly.
1181{
1182
1183  # Shorthand for --mode=foo, only valid as the first argument
1184  case $1 in
1185  clean|clea|cle|cl)
1186    shift; set dummy --mode clean ${1+"$@"}; shift
1187    ;;
1188  compile|compil|compi|comp|com|co|c)
1189    shift; set dummy --mode compile ${1+"$@"}; shift
1190    ;;
1191  execute|execut|execu|exec|exe|ex|e)
1192    shift; set dummy --mode execute ${1+"$@"}; shift
1193    ;;
1194  finish|finis|fini|fin|fi|f)
1195    shift; set dummy --mode finish ${1+"$@"}; shift
1196    ;;
1197  install|instal|insta|inst|ins|in|i)
1198    shift; set dummy --mode install ${1+"$@"}; shift
1199    ;;
1200  link|lin|li|l)
1201    shift; set dummy --mode link ${1+"$@"}; shift
1202    ;;
1203  uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1204    shift; set dummy --mode uninstall ${1+"$@"}; shift
1205    ;;
1206  esac
1207
1208  # Parse non-mode specific arguments:
1209  while test "$#" -gt 0; do
1210    opt="$1"
1211    shift
1212
1213    case $opt in
1214      --config)		func_config					;;
1215
1216      --debug)		preserve_args="$preserve_args $opt"
1217			func_echo "enabling shell trace mode"
1218			opt_debug='set -x'
1219			$opt_debug
1220			;;
1221
1222      -dlopen)		test "$#" -eq 0 && func_missing_arg "$opt" && break
1223			execute_dlfiles="$execute_dlfiles $1"
1224			shift
1225			;;
1226
1227      --dry-run | -n)	opt_dry_run=:					;;
1228      --features)       func_features					;;
1229      --finish)		mode="finish"					;;
1230
1231      --mode)		test "$#" -eq 0 && func_missing_arg "$opt" && break
1232			case $1 in
1233			  # Valid mode arguments:
1234			  clean)	;;
1235			  compile)	;;
1236			  execute)	;;
1237			  finish)	;;
1238			  install)	;;
1239			  link)		;;
1240			  relink)	;;
1241			  uninstall)	;;
1242
1243			  # Catch anything else as an error
1244			  *) func_error "invalid argument for $opt"
1245			     exit_cmd=exit
1246			     break
1247			     ;;
1248		        esac
1249
1250			mode="$1"
1251			shift
1252			;;
1253
1254      --preserve-dup-deps)
1255			opt_duplicate_deps=:				;;
1256
1257      --quiet|--silent)	preserve_args="$preserve_args $opt"
1258			opt_silent=:
1259			;;
1260
1261      --verbose| -v)	preserve_args="$preserve_args $opt"
1262			opt_silent=false
1263			;;
1264
1265      --tag)		test "$#" -eq 0 && func_missing_arg "$opt" && break
1266			preserve_args="$preserve_args $opt $1"
1267			func_enable_tag "$1"	# tagname is set here
1268			shift
1269			;;
1270
1271      # Separate optargs to long options:
1272      -dlopen=*|--mode=*|--tag=*)
1273			func_opt_split "$opt"
1274			set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
1275			shift
1276			;;
1277
1278      -\?|-h)		func_usage					;;
1279      --help)		opt_help=:					;;
1280      --version)	func_version					;;
1281
1282      -*)		func_fatal_help "unrecognized option \`$opt'"	;;
1283
1284      *)		nonopt="$opt"
1285			break
1286			;;
1287    esac
1288  done
1289
1290
1291  case $host in
1292    *cygwin* | *mingw* | *pw32* | *cegcc*)
1293      # don't eliminate duplications in $postdeps and $predeps
1294      opt_duplicate_compiler_generated_deps=:
1295      ;;
1296    *)
1297      opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
1298      ;;
1299  esac
1300
1301  # Having warned about all mis-specified options, bail out if
1302  # anything was wrong.
1303  $exit_cmd $EXIT_FAILURE
1304}
1305
1306# func_check_version_match
1307# Ensure that we are using m4 macros, and libtool script from the same
1308# release of libtool.
1309func_check_version_match ()
1310{
1311  if test "$package_revision" != "$macro_revision"; then
1312    if test "$VERSION" != "$macro_version"; then
1313      if test -z "$macro_version"; then
1314        cat >&2 <<_LT_EOF
1315$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
1316$progname: definition of this LT_INIT comes from an older release.
1317$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1318$progname: and run autoconf again.
1319_LT_EOF
1320      else
1321        cat >&2 <<_LT_EOF
1322$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
1323$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
1324$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1325$progname: and run autoconf again.
1326_LT_EOF
1327      fi
1328    else
1329      cat >&2 <<_LT_EOF
1330$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
1331$progname: but the definition of this LT_INIT comes from revision $macro_revision.
1332$progname: You should recreate aclocal.m4 with macros from revision $package_revision
1333$progname: of $PACKAGE $VERSION and run autoconf again.
1334_LT_EOF
1335    fi
1336
1337    exit $EXIT_MISMATCH
1338  fi
1339}
1340
1341
1342## ----------- ##
1343##    Main.    ##
1344## ----------- ##
1345
1346$opt_help || {
1347  # Sanity checks first:
1348  func_check_version_match
1349
1350  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1351    func_fatal_configuration "not configured to build any kind of library"
1352  fi
1353
1354  test -z "$mode" && func_fatal_error "error: you must specify a MODE."
1355
1356
1357  # Darwin sucks
1358  eval std_shrext=\"$shrext_cmds\"
1359
1360
1361  # Only execute mode is allowed to have -dlopen flags.
1362  if test -n "$execute_dlfiles" && test "$mode" != execute; then
1363    func_error "unrecognized option \`-dlopen'"
1364    $ECHO "$help" 1>&2
1365    exit $EXIT_FAILURE
1366  fi
1367
1368  # Change the help message to a mode-specific one.
1369  generic_help="$help"
1370  help="Try \`$progname --help --mode=$mode' for more information."
1371}
1372
1373
1374# func_lalib_p file
1375# True iff FILE is a libtool `.la' library or `.lo' object file.
1376# This function is only a basic sanity check; it will hardly flush out
1377# determined imposters.
1378func_lalib_p ()
1379{
1380    test -f "$1" &&
1381      $SED -e 4q "$1" 2>/dev/null \
1382        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
1383}
1384
1385# func_lalib_unsafe_p file
1386# True iff FILE is a libtool `.la' library or `.lo' object file.
1387# This function implements the same check as func_lalib_p without
1388# resorting to external programs.  To this end, it redirects stdin and
1389# closes it afterwards, without saving the original file descriptor.
1390# As a safety measure, use it only where a negative result would be
1391# fatal anyway.  Works if `file' does not exist.
1392func_lalib_unsafe_p ()
1393{
1394    lalib_p=no
1395    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
1396	for lalib_p_l in 1 2 3 4
1397	do
1398	    read lalib_p_line
1399	    case "$lalib_p_line" in
1400		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1401	    esac
1402	done
1403	exec 0<&5 5<&-
1404    fi
1405    test "$lalib_p" = yes
1406}
1407
1408# func_ltwrapper_script_p file
1409# True iff FILE is a libtool wrapper script
1410# This function is only a basic sanity check; it will hardly flush out
1411# determined imposters.
1412func_ltwrapper_script_p ()
1413{
1414    func_lalib_p "$1"
1415}
1416
1417# func_ltwrapper_executable_p file
1418# True iff FILE is a libtool wrapper executable
1419# This function is only a basic sanity check; it will hardly flush out
1420# determined imposters.
1421func_ltwrapper_executable_p ()
1422{
1423    func_ltwrapper_exec_suffix=
1424    case $1 in
1425    *.exe) ;;
1426    *) func_ltwrapper_exec_suffix=.exe ;;
1427    esac
1428    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
1429}
1430
1431# func_ltwrapper_scriptname file
1432# Assumes file is an ltwrapper_executable
1433# uses $file to determine the appropriate filename for a
1434# temporary ltwrapper_script.
1435func_ltwrapper_scriptname ()
1436{
1437    func_ltwrapper_scriptname_result=""
1438    if func_ltwrapper_executable_p "$1"; then
1439	func_dirname_and_basename "$1" "" "."
1440	func_stripname '' '.exe' "$func_basename_result"
1441	func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
1442    fi
1443}
1444
1445# func_ltwrapper_p file
1446# True iff FILE is a libtool wrapper script or wrapper executable
1447# This function is only a basic sanity check; it will hardly flush out
1448# determined imposters.
1449func_ltwrapper_p ()
1450{
1451    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
1452}
1453
1454
1455# func_execute_cmds commands fail_cmd
1456# Execute tilde-delimited COMMANDS.
1457# If FAIL_CMD is given, eval that upon failure.
1458# FAIL_CMD may read-access the current command in variable CMD!
1459func_execute_cmds ()
1460{
1461    $opt_debug
1462    save_ifs=$IFS; IFS='~'
1463    for cmd in $1; do
1464      IFS=$save_ifs
1465      eval cmd=\"$cmd\"
1466      func_show_eval "$cmd" "${2-:}"
1467    done
1468    IFS=$save_ifs
1469}
1470
1471
1472# func_source file
1473# Source FILE, adding directory component if necessary.
1474# Note that it is not necessary on cygwin/mingw to append a dot to
1475# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
1476# behavior happens only for exec(3), not for open(2)!  Also, sourcing
1477# `FILE.' does not work on cygwin managed mounts.
1478func_source ()
1479{
1480    $opt_debug
1481    case $1 in
1482    */* | *\\*)	. "$1" ;;
1483    *)		. "./$1" ;;
1484    esac
1485}
1486
1487
1488# func_infer_tag arg
1489# Infer tagged configuration to use if any are available and
1490# if one wasn't chosen via the "--tag" command line option.
1491# Only attempt this if the compiler in the base compile
1492# command doesn't match the default compiler.
1493# arg is usually of the form 'gcc ...'
1494func_infer_tag ()
1495{
1496    $opt_debug
1497    if test -n "$available_tags" && test -z "$tagname"; then
1498      CC_quoted=
1499      for arg in $CC; do
1500        func_quote_for_eval "$arg"
1501	CC_quoted="$CC_quoted $func_quote_for_eval_result"
1502      done
1503      case $@ in
1504      # Blanks in the command may have been stripped by the calling shell,
1505      # but not from the CC environment variable when configure was run.
1506      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
1507      # Blanks at the start of $base_compile will cause this to fail
1508      # if we don't check for them as well.
1509      *)
1510	for z in $available_tags; do
1511	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1512	    # Evaluate the configuration.
1513	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1514	    CC_quoted=
1515	    for arg in $CC; do
1516	      # Double-quote args containing other shell metacharacters.
1517	      func_quote_for_eval "$arg"
1518	      CC_quoted="$CC_quoted $func_quote_for_eval_result"
1519	    done
1520	    case "$@ " in
1521	      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
1522	      # The compiler in the base compile command matches
1523	      # the one in the tagged configuration.
1524	      # Assume this is the tagged configuration we want.
1525	      tagname=$z
1526	      break
1527	      ;;
1528	    esac
1529	  fi
1530	done
1531	# If $tagname still isn't set, then no tagged configuration
1532	# was found and let the user know that the "--tag" command
1533	# line option must be used.
1534	if test -z "$tagname"; then
1535	  func_echo "unable to infer tagged configuration"
1536	  func_fatal_error "specify a tag with \`--tag'"
1537#	else
1538#	  func_verbose "using $tagname tagged configuration"
1539	fi
1540	;;
1541      esac
1542    fi
1543}
1544
1545
1546
1547# func_write_libtool_object output_name pic_name nonpic_name
1548# Create a libtool object file (analogous to a ".la" file),
1549# but don't create it if we're doing a dry run.
1550func_write_libtool_object ()
1551{
1552    write_libobj=${1}
1553    if test "$build_libtool_libs" = yes; then
1554      write_lobj=\'${2}\'
1555    else
1556      write_lobj=none
1557    fi
1558
1559    if test "$build_old_libs" = yes; then
1560      write_oldobj=\'${3}\'
1561    else
1562      write_oldobj=none
1563    fi
1564
1565    $opt_dry_run || {
1566      cat >${write_libobj}T <<EOF
1567# $write_libobj - a libtool object file
1568# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1569#
1570# Please DO NOT delete this file!
1571# It is necessary for linking the library.
1572
1573# Name of the PIC object.
1574pic_object=$write_lobj
1575
1576# Name of the non-PIC object
1577non_pic_object=$write_oldobj
1578
1579EOF
1580      $MV "${write_libobj}T" "${write_libobj}"
1581    }
1582}
1583
1584# func_mode_compile arg...
1585func_mode_compile ()
1586{
1587    $opt_debug
1588    # Get the compilation command and the source file.
1589    base_compile=
1590    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
1591    suppress_opt=yes
1592    suppress_output=
1593    arg_mode=normal
1594    libobj=
1595    later=
1596    pie_flag=
1597
1598    for arg
1599    do
1600      case $arg_mode in
1601      arg  )
1602	# do not "continue".  Instead, add this to base_compile
1603	lastarg="$arg"
1604	arg_mode=normal
1605	;;
1606
1607      target )
1608	libobj="$arg"
1609	arg_mode=normal
1610	continue
1611	;;
1612
1613      normal )
1614	# Accept any command-line options.
1615	case $arg in
1616	-o)
1617	  test -n "$libobj" && \
1618	    func_fatal_error "you cannot specify \`-o' more than once"
1619	  arg_mode=target
1620	  continue
1621	  ;;
1622
1623	-pie | -fpie | -fPIE)
1624          pie_flag="$pie_flag $arg"
1625	  continue
1626	  ;;
1627
1628	-shared | -static | -prefer-pic | -prefer-non-pic)
1629	  later="$later $arg"
1630	  continue
1631	  ;;
1632
1633	-no-suppress)
1634	  suppress_opt=no
1635	  continue
1636	  ;;
1637
1638	-Xcompiler)
1639	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
1640	  continue      #  The current "srcfile" will either be retained or
1641	  ;;            #  replaced later.  I would guess that would be a bug.
1642
1643	-Wc,*)
1644	  func_stripname '-Wc,' '' "$arg"
1645	  args=$func_stripname_result
1646	  lastarg=
1647	  save_ifs="$IFS"; IFS=','
1648	  for arg in $args; do
1649	    IFS="$save_ifs"
1650	    func_quote_for_eval "$arg"
1651	    lastarg="$lastarg $func_quote_for_eval_result"
1652	  done
1653	  IFS="$save_ifs"
1654	  func_stripname ' ' '' "$lastarg"
1655	  lastarg=$func_stripname_result
1656
1657	  # Add the arguments to base_compile.
1658	  base_compile="$base_compile $lastarg"
1659	  continue
1660	  ;;
1661
1662	*)
1663	  # Accept the current argument as the source file.
1664	  # The previous "srcfile" becomes the current argument.
1665	  #
1666	  lastarg="$srcfile"
1667	  srcfile="$arg"
1668	  ;;
1669	esac  #  case $arg
1670	;;
1671      esac    #  case $arg_mode
1672
1673      # Aesthetically quote the previous argument.
1674      func_quote_for_eval "$lastarg"
1675      base_compile="$base_compile $func_quote_for_eval_result"
1676    done # for arg
1677
1678    case $arg_mode in
1679    arg)
1680      func_fatal_error "you must specify an argument for -Xcompile"
1681      ;;
1682    target)
1683      func_fatal_error "you must specify a target with \`-o'"
1684      ;;
1685    *)
1686      # Get the name of the library object.
1687      test -z "$libobj" && {
1688	func_basename "$srcfile"
1689	libobj="$func_basename_result"
1690      }
1691      ;;
1692    esac
1693
1694    # Recognize several different file suffixes.
1695    # If the user specifies -o file.o, it is replaced with file.lo
1696    case $libobj in
1697    *.[cCFSifmso] | \
1698    *.ada | *.adb | *.ads | *.asm | \
1699    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
1700    *.[fF][09]? | *.for | *.java | *.obj | *.sx)
1701      func_xform "$libobj"
1702      libobj=$func_xform_result
1703      ;;
1704    esac
1705
1706    case $libobj in
1707    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
1708    *)
1709      func_fatal_error "cannot determine name of library object from \`$libobj'"
1710      ;;
1711    esac
1712
1713    func_infer_tag $base_compile
1714
1715    for arg in $later; do
1716      case $arg in
1717      -shared)
1718	test "$build_libtool_libs" != yes && \
1719	  func_fatal_configuration "can not build a shared library"
1720	build_old_libs=no
1721	continue
1722	;;
1723
1724      -static)
1725	build_libtool_libs=no
1726	build_old_libs=yes
1727	continue
1728	;;
1729
1730      -prefer-pic)
1731	pic_mode=yes
1732	continue
1733	;;
1734
1735      -prefer-non-pic)
1736	pic_mode=no
1737	continue
1738	;;
1739      esac
1740    done
1741
1742    func_quote_for_eval "$libobj"
1743    test "X$libobj" != "X$func_quote_for_eval_result" \
1744      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
1745      && func_warning "libobj name \`$libobj' may not contain shell special characters."
1746    func_dirname_and_basename "$obj" "/" ""
1747    objname="$func_basename_result"
1748    xdir="$func_dirname_result"
1749    lobj=${xdir}$ob

Large files files are truncated, but you can click here to view the full file