/libconfig-1.4.8/m4/libtool.m4
m4 | 7437 lines | 5409 code | 724 blank | 1304 comment | 0 complexity | c3a35a01d632ce199b40fde91ba72ca5 MD5 | raw file
Possible License(s): LGPL-2.1, LGPL-2.0
Large files files are truncated, but you can click here to view the full file
1# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
2#
3# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
4# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
5# Inc.
6# Written by Gordon Matzigkeit, 1996
7#
8# This file is free software; the Free Software Foundation gives
9# unlimited permission to copy and/or distribute it, with or without
10# modifications, as long as this notice is preserved.
11
12m4_define([_LT_COPYING], [dnl
13# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
14# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
15# Inc.
16# Written by Gordon Matzigkeit, 1996
17#
18# This file is part of GNU Libtool.
19#
20# GNU Libtool is free software; you can redistribute it and/or
21# modify it under the terms of the GNU General Public License as
22# published by the Free Software Foundation; either version 2 of
23# the License, or (at your option) any later version.
24#
25# As a special exception to the GNU General Public License,
26# if you distribute this file as part of a program or library that
27# is built using GNU Libtool, you may include this file under the
28# same distribution terms that you use for the rest of that program.
29#
30# GNU Libtool is distributed in the hope that it will be useful,
31# but WITHOUT ANY WARRANTY; without even the implied warranty of
32# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33# GNU General Public License for more details.
34#
35# You should have received a copy of the GNU General Public License
36# along with GNU Libtool; see the file COPYING. If not, a copy
37# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
38# obtained by writing to the Free Software Foundation, Inc.,
39# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
40])
41
42# serial 57 LT_INIT
43
44
45# LT_PREREQ(VERSION)
46# ------------------
47# Complain and exit if this libtool version is less that VERSION.
48m4_defun([LT_PREREQ],
49[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
50 [m4_default([$3],
51 [m4_fatal([Libtool version $1 or higher is required],
52 63)])],
53 [$2])])
54
55
56# _LT_CHECK_BUILDDIR
57# ------------------
58# Complain if the absolute build directory name contains unusual characters
59m4_defun([_LT_CHECK_BUILDDIR],
60[case `pwd` in
61 *\ * | *\ *)
62 AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
63esac
64])
65
66
67# LT_INIT([OPTIONS])
68# ------------------
69AC_DEFUN([LT_INIT],
70[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
71AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
72AC_BEFORE([$0], [LT_LANG])dnl
73AC_BEFORE([$0], [LT_OUTPUT])dnl
74AC_BEFORE([$0], [LTDL_INIT])dnl
75m4_require([_LT_CHECK_BUILDDIR])dnl
76
77dnl Autoconf doesn't catch unexpanded LT_ macros by default:
78m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
79m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
80dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
81dnl unless we require an AC_DEFUNed macro:
82AC_REQUIRE([LTOPTIONS_VERSION])dnl
83AC_REQUIRE([LTSUGAR_VERSION])dnl
84AC_REQUIRE([LTVERSION_VERSION])dnl
85AC_REQUIRE([LTOBSOLETE_VERSION])dnl
86m4_require([_LT_PROG_LTMAIN])dnl
87
88_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
89
90dnl Parse OPTIONS
91_LT_SET_OPTIONS([$0], [$1])
92
93# This can be used to rebuild libtool when needed
94LIBTOOL_DEPS="$ltmain"
95
96# Always use our own libtool.
97LIBTOOL='$(SHELL) $(top_builddir)/libtool'
98AC_SUBST(LIBTOOL)dnl
99
100_LT_SETUP
101
102# Only expand once:
103m4_define([LT_INIT])
104])# LT_INIT
105
106# Old names:
107AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
108AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
109dnl aclocal-1.4 backwards compatibility:
110dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
111dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
112
113
114# _LT_CC_BASENAME(CC)
115# -------------------
116# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
117m4_defun([_LT_CC_BASENAME],
118[for cc_temp in $1""; do
119 case $cc_temp in
120 compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
121 distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
122 \-*) ;;
123 *) break;;
124 esac
125done
126cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
127])
128
129
130# _LT_FILEUTILS_DEFAULTS
131# ----------------------
132# It is okay to use these file commands and assume they have been set
133# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
134m4_defun([_LT_FILEUTILS_DEFAULTS],
135[: ${CP="cp -f"}
136: ${MV="mv -f"}
137: ${RM="rm -f"}
138])# _LT_FILEUTILS_DEFAULTS
139
140
141# _LT_SETUP
142# ---------
143m4_defun([_LT_SETUP],
144[AC_REQUIRE([AC_CANONICAL_HOST])dnl
145AC_REQUIRE([AC_CANONICAL_BUILD])dnl
146AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
147AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
148
149_LT_DECL([], [host_alias], [0], [The host system])dnl
150_LT_DECL([], [host], [0])dnl
151_LT_DECL([], [host_os], [0])dnl
152dnl
153_LT_DECL([], [build_alias], [0], [The build system])dnl
154_LT_DECL([], [build], [0])dnl
155_LT_DECL([], [build_os], [0])dnl
156dnl
157AC_REQUIRE([AC_PROG_CC])dnl
158AC_REQUIRE([LT_PATH_LD])dnl
159AC_REQUIRE([LT_PATH_NM])dnl
160dnl
161AC_REQUIRE([AC_PROG_LN_S])dnl
162test -z "$LN_S" && LN_S="ln -s"
163_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
164dnl
165AC_REQUIRE([LT_CMD_MAX_LEN])dnl
166_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
167_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
168dnl
169m4_require([_LT_FILEUTILS_DEFAULTS])dnl
170m4_require([_LT_CHECK_SHELL_FEATURES])dnl
171m4_require([_LT_CMD_RELOAD])dnl
172m4_require([_LT_CHECK_MAGIC_METHOD])dnl
173m4_require([_LT_CMD_OLD_ARCHIVE])dnl
174m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
175
176_LT_CONFIG_LIBTOOL_INIT([
177# See if we are running on zsh, and set the options which allow our
178# commands through without removal of \ escapes INIT.
179if test -n "\${ZSH_VERSION+set}" ; then
180 setopt NO_GLOB_SUBST
181fi
182])
183if test -n "${ZSH_VERSION+set}" ; then
184 setopt NO_GLOB_SUBST
185fi
186
187_LT_CHECK_OBJDIR
188
189m4_require([_LT_TAG_COMPILER])dnl
190
191case $host_os in
192aix3*)
193 # AIX sometimes has problems with the GCC collect2 program. For some
194 # reason, if we set the COLLECT_NAMES environment variable, the problems
195 # vanish in a puff of smoke.
196 if test "X${COLLECT_NAMES+set}" != Xset; then
197 COLLECT_NAMES=
198 export COLLECT_NAMES
199 fi
200 ;;
201esac
202
203# Global variables:
204ofile=libtool
205can_build_shared=yes
206
207# All known linkers require a `.a' archive for static linking (except MSVC,
208# which needs '.lib').
209libext=a
210
211with_gnu_ld="$lt_cv_prog_gnu_ld"
212
213old_CC="$CC"
214old_CFLAGS="$CFLAGS"
215
216# Set sane defaults for various variables
217test -z "$CC" && CC=cc
218test -z "$LTCC" && LTCC=$CC
219test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
220test -z "$LD" && LD=ld
221test -z "$ac_objext" && ac_objext=o
222
223_LT_CC_BASENAME([$compiler])
224
225# Only perform the check for file, if the check method requires it
226test -z "$MAGIC_CMD" && MAGIC_CMD=file
227case $deplibs_check_method in
228file_magic*)
229 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
230 _LT_PATH_MAGIC
231 fi
232 ;;
233esac
234
235# Use C for the default configuration in the libtool script
236LT_SUPPORTED_TAG([CC])
237_LT_LANG_C_CONFIG
238_LT_LANG_DEFAULT_CONFIG
239_LT_CONFIG_COMMANDS
240])# _LT_SETUP
241
242
243# _LT_PREPARE_SED_QUOTE_VARS
244# --------------------------
245# Define a few sed substitution that help us do robust quoting.
246m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
247[# Backslashify metacharacters that are still active within
248# double-quoted strings.
249sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
250
251# Same as above, but do not quote variable references.
252double_quote_subst='s/\([["`\\]]\)/\\\1/g'
253
254# Sed substitution to delay expansion of an escaped shell variable in a
255# double_quote_subst'ed string.
256delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
257
258# Sed substitution to delay expansion of an escaped single quote.
259delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
260
261# Sed substitution to avoid accidental globbing in evaled expressions
262no_glob_subst='s/\*/\\\*/g'
263])
264
265# _LT_PROG_LTMAIN
266# ---------------
267# Note that this code is called both from `configure', and `config.status'
268# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
269# `config.status' has no value for ac_aux_dir unless we are using Automake,
270# so we pass a copy along to make sure it has a sensible value anyway.
271m4_defun([_LT_PROG_LTMAIN],
272[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
273_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
274ltmain="$ac_aux_dir/ltmain.sh"
275])# _LT_PROG_LTMAIN
276
277
278## ------------------------------------- ##
279## Accumulate code for creating libtool. ##
280## ------------------------------------- ##
281
282# So that we can recreate a full libtool script including additional
283# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
284# in macros and then make a single call at the end using the `libtool'
285# label.
286
287
288# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
289# ----------------------------------------
290# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
291m4_define([_LT_CONFIG_LIBTOOL_INIT],
292[m4_ifval([$1],
293 [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
294 [$1
295])])])
296
297# Initialize.
298m4_define([_LT_OUTPUT_LIBTOOL_INIT])
299
300
301# _LT_CONFIG_LIBTOOL([COMMANDS])
302# ------------------------------
303# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
304m4_define([_LT_CONFIG_LIBTOOL],
305[m4_ifval([$1],
306 [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
307 [$1
308])])])
309
310# Initialize.
311m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
312
313
314# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
315# -----------------------------------------------------
316m4_defun([_LT_CONFIG_SAVE_COMMANDS],
317[_LT_CONFIG_LIBTOOL([$1])
318_LT_CONFIG_LIBTOOL_INIT([$2])
319])
320
321
322# _LT_FORMAT_COMMENT([COMMENT])
323# -----------------------------
324# Add leading comment marks to the start of each line, and a trailing
325# full-stop to the whole comment if one is not present already.
326m4_define([_LT_FORMAT_COMMENT],
327[m4_ifval([$1], [
328m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
329 [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
330)])
331
332
333
334## ------------------------ ##
335## FIXME: Eliminate VARNAME ##
336## ------------------------ ##
337
338
339# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
340# -------------------------------------------------------------------
341# CONFIGNAME is the name given to the value in the libtool script.
342# VARNAME is the (base) name used in the configure script.
343# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
344# VARNAME. Any other value will be used directly.
345m4_define([_LT_DECL],
346[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
347 [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
348 [m4_ifval([$1], [$1], [$2])])
349 lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
350 m4_ifval([$4],
351 [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
352 lt_dict_add_subkey([lt_decl_dict], [$2],
353 [tagged?], [m4_ifval([$5], [yes], [no])])])
354])
355
356
357# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
358# --------------------------------------------------------
359m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
360
361
362# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
363# ------------------------------------------------
364m4_define([lt_decl_tag_varnames],
365[_lt_decl_filter([tagged?], [yes], $@)])
366
367
368# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
369# ---------------------------------------------------------
370m4_define([_lt_decl_filter],
371[m4_case([$#],
372 [0], [m4_fatal([$0: too few arguments: $#])],
373 [1], [m4_fatal([$0: too few arguments: $#: $1])],
374 [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
375 [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
376 [lt_dict_filter([lt_decl_dict], $@)])[]dnl
377])
378
379
380# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
381# --------------------------------------------------
382m4_define([lt_decl_quote_varnames],
383[_lt_decl_filter([value], [1], $@)])
384
385
386# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
387# ---------------------------------------------------
388m4_define([lt_decl_dquote_varnames],
389[_lt_decl_filter([value], [2], $@)])
390
391
392# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
393# ---------------------------------------------------
394m4_define([lt_decl_varnames_tagged],
395[m4_assert([$# <= 2])dnl
396_$0(m4_quote(m4_default([$1], [[, ]])),
397 m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
398 m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
399m4_define([_lt_decl_varnames_tagged],
400[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
401
402
403# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
404# ------------------------------------------------
405m4_define([lt_decl_all_varnames],
406[_$0(m4_quote(m4_default([$1], [[, ]])),
407 m4_if([$2], [],
408 m4_quote(lt_decl_varnames),
409 m4_quote(m4_shift($@))))[]dnl
410])
411m4_define([_lt_decl_all_varnames],
412[lt_join($@, lt_decl_varnames_tagged([$1],
413 lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
414])
415
416
417# _LT_CONFIG_STATUS_DECLARE([VARNAME])
418# ------------------------------------
419# Quote a variable value, and forward it to `config.status' so that its
420# declaration there will have the same value as in `configure'. VARNAME
421# must have a single quote delimited value for this to work.
422m4_define([_LT_CONFIG_STATUS_DECLARE],
423[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
424
425
426# _LT_CONFIG_STATUS_DECLARATIONS
427# ------------------------------
428# We delimit libtool config variables with single quotes, so when
429# we write them to config.status, we have to be sure to quote all
430# embedded single quotes properly. In configure, this macro expands
431# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
432#
433# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
434m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
435[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
436 [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
437
438
439# _LT_LIBTOOL_TAGS
440# ----------------
441# Output comment and list of tags supported by the script
442m4_defun([_LT_LIBTOOL_TAGS],
443[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
444available_tags="_LT_TAGS"dnl
445])
446
447
448# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
449# -----------------------------------
450# Extract the dictionary values for VARNAME (optionally with TAG) and
451# expand to a commented shell variable setting:
452#
453# # Some comment about what VAR is for.
454# visible_name=$lt_internal_name
455m4_define([_LT_LIBTOOL_DECLARE],
456[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
457 [description])))[]dnl
458m4_pushdef([_libtool_name],
459 m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
460m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
461 [0], [_libtool_name=[$]$1],
462 [1], [_libtool_name=$lt_[]$1],
463 [2], [_libtool_name=$lt_[]$1],
464 [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
465m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
466])
467
468
469# _LT_LIBTOOL_CONFIG_VARS
470# -----------------------
471# Produce commented declarations of non-tagged libtool config variables
472# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
473# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
474# section) are produced by _LT_LIBTOOL_TAG_VARS.
475m4_defun([_LT_LIBTOOL_CONFIG_VARS],
476[m4_foreach([_lt_var],
477 m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
478 [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
479
480
481# _LT_LIBTOOL_TAG_VARS(TAG)
482# -------------------------
483m4_define([_LT_LIBTOOL_TAG_VARS],
484[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
485 [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
486
487
488# _LT_TAGVAR(VARNAME, [TAGNAME])
489# ------------------------------
490m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
491
492
493# _LT_CONFIG_COMMANDS
494# -------------------
495# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
496# variables for single and double quote escaping we saved from calls
497# to _LT_DECL, we can put quote escaped variables declarations
498# into `config.status', and then the shell code to quote escape them in
499# for loops in `config.status'. Finally, any additional code accumulated
500# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
501m4_defun([_LT_CONFIG_COMMANDS],
502[AC_PROVIDE_IFELSE([LT_OUTPUT],
503 dnl If the libtool generation code has been placed in $CONFIG_LT,
504 dnl instead of duplicating it all over again into config.status,
505 dnl then we will have config.status run $CONFIG_LT later, so it
506 dnl needs to know what name is stored there:
507 [AC_CONFIG_COMMANDS([libtool],
508 [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
509 dnl If the libtool generation code is destined for config.status,
510 dnl expand the accumulated commands and init code now:
511 [AC_CONFIG_COMMANDS([libtool],
512 [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
513])#_LT_CONFIG_COMMANDS
514
515
516# Initialize.
517m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
518[
519
520# The HP-UX ksh and POSIX shell print the target directory to stdout
521# if CDPATH is set.
522(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
523
524sed_quote_subst='$sed_quote_subst'
525double_quote_subst='$double_quote_subst'
526delay_variable_subst='$delay_variable_subst'
527_LT_CONFIG_STATUS_DECLARATIONS
528LTCC='$LTCC'
529LTCFLAGS='$LTCFLAGS'
530compiler='$compiler_DEFAULT'
531
532# A function that is used when there is no print builtin or printf.
533func_fallback_echo ()
534{
535 eval 'cat <<_LTECHO_EOF
536\$[]1
537_LTECHO_EOF'
538}
539
540# Quote evaled strings.
541for var in lt_decl_all_varnames([[ \
542]], lt_decl_quote_varnames); do
543 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
544 *[[\\\\\\\`\\"\\\$]]*)
545 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
546 ;;
547 *)
548 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
549 ;;
550 esac
551done
552
553# Double-quote double-evaled strings.
554for var in lt_decl_all_varnames([[ \
555]], lt_decl_dquote_varnames); do
556 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
557 *[[\\\\\\\`\\"\\\$]]*)
558 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
559 ;;
560 *)
561 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
562 ;;
563 esac
564done
565
566_LT_OUTPUT_LIBTOOL_INIT
567])
568
569# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
570# ------------------------------------
571# Generate a child script FILE with all initialization necessary to
572# reuse the environment learned by the parent script, and make the
573# file executable. If COMMENT is supplied, it is inserted after the
574# `#!' sequence but before initialization text begins. After this
575# macro, additional text can be appended to FILE to form the body of
576# the child script. The macro ends with non-zero status if the
577# file could not be fully written (such as if the disk is full).
578m4_ifdef([AS_INIT_GENERATED],
579[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
580[m4_defun([_LT_GENERATED_FILE_INIT],
581[m4_require([AS_PREPARE])]dnl
582[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
583[lt_write_fail=0
584cat >$1 <<_ASEOF || lt_write_fail=1
585#! $SHELL
586# Generated by $as_me.
587$2
588SHELL=\${CONFIG_SHELL-$SHELL}
589export SHELL
590_ASEOF
591cat >>$1 <<\_ASEOF || lt_write_fail=1
592AS_SHELL_SANITIZE
593_AS_PREPARE
594exec AS_MESSAGE_FD>&1
595_ASEOF
596test $lt_write_fail = 0 && chmod +x $1[]dnl
597m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
598
599# LT_OUTPUT
600# ---------
601# This macro allows early generation of the libtool script (before
602# AC_OUTPUT is called), incase it is used in configure for compilation
603# tests.
604AC_DEFUN([LT_OUTPUT],
605[: ${CONFIG_LT=./config.lt}
606AC_MSG_NOTICE([creating $CONFIG_LT])
607_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
608[# Run this file to recreate a libtool stub with the current configuration.])
609
610cat >>"$CONFIG_LT" <<\_LTEOF
611lt_cl_silent=false
612exec AS_MESSAGE_LOG_FD>>config.log
613{
614 echo
615 AS_BOX([Running $as_me.])
616} >&AS_MESSAGE_LOG_FD
617
618lt_cl_help="\
619\`$as_me' creates a local libtool stub from the current configuration,
620for use in further configure time tests before the real libtool is
621generated.
622
623Usage: $[0] [[OPTIONS]]
624
625 -h, --help print this help, then exit
626 -V, --version print version number, then exit
627 -q, --quiet do not print progress messages
628 -d, --debug don't remove temporary files
629
630Report bugs to <bug-libtool@gnu.org>."
631
632lt_cl_version="\
633m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
634m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
635configured by $[0], generated by m4_PACKAGE_STRING.
636
637Copyright (C) 2010 Free Software Foundation, Inc.
638This config.lt script is free software; the Free Software Foundation
639gives unlimited permision to copy, distribute and modify it."
640
641while test $[#] != 0
642do
643 case $[1] in
644 --version | --v* | -V )
645 echo "$lt_cl_version"; exit 0 ;;
646 --help | --h* | -h )
647 echo "$lt_cl_help"; exit 0 ;;
648 --debug | --d* | -d )
649 debug=: ;;
650 --quiet | --q* | --silent | --s* | -q )
651 lt_cl_silent=: ;;
652
653 -*) AC_MSG_ERROR([unrecognized option: $[1]
654Try \`$[0] --help' for more information.]) ;;
655
656 *) AC_MSG_ERROR([unrecognized argument: $[1]
657Try \`$[0] --help' for more information.]) ;;
658 esac
659 shift
660done
661
662if $lt_cl_silent; then
663 exec AS_MESSAGE_FD>/dev/null
664fi
665_LTEOF
666
667cat >>"$CONFIG_LT" <<_LTEOF
668_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
669_LTEOF
670
671cat >>"$CONFIG_LT" <<\_LTEOF
672AC_MSG_NOTICE([creating $ofile])
673_LT_OUTPUT_LIBTOOL_COMMANDS
674AS_EXIT(0)
675_LTEOF
676chmod +x "$CONFIG_LT"
677
678# configure is writing to config.log, but config.lt does its own redirection,
679# appending to config.log, which fails on DOS, as config.log is still kept
680# open by configure. Here we exec the FD to /dev/null, effectively closing
681# config.log, so it can be properly (re)opened and appended to by config.lt.
682lt_cl_success=:
683test "$silent" = yes &&
684 lt_config_lt_args="$lt_config_lt_args --quiet"
685exec AS_MESSAGE_LOG_FD>/dev/null
686$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
687exec AS_MESSAGE_LOG_FD>>config.log
688$lt_cl_success || AS_EXIT(1)
689])# LT_OUTPUT
690
691
692# _LT_CONFIG(TAG)
693# ---------------
694# If TAG is the built-in tag, create an initial libtool script with a
695# default configuration from the untagged config vars. Otherwise add code
696# to config.status for appending the configuration named by TAG from the
697# matching tagged config vars.
698m4_defun([_LT_CONFIG],
699[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
700_LT_CONFIG_SAVE_COMMANDS([
701 m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
702 m4_if(_LT_TAG, [C], [
703 # See if we are running on zsh, and set the options which allow our
704 # commands through without removal of \ escapes.
705 if test -n "${ZSH_VERSION+set}" ; then
706 setopt NO_GLOB_SUBST
707 fi
708
709 cfgfile="${ofile}T"
710 trap "$RM \"$cfgfile\"; exit 1" 1 2 15
711 $RM "$cfgfile"
712
713 cat <<_LT_EOF >> "$cfgfile"
714#! $SHELL
715
716# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
717# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
718# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
719# NOTE: Changes made to this file will be lost: look at ltmain.sh.
720#
721_LT_COPYING
722_LT_LIBTOOL_TAGS
723
724# ### BEGIN LIBTOOL CONFIG
725_LT_LIBTOOL_CONFIG_VARS
726_LT_LIBTOOL_TAG_VARS
727# ### END LIBTOOL CONFIG
728
729_LT_EOF
730
731 case $host_os in
732 aix3*)
733 cat <<\_LT_EOF >> "$cfgfile"
734# AIX sometimes has problems with the GCC collect2 program. For some
735# reason, if we set the COLLECT_NAMES environment variable, the problems
736# vanish in a puff of smoke.
737if test "X${COLLECT_NAMES+set}" != Xset; then
738 COLLECT_NAMES=
739 export COLLECT_NAMES
740fi
741_LT_EOF
742 ;;
743 esac
744
745 _LT_PROG_LTMAIN
746
747 # We use sed instead of cat because bash on DJGPP gets confused if
748 # if finds mixed CR/LF and LF-only lines. Since sed operates in
749 # text mode, it properly converts lines to CR/LF. This bash problem
750 # is reportedly fixed, but why not run on old versions too?
751 sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
752 || (rm -f "$cfgfile"; exit 1)
753
754 _LT_PROG_XSI_SHELLFNS
755
756 sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
757 || (rm -f "$cfgfile"; exit 1)
758
759 mv -f "$cfgfile" "$ofile" ||
760 (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
761 chmod +x "$ofile"
762],
763[cat <<_LT_EOF >> "$ofile"
764
765dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
766dnl in a comment (ie after a #).
767# ### BEGIN LIBTOOL TAG CONFIG: $1
768_LT_LIBTOOL_TAG_VARS(_LT_TAG)
769# ### END LIBTOOL TAG CONFIG: $1
770_LT_EOF
771])dnl /m4_if
772],
773[m4_if([$1], [], [
774 PACKAGE='$PACKAGE'
775 VERSION='$VERSION'
776 TIMESTAMP='$TIMESTAMP'
777 RM='$RM'
778 ofile='$ofile'], [])
779])dnl /_LT_CONFIG_SAVE_COMMANDS
780])# _LT_CONFIG
781
782
783# LT_SUPPORTED_TAG(TAG)
784# ---------------------
785# Trace this macro to discover what tags are supported by the libtool
786# --tag option, using:
787# autoconf --trace 'LT_SUPPORTED_TAG:$1'
788AC_DEFUN([LT_SUPPORTED_TAG], [])
789
790
791# C support is built-in for now
792m4_define([_LT_LANG_C_enabled], [])
793m4_define([_LT_TAGS], [])
794
795
796# LT_LANG(LANG)
797# -------------
798# Enable libtool support for the given language if not already enabled.
799AC_DEFUN([LT_LANG],
800[AC_BEFORE([$0], [LT_OUTPUT])dnl
801m4_case([$1],
802 [C], [_LT_LANG(C)],
803 [C++], [_LT_LANG(CXX)],
804 [Java], [_LT_LANG(GCJ)],
805 [Fortran 77], [_LT_LANG(F77)],
806 [Fortran], [_LT_LANG(FC)],
807 [Windows Resource], [_LT_LANG(RC)],
808 [m4_ifdef([_LT_LANG_]$1[_CONFIG],
809 [_LT_LANG($1)],
810 [m4_fatal([$0: unsupported language: "$1"])])])dnl
811])# LT_LANG
812
813
814# _LT_LANG(LANGNAME)
815# ------------------
816m4_defun([_LT_LANG],
817[m4_ifdef([_LT_LANG_]$1[_enabled], [],
818 [LT_SUPPORTED_TAG([$1])dnl
819 m4_append([_LT_TAGS], [$1 ])dnl
820 m4_define([_LT_LANG_]$1[_enabled], [])dnl
821 _LT_LANG_$1_CONFIG($1)])dnl
822])# _LT_LANG
823
824
825# _LT_LANG_DEFAULT_CONFIG
826# -----------------------
827m4_defun([_LT_LANG_DEFAULT_CONFIG],
828[AC_PROVIDE_IFELSE([AC_PROG_CXX],
829 [LT_LANG(CXX)],
830 [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
831
832AC_PROVIDE_IFELSE([AC_PROG_F77],
833 [LT_LANG(F77)],
834 [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
835
836AC_PROVIDE_IFELSE([AC_PROG_FC],
837 [LT_LANG(FC)],
838 [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
839
840dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
841dnl pulling things in needlessly.
842AC_PROVIDE_IFELSE([AC_PROG_GCJ],
843 [LT_LANG(GCJ)],
844 [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
845 [LT_LANG(GCJ)],
846 [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
847 [LT_LANG(GCJ)],
848 [m4_ifdef([AC_PROG_GCJ],
849 [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
850 m4_ifdef([A][M_PROG_GCJ],
851 [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
852 m4_ifdef([LT_PROG_GCJ],
853 [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
854
855AC_PROVIDE_IFELSE([LT_PROG_RC],
856 [LT_LANG(RC)],
857 [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
858])# _LT_LANG_DEFAULT_CONFIG
859
860# Obsolete macros:
861AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
862AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
863AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
864AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
865AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
866dnl aclocal-1.4 backwards compatibility:
867dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
868dnl AC_DEFUN([AC_LIBTOOL_F77], [])
869dnl AC_DEFUN([AC_LIBTOOL_FC], [])
870dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
871dnl AC_DEFUN([AC_LIBTOOL_RC], [])
872
873
874# _LT_TAG_COMPILER
875# ----------------
876m4_defun([_LT_TAG_COMPILER],
877[AC_REQUIRE([AC_PROG_CC])dnl
878
879_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
880_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
881_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
882_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
883
884# If no C compiler was specified, use CC.
885LTCC=${LTCC-"$CC"}
886
887# If no C compiler flags were specified, use CFLAGS.
888LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
889
890# Allow CC to be a program name with arguments.
891compiler=$CC
892])# _LT_TAG_COMPILER
893
894
895# _LT_COMPILER_BOILERPLATE
896# ------------------------
897# Check for compiler boilerplate output or warnings with
898# the simple compiler test code.
899m4_defun([_LT_COMPILER_BOILERPLATE],
900[m4_require([_LT_DECL_SED])dnl
901ac_outfile=conftest.$ac_objext
902echo "$lt_simple_compile_test_code" >conftest.$ac_ext
903eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
904_lt_compiler_boilerplate=`cat conftest.err`
905$RM conftest*
906])# _LT_COMPILER_BOILERPLATE
907
908
909# _LT_LINKER_BOILERPLATE
910# ----------------------
911# Check for linker boilerplate output or warnings with
912# the simple link test code.
913m4_defun([_LT_LINKER_BOILERPLATE],
914[m4_require([_LT_DECL_SED])dnl
915ac_outfile=conftest.$ac_objext
916echo "$lt_simple_link_test_code" >conftest.$ac_ext
917eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
918_lt_linker_boilerplate=`cat conftest.err`
919$RM -r conftest*
920])# _LT_LINKER_BOILERPLATE
921
922# _LT_REQUIRED_DARWIN_CHECKS
923# -------------------------
924m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
925 case $host_os in
926 rhapsody* | darwin*)
927 AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
928 AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
929 AC_CHECK_TOOL([LIPO], [lipo], [:])
930 AC_CHECK_TOOL([OTOOL], [otool], [:])
931 AC_CHECK_TOOL([OTOOL64], [otool64], [:])
932 _LT_DECL([], [DSYMUTIL], [1],
933 [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
934 _LT_DECL([], [NMEDIT], [1],
935 [Tool to change global to local symbols on Mac OS X])
936 _LT_DECL([], [LIPO], [1],
937 [Tool to manipulate fat objects and archives on Mac OS X])
938 _LT_DECL([], [OTOOL], [1],
939 [ldd/readelf like tool for Mach-O binaries on Mac OS X])
940 _LT_DECL([], [OTOOL64], [1],
941 [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
942
943 AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
944 [lt_cv_apple_cc_single_mod=no
945 if test -z "${LT_MULTI_MODULE}"; then
946 # By default we will add the -single_module flag. You can override
947 # by either setting the environment variable LT_MULTI_MODULE
948 # non-empty at configure time, or by adding -multi_module to the
949 # link flags.
950 rm -rf libconftest.dylib*
951 echo "int foo(void){return 1;}" > conftest.c
952 echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
953-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
954 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
955 -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
956 _lt_result=$?
957 if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
958 lt_cv_apple_cc_single_mod=yes
959 else
960 cat conftest.err >&AS_MESSAGE_LOG_FD
961 fi
962 rm -rf libconftest.dylib*
963 rm -f conftest.*
964 fi])
965 AC_CACHE_CHECK([for -exported_symbols_list linker flag],
966 [lt_cv_ld_exported_symbols_list],
967 [lt_cv_ld_exported_symbols_list=no
968 save_LDFLAGS=$LDFLAGS
969 echo "_main" > conftest.sym
970 LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
971 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
972 [lt_cv_ld_exported_symbols_list=yes],
973 [lt_cv_ld_exported_symbols_list=no])
974 LDFLAGS="$save_LDFLAGS"
975 ])
976 AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
977 [lt_cv_ld_force_load=no
978 cat > conftest.c << _LT_EOF
979int forced_loaded() { return 2;}
980_LT_EOF
981 echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
982 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
983 echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
984 $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
985 echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
986 $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
987 cat > conftest.c << _LT_EOF
988int main() { return 0;}
989_LT_EOF
990 echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
991 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
992 _lt_result=$?
993 if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
994 lt_cv_ld_force_load=yes
995 else
996 cat conftest.err >&AS_MESSAGE_LOG_FD
997 fi
998 rm -f conftest.err libconftest.a conftest conftest.c
999 rm -rf conftest.dSYM
1000 ])
1001 case $host_os in
1002 rhapsody* | darwin1.[[012]])
1003 _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
1004 darwin1.*)
1005 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
1006 darwin*) # darwin 5.x on
1007 # if running on 10.5 or later, the deployment target defaults
1008 # to the OS version, if on x86, and 10.4, the deployment
1009 # target defaults to 10.4. Don't you love it?
1010 case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
1011 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
1012 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
1013 10.[[012]]*)
1014 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
1015 10.*)
1016 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
1017 esac
1018 ;;
1019 esac
1020 if test "$lt_cv_apple_cc_single_mod" = "yes"; then
1021 _lt_dar_single_mod='$single_module'
1022 fi
1023 if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
1024 _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
1025 else
1026 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
1027 fi
1028 if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
1029 _lt_dsymutil='~$DSYMUTIL $lib || :'
1030 else
1031 _lt_dsymutil=
1032 fi
1033 ;;
1034 esac
1035])
1036
1037
1038# _LT_DARWIN_LINKER_FEATURES
1039# --------------------------
1040# Checks for linker and compiler features on darwin
1041m4_defun([_LT_DARWIN_LINKER_FEATURES],
1042[
1043 m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1044 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1045 _LT_TAGVAR(hardcode_direct, $1)=no
1046 _LT_TAGVAR(hardcode_automatic, $1)=yes
1047 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1048 if test "$lt_cv_ld_force_load" = "yes"; then
1049 _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
1050 else
1051 _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1052 fi
1053 _LT_TAGVAR(link_all_deplibs, $1)=yes
1054 _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
1055 case $cc_basename in
1056 ifort*) _lt_dar_can_shared=yes ;;
1057 *) _lt_dar_can_shared=$GCC ;;
1058 esac
1059 if test "$_lt_dar_can_shared" = "yes"; then
1060 output_verbose_link_cmd=func_echo_all
1061 _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
1062 _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
1063 _LT_TAGVAR(archive_expsym_cmds, $1)="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 ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
1064 _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
1065 m4_if([$1], [CXX],
1066[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
1067 _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
1068 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
1069 fi
1070],[])
1071 else
1072 _LT_TAGVAR(ld_shlibs, $1)=no
1073 fi
1074])
1075
1076# _LT_SYS_MODULE_PATH_AIX
1077# -----------------------
1078# Links a minimal program and checks the executable
1079# for the system default hardcoded library path. In most cases,
1080# this is /usr/lib:/lib, but when the MPI compilers are used
1081# the location of the communication and MPI libs are included too.
1082# If we don't find anything, use the default library path according
1083# to the aix ld manual.
1084m4_defun([_LT_SYS_MODULE_PATH_AIX],
1085[m4_require([_LT_DECL_SED])dnl
1086AC_LINK_IFELSE(AC_LANG_PROGRAM,[
1087lt_aix_libpath_sed='
1088 /Import File Strings/,/^$/ {
1089 /^0/ {
1090 s/^0 *\(.*\)$/\1/
1091 p
1092 }
1093 }'
1094aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1095# Check for a 64-bit object if we didn't find anything.
1096if test -z "$aix_libpath"; then
1097 aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1098fi],[])
1099if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
1100])# _LT_SYS_MODULE_PATH_AIX
1101
1102
1103# _LT_SHELL_INIT(ARG)
1104# -------------------
1105m4_define([_LT_SHELL_INIT],
1106[m4_divert_text([M4SH-INIT], [$1
1107])])# _LT_SHELL_INIT
1108
1109
1110
1111# _LT_PROG_ECHO_BACKSLASH
1112# -----------------------
1113# Find how we can fake an echo command that does not interpret backslash.
1114# In particular, with Autoconf 2.60 or later we add some code to the start
1115# of the generated configure script which will find a shell with a builtin
1116# printf (which we can use as an echo command).
1117m4_defun([_LT_PROG_ECHO_BACKSLASH],
1118[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1119ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1120ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1121
1122AC_MSG_CHECKING([how to print strings])
1123# Test print first, because it will be a builtin if present.
1124if test "X`print -r -- -n 2>/dev/null`" = X-n && \
1125 test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
1126 ECHO='print -r --'
1127elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
1128 ECHO='printf %s\n'
1129else
1130 # Use this function as a fallback that always works.
1131 func_fallback_echo ()
1132 {
1133 eval 'cat <<_LTECHO_EOF
1134$[]1
1135_LTECHO_EOF'
1136 }
1137 ECHO='func_fallback_echo'
1138fi
1139
1140# func_echo_all arg...
1141# Invoke $ECHO with all args, space-separated.
1142func_echo_all ()
1143{
1144 $ECHO "$*"
1145}
1146
1147case "$ECHO" in
1148 printf*) AC_MSG_RESULT([printf]) ;;
1149 print*) AC_MSG_RESULT([print -r]) ;;
1150 *) AC_MSG_RESULT([cat]) ;;
1151esac
1152
1153m4_ifdef([_AS_DETECT_SUGGESTED],
1154[_AS_DETECT_SUGGESTED([
1155 test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
1156 ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1157 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1158 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1159 PATH=/empty FPATH=/empty; export PATH FPATH
1160 test "X`printf %s $ECHO`" = "X$ECHO" \
1161 || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1162
1163_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1164_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
1165])# _LT_PROG_ECHO_BACKSLASH
1166
1167
1168# _LT_ENABLE_LOCK
1169# ---------------
1170m4_defun([_LT_ENABLE_LOCK],
1171[AC_ARG_ENABLE([libtool-lock],
1172 [AS_HELP_STRING([--disable-libtool-lock],
1173 [avoid locking (might break parallel builds)])])
1174test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1175
1176# Some flags need to be propagated to the compiler or linker for good
1177# libtool support.
1178case $host in
1179ia64-*-hpux*)
1180 # Find out which ABI we are using.
1181 echo 'int i;' > conftest.$ac_ext
1182 if AC_TRY_EVAL(ac_compile); then
1183 case `/usr/bin/file conftest.$ac_objext` in
1184 *ELF-32*)
1185 HPUX_IA64_MODE="32"
1186 ;;
1187 *ELF-64*)
1188 HPUX_IA64_MODE="64"
1189 ;;
1190 esac
1191 fi
1192 rm -rf conftest*
1193 ;;
1194*-*-irix6*)
1195 # Find out which ABI we are using.
1196 echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1197 if AC_TRY_EVAL(ac_compile); then
1198 if test "$lt_cv_prog_gnu_ld" = yes; then
1199 case `/usr/bin/file conftest.$ac_objext` in
1200 *32-bit*)
1201 LD="${LD-ld} -melf32bsmip"
1202 ;;
1203 *N32*)
1204 LD="${LD-ld} -melf32bmipn32"
1205 ;;
1206 *64-bit*)
1207 LD="${LD-ld} -melf64bmip"
1208 ;;
1209 esac
1210 else
1211 case `/usr/bin/file conftest.$ac_objext` in
1212 *32-bit*)
1213 LD="${LD-ld} -32"
1214 ;;
1215 *N32*)
1216 LD="${LD-ld} -n32"
1217 ;;
1218 *64-bit*)
1219 LD="${LD-ld} -64"
1220 ;;
1221 esac
1222 fi
1223 fi
1224 rm -rf conftest*
1225 ;;
1226
1227x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
1228s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1229 # Find out which ABI we are using.
1230 echo 'int i;' > conftest.$ac_ext
1231 if AC_TRY_EVAL(ac_compile); then
1232 case `/usr/bin/file conftest.o` in
1233 *32-bit*)
1234 case $host in
1235 x86_64-*kfreebsd*-gnu)
1236 LD="${LD-ld} -m elf_i386_fbsd"
1237 ;;
1238 x86_64-*linux*)
1239 LD="${LD-ld} -m elf_i386"
1240 ;;
1241 ppc64-*linux*|powerpc64-*linux*)
1242 LD="${LD-ld} -m elf32ppclinux"
1243 ;;
1244 s390x-*linux*)
1245 LD="${LD-ld} -m elf_s390"
1246 ;;
1247 sparc64-*linux*)
1248 LD="${LD-ld} -m elf32_sparc"
1249 ;;
1250 esac
1251 ;;
1252 *64-bit*)
1253 case $host in
1254 x86_64-*kfreebsd*-gnu)
1255 LD="${LD-ld} -m elf_x86_64_fbsd"
1256 ;;
1257 x86_64-*linux*)
1258 LD="${LD-ld} -m elf_x86_64"
1259 ;;
1260 ppc*-*linux*|powerpc*-*linux*)
1261 LD="${LD-ld} -m elf64ppc"
1262 ;;
1263 s390*-*linux*|s390*-*tpf*)
1264 LD="${LD-ld} -m elf64_s390"
1265 ;;
1266 sparc*-*linux*)
1267 LD="${LD-ld} -m elf64_sparc"
1268 ;;
1269 esac
1270 ;;
1271 esac
1272 fi
1273 rm -rf conftest*
1274 ;;
1275
1276*-*-sco3.2v5*)
1277 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1278 SAVE_CFLAGS="$CFLAGS"
1279 CFLAGS="$CFLAGS -belf"
1280 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1281 [AC_LANG_PUSH(C)
1282 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1283 AC_LANG_POP])
1284 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1285 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1286 CFLAGS="$SAVE_CFLAGS"
1287 fi
1288 ;;
1289sparc*-*solaris*)
1290 # Find out which ABI we are using.
1291 echo 'int i;' > conftest.$ac_ext
1292 if AC_TRY_EVAL(ac_compile); then
1293 case `/usr/bin/file conftest.o` in
1294 *64-bit*)
1295 case $lt_cv_prog_gnu_ld in
1296 yes*) LD="${LD-ld} -m elf64_sparc" ;;
1297 *)
1298 if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1299 LD="${LD-ld} -64"
1300 fi
1301 ;;
1302 esac
1303 ;;
1304 esac
1305 fi
1306 rm -rf conftest*
1307 ;;
1308esac
1309
1310need_locks="$enable_libtool_lock"
1311])# _LT_ENABLE_LOCK
1312
1313
1314# _LT_CMD_OLD_ARCHIVE
1315# -------------------
1316m4_defun([_LT_CMD_OLD_ARCHIVE],
1317[AC_CHECK_TOOL(AR, ar, false)
1318test -z "$AR" && AR=ar
1319test -z "$AR_FLAGS" && AR_FLAGS=cru
1320_LT_DECL([], [AR], [1], [The archiver])
1321_LT_DECL([], [AR_FLAGS], [1])
1322
1323AC_CHECK_TOOL(STRIP, strip, :)
1324test -z "$STRIP" && STRIP=:
1325_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1326
1327AC_CHECK_TOOL(RANLIB, ranlib, :)
1328test -z "$RANLIB" && RANLIB=:
1329_LT_DECL([], [RANLIB], [1],
1330 [Commands used to install an old-style archive])
1331
1332# Determine commands to create old-style static archives.
1333old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1334old_postinstall_cmds='chmod 644 $oldlib'
1335old_postuninstall_cmds=
1336
1337if test -n "$RANLIB"; then
1338 case $host_os in
1339 openbsd*)
1340 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
1341 ;;
1342 *)
1343 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
1344 ;;
1345 esac
1346 old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1347fi
1348
1349case $host_os in
1350 darwin*)
1351 lock_old_archive_extraction=yes ;;
1352 *)
1353 lock_old_archive_extraction=no ;;
1354esac
1355_LT_DECL([], [old_postinstall_cmds], [2])
1356_LT_DECL([], [old_postuninstall_cmds], [2])
1357_LT_TAGDECL([], [old_archive_cmds], [2],
1358 [Commands used to build an old-style archive])
1359_LT_DECL([], [lock_old_archive_extraction], [0],
1360 [Whether to use a lock for old archive extraction])
1361])# _LT_CMD_OLD_ARCHIVE
1362
1363
1364# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1365# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1366# ----------------------------------------------------------------
1367# Check whether the given compiler option works
1368AC_DEFUN([_LT_COMPILER_OPTION],
1369[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1370m4_require([_LT_DECL_SED])dnl
1371AC_CACHE_CHECK([$1], [$2],
1372 [$2=no
1373 m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1374 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1375 lt_compiler_flag="$3"
1376 # Insert the option either (1) after the last *FLAGS variable, or
1377 # (2) before a word containing "conftest.", or (3) at the end.
1378 # Note that $ac_compile itself does not contain backslashes and begins
1379 # with a dollar sign (not a hyphen), so the echo should work correctly.
1380 # The option is referenced via a variable to avoid confusing sed.
1381 lt_compile=`echo "$ac_compile" | $SED \
1382 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1383 -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1384 -e 's:$: $lt_compiler_flag:'`
1385 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1386 (eval "$lt_compile" 2>conftest.err)
1387 ac_status=$?
1388 cat conftest.err >&AS_MESSAGE_LOG_FD
1389 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1390 if (exit $ac_status) && test -s "$ac_outfile"; then
1391 # The compiler can only warn and ignore the option if not recognized
1392 # So say no if there are warnings other than the usual output.
1393 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
1394 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1395 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1396 $2=yes
1397 fi
1398 fi
1399 $RM conftest*
1400])
1401
1402if test x"[$]$2" = xyes; then
1403 m4_if([$5], , :, [$5])
1404else
1405 m4_if([$6], , :, [$6])
1406fi
1407])# _LT_COMPILER_OPTION
1408
1409# Old name:
1410AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1411dnl aclocal-1.4 backwards compatibility:
1412dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1413
1414
1415# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1416# [ACTION-SUCCESS], [ACTION-FAILURE])
1417# ----------------------------------------------------
1418# Check whether the given linker option works
1419AC_DEFUN([_LT_LINKER_OPTION],
1420[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1421m4_require([_LT_DECL_SED])dnl
1422AC_CACHE_CHECK([$1], [$2],
1423 [$2=no
1424 save_LDFLAGS="$LDFLAGS"
1425 LDFLAGS="$LDFLAGS $3"
1426 echo "$lt_simple_link_test_code" > conftest.$ac_ext
1427 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1428 # The linker can only warn and ignore the option if not recognized
1429 # So say no if there are warnings
1430 if test -s conftest.err; then
1431 # Append any errors to the config.log.
1432 cat conftest.err 1>&AS_MESSAGE_LOG_FD
1433 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
1434 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1435 if diff conftest.exp conftest.er2 >/dev/null; then
1436 $2=yes
1437 fi
1438 else
1439 $2=yes
1440 fi
1441 fi
1442 $RM -r conftest*
1443 LDFLAGS="$save_LDFLAGS"
1444])
1445
1446if test x"[$]$2" = xyes; then
1447 m4_if([$4], , :, [$4])
1448else
1449 m4_if([$5], , :, [$5])
1450fi
1451])# _LT_LINKER_OPTION
1452
1453# Old name:
1454AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1455dnl aclocal-1.4 backwards compatibility:
1456dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1457
1458
1459# LT_CMD_MAX_LEN
1460#---------------
1461AC_DEFUN([LT_CMD_MAX_LEN],
1462[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1463# find the maximum length of command line arguments
1464AC_MSG_CHECKING([the maximum length of command line arguments])
1465AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1466 i=0
1467 teststring="ABCD"
1468
1469 case $build_os in
1470 msdosdjgpp*)
1471 # On DJGPP, this test can blow up pretty badly due to problems in libc
1472 # (any single argument exceeding 2000 bytes causes a buffer overrun
1473 # during glob expansion). Even if it were fixed, the result of this
1474 # check would be larger than it should be.
1475 lt_cv_sys_max_cmd_len=12288; # 12K is about right
1476 ;;
1477
1478 gnu*)
1479 # Under GNU Hurd, this test is not required because there is
1480 # no limit to the length of command line arguments.
1481 # Libtool will interpret -1 as no limit whatsoever
1482 lt_cv_sys_max_cmd_len=-1;
1483 ;;
1484
1485 cygwin* | mingw* | cegcc*)
1486 # On Win9x/ME, this test blows up -- it succeeds, but takes
1487 # about 5 minutes as the teststring grows exponentially.
1488 # Worse, since 9x/ME are not pre-emptively multitasking,
1489 # you end up with a "frozen" computer, even though with patience
1490 # the test eventually succeeds (with a max line length of 256k).
1491 # Instead, let's just punt: use the minimum linelength reported by
1492 # all of the supported platforms: 8192 (on NT/2K/XP).
1493 lt_cv_sys_max_cmd_len=8192;
1494 ;;
1495
1496 mint*)
1497 # On MiNT this can take a long time and run out of memory.
1498 lt_cv_sys_max_cmd_len=8192;
1499 ;;
1500
1501 amigaos*)
1502 # On AmigaOS with pdksh, this test takes hours, literally.
1503 # So we just punt and use a minimum line length of 8192.
1504 lt_cv_sys_max_cmd_len=8192;
1505 ;;
1506
1507 netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
1508 # This has been around since 386BSD, at least. Likely further.
1509 if test -x /sbin/sysctl; then
1510 lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1511 elif test -x /usr/sbin/sysctl; then
1512 lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1513 else
1514 lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
1515 fi
1516 # And add a safety zone
1517 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1518 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1519 ;;
1520
1521 interix*)
1522 # We know the value 262144 and hardcode it with a safety zone (like BSD)
1523 lt_cv_sys_max_cmd_len=196608
1524 ;;
1525
1526 osf*)
1527 # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1528 # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1529 # nice to cause kernel panics so lets avoid the loop below.
1530 # First set a reasonable default.
1531 lt_cv_sys_max_cmd_len=16384
1532 #
1533 if test -x /sbin/sysconfig; then
1534 case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1535 *1*) lt_cv_sys_max_cmd_len=-1 ;;
1536 esac
1537 fi
1538 ;;
1539 sco3.2v5*)
1540 lt_cv_sys_max_cmd_len=102400
1541 ;;
1542 sysv5* | sco5v6* | sysv4.2uw2*)
1543 kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1544 if test -n "$kargmax"; then
1545 lt_cv_sys_ma…
Large files files are truncated, but you can click here to view the full file