/libtool

http://github.com/fizx/parsley · Shell · 8890 lines · 7081 code · 686 blank · 1123 comment · 750 complexity · 49bf31347fbe76c3a8350a685f6d89eb MD5 · raw file

Large files are truncated click here to view the full file

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