1 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
4 # 2006, 2007 Free Software Foundation, Inc.
6 # This file is part of GNU Libtool:
7 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
9 # This file is free software; the Free Software Foundation gives
10 # unlimited permission to copy and/or distribute it, with or without
11 # modifications, as long as this notice is preserved.
13 m4_define([_LT_COPYING], [dnl
14 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
15 # 2006, 2007 Free Software Foundation, Inc.
17 # This file is part of GNU Libtool:
18 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
20 # This program is free software; you can redistribute it and/or modify
21 # it under the terms of the GNU General Public License as published by
22 # the Free Software Foundation; either version 2 of the License, or
23 # (at your option) any later version.
25 # This program is distributed in the hope that it will be useful, but
26 # WITHOUT ANY WARRANTY; without even the implied warranty of
27 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 # General Public License for more details.
30 # You should have received a copy of the GNU General Public License
31 # along with this program; if not, a copy can be downloaded from
32 # http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
33 # Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
36 # As a special exception to the GNU General Public License, if you
37 # distribute this file as part of a program that contains a
38 # configuration script generated by Autoconf, you may include it under
39 # the same distribution terms that you use for the rest of that program.
47 # Complain and exit if this libtool version is less that VERSION.
49 [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
51 [m4_fatal([Libtool version $1 or higher is required],
59 [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
60 AC_BEFORE([$0], [LT_LANG])dnl
61 AC_BEFORE([$0], [LT_OUTPUT])dnl
63 dnl Autoconf doesn't catch unexpanded LT_ macros by default:
64 m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
65 m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
66 dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
67 dnl unless we require an AC_DEFUNed macro:
68 AC_REQUIRE([LTOPTIONS_VERSION])dnl
69 AC_REQUIRE([LTSUGAR_VERSION])dnl
70 AC_REQUIRE([LTVERSION_VERSION])dnl
71 m4_require([_LT_PROG_LTMAIN])dnl
72 m4_require([_LT_SET_OPTIONS], [_LT_SET_OPTIONS([$1])])dnl
74 # This can be used to rebuild libtool when needed
75 LIBTOOL_DEPS="$ltmain"
77 # Always use our own libtool.
78 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
88 AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
89 AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
90 dnl aclocal-1.4 backwards compatibility:
91 dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
92 dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
97 # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
98 m4_defun([_LT_CC_BASENAME],
99 [for cc_temp in $1""; do
101 compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
102 distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
107 cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
111 # _LT_FILEUTILS_DEFAULTS
112 # ----------------------
113 # It is okay to use these file commands and assume they have been set
114 # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
115 m4_defun([_LT_FILEUTILS_DEFAULTS],
119 ])# _LT_FILEUTILS_DEFAULTS
124 m4_defun([_LT_SETUP],
125 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
126 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
127 _LT_DECL([], [host_alias], [0], [The host system])dnl
128 _LT_DECL([], [host], [0])dnl
129 _LT_DECL([], [host_os], [0])dnl
131 _LT_DECL([], [build_alias], [0], [The build system])dnl
132 _LT_DECL([], [build], [0])dnl
133 _LT_DECL([], [build_os], [0])dnl
135 AC_REQUIRE([AC_PROG_CC])dnl
136 AC_REQUIRE([LT_PATH_LD])dnl
137 AC_REQUIRE([LT_PATH_NM])dnl
139 AC_REQUIRE([AC_PROG_LN_S])dnl
140 test -z "$LN_S" && LN_S="ln -s"
141 _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
143 AC_REQUIRE([LT_CMD_MAX_LEN])dnl
144 AC_REQUIRE([AC_OBJEXT])dnl
145 _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
146 AC_REQUIRE([AC_EXEEXT])dnl
147 _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
149 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
150 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
151 m4_require([_LT_CMD_RELOAD])dnl
152 m4_require([_LT_CHECK_MAGIC_METHOD])dnl
153 m4_require([_LT_CMD_OLD_ARCHIVE])dnl
154 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
156 _LT_CONFIG_LIBTOOL_INIT([
157 # See if we are running on zsh, and set the options which allow our
158 # commands through without removal of \ escapes INIT.
159 if test -n "\${ZSH_VERSION+set}" ; then
163 if test -n "${ZSH_VERSION+set}" ; then
169 m4_require([_LT_TAG_COMPILER])dnl
170 _LT_PROG_ECHO_BACKSLASH
174 # AIX sometimes has problems with the GCC collect2 program. For some
175 # reason, if we set the COLLECT_NAMES environment variable, the problems
176 # vanish in a puff of smoke.
177 if test "X${COLLECT_NAMES+set}" != Xset; then
184 # Sed substitution that helps us do robust quoting. It backslashifies
185 # metacharacters that are still active within double-quoted strings.
186 sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
188 # Same as above, but do not quote variable references.
189 double_quote_subst='s/\([["`\\]]\)/\\\1/g'
191 # Sed substitution to delay expansion of an escaped shell variable in a
192 # double_quote_subst'ed string.
193 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
195 # Sed substitution to delay expansion of an escaped single quote.
196 delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
198 # Sed substitution to avoid accidental globbing in evaled expressions
199 no_glob_subst='s/\*/\\\*/g'
205 # All known linkers require a `.a' archive for static linking (except MSVC,
206 # which needs '.lib').
209 with_gnu_ld="$lt_cv_prog_gnu_ld"
214 # Set sane defaults for various variables
215 test -z "$CC" && CC=cc
216 test -z "$LTCC" && LTCC=$CC
217 test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
218 test -z "$LD" && LD=ld
219 test -z "$ac_objext" && ac_objext=o
221 _LT_CC_BASENAME([$compiler])
223 # Only perform the check for file, if the check method requires it
224 test -z "$MAGIC_CMD" && MAGIC_CMD=file
225 case $deplibs_check_method in
227 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
233 # Use C for the default configuration in the libtool script
234 LT_SUPPORTED_TAG([CC])
236 _LT_LANG_DEFAULT_CONFIG
243 # Note that this code is called both from `configure', and `config.status'
244 # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
245 # `config.status' has no value for ac_aux_dir unless we are using Automake,
246 # so we pass a copy along to make sure it has a sensible value anyway.
247 m4_defun([_LT_PROG_LTMAIN],
248 [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
249 _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
250 ltmain="$ac_aux_dir/ltmain.sh"
254 ## ------------------------------------- ##
255 ## Accumulate code for creating libtool. ##
256 ## ------------------------------------- ##
258 # So that we can recreate a full libtool script including additional
259 # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
260 # in macros and then make a single call at the end using the `libtool'
264 # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
265 # ----------------------------------------
266 # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
267 m4_define([_LT_CONFIG_LIBTOOL_INIT],
269 [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
274 m4_define([_LT_OUTPUT_LIBTOOL_INIT])
277 # _LT_CONFIG_LIBTOOL([COMMANDS])
278 # ------------------------------
279 # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
280 m4_define([_LT_CONFIG_LIBTOOL],
282 [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
287 m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
290 # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
291 # -----------------------------------------------------
292 m4_defun([_LT_CONFIG_SAVE_COMMANDS],
293 [_LT_CONFIG_LIBTOOL([$1])
294 _LT_CONFIG_LIBTOOL_INIT([$2])
298 # _LT_FORMAT_COMMENT([COMMENT])
299 # -----------------------------
300 # Add leading comment marks to the start of each line, and a trailing
301 # full-stop to the whole comment if one is not present already.
302 m4_define([_LT_FORMAT_COMMENT],
304 m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
305 [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
310 ## ------------------------ ##
311 ## FIXME: Eliminate VARNAME ##
312 ## ------------------------ ##
315 # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
316 # -------------------------------------------------------------------
317 # CONFIGNAME is the name given to the value in the libtool script.
318 # VARNAME is the (base) name used in the configure script.
319 # VALUE may be 0, 1 or 2 for a computed quote escaped value based on
320 # VARNAME. Any other value will be used directly.
321 m4_define([_LT_DECL],
322 [lt_if_append_uniq([lt_decl_varnames], [$2], [[, ]],
323 [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
324 [m4_ifval([$1], [$1], [$2])])
325 lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
327 [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
328 lt_dict_add_subkey([lt_decl_dict], [$2],
329 [tagged?], [m4_ifval([$5], [yes], [no])])])
333 # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
334 # --------------------------------------------------------
335 m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
338 # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
339 # ------------------------------------------------
340 m4_define([lt_decl_tag_varnames],
341 [_lt_decl_filter([tagged?], [yes], $@)])
344 # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
345 # ---------------------------------------------------------
346 m4_define([_lt_decl_filter],
348 [0], [m4_fatal([$0: too few arguments: $#])],
349 [1], [m4_fatal([$0: too few arguments: $#: $1])],
350 [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
351 [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
352 [lt_dict_filter([lt_decl_dict], $@)])[]dnl
356 # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
357 # --------------------------------------------------
358 m4_define([lt_decl_quote_varnames],
359 [_lt_decl_filter([value], [1], $@)])
362 # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
363 # ---------------------------------------------------
364 m4_define([lt_decl_dquote_varnames],
365 [_lt_decl_filter([value], [2], $@)])
368 # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
369 # ---------------------------------------------------
370 m4_define([lt_decl_varnames_tagged],
371 [_$0(m4_quote(m4_default([$1], [[, ]])),
372 m4_quote(m4_if([$2], [],
373 m4_quote(lt_decl_tag_varnames),
374 m4_quote(m4_shift($@)))),
375 m4_split(m4_normalize(m4_quote(_LT_TAGS))))])
376 m4_define([_lt_decl_varnames_tagged], [lt_combine([$1], [$2], [_], $3)])
379 # lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
380 # ------------------------------------------------
381 m4_define([lt_decl_all_varnames],
382 [_$0(m4_quote(m4_default([$1], [[, ]])),
384 m4_quote(lt_decl_varnames),
385 m4_quote(m4_shift($@))))[]dnl
387 m4_define([_lt_decl_all_varnames],
388 [lt_join($@, lt_decl_varnames_tagged([$1],
389 lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
393 # _LT_CONFIG_STATUS_DECLARE([VARNAME])
394 # ------------------------------------
395 # Quote a variable value, and forward it to `config.status' so that its
396 # declaration there will have the same value as in `configure'. VARNAME
397 # must have a single quote delimited value for this to work.
398 m4_define([_LT_CONFIG_STATUS_DECLARE],
399 [$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
402 # _LT_CONFIG_STATUS_DECLARATIONS
403 # ------------------------------
404 # We delimit libtool config variables with single quotes, so when
405 # we write them to config.status, we have to be sure to quote all
406 # embedded single quotes properly. In configure, this macro expands
407 # each variable declared with _LT_DECL (and _LT_TAGDECL) into:
409 # <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
410 m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
411 [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
412 [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
417 # Output comment and list of tags supported by the script
418 m4_defun([_LT_LIBTOOL_TAGS],
419 [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
420 available_tags="_LT_TAGS"dnl
424 # _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
425 # -----------------------------------
426 # Extract the dictionary values for VARNAME (optionally with TAG) and
427 # expand to a commented shell variable setting:
429 # # Some comment about what VAR is for.
430 # visible_name=$lt_internal_name
431 m4_define([_LT_LIBTOOL_DECLARE],
432 [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
433 [description])))[]dnl
434 m4_pushdef([_libtool_name],
435 m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
436 m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
437 [0], [_libtool_name=[$]$1],
438 [1], [_libtool_name=$lt_[]$1],
439 [2], [_libtool_name=$lt_[]$1],
440 [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
441 m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
445 # _LT_LIBTOOL_CONFIG_VARS
446 # -----------------------
447 # Produce commented declarations of non-tagged libtool config variables
448 # suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
449 # script. Tagged libtool config variables (even for the LIBTOOL CONFIG
450 # section) are produced by _LT_LIBTOOL_TAG_VARS.
451 m4_defun([_LT_LIBTOOL_CONFIG_VARS],
452 [m4_foreach([_lt_var],
453 m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
454 [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
457 # _LT_LIBTOOL_TAG_VARS(TAG)
458 # -------------------------
459 m4_define([_LT_LIBTOOL_TAG_VARS],
460 [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
461 [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
464 # _LT_TAGVAR(VARNAME, [TAGNAME])
465 # ------------------------------
466 m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
469 # _LT_CONFIG_COMMANDS
470 # -------------------
471 # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
472 # variables for single and double quote escaping we saved from calls
473 # to _LT_DECL, we can put quote escaped variables declarations
474 # into `config.status', and then the shell code to quote escape them in
475 # for loops in `config.status'. Finally, any additional code accumulated
476 # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
477 m4_defun([_LT_CONFIG_COMMANDS],
478 [AC_PROVIDE_IFELSE([LT_OUTPUT],
479 dnl If the libtool generation code has been placed in $CONFIG_LT,
480 dnl instead of duplicating it all over again into config.status,
481 dnl then we will have config.status run $CONFIG_LT later, so it
482 dnl needs to know what name is stored there:
483 [AC_CONFIG_COMMANDS([libtool],
484 [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
485 dnl If the libtool generation code is destined for config.status,
486 dnl expand the accumulated commands and init code now:
487 [AC_CONFIG_COMMANDS([libtool],
488 [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
489 ])#_LT_CONFIG_COMMANDS
493 m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
496 # The HP-UX ksh and POSIX shell print the target directory to stdout
498 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
500 sed_quote_subst='$sed_quote_subst'
501 double_quote_subst='$double_quote_subst'
502 delay_variable_subst='$delay_variable_subst'
503 _LT_CONFIG_STATUS_DECLARATIONS
506 compiler='$compiler_DEFAULT'
508 # Quote evaled strings.
509 for var in lt_decl_all_varnames([[ \
510 ]], lt_decl_quote_varnames); do
511 case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
512 *[[\\\\\\\`\\"\\\$]]*)
513 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
516 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
521 # Double-quote double-evaled strings.
522 for var in lt_decl_all_varnames([[ \
523 ]], lt_decl_dquote_varnames); do
524 case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
525 *[[\\\\\\\`\\"\\\$]]*)
526 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
529 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
534 # Fix-up fallback echo if it was mangled by the above quoting rules.
536 *'\\\[$]0 --fallback-echo"')dnl "
537 lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
541 _LT_OUTPUT_LIBTOOL_INIT
547 # This macro allows early generation of the libtool script (before
548 # AC_OUTPUT is called), incase it is used in configure for compilation
550 AC_DEFUN([LT_OUTPUT],
551 [: ${CONFIG_LT=./config.lt}
552 AC_MSG_NOTICE([creating $CONFIG_LT])
553 cat >"$CONFIG_LT" <<_LTEOF
555 # Generated by $as_me.
556 # Run this file to recreate a libtool stub with the current configuration.
559 SHELL=\${CONFIG_SHELL-$SHELL}
562 cat >>"$CONFIG_LT" <<\_LTEOF
566 exec AS_MESSAGE_FD>&1
567 exec AS_MESSAGE_LOG_FD>>config.log
570 AS_BOX([Running $as_me.])
571 } >&AS_MESSAGE_LOG_FD
574 \`$as_me' creates a local libtool stub from the current configuration,
575 for use in further configure time tests before the real libtool is
578 Usage: $[0] [[OPTIONS]]
580 -h, --help print this help, then exit
581 -V, --version print version number, then exit
582 -q, --quiet do not print progress messages
583 -d, --debug don't remove temporary files
585 Report bugs to <bug-libtool@gnu.org>."
588 m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
589 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
590 configured by $[0], generated by m4_PACKAGE_STRING.
592 Copyright (C) 2007 Free Software Foundation, Inc.
593 This config.lt script is free software; the Free Software Foundation
594 gives unlimited permision to copy, distribute and modify it."
599 --version | --v* | -V )
600 echo "$lt_cl_version"; exit 0 ;;
602 echo "$lt_cl_help"; exit 0 ;;
603 --debug | --d* | -d )
605 --quiet | --q* | --silent | --s* | -q )
608 -*) AC_MSG_ERROR([unrecognized option: $[1]
609 Try `$[0] --help' for more information.]) ;;
611 *) AC_MSG_ERROR([unrecognized argument: $[1]
612 Try `$[0] --help for more information.]) ;;
617 if $lt_cl_silent; then
618 exec AS_MESSAGE_FD>/dev/null
622 cat >>"$CONFIG_LT" <<_LTEOF
623 _LT_OUTPUT_LIBTOOL_COMMANDS_INIT
626 cat >>"$CONFIG_LT" <<\_LTEOF
627 AC_MSG_NOTICE([creating $ofile])
628 _LT_OUTPUT_LIBTOOL_COMMANDS
631 chmod +x "$CONFIG_LT"
633 # configure is writing to config.log, but config.lt does its own redirection,
634 # appending to config.log, which fails on DOS, as config.log is still kept
635 # open by configure. Here we exec the FD to /dev/null, effectively closing
636 # config.log, so it can be properly (re)opened and appended to by config.lt.
637 if test "$no_create" != yes; then
639 test "$silent" = yes &&
640 lt_config_lt_args="$lt_config_lt_args --quiet"
641 exec AS_MESSAGE_LOG_FD>/dev/null
642 $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
643 exec AS_MESSAGE_LOG_FD>>config.log
644 $lt_cl_success || AS_EXIT(1)
651 # If TAG is the built-in tag, create an initial libtool script with a
652 # default configuration from the untagged config vars. Otherwise add code
653 # to config.status for appending the configuration named by TAG from the
654 # matching tagged config vars.
655 m4_defun([_LT_CONFIG],
656 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
657 _LT_CONFIG_SAVE_COMMANDS([
658 m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
659 m4_if(_LT_TAG, [C], [
660 # See if we are running on zsh, and set the options which allow our
661 # commands through without removal of \ escapes.
662 if test -n "${ZSH_VERSION+set}" ; then
667 trap "$RM \"$cfgfile\"; exit 1" 1 2 15
670 cat <<_LT_EOF >> "$cfgfile"
673 # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
674 # Generated automatically by $as_me (GNU $PACKAGE$TIMESTAMP) $VERSION
675 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
676 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
681 # ### BEGIN LIBTOOL CONFIG
682 _LT_LIBTOOL_CONFIG_VARS
684 # ### END LIBTOOL CONFIG
690 cat <<\_LT_EOF >> "$cfgfile"
691 # AIX sometimes has problems with the GCC collect2 program. For some
692 # reason, if we set the COLLECT_NAMES environment variable, the problems
693 # vanish in a puff of smoke.
694 if test "X${COLLECT_NAMES+set}" != Xset; then
704 # We use sed instead of cat because bash on DJGPP gets confused if
705 # if finds mixed CR/LF and LF-only lines. Since sed operates in
706 # text mode, it properly converts lines to CR/LF. This bash problem
707 # is reportedly fixed, but why not run on old versions too?
708 sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
709 || (rm -f "$cfgfile"; exit 1)
711 _LT_PROG_XSI_SHELLFNS
713 sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
714 || (rm -f "$cfgfile"; exit 1)
716 mv -f "$cfgfile" "$ofile" ||
717 (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
720 [cat <<_LT_EOF >> "$ofile"
722 dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
723 dnl in a comment (ie after a #).
724 # ### BEGIN LIBTOOL TAG CONFIG: $1
725 _LT_LIBTOOL_TAG_VARS(_LT_TAG)
726 # ### END LIBTOOL TAG CONFIG: $1
733 TIMESTAMP='$TIMESTAMP'
736 ])dnl /_LT_CONFIG_SAVE_COMMANDS
740 # LT_SUPPORTED_TAG(TAG)
741 # ---------------------
742 # Trace this macro to discover what tags are supported by the libtool
743 # --tag option, using:
744 # autoconf --trace 'LT_SUPPORTED_TAG:$1'
745 AC_DEFUN([LT_SUPPORTED_TAG], [])
748 # C support is built-in for now
749 m4_define([_LT_LANG_C_enabled], [])
750 m4_define([_LT_TAGS], [])
755 # Enable libtool support for the given language if not already enabled.
757 [AC_BEFORE([$0], [LT_OUTPUT])dnl
760 [C++], [_LT_LANG(CXX)],
761 [Java], [_LT_LANG(GCJ)],
762 [Fortran 77], [_LT_LANG(F77)],
763 [Fortran], [_LT_LANG(FC)],
764 [Windows Resource], [_LT_LANG(RC)],
765 [m4_ifdef([_LT_LANG_]$1[_CONFIG],
767 [m4_fatal([$0: unsupported language: "$1"])])])dnl
774 [m4_ifdef([_LT_LANG_]$1[_enabled], [],
775 [LT_SUPPORTED_TAG([$1])dnl
776 m4_append([_LT_TAGS], [$1 ])dnl
777 m4_define([_LT_LANG_]$1[_enabled], [])dnl
778 _LT_LANG_$1_CONFIG($1)])dnl
782 # _LT_LANG_DEFAULT_CONFIG
783 # -----------------------
784 m4_defun([_LT_LANG_DEFAULT_CONFIG],
785 [AC_PROVIDE_IFELSE([AC_PROG_CXX],
787 [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
789 AC_PROVIDE_IFELSE([AC_PROG_F77],
791 [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
793 AC_PROVIDE_IFELSE([AC_PROG_FC],
795 [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
797 dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
798 dnl pulling things in needlessly.
799 AC_PROVIDE_IFELSE([AC_PROG_GCJ],
801 [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
803 [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
805 [m4_ifdef([AC_PROG_GCJ],
806 [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
807 m4_ifdef([A][M_PROG_GCJ],
808 [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
809 m4_ifdef([LT_PROG_GCJ],
810 [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
812 AC_PROVIDE_IFELSE([LT_PROG_RC],
814 [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
815 ])# _LT_LANG_DEFAULT_CONFIG
818 AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
819 AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
820 AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
821 AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
822 dnl aclocal-1.4 backwards compatibility:
823 dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
824 dnl AC_DEFUN([AC_LIBTOOL_F77], [])
825 dnl AC_DEFUN([AC_LIBTOOL_FC], [])
826 dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
831 m4_defun([_LT_TAG_COMPILER],
832 [AC_REQUIRE([AC_PROG_CC])dnl
834 _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
835 _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
836 _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
837 _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
839 # If no C compiler was specified, use CC.
842 # If no C compiler flags were specified, use CFLAGS.
843 LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
845 # Allow CC to be a program name with arguments.
850 # _LT_COMPILER_BOILERPLATE
851 # ------------------------
852 # Check for compiler boilerplate output or warnings with
853 # the simple compiler test code.
854 m4_defun([_LT_COMPILER_BOILERPLATE],
855 [m4_require([_LT_DECL_SED])dnl
856 ac_outfile=conftest.$ac_objext
857 echo "$lt_simple_compile_test_code" >conftest.$ac_ext
858 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
859 _lt_compiler_boilerplate=`cat conftest.err`
861 ])# _LT_COMPILER_BOILERPLATE
864 # _LT_LINKER_BOILERPLATE
865 # ----------------------
866 # Check for linker boilerplate output or warnings with
867 # the simple link test code.
868 m4_defun([_LT_LINKER_BOILERPLATE],
869 [m4_require([_LT_DECL_SED])dnl
870 ac_outfile=conftest.$ac_objext
871 echo "$lt_simple_link_test_code" >conftest.$ac_ext
872 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
873 _lt_linker_boilerplate=`cat conftest.err`
875 ])# _LT_LINKER_BOILERPLATE
878 # _LT_SYS_MODULE_PATH_AIX
879 # -----------------------
880 # Links a minimal program and checks the executable
881 # for the system default hardcoded library path. In most cases,
882 # this is /usr/lib:/lib, but when the MPI compilers are used
883 # the location of the communication and MPI libs are included too.
884 # If we don't find anything, use the default library path according
885 # to the aix ld manual.
886 m4_defun([_LT_SYS_MODULE_PATH_AIX],
887 [m4_require([_LT_DECL_SED])dnl
888 AC_LINK_IFELSE(AC_LANG_PROGRAM,[
890 /Import File Strings/,/^$/ {
896 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
897 # Check for a 64-bit object if we didn't find anything.
898 if test -z "$aix_libpath"; then
899 aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
901 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
902 ])# _LT_SYS_MODULE_PATH_AIX
905 # _LT_SHELL_INIT(ARG)
906 # -------------------
907 m4_define([_LT_SHELL_INIT],
908 [ifdef([AC_DIVERSION_NOTICE],
909 [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
910 [AC_DIVERT_PUSH(NOTICE)])
916 # _LT_PROG_ECHO_BACKSLASH
917 # -----------------------
918 # Add some code to the start of the generated configure script which
919 # will find an echo command which doesn't interpret backslashes.
920 m4_defun([_LT_PROG_ECHO_BACKSLASH],
922 # Check that we are running under the correct shell.
923 SHELL=${CONFIG_SHELL-/bin/sh}
927 # Remove one level of quotation (which was required for Make).
928 ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
933 if test "X[$]1" = X--no-reexec; then
934 # Discard the --no-reexec flag, and continue.
936 elif test "X[$]1" = X--fallback-echo; then
937 # Avoid inline document here, it may be left over
939 elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
940 # Yippee, $ECHO works!
943 # Restart under the correct shell.
944 exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
947 if test "X[$]1" = X--fallback-echo; then
948 # used as fallback echo
956 # The HP-UX ksh and POSIX shell print the target directory to stdout
958 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
960 if test -z "$lt_ECHO"; then
961 if test "X${echo_test_string+set}" != Xset; then
962 # find a string as large as possible, as long as the shell can cope with it
963 for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
964 # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
965 if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
966 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
973 if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
974 echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
975 test "X$echo_testing_string" = "X$echo_test_string"; then
978 # The Solaris, AIX, and Digital Unix default echo programs unquote
979 # backslashes. This makes it impossible to quote backslashes using
980 # echo "$something" | sed 's/\\/\\\\/g'
982 # So, first we look for a working echo in the user's PATH.
984 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
985 for dir in $PATH /usr/ucb; do
987 if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
988 test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
989 echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
990 test "X$echo_testing_string" = "X$echo_test_string"; then
997 if test "X$ECHO" = Xecho; then
998 # We didn't find a better echo, so look for alternatives.
999 if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
1000 echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
1001 test "X$echo_testing_string" = "X$echo_test_string"; then
1002 # This shell has a builtin print -r that does the trick.
1004 elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
1005 test "X$CONFIG_SHELL" != X/bin/ksh; then
1006 # If we have ksh, try running configure again with it.
1007 ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
1008 export ORIGINAL_CONFIG_SHELL
1009 CONFIG_SHELL=/bin/ksh
1011 exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
1015 if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
1016 echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
1017 test "X$echo_testing_string" = "X$echo_test_string"; then
1018 # Cool, printf works
1020 elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1021 test "X$echo_testing_string" = 'X\t' &&
1022 echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1023 test "X$echo_testing_string" = "X$echo_test_string"; then
1024 CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
1026 SHELL="$CONFIG_SHELL"
1028 ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
1029 elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1030 test "X$echo_testing_string" = 'X\t' &&
1031 echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1032 test "X$echo_testing_string" = "X$echo_test_string"; then
1033 ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
1035 # maybe with a smaller string...
1038 for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
1039 if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
1046 if test "$prev" != 'sed 50q "[$]0"'; then
1047 echo_test_string=`eval $prev`
1048 export echo_test_string
1049 exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
1051 # Oops. We lost completely, so just stick with echo.
1060 # Copy echo and quote the copy suitably for passing to libtool from
1061 # the Makefile, instead of quoting the original, which is used later.
1063 if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
1064 lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
1069 _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1070 _LT_DECL([], [ECHO], [1],
1071 [An echo program that does not interpret backslashes])
1072 ])# _LT_PROG_ECHO_BACKSLASH
1077 m4_defun([_LT_ENABLE_LOCK],
1078 [AC_REQUIRE([AC_OBJEXT])dnl
1079 AC_ARG_ENABLE([libtool-lock],
1080 [AS_HELP_STRING([--disable-libtool-lock],
1081 [avoid locking (might break parallel builds)])])
1082 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1084 # Some flags need to be propagated to the compiler or linker for good
1088 # Find out which ABI we are using.
1089 echo 'int i;' > conftest.$ac_ext
1090 if AC_TRY_EVAL(ac_compile); then
1091 case `/usr/bin/file conftest.$ac_objext` in
1103 # Find out which ABI we are using.
1104 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1105 if AC_TRY_EVAL(ac_compile); then
1106 if test "$lt_cv_prog_gnu_ld" = yes; then
1107 case `/usr/bin/file conftest.$ac_objext` in
1109 LD="${LD-ld} -melf32bsmip"
1112 LD="${LD-ld} -melf32bmipn32"
1115 LD="${LD-ld} -melf64bmip"
1119 case `/usr/bin/file conftest.$ac_objext` in
1135 x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
1136 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1137 # Find out which ABI we are using.
1138 echo 'int i;' > conftest.$ac_ext
1139 if AC_TRY_EVAL(ac_compile); then
1140 case `/usr/bin/file conftest.o` in
1143 x86_64-*kfreebsd*-gnu)
1144 LD="${LD-ld} -m elf_i386_fbsd"
1147 LD="${LD-ld} -m elf_i386"
1149 ppc64-*linux*|powerpc64-*linux*)
1150 LD="${LD-ld} -m elf32ppclinux"
1153 LD="${LD-ld} -m elf_s390"
1156 LD="${LD-ld} -m elf32_sparc"
1162 x86_64-*kfreebsd*-gnu)
1163 LD="${LD-ld} -m elf_x86_64_fbsd"
1166 LD="${LD-ld} -m elf_x86_64"
1168 ppc*-*linux*|powerpc*-*linux*)
1169 LD="${LD-ld} -m elf64ppc"
1171 s390*-*linux*|s390*-*tpf*)
1172 LD="${LD-ld} -m elf64_s390"
1175 LD="${LD-ld} -m elf64_sparc"
1185 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1186 SAVE_CFLAGS="$CFLAGS"
1187 CFLAGS="$CFLAGS -belf"
1188 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1190 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1192 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1193 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1194 CFLAGS="$SAVE_CFLAGS"
1198 # Find out which ABI we are using.
1199 echo 'int i;' > conftest.$ac_ext
1200 if AC_TRY_EVAL(ac_compile); then
1201 case `/usr/bin/file conftest.o` in
1203 case $lt_cv_prog_gnu_ld in
1204 yes*) LD="${LD-ld} -m elf64_sparc" ;;
1205 *) LD="${LD-ld} -64" ;;
1214 need_locks="$enable_libtool_lock"
1218 # _LT_CMD_OLD_ARCHIVE
1219 # -------------------
1220 m4_defun([_LT_CMD_OLD_ARCHIVE],
1221 [AC_CHECK_TOOL(AR, ar, false)
1222 test -z "$AR" && AR=ar
1223 test -z "$AR_FLAGS" && AR_FLAGS=cru
1224 _LT_DECL([], [AR], [1], [The archiver])
1225 _LT_DECL([], [AR_FLAGS], [1])
1227 AC_CHECK_TOOL(STRIP, strip, :)
1228 test -z "$STRIP" && STRIP=:
1229 _LT_DECL([], [STRIP], [1], [A symbol stripping program])
1231 AC_CHECK_TOOL(RANLIB, ranlib, :)
1232 test -z "$RANLIB" && RANLIB=:
1233 _LT_DECL([], [RANLIB], [1],
1234 [Commands used to install an old-style archive])
1236 # Determine commands to create old-style static archives.
1237 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
1238 old_postinstall_cmds='chmod 644 $oldlib'
1239 old_postuninstall_cmds=
1241 if test -n "$RANLIB"; then
1244 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
1247 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
1250 old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1252 _LT_DECL([], [old_postinstall_cmds], [2])
1253 _LT_DECL([], [old_postuninstall_cmds], [2])
1254 _LT_TAGDECL([], [old_archive_cmds], [2],
1255 [Commands used to build an old-style archive])
1256 ])# _LT_CMD_OLD_ARCHIVE
1259 # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1260 # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1261 # ----------------------------------------------------------------
1262 # Check whether the given compiler option works
1263 AC_DEFUN([_LT_COMPILER_OPTION],
1264 [AC_REQUIRE([AC_OBJEXT])dnl
1265 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1266 m4_require([_LT_DECL_SED])dnl
1267 AC_CACHE_CHECK([$1], [$2],
1269 m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1270 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1271 lt_compiler_flag="$3"
1272 # Insert the option either (1) after the last *FLAGS variable, or
1273 # (2) before a word containing "conftest.", or (3) at the end.
1274 # Note that $ac_compile itself does not contain backslashes and begins
1275 # with a dollar sign (not a hyphen), so the echo should work correctly.
1276 # The option is referenced via a variable to avoid confusing sed.
1277 lt_compile=`echo "$ac_compile" | $SED \
1278 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1279 -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1280 -e 's:$: $lt_compiler_flag:'`
1281 (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1282 (eval "$lt_compile" 2>conftest.err)
1284 cat conftest.err >&AS_MESSAGE_LOG_FD
1285 echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1286 if (exit $ac_status) && test -s "$ac_outfile"; then
1287 # The compiler can only warn and ignore the option if not recognized
1288 # So say no if there are warnings other than the usual output.
1289 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
1290 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1291 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1298 if test x"[$]$2" = xyes; then
1299 m4_if([$5], , :, [$5])
1301 m4_if([$6], , :, [$6])
1303 ])# _LT_COMPILER_OPTION
1306 AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1307 dnl aclocal-1.4 backwards compatibility:
1308 dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1311 # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1312 # [ACTION-SUCCESS], [ACTION-FAILURE])
1313 # ----------------------------------------------------
1314 # Check whether the given linker option works
1315 AC_DEFUN([_LT_LINKER_OPTION],
1316 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1317 m4_require([_LT_DECL_SED])dnl
1318 AC_CACHE_CHECK([$1], [$2],
1320 save_LDFLAGS="$LDFLAGS"
1321 LDFLAGS="$LDFLAGS $3"
1322 echo "$lt_simple_link_test_code" > conftest.$ac_ext
1323 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1324 # The linker can only warn and ignore the option if not recognized
1325 # So say no if there are warnings
1326 if test -s conftest.err; then
1327 # Append any errors to the config.log.
1328 cat conftest.err 1>&AS_MESSAGE_LOG_FD
1329 $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
1330 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1331 if diff conftest.exp conftest.er2 >/dev/null; then
1339 LDFLAGS="$save_LDFLAGS"
1342 if test x"[$]$2" = xyes; then
1343 m4_if([$4], , :, [$4])
1345 m4_if([$5], , :, [$5])
1347 ])# _LT_LINKER_OPTION
1350 AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1351 dnl aclocal-1.4 backwards compatibility:
1352 dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1357 AC_DEFUN([LT_CMD_MAX_LEN],
1358 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1359 # find the maximum length of command line arguments
1360 AC_MSG_CHECKING([the maximum length of command line arguments])
1361 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1367 # On DJGPP, this test can blow up pretty badly due to problems in libc
1368 # (any single argument exceeding 2000 bytes causes a buffer overrun
1369 # during glob expansion). Even if it were fixed, the result of this
1370 # check would be larger than it should be.
1371 lt_cv_sys_max_cmd_len=12288; # 12K is about right
1375 # Under GNU Hurd, this test is not required because there is
1376 # no limit to the length of command line arguments.
1377 # Libtool will interpret -1 as no limit whatsoever
1378 lt_cv_sys_max_cmd_len=-1;
1382 # On Win9x/ME, this test blows up -- it succeeds, but takes
1383 # about 5 minutes as the teststring grows exponentially.
1384 # Worse, since 9x/ME are not pre-emptively multitasking,
1385 # you end up with a "frozen" computer, even though with patience
1386 # the test eventually succeeds (with a max line length of 256k).
1387 # Instead, let's just punt: use the minimum linelength reported by
1388 # all of the supported platforms: 8192 (on NT/2K/XP).
1389 lt_cv_sys_max_cmd_len=8192;
1393 # On AmigaOS with pdksh, this test takes hours, literally.
1394 # So we just punt and use a minimum line length of 8192.
1395 lt_cv_sys_max_cmd_len=8192;
1398 netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
1399 # This has been around since 386BSD, at least. Likely further.
1400 if test -x /sbin/sysctl; then
1401 lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1402 elif test -x /usr/sbin/sysctl; then
1403 lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1405 lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
1407 # And add a safety zone
1408 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1409 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1413 # We know the value 262144 and hardcode it with a safety zone (like BSD)
1414 lt_cv_sys_max_cmd_len=196608
1418 # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1419 # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1420 # nice to cause kernel panics so lets avoid the loop below.
1421 # First set a reasonable default.
1422 lt_cv_sys_max_cmd_len=16384
1424 if test -x /sbin/sysconfig; then
1425 case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1426 *1*) lt_cv_sys_max_cmd_len=-1 ;;
1431 lt_cv_sys_max_cmd_len=102400
1433 sysv5* | sco5v6* | sysv4.2uw2*)
1434 kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1435 if test -n "$kargmax"; then
1436 lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
1438 lt_cv_sys_max_cmd_len=32768
1442 # Make teststring a little bigger before we do anything with it.
1443 # a 1K string should be a reasonable start.
1444 for i in 1 2 3 4 5 6 7 8 ; do
1445 teststring=$teststring$teststring
1447 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1448 # If test is not a shell built-in, we'll probably end up computing a
1449 # maximum length that is only half of the actual maximum length, but
1451 while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
1452 = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
1453 test $i != 17 # 1/2 MB should be enough
1456 teststring=$teststring$teststring
1458 # Only check the string length outside the loop.
1459 lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1461 # Add a significant safety factor because C++ compilers can tack on massive
1462 # amounts of additional arguments before passing them to the linker.
1463 # It appears as though 1/2 is a usable value.
1464 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1468 if test -n $lt_cv_sys_max_cmd_len ; then
1469 AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1473 max_cmd_len=$lt_cv_sys_max_cmd_len
1474 _LT_DECL([], [max_cmd_len], [0],
1475 [What is the maximum length of a command?])
1479 AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1480 dnl aclocal-1.4 backwards compatibility:
1481 dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1486 m4_defun([_LT_HEADER_DLFCN],
1487 [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1488 ])# _LT_HEADER_DLFCN
1491 # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1492 # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1493 # ----------------------------------------------------------------
1494 m4_defun([_LT_TRY_DLOPEN_SELF],
1495 [m4_require([_LT_HEADER_DLFCN])dnl
1496 if test "$cross_compiling" = yes; then :
1499 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1500 lt_status=$lt_dlunknown
1501 cat > conftest.$ac_ext <<_LT_EOF
1502 [#line __oline__ "configure"
1503 #include "confdefs.h"
1512 # define LT_DLGLOBAL RTLD_GLOBAL
1515 # define LT_DLGLOBAL DL_GLOBAL
1517 # define LT_DLGLOBAL 0
1521 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1522 find out it does not work in some platform. */
1523 #ifndef LT_DLLAZY_OR_NOW
1525 # define LT_DLLAZY_OR_NOW RTLD_LAZY
1528 # define LT_DLLAZY_OR_NOW DL_LAZY
1531 # define LT_DLLAZY_OR_NOW RTLD_NOW
1534 # define LT_DLLAZY_OR_NOW DL_NOW
1536 # define LT_DLLAZY_OR_NOW 0
1544 extern "C" void exit (int);
1547 void fnord() { int i=42;}
1550 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1551 int status = $lt_dlunknown;
1555 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
1556 else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
1557 /* dlclose (self); */
1565 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1566 (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1569 x$lt_dlno_uscore) $1 ;;
1570 x$lt_dlneed_uscore) $2 ;;
1571 x$lt_dlunknown|x*) $3 ;;
1574 # compilation failed
1579 ])# _LT_TRY_DLOPEN_SELF
1582 # LT_SYS_DLOPEN_SELF
1583 # ------------------
1584 AC_DEFUN([LT_SYS_DLOPEN_SELF],
1585 [m4_require([_LT_HEADER_DLFCN])dnl
1586 if test "x$enable_dlopen" != xyes; then
1587 enable_dlopen=unknown
1588 enable_dlopen_self=unknown
1589 enable_dlopen_self_static=unknown
1596 lt_cv_dlopen="load_add_on"
1598 lt_cv_dlopen_self=yes
1602 lt_cv_dlopen="LoadLibrary"
1607 lt_cv_dlopen="dlopen"
1612 # if libdl is installed we need to link against it
1613 AC_CHECK_LIB([dl], [dlopen],
1614 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
1617 lt_cv_dlopen_self=yes
1622 AC_CHECK_FUNC([shl_load],
1623 [lt_cv_dlopen="shl_load"],
1624 [AC_CHECK_LIB([dld], [shl_load],
1625 [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
1626 [AC_CHECK_FUNC([dlopen],
1627 [lt_cv_dlopen="dlopen"],
1628 [AC_CHECK_LIB([dl], [dlopen],
1629 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1630 [AC_CHECK_LIB([svld], [dlopen],
1631 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1632 [AC_CHECK_LIB([dld], [dld_link],
1633 [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
1642 if test "x$lt_cv_dlopen" != xno; then
1648 case $lt_cv_dlopen in
1650 save_CPPFLAGS="$CPPFLAGS"
1651 test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1653 save_LDFLAGS="$LDFLAGS"
1654 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1657 LIBS="$lt_cv_dlopen_libs $LIBS"
1659 AC_CACHE_CHECK([whether a program can dlopen itself],
1660 lt_cv_dlopen_self, [dnl
1661 _LT_TRY_DLOPEN_SELF(
1662 lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1663 lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1666 if test "x$lt_cv_dlopen_self" = xyes; then
1667 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1668 AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1669 lt_cv_dlopen_self_static, [dnl
1670 _LT_TRY_DLOPEN_SELF(
1671 lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1672 lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
1676 CPPFLAGS="$save_CPPFLAGS"
1677 LDFLAGS="$save_LDFLAGS"
1682 case $lt_cv_dlopen_self in
1683 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1684 *) enable_dlopen_self=unknown ;;
1687 case $lt_cv_dlopen_self_static in
1688 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1689 *) enable_dlopen_self_static=unknown ;;
1692 _LT_DECL([dlopen_support], [enable_dlopen], [0],
1693 [Whether dlopen is supported])
1694 _LT_DECL([dlopen_self], [enable_dlopen_self], [0],
1695 [Whether dlopen of programs is supported])
1696 _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
1697 [Whether dlopen of statically linked programs is supported])
1698 ])# LT_SYS_DLOPEN_SELF
1701 AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
1702 dnl aclocal-1.4 backwards compatibility:
1703 dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1706 # _LT_COMPILER_C_O([TAGNAME])
1707 # ---------------------------
1708 # Check to see if options -c and -o are simultaneously supported by compiler.
1709 # This macro does not hard code the compiler like AC_PROG_CC_C_O.
1710 m4_defun([_LT_COMPILER_C_O],
1711 [AC_REQUIRE([AC_OBJEXT])dnl
1712 m4_require([_LT_DECL_SED])dnl
1713 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1714 m4_require([_LT_TAG_COMPILER])dnl
1715 AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1716 [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1717 [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1718 $RM -r conftest 2>/dev/null
1722 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1724 lt_compiler_flag="-o out/conftest2.$ac_objext"
1725 # Insert the option either (1) after the last *FLAGS variable, or
1726 # (2) before a word containing "conftest.", or (3) at the end.
1727 # Note that $ac_compile itself does not contain backslashes and begins
1728 # with a dollar sign (not a hyphen), so the echo should work correctly.
1729 lt_compile=`echo "$ac_compile" | $SED \
1730 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1731 -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1732 -e 's:$: $lt_compiler_flag:'`
1733 (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1734 (eval "$lt_compile" 2>out/conftest.err)
1736 cat out/conftest.err >&AS_MESSAGE_LOG_FD
1737 echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1738 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1740 # The compiler can only warn and ignore the option if not recognized
1741 # So say no if there are warnings
1742 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
1743 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
1744 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
1745 _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
1748 chmod u+w . 2>&AS_MESSAGE_LOG_FD
1750 # SGI C++ compiler will create directory out/ii_files/ for
1751 # template instantiation
1752 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
1753 $RM out/* && rmdir out
1758 _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
1759 [Does compiler simultaneously support -c and -o options?])
1760 ])# _LT_COMPILER_C_O
1763 # _LT_COMPILER_FILE_LOCKS([TAGNAME])
1764 # ----------------------------------
1765 # Check to see if we can do hard links to lock some files if needed
1766 m4_defun([_LT_COMPILER_FILE_LOCKS],
1767 [m4_require([_LT_ENABLE_LOCK])dnl
1768 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1769 _LT_COMPILER_C_O([$1])
1771 hard_links="nottested"
1772 if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
1773 # do not overwrite the value of need_locks provided by the user
1774 AC_MSG_CHECKING([if we can lock with hard links])
1777 ln conftest.a conftest.b 2>/dev/null && hard_links=no
1779 ln conftest.a conftest.b 2>&5 || hard_links=no
1780 ln conftest.a conftest.b 2>/dev/null && hard_links=no
1781 AC_MSG_RESULT([$hard_links])
1782 if test "$hard_links" = no; then
1783 AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
1789 _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
1790 ])# _LT_COMPILER_FILE_LOCKS
1795 m4_defun([_LT_CHECK_OBJDIR],
1796 [AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
1797 [rm -f .libs 2>/dev/null
1798 mkdir .libs 2>/dev/null
1799 if test -d .libs; then
1802 # MS-DOS does not allow filenames that begin with a dot.
1805 rmdir .libs 2>/dev/null])
1806 objdir=$lt_cv_objdir
1807 _LT_DECL([], [objdir], [0],
1808 [The name of the directory that contains temporary libtool files])dnl
1809 m4_pattern_allow([LT_OBJDIR])dnl
1810 AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
1811 [Define to the sub-directory in which libtool stores uninstalled libraries.])
1812 ])# _LT_CHECK_OBJDIR
1815 # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
1816 # --------------------------------------
1817 # Check hardcoding attributes.
1818 m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
1819 [AC_MSG_CHECKING([how to hardcode library paths into programs])
1820 _LT_TAGVAR(hardcode_action, $1)=
1821 if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
1822 test -n "$_LT_TAGVAR(runpath_var, $1)" ||
1823 test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
1825 # We can hardcode non-existent directories.
1826 if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
1827 # If the only mechanism to avoid hardcoding is shlibpath_var, we
1828 # have to relink, otherwise we might link with an installed library
1829 # when we should be linking with a yet-to-be-installed one
1830 ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
1831 test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
1832 # Linking always hardcodes the temporary library directory.
1833 _LT_TAGVAR(hardcode_action, $1)=relink
1835 # We can link without hardcoding, and we can hardcode nonexisting dirs.
1836 _LT_TAGVAR(hardcode_action, $1)=immediate
1839 # We cannot hardcode anything, or else we can only hardcode existing
1841 _LT_TAGVAR(hardcode_action, $1)=unsupported
1843 AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
1845 if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
1846 test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
1847 # Fast installation is not supported
1848 enable_fast_install=no
1849 elif test "$shlibpath_overrides_runpath" = yes ||
1850 test "$enable_shared" = no; then
1851 # Fast installation is not necessary
1852 enable_fast_install=needless
1854 _LT_TAGDECL([], [hardcode_action], [0],
1855 [How to hardcode a shared library path into an executable])
1856 ])# _LT_LINKER_HARDCODE_LIBPATH
1861 m4_defun([_LT_CMD_STRIPLIB],
1862 [m4_require([_LT_DECL_EGREP])
1865 AC_MSG_CHECKING([whether stripping libraries is possible])
1866 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
1867 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
1868 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
1869 AC_MSG_RESULT([yes])
1871 # FIXME - insert some real tests, host_os isn't really good enough
1874 if test -n "$STRIP" ; then
1875 striplib="$STRIP -x"
1876 old_striplib="$STRIP -S"
1877 AC_MSG_RESULT([yes])
1887 _LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
1888 _LT_DECL([], [striplib], [1])
1889 ])# _LT_CMD_STRIPLIB
1892 # _LT_SYS_DYNAMIC_LINKER([TAG])
1893 # -----------------------------
1894 # PORTME Fill in your ld.so characteristics
1895 m4_defun([_LT_SYS_DYNAMIC_LINKER],
1896 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1897 m4_require([_LT_DECL_EGREP])dnl
1898 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1899 m4_require([_LT_DECL_SED])dnl
1900 AC_MSG_CHECKING([dynamic linker characteristics])
1902 [C], [withGCC=$GCC],
1903 [CXX], [withGCC=$GXX],
1904 [F77], [withGCC=$G77],
1905 [FC], [withGCC=$ac_cv_fc_compiler_gnu],
1906 [GCJ], [withGCC=$GCC],
1908 if test "$withGCC" = yes; then
1910 darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
1911 *) lt_awk_arg="/^libraries:/" ;;
1913 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
1914 if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
1915 # if the path contains ";" then we assume it to be the separator
1916 # otherwise default to the standard path separator (i.e. ":") - it is
1917 # assumed that no part of a normal pathname contains ";" but that should
1918 # okay in the real world where ";" in dirpaths is itself problematic.
1919 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
1921 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
1923 # Ok, now we have the path, separated by spaces, we can step through it
1924 # and add multilib dir if necessary.
1925 lt_tmp_lt_search_path_spec=
1926 lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
1927 for lt_sys_path in $lt_search_path_spec; do
1928 if test -d "$lt_sys_path/$lt_multi_os_dir"; then
1929 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
1931 test -d "$lt_sys_path" && \
1932 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
1935 lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
1936 BEGIN {RS=" "; FS="/|\n";} {
1939 for (lt_i = NF; lt_i > 0; lt_i--) {
1940 if ($lt_i != "" && $lt_i != ".") {
1941 if ($lt_i == "..") {
1944 if (lt_count == 0) {
1945 lt_foo="/" $lt_i lt_foo;
1952 if (lt_foo != "") { lt_freq[[lt_foo]]++; }
1953 if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
1955 sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
1957 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
1961 libname_spec='lib$name'
1969 shlibpath_overrides_runpath=unknown
1971 dynamic_linker="$host_os ld.so"
1972 sys_lib_dlsearch_path_spec="/lib /usr/lib"
1973 need_lib_prefix=unknown
1974 hardcode_into_libs=no
1976 # when you set need_version to no, make sure it does not cause -set_version
1977 # flags to be left without arguments
1978 need_version=unknown
1983 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
1984 shlibpath_var=LIBPATH
1986 # AIX 3 has no versioning support, so we append a major version to the name.
1987 soname_spec='${libname}${release}${shared_ext}$major'
1994 hardcode_into_libs=yes
1995 if test "$host_cpu" = ia64; then
1996 # AIX 5 supports IA64
1997 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
1998 shlibpath_var=LD_LIBRARY_PATH
2000 # With GCC up to 2.95.x, collect2 would create an import file
2001 # for dependence libraries. The import file would start with
2002 # the line `#! .'. This would cause the generated library to
2003 # depend on `.', always an invalid library. This was fixed in
2004 # development snapshots of GCC prior to 3.0.
2006 aix4 | aix4.[[01]] | aix4.[[01]].*)
2007 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2009 echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
2016 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
2017 # soname into executable. Probably we can add versioning support to
2018 # collect2, so additional links can be useful in future.
2019 if test "$aix_use_runtimelinking" = yes; then
2020 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2021 # instead of lib<name>.a to let people know that these are not
2022 # typical AIX shared libraries.
2023 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2025 # We preserve .a as extension for shared libraries through AIX4.2
2026 # and later when we are not doing run time linking.
2027 library_names_spec='${libname}${release}.a $libname.a'
2028 soname_spec='${libname}${release}${shared_ext}$major'
2030 shlibpath_var=LIBPATH
2035 if test "$host_cpu" = m68k; then
2036 library_names_spec='$libname.ixlibrary $libname.a'
2037 # Create ${libname}_ixlibrary.a entries in /sys/libs.
2038 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
2045 library_names_spec='${libname}${shared_ext}'
2046 dynamic_linker="$host_os ld.so"
2047 shlibpath_var=LIBRARY_PATH
2053 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2054 soname_spec='${libname}${release}${shared_ext}$major'
2055 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2056 shlibpath_var=LD_LIBRARY_PATH
2057 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2058 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2059 # the default ld.so.conf also contains /usr/contrib/lib and
2060 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2061 # libtool to hard-code these into programs
2064 cygwin* | mingw* | pw32*)
2065 version_type=windows
2070 case $withGCC,$host_os in
2071 yes,cygwin* | yes,mingw* | yes,pw32*)
2072 library_names_spec='$libname.dll.a'
2073 # DLL is installed to $(libdir)/../bin by postinstall_cmds
2074 postinstall_cmds='base_file=`basename \${file}`~
2075 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2076 dldir=$destdir/`dirname \$dlpath`~
2077 test -d \$dldir || mkdir -p \$dldir~
2078 $install_prog $dir/$dlname \$dldir/$dlname~
2079 chmod a+x \$dldir/$dlname~
2080 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2081 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2083 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2084 dlpath=$dir/\$dldll~
2086 shlibpath_overrides_runpath=yes
2090 # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2091 soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2092 sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
2095 # MinGW DLLs use traditional 'lib' prefix
2096 soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2097 sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2098 if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2099 # It is most probably a Windows format PATH printed by
2100 # mingw gcc, but we are running on Cygwin. Gcc prints its search
2101 # path with ; separators, and with drive letters. We can handle the
2102 # drive letters (cygwin fileutils understands them), so leave them,
2103 # especially as we might pass files found there to a mingw objdump,
2104 # which wouldn't understand a cygwinified path. Ahh.
2105 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2107 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2111 # pw32 DLLs use 'pw' prefix rather than 'lib'
2112 library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2118 library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2121 dynamic_linker='Win32 ld.exe'
2122 # FIXME: first we should search . and the directory the executable is in
2126 darwin* | rhapsody*)
2127 dynamic_linker="$host_os dyld"
2131 library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
2132 soname_spec='${libname}${release}${major}$shared_ext'
2133 shlibpath_overrides_runpath=yes
2134 shlibpath_var=DYLD_LIBRARY_PATH
2135 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2137 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2138 sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2145 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
2146 soname_spec='${libname}${release}${shared_ext}$major'
2147 shlibpath_var=LD_LIBRARY_PATH
2154 freebsd* | dragonfly*)
2155 # DragonFly does not have aout. When/if they implement a new
2156 # versioning mechanism, adjust this.
2157 if test -x /usr/bin/objformat; then
2158 objformat=`/usr/bin/objformat`
2161 freebsd[[123]]*) objformat=aout ;;
2165 version_type=freebsd-$objformat
2166 case $version_type in
2168 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2173 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
2177 shlibpath_var=LD_LIBRARY_PATH
2180 shlibpath_overrides_runpath=yes
2182 freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2183 shlibpath_overrides_runpath=yes
2184 hardcode_into_libs=yes
2186 freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2187 freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2188 shlibpath_overrides_runpath=no
2189 hardcode_into_libs=yes
2191 *) # from 4.6 on, and DragonFly
2192 shlibpath_overrides_runpath=yes
2193 hardcode_into_libs=yes
2202 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2203 soname_spec='${libname}${release}${shared_ext}$major'
2204 shlibpath_var=LD_LIBRARY_PATH
2205 hardcode_into_libs=yes
2208 hpux9* | hpux10* | hpux11*)
2209 # Give a soname corresponding to the major version so that dld.sl refuses to
2210 # link against other versions.
2217 hardcode_into_libs=yes
2218 dynamic_linker="$host_os dld.so"
2219 shlibpath_var=LD_LIBRARY_PATH
2220 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2221 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2222 soname_spec='${libname}${release}${shared_ext}$major'
2223 if test "X$HPUX_IA64_MODE" = X32; then
2224 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2226 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2228 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2232 hardcode_into_libs=yes
2233 dynamic_linker="$host_os dld.sl"
2234 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2235 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2236 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2237 soname_spec='${libname}${release}${shared_ext}$major'
2238 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2239 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2243 dynamic_linker="$host_os dld.sl"
2244 shlibpath_var=SHLIB_PATH
2245 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2246 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2247 soname_spec='${libname}${release}${shared_ext}$major'
2250 # HP-UX runs *really* slowly unless shared libraries are mode 555.
2251 postinstall_cmds='chmod 555 $lib'
2258 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2259 soname_spec='${libname}${release}${shared_ext}$major'
2260 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2261 shlibpath_var=LD_LIBRARY_PATH
2262 shlibpath_overrides_runpath=no
2263 hardcode_into_libs=yes
2266 irix5* | irix6* | nonstopux*)
2268 nonstopux*) version_type=nonstopux ;;
2270 if test "$lt_cv_prog_gnu_ld" = yes; then
2278 soname_spec='${libname}${release}${shared_ext}$major'
2279 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
2281 irix5* | nonstopux*)
2285 case $LD in # libtool.m4 will add one of these switches to LD
2286 *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2287 libsuff= shlibsuff= libmagic=32-bit;;
2288 *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2289 libsuff=32 shlibsuff=N32 libmagic=N32;;
2290 *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2291 libsuff=64 shlibsuff=64 libmagic=64-bit;;
2292 *) libsuff= shlibsuff= libmagic=never-match;;
2296 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2297 shlibpath_overrides_runpath=no
2298 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2299 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2300 hardcode_into_libs=yes
2303 # No shared lib support for Linux oldld, aout, or coff.
2304 linux*oldld* | linux*aout* | linux*coff*)
2308 # This must be Linux ELF.
2309 linux* | k*bsd*-gnu)
2313 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2314 soname_spec='${libname}${release}${shared_ext}$major'
2315 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2316 shlibpath_var=LD_LIBRARY_PATH
2317 shlibpath_overrides_runpath=no
2318 # Some binutils ld are patched to set DT_RUNPATH
2319 save_LDFLAGS=$LDFLAGS
2321 eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2322 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2323 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2324 [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir"],
2325 [shlibpath_overrides_runpath=yes])])
2326 LDFLAGS=$save_LDFLAGS
2329 # This implies no fast_install, which is unacceptable.
2330 # Some rework will be needed to allow for fast_install
2331 # before this can be enabled.
2332 hardcode_into_libs=yes
2334 # Append ld.so.conf contents to the search path
2335 if test -f /etc/ld.so.conf; then
2336 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
2337 sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
2340 # We used to test for /lib/ld.so.1 and disable shared libraries on
2341 # powerpc, because MkLinux only supported shared libraries with the
2342 # GNU dynamic linker. Since this was broken with cross compilers,
2343 # most powerpc-linux boxes support dynamic linking these days and
2344 # people can always --disable-shared, the test was removed, and we
2345 # assume the GNU/Linux dynamic linker is in use.
2346 dynamic_linker='GNU/Linux ld.so'
2353 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2354 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2355 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2356 dynamic_linker='NetBSD (a.out) ld.so'
2358 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2359 soname_spec='${libname}${release}${shared_ext}$major'
2360 dynamic_linker='NetBSD ld.elf_so'
2362 shlibpath_var=LD_LIBRARY_PATH
2363 shlibpath_overrides_runpath=yes
2364 hardcode_into_libs=yes
2369 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2370 shlibpath_var=LD_LIBRARY_PATH
2371 shlibpath_overrides_runpath=yes
2378 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2379 soname_spec='${libname}${release}${shared_ext}$major'
2380 shlibpath_var=LD_LIBRARY_PATH
2381 shlibpath_overrides_runpath=no
2382 hardcode_into_libs=yes
2383 dynamic_linker='ldqnx.so'
2388 sys_lib_dlsearch_path_spec="/usr/lib"
2390 # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
2392 openbsd3.3 | openbsd3.3.*) need_version=yes ;;
2393 *) need_version=no ;;
2395 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2396 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2397 shlibpath_var=LD_LIBRARY_PATH
2398 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2400 openbsd2.[[89]] | openbsd2.[[89]].*)
2401 shlibpath_overrides_runpath=no
2404 shlibpath_overrides_runpath=yes
2408 shlibpath_overrides_runpath=yes
2413 libname_spec='$name'
2416 library_names_spec='$libname${shared_ext} $libname.a'
2417 dynamic_linker='OS/2 ld.exe'
2418 shlibpath_var=LIBPATH
2421 osf3* | osf4* | osf5*)
2425 soname_spec='${libname}${release}${shared_ext}$major'
2426 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2427 shlibpath_var=LD_LIBRARY_PATH
2428 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2429 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2440 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2441 soname_spec='${libname}${release}${shared_ext}$major'
2442 shlibpath_var=LD_LIBRARY_PATH
2443 shlibpath_overrides_runpath=yes
2444 hardcode_into_libs=yes
2445 # ldd complains unless libraries are executable
2446 postinstall_cmds='chmod +x $lib'
2451 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2452 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2453 shlibpath_var=LD_LIBRARY_PATH
2454 shlibpath_overrides_runpath=yes
2455 if test "$with_gnu_ld" = yes; then
2463 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2464 soname_spec='${libname}${release}${shared_ext}$major'
2465 shlibpath_var=LD_LIBRARY_PATH
2466 case $host_vendor in
2468 shlibpath_overrides_runpath=no
2470 runpath_var=LD_RUN_PATH
2478 shlibpath_overrides_runpath=no
2479 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2485 if test -d /usr/nec ;then
2487 library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
2488 soname_spec='$libname${shared_ext}.$major'
2489 shlibpath_var=LD_LIBRARY_PATH
2493 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2494 version_type=freebsd-elf
2497 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2498 soname_spec='${libname}${release}${shared_ext}$major'
2499 shlibpath_var=LD_LIBRARY_PATH
2500 shlibpath_overrides_runpath=yes
2501 hardcode_into_libs=yes
2502 if test "$with_gnu_ld" = yes; then
2503 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
2505 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
2508 sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
2512 sys_lib_dlsearch_path_spec='/usr/lib'
2516 # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
2520 library_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2521 shlibpath_var=LD_LIBRARY_PATH
2522 shlibpath_overrides_runpath=no
2523 hardcode_into_libs=yes
2528 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2529 soname_spec='${libname}${release}${shared_ext}$major'
2530 shlibpath_var=LD_LIBRARY_PATH
2537 AC_MSG_RESULT([$dynamic_linker])
2538 test "$dynamic_linker" = no && can_build_shared=no
2540 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2541 if test "$GCC" = yes; then
2542 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2545 _LT_DECL([], [variables_saved_for_relink], [1],
2546 [Variables whose values should be saved in libtool wrapper scripts and
2547 restored at link time])
2548 _LT_DECL([], [need_lib_prefix], [0],
2549 [Do we need the "lib" prefix for modules?])
2550 _LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
2551 _LT_DECL([], [version_type], [0], [Library versioning type])
2552 _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
2553 _LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
2554 _LT_DECL([], [shlibpath_overrides_runpath], [0],
2555 [Is shlibpath searched before the hard-coded library search path?])
2556 _LT_DECL([], [libname_spec], [1], [Format of library name prefix])
2557 _LT_DECL([], [library_names_spec], [1],
2558 [[List of archive names. First name is the real one, the rest are links.
2559 The last name is the one that the linker finds with -lNAME]])
2560 _LT_DECL([], [soname_spec], [1],
2561 [[The coded name of the library, if different from the real name]])
2562 _LT_DECL([], [postinstall_cmds], [2],
2563 [Command to use after installation of a shared archive])
2564 _LT_DECL([], [postuninstall_cmds], [2],
2565 [Command to use after uninstallation of a shared archive])
2566 _LT_DECL([], [finish_cmds], [2],
2567 [Commands used to finish a libtool library installation in a directory])
2568 _LT_DECL([], [finish_eval], [1],
2569 [[As "finish_cmds", except a single script fragment to be evaled but
2571 _LT_DECL([], [hardcode_into_libs], [0],
2572 [Whether we should hardcode library paths into libraries])
2573 _LT_DECL([], [sys_lib_search_path_spec], [2],
2574 [Compile-time system search path for libraries])
2575 _LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
2576 [Run-time system search path for libraries])
2577 ])# _LT_SYS_DYNAMIC_LINKER
2580 # _LT_PATH_TOOL_PREFIX(TOOL)
2581 # --------------------------
2582 # find a file program which can recognize shared library
2583 AC_DEFUN([_LT_PATH_TOOL_PREFIX],
2584 [m4_require([_LT_DECL_EGREP])dnl
2585 AC_MSG_CHECKING([for $1])
2586 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
2588 [[\\/*] | ?:[\\/]*])
2589 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
2592 lt_save_MAGIC_CMD="$MAGIC_CMD"
2593 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2594 dnl $ac_dummy forces splitting on constant user-supplied paths.
2595 dnl POSIX.2 word splitting is done only on the output of word expansions,
2596 dnl not every word. This closes a longstanding sh security hole.
2597 ac_dummy="m4_if([$2], , $PATH, [$2])"
2598 for ac_dir in $ac_dummy; do
2600 test -z "$ac_dir" && ac_dir=.
2601 if test -f $ac_dir/$1; then
2602 lt_cv_path_MAGIC_CMD="$ac_dir/$1"
2603 if test -n "$file_magic_test_file"; then
2604 case $deplibs_check_method in
2606 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
2607 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2608 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2609 $EGREP "$file_magic_regex" > /dev/null; then
2614 *** Warning: the command libtool uses to detect shared libraries,
2615 *** $file_magic_cmd, produces output that libtool cannot recognize.
2616 *** The result is that libtool may fail to recognize shared libraries
2617 *** as such. This will affect the creation of libtool libraries that
2618 *** depend on shared libraries, but programs linked with such libtool
2619 *** libraries will work regardless of this problem. Nevertheless, you
2620 *** may want to report the problem to your system manager and/or to
2621 *** bug-libtool@gnu.org
2631 MAGIC_CMD="$lt_save_MAGIC_CMD"
2634 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2635 if test -n "$MAGIC_CMD"; then
2636 AC_MSG_RESULT($MAGIC_CMD)
2640 _LT_DECL([], [MAGIC_CMD], [0],
2641 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
2642 ])# _LT_PATH_TOOL_PREFIX
2645 AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
2646 dnl aclocal-1.4 backwards compatibility:
2647 dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
2652 # find a file program which can recognize a shared library
2653 m4_defun([_LT_PATH_MAGIC],
2654 [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
2655 if test -z "$lt_cv_path_MAGIC_CMD"; then
2656 if test -n "$ac_tool_prefix"; then
2657 _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
2667 # find the pathname to the GNU or non-GNU linker
2668 AC_DEFUN([LT_PATH_LD],
2669 [AC_REQUIRE([AC_PROG_CC])dnl
2670 AC_REQUIRE([AC_CANONICAL_HOST])dnl
2671 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
2672 m4_require([_LT_DECL_SED])dnl
2673 m4_require([_LT_DECL_EGREP])dnl
2675 AC_ARG_WITH([gnu-ld],
2676 [AS_HELP_STRING([--with-gnu-ld],
2677 [assume the C compiler uses GNU ld @<:@default=no@:>@])],
2678 [test "$withval" = no || with_gnu_ld=yes],
2679 [with_gnu_ld=no])dnl
2682 if test "$GCC" = yes; then
2683 # Check if gcc -print-prog-name=ld gives a path.
2684 AC_MSG_CHECKING([for ld used by $CC])
2687 # gcc leaves a trailing carriage return which upsets mingw
2688 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2690 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2693 # Accept absolute paths.
2694 [[\\/]]* | ?:[[\\/]]*)
2695 re_direlt='/[[^/]][[^/]]*/\.\./'
2696 # Canonicalize the pathname of ld
2697 ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
2698 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
2699 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
2701 test -z "$LD" && LD="$ac_prog"
2704 # If it fails, then pretend we aren't using GCC.
2708 # If it is relative, then search for the first ld in PATH.
2712 elif test "$with_gnu_ld" = yes; then
2713 AC_MSG_CHECKING([for GNU ld])
2715 AC_MSG_CHECKING([for non-GNU ld])
2717 AC_CACHE_VAL(lt_cv_path_LD,
2718 [if test -z "$LD"; then
2719 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2720 for ac_dir in $PATH; do
2722 test -z "$ac_dir" && ac_dir=.
2723 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2724 lt_cv_path_LD="$ac_dir/$ac_prog"
2725 # Check to see if the program is GNU ld. I'd rather use --version,
2726 # but apparently some variants of GNU ld only accept -v.
2727 # Break only if it was the GNU/non-GNU ld that we prefer.
2728 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
2729 *GNU* | *'with BFD'*)
2730 test "$with_gnu_ld" != no && break
2733 test "$with_gnu_ld" != yes && break
2740 lt_cv_path_LD="$LD" # Let the user override the test with a path.
2743 if test -n "$LD"; then
2748 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2752 _LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
2756 AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
2757 AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
2758 dnl aclocal-1.4 backwards compatibility:
2759 dnl AC_DEFUN([AM_PROG_LD], [])
2760 dnl AC_DEFUN([AC_PROG_LD], [])
2765 m4_defun([_LT_PATH_LD_GNU],
2766 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
2767 [# I'd rather use --version here, but apparently some GNU lds only accept -v.
2768 case `$LD -v 2>&1 </dev/null` in
2769 *GNU* | *'with BFD'*)
2770 lt_cv_prog_gnu_ld=yes
2773 lt_cv_prog_gnu_ld=no
2776 with_gnu_ld=$lt_cv_prog_gnu_ld
2782 # find reload flag for linker
2783 # -- PORTME Some linkers may need a different reload flag.
2784 m4_defun([_LT_CMD_RELOAD],
2785 [AC_CACHE_CHECK([for $LD option to reload object files],
2786 lt_cv_ld_reload_flag,
2787 [lt_cv_ld_reload_flag='-r'])
2788 reload_flag=$lt_cv_ld_reload_flag
2789 case $reload_flag in
2791 *) reload_flag=" $reload_flag" ;;
2793 reload_cmds='$LD$reload_flag -o $output$reload_objs'
2796 if test "$GCC" = yes; then
2797 reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
2799 reload_cmds='$LD$reload_flag -o $output$reload_objs'
2803 _LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
2804 _LT_DECL([], [reload_cmds], [2])dnl
2808 # _LT_CHECK_MAGIC_METHOD
2809 # ----------------------
2810 # how to check for library dependencies
2811 # -- PORTME fill in with the dynamic library characteristics
2812 m4_defun([_LT_CHECK_MAGIC_METHOD],
2813 [m4_require([_LT_DECL_EGREP])
2814 AC_CACHE_CHECK([how to recognize dependent libraries],
2815 lt_cv_deplibs_check_method,
2816 [lt_cv_file_magic_cmd='$MAGIC_CMD'
2817 lt_cv_file_magic_test_file=
2818 lt_cv_deplibs_check_method='unknown'
2819 # Need to set the preceding variable on all platforms that support
2820 # interlibrary dependencies.
2821 # 'none' -- dependencies not supported.
2822 # `unknown' -- same as none, but documents that we really don't know.
2823 # 'pass_all' -- all dependencies passed with no checks.
2824 # 'test_compile' -- check by making test program.
2825 # 'file_magic [[regex]]' -- check by looking for files in library path
2826 # which responds to the $file_magic_cmd with a given extended regex.
2827 # If you have `file' or equivalent on your system and you're not sure
2828 # whether `pass_all' will *always* work, you probably want this one.
2832 lt_cv_deplibs_check_method=pass_all
2836 lt_cv_deplibs_check_method=pass_all
2840 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
2841 lt_cv_file_magic_cmd='/usr/bin/file -L'
2842 lt_cv_file_magic_test_file=/shlib/libc.so
2846 # func_win32_libid is a shell function defined in ltmain.sh
2847 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
2848 lt_cv_file_magic_cmd='func_win32_libid'
2852 # Base MSYS/MinGW do not provide the 'file' command needed by
2853 # func_win32_libid shell function, so use a weaker test based on 'objdump',
2854 # unless we find 'file', for example because we are cross-compiling.
2855 if ( file / ) >/dev/null 2>&1; then
2856 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
2857 lt_cv_file_magic_cmd='func_win32_libid'
2859 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
2860 lt_cv_file_magic_cmd='$OBJDUMP -f'
2864 darwin* | rhapsody*)
2865 lt_cv_deplibs_check_method=pass_all
2868 freebsd* | dragonfly*)
2869 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
2872 # Not sure whether the presence of OpenBSD here was a mistake.
2873 # Let's accept both of them until this is cleared up.
2874 lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
2875 lt_cv_file_magic_cmd=/usr/bin/file
2876 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
2880 lt_cv_deplibs_check_method=pass_all
2885 lt_cv_deplibs_check_method=pass_all
2888 hpux10.20* | hpux11*)
2889 lt_cv_file_magic_cmd=/usr/bin/file
2892 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
2893 lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
2896 [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
2897 lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
2900 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
2901 lt_cv_file_magic_test_file=/usr/lib/libc.sl
2907 # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
2908 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
2911 irix5* | irix6* | nonstopux*)
2913 *-32|*"-32 ") libmagic=32-bit;;
2914 *-n32|*"-n32 ") libmagic=N32;;
2915 *-64|*"-64 ") libmagic=64-bit;;
2916 *) libmagic=never-match;;
2918 lt_cv_deplibs_check_method=pass_all
2921 # This must be Linux ELF.
2922 linux* | k*bsd*-gnu)
2923 lt_cv_deplibs_check_method=pass_all
2927 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
2928 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
2930 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
2935 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
2936 lt_cv_file_magic_cmd=/usr/bin/file
2937 lt_cv_file_magic_test_file=/usr/lib/libnls.so
2941 lt_cv_deplibs_check_method=pass_all
2945 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2946 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
2948 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
2952 osf3* | osf4* | osf5*)
2953 lt_cv_deplibs_check_method=pass_all
2957 lt_cv_deplibs_check_method=pass_all
2961 lt_cv_deplibs_check_method=pass_all
2964 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2965 lt_cv_deplibs_check_method=pass_all
2969 case $host_vendor in
2971 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
2972 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
2975 lt_cv_deplibs_check_method=pass_all
2978 lt_cv_file_magic_cmd='/bin/file'
2979 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
2982 lt_cv_file_magic_cmd='/bin/file'
2983 lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
2984 lt_cv_file_magic_test_file=/lib/libc.so
2987 lt_cv_deplibs_check_method=pass_all
2990 lt_cv_deplibs_check_method=pass_all
2996 lt_cv_deplibs_check_method=pass_all
3000 file_magic_cmd=$lt_cv_file_magic_cmd
3001 deplibs_check_method=$lt_cv_deplibs_check_method
3002 test -z "$deplibs_check_method" && deplibs_check_method=unknown
3004 _LT_DECL([], [deplibs_check_method], [1],
3005 [Method to check whether dependent libraries are shared objects])
3006 _LT_DECL([], [file_magic_cmd], [1],
3007 [Command to use when deplibs_check_method == "file_magic"])
3008 ])# _LT_CHECK_MAGIC_METHOD
3013 # find the pathname to a BSD- or MS-compatible name lister
3014 AC_DEFUN([LT_PATH_NM],
3015 [AC_REQUIRE([AC_PROG_CC])dnl
3016 AC_REQUIRE([AC_OBJEXT])dnl
3017 AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3018 [if test -n "$NM"; then
3019 # Let the user override the test.
3022 lt_nm_to_check="${ac_tool_prefix}nm"
3023 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3024 lt_nm_to_check="$lt_nm_to_check nm"
3026 for lt_tmp_nm in $lt_nm_to_check; do
3027 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3028 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3030 test -z "$ac_dir" && ac_dir=.
3031 tmp_nm="$ac_dir/$lt_tmp_nm"
3032 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
3033 # Check to see if the nm accepts a BSD-compat flag.
3034 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3035 # nm: unknown option "B" ignored
3036 # Tru64's nm complains that /dev/null is an invalid object file
3037 case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
3038 */dev/null* | *'Invalid file or object type'*)
3039 lt_cv_path_NM="$tmp_nm -B"
3043 case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3045 lt_cv_path_NM="$tmp_nm -p"
3049 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3050 continue # so that we can try to find one that supports BSD flags
3059 : ${lt_cv_path_NM=no}
3061 if test "$lt_cv_path_NM" != "no"; then
3064 # Didn't find any BSD compatible name lister, look for dumpbin.
3065 AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
3067 if test "$DUMPBIN" != ":"; then
3071 test -z "$NM" && NM=nm
3073 _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3075 AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3076 [lt_cv_nm_interface="BSD nm"
3077 echo "int some_variable = 0;" > conftest.$ac_ext
3078 (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3079 (eval "$ac_compile" 2>conftest.err)
3080 cat conftest.err >&AS_MESSAGE_LOG_FD
3081 (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3082 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3083 cat conftest.err >&AS_MESSAGE_LOG_FD
3084 (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
3085 cat conftest.out >&AS_MESSAGE_LOG_FD
3086 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3087 lt_cv_nm_interface="MS dumpbin"
3093 AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3094 AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3095 dnl aclocal-1.4 backwards compatibility:
3096 dnl AC_DEFUN([AM_PROG_NM], [])
3097 dnl AC_DEFUN([AC_PROG_NM], [])
3102 # check for math library
3103 AC_DEFUN([LT_LIB_M],
3104 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
3107 *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
3108 # These system don't have libm, or don't need it
3111 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3112 AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3115 AC_CHECK_LIB(m, cos, LIBM="-lm")
3122 AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3123 dnl aclocal-1.4 backwards compatibility:
3124 dnl AC_DEFUN([AC_CHECK_LIBM], [])
3127 # _LT_COMPILER_NO_RTTI([TAGNAME])
3128 # -------------------------------
3129 m4_defun([_LT_COMPILER_NO_RTTI],
3130 [m4_require([_LT_TAG_COMPILER])dnl
3132 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3134 if test "$GCC" = yes; then
3135 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
3137 _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3138 lt_cv_prog_compiler_rtti_exceptions,
3139 [-fno-rtti -fno-exceptions], [],
3140 [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3142 _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3143 [Compiler flag to turn off builtin functions])
3144 ])# _LT_COMPILER_NO_RTTI
3147 # _LT_CMD_GLOBAL_SYMBOLS
3148 # ----------------------
3149 m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3150 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
3151 AC_REQUIRE([AC_PROG_CC])dnl
3152 AC_REQUIRE([AC_OBJEXT])dnl
3153 AC_REQUIRE([LT_PATH_NM])dnl
3154 AC_REQUIRE([LT_PATH_LD])dnl
3155 m4_require([_LT_DECL_SED])dnl
3156 m4_require([_LT_DECL_EGREP])dnl
3157 m4_require([_LT_TAG_COMPILER])dnl
3159 # Check for command to grab the raw symbol name followed by C symbol from nm.
3160 AC_MSG_CHECKING([command to parse $NM output from $compiler object])
3161 AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3163 # These are sane defaults that work on at least a few old systems.
3164 # [They come from Ultrix. What could be older than Ultrix?!! ;)]
3166 # Character class describing NM global symbol codes.
3167 symcode='[[BCDEGRST]]'
3169 # Regexp to match symbols that can be accessed directly from C.
3170 sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3172 # Define system-specific variables.
3177 cygwin* | mingw* | pw32*)
3178 symcode='[[ABCDGISTW]]'
3181 if test "$host_cpu" = ia64; then
3182 symcode='[[ABCDEGRST]]'
3186 symcode='[[BCDEGRST]]'
3189 symcode='[[BCDEGQRST]]'
3200 sysv5* | sco5v6* | unixware* | OpenUNIX*)
3204 symcode='[[DFNSTU]]'
3208 # If we're using GNU nm, then use its standard symbol codes.
3209 case `$NM -V 2>&1` in
3210 *GNU* | *'with BFD'*)
3211 symcode='[[ABCDGIRSTW]]' ;;
3214 # Transform an extracted symbol line into a proper C declaration.
3215 # Some systems (esp. on ia64) link data and code symbols differently,
3216 # so use this general approach.
3217 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3219 # Transform an extracted symbol line into symbol name and symbol address
3220 lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
3222 # Handle CRLF in mingw tool chain
3226 opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
3230 # Try without a prefix underscore, then with it.
3231 for ac_symprfx in "" "_"; do
3233 # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
3234 symxfrm="\\1 $ac_symprfx\\2 \\2"
3236 # Write the raw and C identifiers.
3237 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3238 # Fake it for dumpbin and say T for any non-static function
3239 # and D for any global variable.
3240 # Also find C++ and __fastcall symbols from MSVC++,
3241 # which start with @ or ?.
3242 lt_cv_sys_global_symbol_pipe="$AWK ['"\
3243 " {last_section=section; section=\$ 3};"\
3244 " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
3245 " \$ 0!~/External *\|/{next};"\
3246 " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
3247 " {if(hide[section]) next};"\
3248 " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
3249 " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
3250 " s[1]~/^[@?]/{print s[1], s[1]; next};"\
3251 " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
3252 " ' prfx=^$ac_symprfx]"
3254 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
3257 # Check to see that the pipe works correctly.
3261 cat > conftest.$ac_ext <<_LT_EOF
3266 void nm_test_func(void);
3267 void nm_test_func(void){}
3271 int main(){nm_test_var='a';nm_test_func();return(0);}
3274 if AC_TRY_EVAL(ac_compile); then
3275 # Now try to grab the symbols.
3277 if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
3278 # Try sorting and uniquifying the output.
3279 if sort "$nlist" | uniq > "$nlist"T; then
3280 mv -f "$nlist"T "$nlist"
3285 # Make sure that we snagged all the symbols we need.
3286 if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
3287 if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
3288 cat <<_LT_EOF > conftest.$ac_ext
3294 # Now generate the symbol file.
3295 eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3297 cat <<_LT_EOF >> conftest.$ac_ext
3299 /* The mapping between symbol names and symbols. */
3304 lt__PROGRAM__LTX_preloaded_symbols[[]] =
3306 { "@PROGRAM@", (void *) 0 },
3308 $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
3309 cat <<\_LT_EOF >> conftest.$ac_ext
3313 /* This works around a problem in FreeBSD linker */
3314 #ifdef FREEBSD_WORKAROUND
3315 static const void *lt_preloaded_setup() {
3316 return lt__PROGRAM__LTX_preloaded_symbols;
3324 # Now try linking the two files.
3325 mv conftest.$ac_objext conftstm.$ac_objext
3326 lt_save_LIBS="$LIBS"
3327 lt_save_CFLAGS="$CFLAGS"
3328 LIBS="conftstm.$ac_objext"
3329 CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
3330 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
3333 LIBS="$lt_save_LIBS"
3334 CFLAGS="$lt_save_CFLAGS"
3336 echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
3339 echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
3342 echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
3345 echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
3346 cat conftest.$ac_ext >&5
3348 rm -f conftest* conftst*
3350 # Do not use the global_symbol_pipe unless it works.
3351 if test "$pipe_works" = yes; then
3354 lt_cv_sys_global_symbol_pipe=
3358 if test -z "$lt_cv_sys_global_symbol_pipe"; then
3359 lt_cv_sys_global_symbol_to_cdecl=
3361 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
3362 AC_MSG_RESULT(failed)
3367 _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
3368 [Take the output of nm and produce a listing of raw symbols and C names])
3369 _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
3370 [Transform the output of nm in a proper C declaration])
3371 _LT_DECL([global_symbol_to_c_name_address],
3372 [lt_cv_sys_global_symbol_to_c_name_address], [1],
3373 [Transform the output of nm in a C name address pair])
3374 ]) # _LT_CMD_GLOBAL_SYMBOLS
3377 # _LT_COMPILER_PIC([TAGNAME])
3378 # ---------------------------
3379 m4_defun([_LT_COMPILER_PIC],
3380 [m4_require([_LT_TAG_COMPILER])dnl
3381 _LT_TAGVAR(lt_prog_compiler_wl, $1)=
3382 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3383 _LT_TAGVAR(lt_prog_compiler_static, $1)=
3385 AC_MSG_CHECKING([for $compiler option to produce PIC])
3386 m4_if([$1], [CXX], [
3387 # C++ specific cases for pic, static, wl, etc.
3388 if test "$GXX" = yes; then
3389 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3390 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3394 # All AIX code is PIC.
3395 if test "$host_cpu" = ia64; then
3396 # AIX 5 now supports IA64 processor
3397 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3401 if test "$host_cpu" = m68k; then
3402 # FIXME: we need at least 68020 code to build shared libraries, but
3403 # adding the `-m68020' flag to GCC prevents building anything better,
3405 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3408 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3409 # PIC is the default for these OSes.
3411 mingw* | cygwin* | os2* | pw32*)
3412 # This hack is so that the source file can tell whether it is being
3413 # built for inclusion in a dll (and should export symbols for example).
3414 # Although the cygwin gcc ignores -fPIC, still need this for old-style
3415 # (--disable-auto-import) libraries
3416 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
3418 darwin* | rhapsody*)
3419 # PIC is the default on this platform
3420 # Common symbols not allowed in MH_DYLIB files
3421 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3424 # DJGPP does not support shared libraries at all
3425 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3428 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3429 # Instead, we relocate shared libraries at runtime.
3432 if test -d /usr/nec; then
3433 _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3437 # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
3443 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3448 # QNX uses GNU C++, but need to define -shared option too, otherwise
3450 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3453 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3459 # All AIX code is PIC.
3460 if test "$host_cpu" = ia64; then
3461 # AIX 5 now supports IA64 processor
3462 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3464 _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3468 case $cc_basename in
3470 # Green Hills C++ Compiler
3471 # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
3476 # PIC is the default on this platform
3477 # Common symbols not allowed in MH_DYLIB files
3478 case $cc_basename in
3480 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
3481 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3486 case $cc_basename in
3488 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3491 # Green Hills C++ Compiler
3492 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3498 freebsd* | dragonfly*)
3499 # FreeBSD uses GNU C++
3501 hpux9* | hpux10* | hpux11*)
3502 case $cc_basename in
3504 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3505 _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3506 if test "$host_cpu" != ia64; then
3507 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3511 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3512 _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3518 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3527 # This is c89, which is MS Visual C++ (no shared libs)
3528 # Anyone wants to do a port?
3530 irix5* | irix6* | nonstopux*)
3531 case $cc_basename in
3533 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3534 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3535 # CC pic flag -KPIC is the default.
3541 linux* | k*bsd*-gnu)
3542 case $cc_basename in
3545 _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
3546 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3550 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3551 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3552 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3555 # Portland Group C++ compiler
3556 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3557 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
3558 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3562 # Make sure the PIC flag is empty. It appears that all Alpha
3563 # Linux and Compaq Tru64 Unix objects are PIC.
3564 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3565 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3568 case `$CC -V 2>&1 | sed 5q` in
3571 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3572 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3573 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
3584 case $cc_basename in
3586 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
3595 # QNX uses GNU C++, but need to define -shared option too, otherwise
3597 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3599 osf3* | osf4* | osf5*)
3600 case $cc_basename in
3602 _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
3605 # Rational C++ 2.4.1
3606 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3609 # Digital/Compaq C++
3610 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3611 # Make sure the PIC flag is empty. It appears that all Alpha
3612 # Linux and Compaq Tru64 Unix objects are PIC.
3613 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3614 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3623 case $cc_basename in
3625 # Sun C++ 4.2, 5.x and Centerline C++
3626 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3627 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3628 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
3631 # Green Hills C++ Compiler
3632 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
3639 case $cc_basename in
3642 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3643 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3647 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3653 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
3654 case $cc_basename in
3656 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3657 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3658 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3663 case $cc_basename in
3665 # NonStop-UX NCC 3.20
3666 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3675 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
3681 if test "$GCC" = yes; then
3682 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3683 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3687 # All AIX code is PIC.
3688 if test "$host_cpu" = ia64; then
3689 # AIX 5 now supports IA64 processor
3690 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3695 if test "$host_cpu" = m68k; then
3696 # FIXME: we need at least 68020 code to build shared libraries, but
3697 # adding the `-m68020' flag to GCC prevents building anything better,
3699 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3703 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3704 # PIC is the default for these OSes.
3707 mingw* | cygwin* | pw32* | os2*)
3708 # This hack is so that the source file can tell whether it is being
3709 # built for inclusion in a dll (and should export symbols for example).
3710 # Although the cygwin gcc ignores -fPIC, still need this for old-style
3711 # (--disable-auto-import) libraries
3712 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
3715 darwin* | rhapsody*)
3716 # PIC is the default on this platform
3717 # Common symbols not allowed in MH_DYLIB files
3718 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3722 # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
3729 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3735 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3736 # Instead, we relocate shared libraries at runtime.
3740 # Just because we use GCC doesn't mean we suddenly get shared libraries
3741 # on systems that don't support them.
3742 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
3747 # QNX uses GNU C++, but need to define -shared option too, otherwise
3749 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3753 if test -d /usr/nec; then
3754 _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3759 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3763 # PORTME Check for flag to pass linker flags through the system compiler.
3766 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3767 if test "$host_cpu" = ia64; then
3768 # AIX 5 now supports IA64 processor
3769 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3771 _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3775 # PIC is the default on this platform
3776 # Common symbols not allowed in MH_DYLIB files
3777 case $cc_basename in
3779 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
3780 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3785 mingw* | cygwin* | pw32* | os2*)
3786 # This hack is so that the source file can tell whether it is being
3787 # built for inclusion in a dll (and should export symbols for example).
3788 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
3791 hpux9* | hpux10* | hpux11*)
3792 _LT_TAGVAR(lt_prog_compiler_wl, $1)=