aclocal.m4 revision 18552c8a
1# generated automatically by aclocal 1.13.4 -*- Autoconf -*-
2
3# Copyright (C) 1996-2013 Free Software Foundation, Inc.
4
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15m4_ifndef([AC_AUTOCONF_VERSION],
16  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
18[m4_warning([this file was generated for autoconf 2.69.
19You have another version of autoconf.  It may work, but is not guaranteed to.
20If you have problems, you may need to regenerate the build system entirely.
21To do so, use the procedure documented by the package, typically 'autoreconf'.])])
22
23# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
24#
25#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
26#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
27#                 Foundation, Inc.
28#   Written by Gordon Matzigkeit, 1996
29#
30# This file is free software; the Free Software Foundation gives
31# unlimited permission to copy and/or distribute it, with or without
32# modifications, as long as this notice is preserved.
33
34m4_define([_LT_COPYING], [dnl
35#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
36#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
37#                 Foundation, Inc.
38#   Written by Gordon Matzigkeit, 1996
39#
40#   This file is part of GNU Libtool.
41#
42# GNU Libtool is free software; you can redistribute it and/or
43# modify it under the terms of the GNU General Public License as
44# published by the Free Software Foundation; either version 2 of
45# the License, or (at your option) any later version.
46#
47# As a special exception to the GNU General Public License,
48# if you distribute this file as part of a program or library that
49# is built using GNU Libtool, you may include this file under the
50# same distribution terms that you use for the rest of that program.
51#
52# GNU Libtool is distributed in the hope that it will be useful,
53# but WITHOUT ANY WARRANTY; without even the implied warranty of
54# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
55# GNU General Public License for more details.
56#
57# You should have received a copy of the GNU General Public License
58# along with GNU Libtool; see the file COPYING.  If not, a copy
59# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
60# obtained by writing to the Free Software Foundation, Inc.,
61# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
62])
63
64# serial 57 LT_INIT
65
66
67# LT_PREREQ(VERSION)
68# ------------------
69# Complain and exit if this libtool version is less that VERSION.
70m4_defun([LT_PREREQ],
71[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
72       [m4_default([$3],
73		   [m4_fatal([Libtool version $1 or higher is required],
74		             63)])],
75       [$2])])
76
77
78# _LT_CHECK_BUILDDIR
79# ------------------
80# Complain if the absolute build directory name contains unusual characters
81m4_defun([_LT_CHECK_BUILDDIR],
82[case `pwd` in
83  *\ * | *\	*)
84    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
85esac
86])
87
88
89# LT_INIT([OPTIONS])
90# ------------------
91AC_DEFUN([LT_INIT],
92[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
93AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
94AC_BEFORE([$0], [LT_LANG])dnl
95AC_BEFORE([$0], [LT_OUTPUT])dnl
96AC_BEFORE([$0], [LTDL_INIT])dnl
97m4_require([_LT_CHECK_BUILDDIR])dnl
98
99dnl Autoconf doesn't catch unexpanded LT_ macros by default:
100m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
101m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
102dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
103dnl unless we require an AC_DEFUNed macro:
104AC_REQUIRE([LTOPTIONS_VERSION])dnl
105AC_REQUIRE([LTSUGAR_VERSION])dnl
106AC_REQUIRE([LTVERSION_VERSION])dnl
107AC_REQUIRE([LTOBSOLETE_VERSION])dnl
108m4_require([_LT_PROG_LTMAIN])dnl
109
110_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
111
112dnl Parse OPTIONS
113_LT_SET_OPTIONS([$0], [$1])
114
115# This can be used to rebuild libtool when needed
116LIBTOOL_DEPS="$ltmain"
117
118# Always use our own libtool.
119LIBTOOL='$(SHELL) $(top_builddir)/libtool'
120AC_SUBST(LIBTOOL)dnl
121
122_LT_SETUP
123
124# Only expand once:
125m4_define([LT_INIT])
126])# LT_INIT
127
128# Old names:
129AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
130AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
131dnl aclocal-1.4 backwards compatibility:
132dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
133dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
134
135
136# _LT_CC_BASENAME(CC)
137# -------------------
138# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
139m4_defun([_LT_CC_BASENAME],
140[for cc_temp in $1""; do
141  case $cc_temp in
142    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
143    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
144    \-*) ;;
145    *) break;;
146  esac
147done
148cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
149])
150
151
152# _LT_FILEUTILS_DEFAULTS
153# ----------------------
154# It is okay to use these file commands and assume they have been set
155# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
156m4_defun([_LT_FILEUTILS_DEFAULTS],
157[: ${CP="cp -f"}
158: ${MV="mv -f"}
159: ${RM="rm -f"}
160])# _LT_FILEUTILS_DEFAULTS
161
162
163# _LT_SETUP
164# ---------
165m4_defun([_LT_SETUP],
166[AC_REQUIRE([AC_CANONICAL_HOST])dnl
167AC_REQUIRE([AC_CANONICAL_BUILD])dnl
168AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
169AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
170
171_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
172dnl
173_LT_DECL([], [host_alias], [0], [The host system])dnl
174_LT_DECL([], [host], [0])dnl
175_LT_DECL([], [host_os], [0])dnl
176dnl
177_LT_DECL([], [build_alias], [0], [The build system])dnl
178_LT_DECL([], [build], [0])dnl
179_LT_DECL([], [build_os], [0])dnl
180dnl
181AC_REQUIRE([AC_PROG_CC])dnl
182AC_REQUIRE([LT_PATH_LD])dnl
183AC_REQUIRE([LT_PATH_NM])dnl
184dnl
185AC_REQUIRE([AC_PROG_LN_S])dnl
186test -z "$LN_S" && LN_S="ln -s"
187_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
188dnl
189AC_REQUIRE([LT_CMD_MAX_LEN])dnl
190_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
191_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
192dnl
193m4_require([_LT_FILEUTILS_DEFAULTS])dnl
194m4_require([_LT_CHECK_SHELL_FEATURES])dnl
195m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
196m4_require([_LT_CMD_RELOAD])dnl
197m4_require([_LT_CHECK_MAGIC_METHOD])dnl
198m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
199m4_require([_LT_CMD_OLD_ARCHIVE])dnl
200m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
201m4_require([_LT_WITH_SYSROOT])dnl
202
203_LT_CONFIG_LIBTOOL_INIT([
204# See if we are running on zsh, and set the options which allow our
205# commands through without removal of \ escapes INIT.
206if test -n "\${ZSH_VERSION+set}" ; then
207   setopt NO_GLOB_SUBST
208fi
209])
210if test -n "${ZSH_VERSION+set}" ; then
211   setopt NO_GLOB_SUBST
212fi
213
214_LT_CHECK_OBJDIR
215
216m4_require([_LT_TAG_COMPILER])dnl
217
218case $host_os in
219aix3*)
220  # AIX sometimes has problems with the GCC collect2 program.  For some
221  # reason, if we set the COLLECT_NAMES environment variable, the problems
222  # vanish in a puff of smoke.
223  if test "X${COLLECT_NAMES+set}" != Xset; then
224    COLLECT_NAMES=
225    export COLLECT_NAMES
226  fi
227  ;;
228esac
229
230# Global variables:
231ofile=libtool
232can_build_shared=yes
233
234# All known linkers require a `.a' archive for static linking (except MSVC,
235# which needs '.lib').
236libext=a
237
238with_gnu_ld="$lt_cv_prog_gnu_ld"
239
240old_CC="$CC"
241old_CFLAGS="$CFLAGS"
242
243# Set sane defaults for various variables
244test -z "$CC" && CC=cc
245test -z "$LTCC" && LTCC=$CC
246test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
247test -z "$LD" && LD=ld
248test -z "$ac_objext" && ac_objext=o
249
250_LT_CC_BASENAME([$compiler])
251
252# Only perform the check for file, if the check method requires it
253test -z "$MAGIC_CMD" && MAGIC_CMD=file
254case $deplibs_check_method in
255file_magic*)
256  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
257    _LT_PATH_MAGIC
258  fi
259  ;;
260esac
261
262# Use C for the default configuration in the libtool script
263LT_SUPPORTED_TAG([CC])
264_LT_LANG_C_CONFIG
265_LT_LANG_DEFAULT_CONFIG
266_LT_CONFIG_COMMANDS
267])# _LT_SETUP
268
269
270# _LT_PREPARE_SED_QUOTE_VARS
271# --------------------------
272# Define a few sed substitution that help us do robust quoting.
273m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
274[# Backslashify metacharacters that are still active within
275# double-quoted strings.
276sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
277
278# Same as above, but do not quote variable references.
279double_quote_subst='s/\([["`\\]]\)/\\\1/g'
280
281# Sed substitution to delay expansion of an escaped shell variable in a
282# double_quote_subst'ed string.
283delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
284
285# Sed substitution to delay expansion of an escaped single quote.
286delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
287
288# Sed substitution to avoid accidental globbing in evaled expressions
289no_glob_subst='s/\*/\\\*/g'
290])
291
292# _LT_PROG_LTMAIN
293# ---------------
294# Note that this code is called both from `configure', and `config.status'
295# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
296# `config.status' has no value for ac_aux_dir unless we are using Automake,
297# so we pass a copy along to make sure it has a sensible value anyway.
298m4_defun([_LT_PROG_LTMAIN],
299[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
300_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
301ltmain="$ac_aux_dir/ltmain.sh"
302])# _LT_PROG_LTMAIN
303
304
305
306# So that we can recreate a full libtool script including additional
307# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
308# in macros and then make a single call at the end using the `libtool'
309# label.
310
311
312# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
313# ----------------------------------------
314# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
315m4_define([_LT_CONFIG_LIBTOOL_INIT],
316[m4_ifval([$1],
317          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
318                     [$1
319])])])
320
321# Initialize.
322m4_define([_LT_OUTPUT_LIBTOOL_INIT])
323
324
325# _LT_CONFIG_LIBTOOL([COMMANDS])
326# ------------------------------
327# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
328m4_define([_LT_CONFIG_LIBTOOL],
329[m4_ifval([$1],
330          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
331                     [$1
332])])])
333
334# Initialize.
335m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
336
337
338# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
339# -----------------------------------------------------
340m4_defun([_LT_CONFIG_SAVE_COMMANDS],
341[_LT_CONFIG_LIBTOOL([$1])
342_LT_CONFIG_LIBTOOL_INIT([$2])
343])
344
345
346# _LT_FORMAT_COMMENT([COMMENT])
347# -----------------------------
348# Add leading comment marks to the start of each line, and a trailing
349# full-stop to the whole comment if one is not present already.
350m4_define([_LT_FORMAT_COMMENT],
351[m4_ifval([$1], [
352m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
353              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
354)])
355
356
357
358
359
360# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
361# -------------------------------------------------------------------
362# CONFIGNAME is the name given to the value in the libtool script.
363# VARNAME is the (base) name used in the configure script.
364# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
365# VARNAME.  Any other value will be used directly.
366m4_define([_LT_DECL],
367[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
368    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
369	[m4_ifval([$1], [$1], [$2])])
370    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
371    m4_ifval([$4],
372	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
373    lt_dict_add_subkey([lt_decl_dict], [$2],
374	[tagged?], [m4_ifval([$5], [yes], [no])])])
375])
376
377
378# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
379# --------------------------------------------------------
380m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
381
382
383# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
384# ------------------------------------------------
385m4_define([lt_decl_tag_varnames],
386[_lt_decl_filter([tagged?], [yes], $@)])
387
388
389# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
390# ---------------------------------------------------------
391m4_define([_lt_decl_filter],
392[m4_case([$#],
393  [0], [m4_fatal([$0: too few arguments: $#])],
394  [1], [m4_fatal([$0: too few arguments: $#: $1])],
395  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
396  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
397  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
398])
399
400
401# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
402# --------------------------------------------------
403m4_define([lt_decl_quote_varnames],
404[_lt_decl_filter([value], [1], $@)])
405
406
407# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
408# ---------------------------------------------------
409m4_define([lt_decl_dquote_varnames],
410[_lt_decl_filter([value], [2], $@)])
411
412
413# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
414# ---------------------------------------------------
415m4_define([lt_decl_varnames_tagged],
416[m4_assert([$# <= 2])dnl
417_$0(m4_quote(m4_default([$1], [[, ]])),
418    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
419    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
420m4_define([_lt_decl_varnames_tagged],
421[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
422
423
424# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
425# ------------------------------------------------
426m4_define([lt_decl_all_varnames],
427[_$0(m4_quote(m4_default([$1], [[, ]])),
428     m4_if([$2], [],
429	   m4_quote(lt_decl_varnames),
430	m4_quote(m4_shift($@))))[]dnl
431])
432m4_define([_lt_decl_all_varnames],
433[lt_join($@, lt_decl_varnames_tagged([$1],
434			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
435])
436
437
438# _LT_CONFIG_STATUS_DECLARE([VARNAME])
439# ------------------------------------
440# Quote a variable value, and forward it to `config.status' so that its
441# declaration there will have the same value as in `configure'.  VARNAME
442# must have a single quote delimited value for this to work.
443m4_define([_LT_CONFIG_STATUS_DECLARE],
444[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
445
446
447# _LT_CONFIG_STATUS_DECLARATIONS
448# ------------------------------
449# We delimit libtool config variables with single quotes, so when
450# we write them to config.status, we have to be sure to quote all
451# embedded single quotes properly.  In configure, this macro expands
452# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
453#
454#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
455m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
456[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
457    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
458
459
460# _LT_LIBTOOL_TAGS
461# ----------------
462# Output comment and list of tags supported by the script
463m4_defun([_LT_LIBTOOL_TAGS],
464[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
465available_tags="_LT_TAGS"dnl
466])
467
468
469# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
470# -----------------------------------
471# Extract the dictionary values for VARNAME (optionally with TAG) and
472# expand to a commented shell variable setting:
473#
474#    # Some comment about what VAR is for.
475#    visible_name=$lt_internal_name
476m4_define([_LT_LIBTOOL_DECLARE],
477[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
478					   [description])))[]dnl
479m4_pushdef([_libtool_name],
480    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
481m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
482    [0], [_libtool_name=[$]$1],
483    [1], [_libtool_name=$lt_[]$1],
484    [2], [_libtool_name=$lt_[]$1],
485    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
486m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
487])
488
489
490# _LT_LIBTOOL_CONFIG_VARS
491# -----------------------
492# Produce commented declarations of non-tagged libtool config variables
493# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
494# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
495# section) are produced by _LT_LIBTOOL_TAG_VARS.
496m4_defun([_LT_LIBTOOL_CONFIG_VARS],
497[m4_foreach([_lt_var],
498    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
499    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
500
501
502# _LT_LIBTOOL_TAG_VARS(TAG)
503# -------------------------
504m4_define([_LT_LIBTOOL_TAG_VARS],
505[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
506    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
507
508
509# _LT_TAGVAR(VARNAME, [TAGNAME])
510# ------------------------------
511m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
512
513
514# _LT_CONFIG_COMMANDS
515# -------------------
516# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
517# variables for single and double quote escaping we saved from calls
518# to _LT_DECL, we can put quote escaped variables declarations
519# into `config.status', and then the shell code to quote escape them in
520# for loops in `config.status'.  Finally, any additional code accumulated
521# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
522m4_defun([_LT_CONFIG_COMMANDS],
523[AC_PROVIDE_IFELSE([LT_OUTPUT],
524	dnl If the libtool generation code has been placed in $CONFIG_LT,
525	dnl instead of duplicating it all over again into config.status,
526	dnl then we will have config.status run $CONFIG_LT later, so it
527	dnl needs to know what name is stored there:
528        [AC_CONFIG_COMMANDS([libtool],
529            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
530    dnl If the libtool generation code is destined for config.status,
531    dnl expand the accumulated commands and init code now:
532    [AC_CONFIG_COMMANDS([libtool],
533        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
534])#_LT_CONFIG_COMMANDS
535
536
537# Initialize.
538m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
539[
540
541# The HP-UX ksh and POSIX shell print the target directory to stdout
542# if CDPATH is set.
543(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
544
545sed_quote_subst='$sed_quote_subst'
546double_quote_subst='$double_quote_subst'
547delay_variable_subst='$delay_variable_subst'
548_LT_CONFIG_STATUS_DECLARATIONS
549LTCC='$LTCC'
550LTCFLAGS='$LTCFLAGS'
551compiler='$compiler_DEFAULT'
552
553# A function that is used when there is no print builtin or printf.
554func_fallback_echo ()
555{
556  eval 'cat <<_LTECHO_EOF
557\$[]1
558_LTECHO_EOF'
559}
560
561# Quote evaled strings.
562for var in lt_decl_all_varnames([[ \
563]], lt_decl_quote_varnames); do
564    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
565    *[[\\\\\\\`\\"\\\$]]*)
566      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
567      ;;
568    *)
569      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
570      ;;
571    esac
572done
573
574# Double-quote double-evaled strings.
575for var in lt_decl_all_varnames([[ \
576]], lt_decl_dquote_varnames); do
577    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
578    *[[\\\\\\\`\\"\\\$]]*)
579      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
580      ;;
581    *)
582      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
583      ;;
584    esac
585done
586
587_LT_OUTPUT_LIBTOOL_INIT
588])
589
590# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
591# ------------------------------------
592# Generate a child script FILE with all initialization necessary to
593# reuse the environment learned by the parent script, and make the
594# file executable.  If COMMENT is supplied, it is inserted after the
595# `#!' sequence but before initialization text begins.  After this
596# macro, additional text can be appended to FILE to form the body of
597# the child script.  The macro ends with non-zero status if the
598# file could not be fully written (such as if the disk is full).
599m4_ifdef([AS_INIT_GENERATED],
600[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
601[m4_defun([_LT_GENERATED_FILE_INIT],
602[m4_require([AS_PREPARE])]dnl
603[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
604[lt_write_fail=0
605cat >$1 <<_ASEOF || lt_write_fail=1
606#! $SHELL
607# Generated by $as_me.
608$2
609SHELL=\${CONFIG_SHELL-$SHELL}
610export SHELL
611_ASEOF
612cat >>$1 <<\_ASEOF || lt_write_fail=1
613AS_SHELL_SANITIZE
614_AS_PREPARE
615exec AS_MESSAGE_FD>&1
616_ASEOF
617test $lt_write_fail = 0 && chmod +x $1[]dnl
618m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
619
620# LT_OUTPUT
621# ---------
622# This macro allows early generation of the libtool script (before
623# AC_OUTPUT is called), incase it is used in configure for compilation
624# tests.
625AC_DEFUN([LT_OUTPUT],
626[: ${CONFIG_LT=./config.lt}
627AC_MSG_NOTICE([creating $CONFIG_LT])
628_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
629[# Run this file to recreate a libtool stub with the current configuration.])
630
631cat >>"$CONFIG_LT" <<\_LTEOF
632lt_cl_silent=false
633exec AS_MESSAGE_LOG_FD>>config.log
634{
635  echo
636  AS_BOX([Running $as_me.])
637} >&AS_MESSAGE_LOG_FD
638
639lt_cl_help="\
640\`$as_me' creates a local libtool stub from the current configuration,
641for use in further configure time tests before the real libtool is
642generated.
643
644Usage: $[0] [[OPTIONS]]
645
646  -h, --help      print this help, then exit
647  -V, --version   print version number, then exit
648  -q, --quiet     do not print progress messages
649  -d, --debug     don't remove temporary files
650
651Report bugs to <bug-libtool@gnu.org>."
652
653lt_cl_version="\
654m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
655m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
656configured by $[0], generated by m4_PACKAGE_STRING.
657
658Copyright (C) 2011 Free Software Foundation, Inc.
659This config.lt script is free software; the Free Software Foundation
660gives unlimited permision to copy, distribute and modify it."
661
662while test $[#] != 0
663do
664  case $[1] in
665    --version | --v* | -V )
666      echo "$lt_cl_version"; exit 0 ;;
667    --help | --h* | -h )
668      echo "$lt_cl_help"; exit 0 ;;
669    --debug | --d* | -d )
670      debug=: ;;
671    --quiet | --q* | --silent | --s* | -q )
672      lt_cl_silent=: ;;
673
674    -*) AC_MSG_ERROR([unrecognized option: $[1]
675Try \`$[0] --help' for more information.]) ;;
676
677    *) AC_MSG_ERROR([unrecognized argument: $[1]
678Try \`$[0] --help' for more information.]) ;;
679  esac
680  shift
681done
682
683if $lt_cl_silent; then
684  exec AS_MESSAGE_FD>/dev/null
685fi
686_LTEOF
687
688cat >>"$CONFIG_LT" <<_LTEOF
689_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
690_LTEOF
691
692cat >>"$CONFIG_LT" <<\_LTEOF
693AC_MSG_NOTICE([creating $ofile])
694_LT_OUTPUT_LIBTOOL_COMMANDS
695AS_EXIT(0)
696_LTEOF
697chmod +x "$CONFIG_LT"
698
699# configure is writing to config.log, but config.lt does its own redirection,
700# appending to config.log, which fails on DOS, as config.log is still kept
701# open by configure.  Here we exec the FD to /dev/null, effectively closing
702# config.log, so it can be properly (re)opened and appended to by config.lt.
703lt_cl_success=:
704test "$silent" = yes &&
705  lt_config_lt_args="$lt_config_lt_args --quiet"
706exec AS_MESSAGE_LOG_FD>/dev/null
707$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
708exec AS_MESSAGE_LOG_FD>>config.log
709$lt_cl_success || AS_EXIT(1)
710])# LT_OUTPUT
711
712
713# _LT_CONFIG(TAG)
714# ---------------
715# If TAG is the built-in tag, create an initial libtool script with a
716# default configuration from the untagged config vars.  Otherwise add code
717# to config.status for appending the configuration named by TAG from the
718# matching tagged config vars.
719m4_defun([_LT_CONFIG],
720[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
721_LT_CONFIG_SAVE_COMMANDS([
722  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
723  m4_if(_LT_TAG, [C], [
724    # See if we are running on zsh, and set the options which allow our
725    # commands through without removal of \ escapes.
726    if test -n "${ZSH_VERSION+set}" ; then
727      setopt NO_GLOB_SUBST
728    fi
729
730    cfgfile="${ofile}T"
731    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
732    $RM "$cfgfile"
733
734    cat <<_LT_EOF >> "$cfgfile"
735#! $SHELL
736
737# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
738# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
739# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
740# NOTE: Changes made to this file will be lost: look at ltmain.sh.
741#
742_LT_COPYING
743_LT_LIBTOOL_TAGS
744
745# ### BEGIN LIBTOOL CONFIG
746_LT_LIBTOOL_CONFIG_VARS
747_LT_LIBTOOL_TAG_VARS
748# ### END LIBTOOL CONFIG
749
750_LT_EOF
751
752  case $host_os in
753  aix3*)
754    cat <<\_LT_EOF >> "$cfgfile"
755# AIX sometimes has problems with the GCC collect2 program.  For some
756# reason, if we set the COLLECT_NAMES environment variable, the problems
757# vanish in a puff of smoke.
758if test "X${COLLECT_NAMES+set}" != Xset; then
759  COLLECT_NAMES=
760  export COLLECT_NAMES
761fi
762_LT_EOF
763    ;;
764  esac
765
766  _LT_PROG_LTMAIN
767
768  # We use sed instead of cat because bash on DJGPP gets confused if
769  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
770  # text mode, it properly converts lines to CR/LF.  This bash problem
771  # is reportedly fixed, but why not run on old versions too?
772  sed '$q' "$ltmain" >> "$cfgfile" \
773     || (rm -f "$cfgfile"; exit 1)
774
775  _LT_PROG_REPLACE_SHELLFNS
776
777   mv -f "$cfgfile" "$ofile" ||
778    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
779  chmod +x "$ofile"
780],
781[cat <<_LT_EOF >> "$ofile"
782
783dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
784dnl in a comment (ie after a #).
785# ### BEGIN LIBTOOL TAG CONFIG: $1
786_LT_LIBTOOL_TAG_VARS(_LT_TAG)
787# ### END LIBTOOL TAG CONFIG: $1
788_LT_EOF
789])dnl /m4_if
790],
791[m4_if([$1], [], [
792    PACKAGE='$PACKAGE'
793    VERSION='$VERSION'
794    TIMESTAMP='$TIMESTAMP'
795    RM='$RM'
796    ofile='$ofile'], [])
797])dnl /_LT_CONFIG_SAVE_COMMANDS
798])# _LT_CONFIG
799
800
801# LT_SUPPORTED_TAG(TAG)
802# ---------------------
803# Trace this macro to discover what tags are supported by the libtool
804# --tag option, using:
805#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
806AC_DEFUN([LT_SUPPORTED_TAG], [])
807
808
809# C support is built-in for now
810m4_define([_LT_LANG_C_enabled], [])
811m4_define([_LT_TAGS], [])
812
813
814# LT_LANG(LANG)
815# -------------
816# Enable libtool support for the given language if not already enabled.
817AC_DEFUN([LT_LANG],
818[AC_BEFORE([$0], [LT_OUTPUT])dnl
819m4_case([$1],
820  [C],			[_LT_LANG(C)],
821  [C++],		[_LT_LANG(CXX)],
822  [Go],			[_LT_LANG(GO)],
823  [Java],		[_LT_LANG(GCJ)],
824  [Fortran 77],		[_LT_LANG(F77)],
825  [Fortran],		[_LT_LANG(FC)],
826  [Windows Resource],	[_LT_LANG(RC)],
827  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
828    [_LT_LANG($1)],
829    [m4_fatal([$0: unsupported language: "$1"])])])dnl
830])# LT_LANG
831
832
833# _LT_LANG(LANGNAME)
834# ------------------
835m4_defun([_LT_LANG],
836[m4_ifdef([_LT_LANG_]$1[_enabled], [],
837  [LT_SUPPORTED_TAG([$1])dnl
838  m4_append([_LT_TAGS], [$1 ])dnl
839  m4_define([_LT_LANG_]$1[_enabled], [])dnl
840  _LT_LANG_$1_CONFIG($1)])dnl
841])# _LT_LANG
842
843
844m4_ifndef([AC_PROG_GO], [
845# NOTE: This macro has been submitted for inclusion into   #
846#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
847#  a released version of Autoconf we should remove this    #
848#  macro and use it instead.                               #
849m4_defun([AC_PROG_GO],
850[AC_LANG_PUSH(Go)dnl
851AC_ARG_VAR([GOC],     [Go compiler command])dnl
852AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
853_AC_ARG_VAR_LDFLAGS()dnl
854AC_CHECK_TOOL(GOC, gccgo)
855if test -z "$GOC"; then
856  if test -n "$ac_tool_prefix"; then
857    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
858  fi
859fi
860if test -z "$GOC"; then
861  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
862fi
863])#m4_defun
864])#m4_ifndef
865
866
867# _LT_LANG_DEFAULT_CONFIG
868# -----------------------
869m4_defun([_LT_LANG_DEFAULT_CONFIG],
870[AC_PROVIDE_IFELSE([AC_PROG_CXX],
871  [LT_LANG(CXX)],
872  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
873
874AC_PROVIDE_IFELSE([AC_PROG_F77],
875  [LT_LANG(F77)],
876  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
877
878AC_PROVIDE_IFELSE([AC_PROG_FC],
879  [LT_LANG(FC)],
880  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
881
882dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
883dnl pulling things in needlessly.
884AC_PROVIDE_IFELSE([AC_PROG_GCJ],
885  [LT_LANG(GCJ)],
886  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
887    [LT_LANG(GCJ)],
888    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
889      [LT_LANG(GCJ)],
890      [m4_ifdef([AC_PROG_GCJ],
891	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
892       m4_ifdef([A][M_PROG_GCJ],
893	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
894       m4_ifdef([LT_PROG_GCJ],
895	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
896
897AC_PROVIDE_IFELSE([AC_PROG_GO],
898  [LT_LANG(GO)],
899  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
900
901AC_PROVIDE_IFELSE([LT_PROG_RC],
902  [LT_LANG(RC)],
903  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
904])# _LT_LANG_DEFAULT_CONFIG
905
906# Obsolete macros:
907AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
908AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
909AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
910AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
911AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
912dnl aclocal-1.4 backwards compatibility:
913dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
914dnl AC_DEFUN([AC_LIBTOOL_F77], [])
915dnl AC_DEFUN([AC_LIBTOOL_FC], [])
916dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
917dnl AC_DEFUN([AC_LIBTOOL_RC], [])
918
919
920# _LT_TAG_COMPILER
921# ----------------
922m4_defun([_LT_TAG_COMPILER],
923[AC_REQUIRE([AC_PROG_CC])dnl
924
925_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
926_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
927_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
928_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
929
930# If no C compiler was specified, use CC.
931LTCC=${LTCC-"$CC"}
932
933# If no C compiler flags were specified, use CFLAGS.
934LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
935
936# Allow CC to be a program name with arguments.
937compiler=$CC
938])# _LT_TAG_COMPILER
939
940
941# _LT_COMPILER_BOILERPLATE
942# ------------------------
943# Check for compiler boilerplate output or warnings with
944# the simple compiler test code.
945m4_defun([_LT_COMPILER_BOILERPLATE],
946[m4_require([_LT_DECL_SED])dnl
947ac_outfile=conftest.$ac_objext
948echo "$lt_simple_compile_test_code" >conftest.$ac_ext
949eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
950_lt_compiler_boilerplate=`cat conftest.err`
951$RM conftest*
952])# _LT_COMPILER_BOILERPLATE
953
954
955# _LT_LINKER_BOILERPLATE
956# ----------------------
957# Check for linker boilerplate output or warnings with
958# the simple link test code.
959m4_defun([_LT_LINKER_BOILERPLATE],
960[m4_require([_LT_DECL_SED])dnl
961ac_outfile=conftest.$ac_objext
962echo "$lt_simple_link_test_code" >conftest.$ac_ext
963eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
964_lt_linker_boilerplate=`cat conftest.err`
965$RM -r conftest*
966])# _LT_LINKER_BOILERPLATE
967
968# _LT_REQUIRED_DARWIN_CHECKS
969# -------------------------
970m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
971  case $host_os in
972    rhapsody* | darwin*)
973    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
974    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
975    AC_CHECK_TOOL([LIPO], [lipo], [:])
976    AC_CHECK_TOOL([OTOOL], [otool], [:])
977    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
978    _LT_DECL([], [DSYMUTIL], [1],
979      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
980    _LT_DECL([], [NMEDIT], [1],
981      [Tool to change global to local symbols on Mac OS X])
982    _LT_DECL([], [LIPO], [1],
983      [Tool to manipulate fat objects and archives on Mac OS X])
984    _LT_DECL([], [OTOOL], [1],
985      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
986    _LT_DECL([], [OTOOL64], [1],
987      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
988
989    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
990      [lt_cv_apple_cc_single_mod=no
991      if test -z "${LT_MULTI_MODULE}"; then
992	# By default we will add the -single_module flag. You can override
993	# by either setting the environment variable LT_MULTI_MODULE
994	# non-empty at configure time, or by adding -multi_module to the
995	# link flags.
996	rm -rf libconftest.dylib*
997	echo "int foo(void){return 1;}" > conftest.c
998	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
999-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
1000	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1001	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
1002        _lt_result=$?
1003	# If there is a non-empty error log, and "single_module"
1004	# appears in it, assume the flag caused a linker warning
1005        if test -s conftest.err && $GREP single_module conftest.err; then
1006	  cat conftest.err >&AS_MESSAGE_LOG_FD
1007	# Otherwise, if the output was created with a 0 exit code from
1008	# the compiler, it worked.
1009	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
1010	  lt_cv_apple_cc_single_mod=yes
1011	else
1012	  cat conftest.err >&AS_MESSAGE_LOG_FD
1013	fi
1014	rm -rf libconftest.dylib*
1015	rm -f conftest.*
1016      fi])
1017
1018    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
1019      [lt_cv_ld_exported_symbols_list],
1020      [lt_cv_ld_exported_symbols_list=no
1021      save_LDFLAGS=$LDFLAGS
1022      echo "_main" > conftest.sym
1023      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
1024      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
1025	[lt_cv_ld_exported_symbols_list=yes],
1026	[lt_cv_ld_exported_symbols_list=no])
1027	LDFLAGS="$save_LDFLAGS"
1028    ])
1029
1030    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
1031      [lt_cv_ld_force_load=no
1032      cat > conftest.c << _LT_EOF
1033int forced_loaded() { return 2;}
1034_LT_EOF
1035      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
1036      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
1037      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
1038      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
1039      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
1040      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
1041      cat > conftest.c << _LT_EOF
1042int main() { return 0;}
1043_LT_EOF
1044      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
1045      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
1046      _lt_result=$?
1047      if test -s conftest.err && $GREP force_load conftest.err; then
1048	cat conftest.err >&AS_MESSAGE_LOG_FD
1049      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
1050	lt_cv_ld_force_load=yes
1051      else
1052	cat conftest.err >&AS_MESSAGE_LOG_FD
1053      fi
1054        rm -f conftest.err libconftest.a conftest conftest.c
1055        rm -rf conftest.dSYM
1056    ])
1057    case $host_os in
1058    rhapsody* | darwin1.[[012]])
1059      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
1060    darwin1.*)
1061      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
1062    darwin*) # darwin 5.x on
1063      # if running on 10.5 or later, the deployment target defaults
1064      # to the OS version, if on x86, and 10.4, the deployment
1065      # target defaults to 10.4. Don't you love it?
1066      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
1067	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
1068	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
1069	10.[[012]]*)
1070	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
1071	10.*)
1072	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
1073      esac
1074    ;;
1075  esac
1076    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
1077      _lt_dar_single_mod='$single_module'
1078    fi
1079    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
1080      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
1081    else
1082      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
1083    fi
1084    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
1085      _lt_dsymutil='~$DSYMUTIL $lib || :'
1086    else
1087      _lt_dsymutil=
1088    fi
1089    ;;
1090  esac
1091])
1092
1093
1094# _LT_DARWIN_LINKER_FEATURES([TAG])
1095# ---------------------------------
1096# Checks for linker and compiler features on darwin
1097m4_defun([_LT_DARWIN_LINKER_FEATURES],
1098[
1099  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1100  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1101  _LT_TAGVAR(hardcode_direct, $1)=no
1102  _LT_TAGVAR(hardcode_automatic, $1)=yes
1103  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1104  if test "$lt_cv_ld_force_load" = "yes"; then
1105    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
1106    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
1107                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
1108  else
1109    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1110  fi
1111  _LT_TAGVAR(link_all_deplibs, $1)=yes
1112  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
1113  case $cc_basename in
1114     ifort*) _lt_dar_can_shared=yes ;;
1115     *) _lt_dar_can_shared=$GCC ;;
1116  esac
1117  if test "$_lt_dar_can_shared" = "yes"; then
1118    output_verbose_link_cmd=func_echo_all
1119    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
1120    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
1121    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
1122    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
1123    m4_if([$1], [CXX],
1124[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
1125      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
1126      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
1127    fi
1128],[])
1129  else
1130  _LT_TAGVAR(ld_shlibs, $1)=no
1131  fi
1132])
1133
1134# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
1135# ----------------------------------
1136# Links a minimal program and checks the executable
1137# for the system default hardcoded library path. In most cases,
1138# this is /usr/lib:/lib, but when the MPI compilers are used
1139# the location of the communication and MPI libs are included too.
1140# If we don't find anything, use the default library path according
1141# to the aix ld manual.
1142# Store the results from the different compilers for each TAGNAME.
1143# Allow to override them for all tags through lt_cv_aix_libpath.
1144m4_defun([_LT_SYS_MODULE_PATH_AIX],
1145[m4_require([_LT_DECL_SED])dnl
1146if test "${lt_cv_aix_libpath+set}" = set; then
1147  aix_libpath=$lt_cv_aix_libpath
1148else
1149  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
1150  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
1151  lt_aix_libpath_sed='[
1152      /Import File Strings/,/^$/ {
1153	  /^0/ {
1154	      s/^0  *\([^ ]*\) *$/\1/
1155	      p
1156	  }
1157      }]'
1158  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1159  # Check for a 64-bit object if we didn't find anything.
1160  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1161    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1162  fi],[])
1163  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1164    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
1165  fi
1166  ])
1167  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
1168fi
1169])# _LT_SYS_MODULE_PATH_AIX
1170
1171
1172# _LT_SHELL_INIT(ARG)
1173# -------------------
1174m4_define([_LT_SHELL_INIT],
1175[m4_divert_text([M4SH-INIT], [$1
1176])])# _LT_SHELL_INIT
1177
1178
1179
1180# _LT_PROG_ECHO_BACKSLASH
1181# -----------------------
1182# Find how we can fake an echo command that does not interpret backslash.
1183# In particular, with Autoconf 2.60 or later we add some code to the start
1184# of the generated configure script which will find a shell with a builtin
1185# printf (which we can use as an echo command).
1186m4_defun([_LT_PROG_ECHO_BACKSLASH],
1187[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1188ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1189ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1190
1191AC_MSG_CHECKING([how to print strings])
1192# Test print first, because it will be a builtin if present.
1193if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
1194   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
1195  ECHO='print -r --'
1196elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
1197  ECHO='printf %s\n'
1198else
1199  # Use this function as a fallback that always works.
1200  func_fallback_echo ()
1201  {
1202    eval 'cat <<_LTECHO_EOF
1203$[]1
1204_LTECHO_EOF'
1205  }
1206  ECHO='func_fallback_echo'
1207fi
1208
1209# func_echo_all arg...
1210# Invoke $ECHO with all args, space-separated.
1211func_echo_all ()
1212{
1213    $ECHO "$*" 
1214}
1215
1216case "$ECHO" in
1217  printf*) AC_MSG_RESULT([printf]) ;;
1218  print*) AC_MSG_RESULT([print -r]) ;;
1219  *) AC_MSG_RESULT([cat]) ;;
1220esac
1221
1222m4_ifdef([_AS_DETECT_SUGGESTED],
1223[_AS_DETECT_SUGGESTED([
1224  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
1225    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1226    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1227    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1228    PATH=/empty FPATH=/empty; export PATH FPATH
1229    test "X`printf %s $ECHO`" = "X$ECHO" \
1230      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1231
1232_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1233_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
1234])# _LT_PROG_ECHO_BACKSLASH
1235
1236
1237# _LT_WITH_SYSROOT
1238# ----------------
1239AC_DEFUN([_LT_WITH_SYSROOT],
1240[AC_MSG_CHECKING([for sysroot])
1241AC_ARG_WITH([sysroot],
1242[  --with-sysroot[=DIR] Search for dependent libraries within DIR
1243                        (or the compiler's sysroot if not specified).],
1244[], [with_sysroot=no])
1245
1246dnl lt_sysroot will always be passed unquoted.  We quote it here
1247dnl in case the user passed a directory name.
1248lt_sysroot=
1249case ${with_sysroot} in #(
1250 yes)
1251   if test "$GCC" = yes; then
1252     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
1253   fi
1254   ;; #(
1255 /*)
1256   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
1257   ;; #(
1258 no|'')
1259   ;; #(
1260 *)
1261   AC_MSG_RESULT([${with_sysroot}])
1262   AC_MSG_ERROR([The sysroot must be an absolute path.])
1263   ;;
1264esac
1265
1266 AC_MSG_RESULT([${lt_sysroot:-no}])
1267_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
1268[dependent libraries, and in which our libraries should be installed.])])
1269
1270# _LT_ENABLE_LOCK
1271# ---------------
1272m4_defun([_LT_ENABLE_LOCK],
1273[AC_ARG_ENABLE([libtool-lock],
1274  [AS_HELP_STRING([--disable-libtool-lock],
1275    [avoid locking (might break parallel builds)])])
1276test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1277
1278# Some flags need to be propagated to the compiler or linker for good
1279# libtool support.
1280case $host in
1281ia64-*-hpux*)
1282  # Find out which ABI we are using.
1283  echo 'int i;' > conftest.$ac_ext
1284  if AC_TRY_EVAL(ac_compile); then
1285    case `/usr/bin/file conftest.$ac_objext` in
1286      *ELF-32*)
1287	HPUX_IA64_MODE="32"
1288	;;
1289      *ELF-64*)
1290	HPUX_IA64_MODE="64"
1291	;;
1292    esac
1293  fi
1294  rm -rf conftest*
1295  ;;
1296*-*-irix6*)
1297  # Find out which ABI we are using.
1298  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1299  if AC_TRY_EVAL(ac_compile); then
1300    if test "$lt_cv_prog_gnu_ld" = yes; then
1301      case `/usr/bin/file conftest.$ac_objext` in
1302	*32-bit*)
1303	  LD="${LD-ld} -melf32bsmip"
1304	  ;;
1305	*N32*)
1306	  LD="${LD-ld} -melf32bmipn32"
1307	  ;;
1308	*64-bit*)
1309	  LD="${LD-ld} -melf64bmip"
1310	;;
1311      esac
1312    else
1313      case `/usr/bin/file conftest.$ac_objext` in
1314	*32-bit*)
1315	  LD="${LD-ld} -32"
1316	  ;;
1317	*N32*)
1318	  LD="${LD-ld} -n32"
1319	  ;;
1320	*64-bit*)
1321	  LD="${LD-ld} -64"
1322	  ;;
1323      esac
1324    fi
1325  fi
1326  rm -rf conftest*
1327  ;;
1328
1329x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
1330s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1331  # Find out which ABI we are using.
1332  echo 'int i;' > conftest.$ac_ext
1333  if AC_TRY_EVAL(ac_compile); then
1334    case `/usr/bin/file conftest.o` in
1335      *32-bit*)
1336	case $host in
1337	  x86_64-*kfreebsd*-gnu)
1338	    LD="${LD-ld} -m elf_i386_fbsd"
1339	    ;;
1340	  x86_64-*linux*)
1341	    LD="${LD-ld} -m elf_i386"
1342	    ;;
1343	  ppc64-*linux*|powerpc64-*linux*)
1344	    LD="${LD-ld} -m elf32ppclinux"
1345	    ;;
1346	  s390x-*linux*)
1347	    LD="${LD-ld} -m elf_s390"
1348	    ;;
1349	  sparc64-*linux*)
1350	    LD="${LD-ld} -m elf32_sparc"
1351	    ;;
1352	esac
1353	;;
1354      *64-bit*)
1355	case $host in
1356	  x86_64-*kfreebsd*-gnu)
1357	    LD="${LD-ld} -m elf_x86_64_fbsd"
1358	    ;;
1359	  x86_64-*linux*)
1360	    LD="${LD-ld} -m elf_x86_64"
1361	    ;;
1362	  ppc*-*linux*|powerpc*-*linux*)
1363	    LD="${LD-ld} -m elf64ppc"
1364	    ;;
1365	  s390*-*linux*|s390*-*tpf*)
1366	    LD="${LD-ld} -m elf64_s390"
1367	    ;;
1368	  sparc*-*linux*)
1369	    LD="${LD-ld} -m elf64_sparc"
1370	    ;;
1371	esac
1372	;;
1373    esac
1374  fi
1375  rm -rf conftest*
1376  ;;
1377
1378*-*-sco3.2v5*)
1379  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1380  SAVE_CFLAGS="$CFLAGS"
1381  CFLAGS="$CFLAGS -belf"
1382  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1383    [AC_LANG_PUSH(C)
1384     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1385     AC_LANG_POP])
1386  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1387    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1388    CFLAGS="$SAVE_CFLAGS"
1389  fi
1390  ;;
1391*-*solaris*)
1392  # Find out which ABI we are using.
1393  echo 'int i;' > conftest.$ac_ext
1394  if AC_TRY_EVAL(ac_compile); then
1395    case `/usr/bin/file conftest.o` in
1396    *64-bit*)
1397      case $lt_cv_prog_gnu_ld in
1398      yes*)
1399        case $host in
1400        i?86-*-solaris*)
1401          LD="${LD-ld} -m elf_x86_64"
1402          ;;
1403        sparc*-*-solaris*)
1404          LD="${LD-ld} -m elf64_sparc"
1405          ;;
1406        esac
1407        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
1408        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
1409          LD="${LD-ld}_sol2"
1410        fi
1411        ;;
1412      *)
1413	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1414	  LD="${LD-ld} -64"
1415	fi
1416	;;
1417      esac
1418      ;;
1419    esac
1420  fi
1421  rm -rf conftest*
1422  ;;
1423esac
1424
1425need_locks="$enable_libtool_lock"
1426])# _LT_ENABLE_LOCK
1427
1428
1429# _LT_PROG_AR
1430# -----------
1431m4_defun([_LT_PROG_AR],
1432[AC_CHECK_TOOLS(AR, [ar], false)
1433: ${AR=ar}
1434: ${AR_FLAGS=cru}
1435_LT_DECL([], [AR], [1], [The archiver])
1436_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
1437
1438AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
1439  [lt_cv_ar_at_file=no
1440   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
1441     [echo conftest.$ac_objext > conftest.lst
1442      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
1443      AC_TRY_EVAL([lt_ar_try])
1444      if test "$ac_status" -eq 0; then
1445	# Ensure the archiver fails upon bogus file names.
1446	rm -f conftest.$ac_objext libconftest.a
1447	AC_TRY_EVAL([lt_ar_try])
1448	if test "$ac_status" -ne 0; then
1449          lt_cv_ar_at_file=@
1450        fi
1451      fi
1452      rm -f conftest.* libconftest.a
1453     ])
1454  ])
1455
1456if test "x$lt_cv_ar_at_file" = xno; then
1457  archiver_list_spec=
1458else
1459  archiver_list_spec=$lt_cv_ar_at_file
1460fi
1461_LT_DECL([], [archiver_list_spec], [1],
1462  [How to feed a file listing to the archiver])
1463])# _LT_PROG_AR
1464
1465
1466# _LT_CMD_OLD_ARCHIVE
1467# -------------------
1468m4_defun([_LT_CMD_OLD_ARCHIVE],
1469[_LT_PROG_AR
1470
1471AC_CHECK_TOOL(STRIP, strip, :)
1472test -z "$STRIP" && STRIP=:
1473_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1474
1475AC_CHECK_TOOL(RANLIB, ranlib, :)
1476test -z "$RANLIB" && RANLIB=:
1477_LT_DECL([], [RANLIB], [1],
1478    [Commands used to install an old-style archive])
1479
1480# Determine commands to create old-style static archives.
1481old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1482old_postinstall_cmds='chmod 644 $oldlib'
1483old_postuninstall_cmds=
1484
1485if test -n "$RANLIB"; then
1486  case $host_os in
1487  openbsd*)
1488    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
1489    ;;
1490  *)
1491    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
1492    ;;
1493  esac
1494  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
1495fi
1496
1497case $host_os in
1498  darwin*)
1499    lock_old_archive_extraction=yes ;;
1500  *)
1501    lock_old_archive_extraction=no ;;
1502esac
1503_LT_DECL([], [old_postinstall_cmds], [2])
1504_LT_DECL([], [old_postuninstall_cmds], [2])
1505_LT_TAGDECL([], [old_archive_cmds], [2],
1506    [Commands used to build an old-style archive])
1507_LT_DECL([], [lock_old_archive_extraction], [0],
1508    [Whether to use a lock for old archive extraction])
1509])# _LT_CMD_OLD_ARCHIVE
1510
1511
1512# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1513#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1514# ----------------------------------------------------------------
1515# Check whether the given compiler option works
1516AC_DEFUN([_LT_COMPILER_OPTION],
1517[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1518m4_require([_LT_DECL_SED])dnl
1519AC_CACHE_CHECK([$1], [$2],
1520  [$2=no
1521   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1522   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1523   lt_compiler_flag="$3"
1524   # Insert the option either (1) after the last *FLAGS variable, or
1525   # (2) before a word containing "conftest.", or (3) at the end.
1526   # Note that $ac_compile itself does not contain backslashes and begins
1527   # with a dollar sign (not a hyphen), so the echo should work correctly.
1528   # The option is referenced via a variable to avoid confusing sed.
1529   lt_compile=`echo "$ac_compile" | $SED \
1530   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1531   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1532   -e 's:$: $lt_compiler_flag:'`
1533   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1534   (eval "$lt_compile" 2>conftest.err)
1535   ac_status=$?
1536   cat conftest.err >&AS_MESSAGE_LOG_FD
1537   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1538   if (exit $ac_status) && test -s "$ac_outfile"; then
1539     # The compiler can only warn and ignore the option if not recognized
1540     # So say no if there are warnings other than the usual output.
1541     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
1542     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1543     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1544       $2=yes
1545     fi
1546   fi
1547   $RM conftest*
1548])
1549
1550if test x"[$]$2" = xyes; then
1551    m4_if([$5], , :, [$5])
1552else
1553    m4_if([$6], , :, [$6])
1554fi
1555])# _LT_COMPILER_OPTION
1556
1557# Old name:
1558AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1559dnl aclocal-1.4 backwards compatibility:
1560dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1561
1562
1563# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1564#                  [ACTION-SUCCESS], [ACTION-FAILURE])
1565# ----------------------------------------------------
1566# Check whether the given linker option works
1567AC_DEFUN([_LT_LINKER_OPTION],
1568[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1569m4_require([_LT_DECL_SED])dnl
1570AC_CACHE_CHECK([$1], [$2],
1571  [$2=no
1572   save_LDFLAGS="$LDFLAGS"
1573   LDFLAGS="$LDFLAGS $3"
1574   echo "$lt_simple_link_test_code" > conftest.$ac_ext
1575   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1576     # The linker can only warn and ignore the option if not recognized
1577     # So say no if there are warnings
1578     if test -s conftest.err; then
1579       # Append any errors to the config.log.
1580       cat conftest.err 1>&AS_MESSAGE_LOG_FD
1581       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
1582       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1583       if diff conftest.exp conftest.er2 >/dev/null; then
1584         $2=yes
1585       fi
1586     else
1587       $2=yes
1588     fi
1589   fi
1590   $RM -r conftest*
1591   LDFLAGS="$save_LDFLAGS"
1592])
1593
1594if test x"[$]$2" = xyes; then
1595    m4_if([$4], , :, [$4])
1596else
1597    m4_if([$5], , :, [$5])
1598fi
1599])# _LT_LINKER_OPTION
1600
1601# Old name:
1602AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1603dnl aclocal-1.4 backwards compatibility:
1604dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1605
1606
1607# LT_CMD_MAX_LEN
1608#---------------
1609AC_DEFUN([LT_CMD_MAX_LEN],
1610[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1611# find the maximum length of command line arguments
1612AC_MSG_CHECKING([the maximum length of command line arguments])
1613AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1614  i=0
1615  teststring="ABCD"
1616
1617  case $build_os in
1618  msdosdjgpp*)
1619    # On DJGPP, this test can blow up pretty badly due to problems in libc
1620    # (any single argument exceeding 2000 bytes causes a buffer overrun
1621    # during glob expansion).  Even if it were fixed, the result of this
1622    # check would be larger than it should be.
1623    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1624    ;;
1625
1626  gnu*)
1627    # Under GNU Hurd, this test is not required because there is
1628    # no limit to the length of command line arguments.
1629    # Libtool will interpret -1 as no limit whatsoever
1630    lt_cv_sys_max_cmd_len=-1;
1631    ;;
1632
1633  cygwin* | mingw* | cegcc*)
1634    # On Win9x/ME, this test blows up -- it succeeds, but takes
1635    # about 5 minutes as the teststring grows exponentially.
1636    # Worse, since 9x/ME are not pre-emptively multitasking,
1637    # you end up with a "frozen" computer, even though with patience
1638    # the test eventually succeeds (with a max line length of 256k).
1639    # Instead, let's just punt: use the minimum linelength reported by
1640    # all of the supported platforms: 8192 (on NT/2K/XP).
1641    lt_cv_sys_max_cmd_len=8192;
1642    ;;
1643
1644  mint*)
1645    # On MiNT this can take a long time and run out of memory.
1646    lt_cv_sys_max_cmd_len=8192;
1647    ;;
1648
1649  amigaos*)
1650    # On AmigaOS with pdksh, this test takes hours, literally.
1651    # So we just punt and use a minimum line length of 8192.
1652    lt_cv_sys_max_cmd_len=8192;
1653    ;;
1654
1655  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
1656    # This has been around since 386BSD, at least.  Likely further.
1657    if test -x /sbin/sysctl; then
1658      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1659    elif test -x /usr/sbin/sysctl; then
1660      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1661    else
1662      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
1663    fi
1664    # And add a safety zone
1665    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1666    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1667    ;;
1668
1669  interix*)
1670    # We know the value 262144 and hardcode it with a safety zone (like BSD)
1671    lt_cv_sys_max_cmd_len=196608
1672    ;;
1673
1674  os2*)
1675    # The test takes a long time on OS/2.
1676    lt_cv_sys_max_cmd_len=8192
1677    ;;
1678
1679  osf*)
1680    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1681    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1682    # nice to cause kernel panics so lets avoid the loop below.
1683    # First set a reasonable default.
1684    lt_cv_sys_max_cmd_len=16384
1685    #
1686    if test -x /sbin/sysconfig; then
1687      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1688        *1*) lt_cv_sys_max_cmd_len=-1 ;;
1689      esac
1690    fi
1691    ;;
1692  sco3.2v5*)
1693    lt_cv_sys_max_cmd_len=102400
1694    ;;
1695  sysv5* | sco5v6* | sysv4.2uw2*)
1696    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1697    if test -n "$kargmax"; then
1698      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
1699    else
1700      lt_cv_sys_max_cmd_len=32768
1701    fi
1702    ;;
1703  *)
1704    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1705    if test -n "$lt_cv_sys_max_cmd_len"; then
1706      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1707      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1708    else
1709      # Make teststring a little bigger before we do anything with it.
1710      # a 1K string should be a reasonable start.
1711      for i in 1 2 3 4 5 6 7 8 ; do
1712        teststring=$teststring$teststring
1713      done
1714      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1715      # If test is not a shell built-in, we'll probably end up computing a
1716      # maximum length that is only half of the actual maximum length, but
1717      # we can't tell.
1718      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
1719	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
1720	      test $i != 17 # 1/2 MB should be enough
1721      do
1722        i=`expr $i + 1`
1723        teststring=$teststring$teststring
1724      done
1725      # Only check the string length outside the loop.
1726      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1727      teststring=
1728      # Add a significant safety factor because C++ compilers can tack on
1729      # massive amounts of additional arguments before passing them to the
1730      # linker.  It appears as though 1/2 is a usable value.
1731      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1732    fi
1733    ;;
1734  esac
1735])
1736if test -n $lt_cv_sys_max_cmd_len ; then
1737  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1738else
1739  AC_MSG_RESULT(none)
1740fi
1741max_cmd_len=$lt_cv_sys_max_cmd_len
1742_LT_DECL([], [max_cmd_len], [0],
1743    [What is the maximum length of a command?])
1744])# LT_CMD_MAX_LEN
1745
1746# Old name:
1747AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1748dnl aclocal-1.4 backwards compatibility:
1749dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1750
1751
1752# _LT_HEADER_DLFCN
1753# ----------------
1754m4_defun([_LT_HEADER_DLFCN],
1755[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1756])# _LT_HEADER_DLFCN
1757
1758
1759# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1760#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1761# ----------------------------------------------------------------
1762m4_defun([_LT_TRY_DLOPEN_SELF],
1763[m4_require([_LT_HEADER_DLFCN])dnl
1764if test "$cross_compiling" = yes; then :
1765  [$4]
1766else
1767  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1768  lt_status=$lt_dlunknown
1769  cat > conftest.$ac_ext <<_LT_EOF
1770[#line $LINENO "configure"
1771#include "confdefs.h"
1772
1773#if HAVE_DLFCN_H
1774#include <dlfcn.h>
1775#endif
1776
1777#include <stdio.h>
1778
1779#ifdef RTLD_GLOBAL
1780#  define LT_DLGLOBAL		RTLD_GLOBAL
1781#else
1782#  ifdef DL_GLOBAL
1783#    define LT_DLGLOBAL		DL_GLOBAL
1784#  else
1785#    define LT_DLGLOBAL		0
1786#  endif
1787#endif
1788
1789/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1790   find out it does not work in some platform. */
1791#ifndef LT_DLLAZY_OR_NOW
1792#  ifdef RTLD_LAZY
1793#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1794#  else
1795#    ifdef DL_LAZY
1796#      define LT_DLLAZY_OR_NOW		DL_LAZY
1797#    else
1798#      ifdef RTLD_NOW
1799#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1800#      else
1801#        ifdef DL_NOW
1802#          define LT_DLLAZY_OR_NOW	DL_NOW
1803#        else
1804#          define LT_DLLAZY_OR_NOW	0
1805#        endif
1806#      endif
1807#    endif
1808#  endif
1809#endif
1810
1811/* When -fvisbility=hidden is used, assume the code has been annotated
1812   correspondingly for the symbols needed.  */
1813#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1814int fnord () __attribute__((visibility("default")));
1815#endif
1816
1817int fnord () { return 42; }
1818int main ()
1819{
1820  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1821  int status = $lt_dlunknown;
1822
1823  if (self)
1824    {
1825      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1826      else
1827        {
1828	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
1829          else puts (dlerror ());
1830	}
1831      /* dlclose (self); */
1832    }
1833  else
1834    puts (dlerror ());
1835
1836  return status;
1837}]
1838_LT_EOF
1839  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1840    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1841    lt_status=$?
1842    case x$lt_status in
1843      x$lt_dlno_uscore) $1 ;;
1844      x$lt_dlneed_uscore) $2 ;;
1845      x$lt_dlunknown|x*) $3 ;;
1846    esac
1847  else :
1848    # compilation failed
1849    $3
1850  fi
1851fi
1852rm -fr conftest*
1853])# _LT_TRY_DLOPEN_SELF
1854
1855
1856# LT_SYS_DLOPEN_SELF
1857# ------------------
1858AC_DEFUN([LT_SYS_DLOPEN_SELF],
1859[m4_require([_LT_HEADER_DLFCN])dnl
1860if test "x$enable_dlopen" != xyes; then
1861  enable_dlopen=unknown
1862  enable_dlopen_self=unknown
1863  enable_dlopen_self_static=unknown
1864else
1865  lt_cv_dlopen=no
1866  lt_cv_dlopen_libs=
1867
1868  case $host_os in
1869  beos*)
1870    lt_cv_dlopen="load_add_on"
1871    lt_cv_dlopen_libs=
1872    lt_cv_dlopen_self=yes
1873    ;;
1874
1875  mingw* | pw32* | cegcc*)
1876    lt_cv_dlopen="LoadLibrary"
1877    lt_cv_dlopen_libs=
1878    ;;
1879
1880  cygwin*)
1881    lt_cv_dlopen="dlopen"
1882    lt_cv_dlopen_libs=
1883    ;;
1884
1885  darwin*)
1886  # if libdl is installed we need to link against it
1887    AC_CHECK_LIB([dl], [dlopen],
1888		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
1889    lt_cv_dlopen="dyld"
1890    lt_cv_dlopen_libs=
1891    lt_cv_dlopen_self=yes
1892    ])
1893    ;;
1894
1895  *)
1896    AC_CHECK_FUNC([shl_load],
1897	  [lt_cv_dlopen="shl_load"],
1898      [AC_CHECK_LIB([dld], [shl_load],
1899	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
1900	[AC_CHECK_FUNC([dlopen],
1901	      [lt_cv_dlopen="dlopen"],
1902	  [AC_CHECK_LIB([dl], [dlopen],
1903		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1904	    [AC_CHECK_LIB([svld], [dlopen],
1905		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1906	      [AC_CHECK_LIB([dld], [dld_link],
1907		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
1908	      ])
1909	    ])
1910	  ])
1911	])
1912      ])
1913    ;;
1914  esac
1915
1916  if test "x$lt_cv_dlopen" != xno; then
1917    enable_dlopen=yes
1918  else
1919    enable_dlopen=no
1920  fi
1921
1922  case $lt_cv_dlopen in
1923  dlopen)
1924    save_CPPFLAGS="$CPPFLAGS"
1925    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1926
1927    save_LDFLAGS="$LDFLAGS"
1928    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1929
1930    save_LIBS="$LIBS"
1931    LIBS="$lt_cv_dlopen_libs $LIBS"
1932
1933    AC_CACHE_CHECK([whether a program can dlopen itself],
1934	  lt_cv_dlopen_self, [dnl
1935	  _LT_TRY_DLOPEN_SELF(
1936	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1937	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1938    ])
1939
1940    if test "x$lt_cv_dlopen_self" = xyes; then
1941      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1942      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1943	  lt_cv_dlopen_self_static, [dnl
1944	  _LT_TRY_DLOPEN_SELF(
1945	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1946	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
1947      ])
1948    fi
1949
1950    CPPFLAGS="$save_CPPFLAGS"
1951    LDFLAGS="$save_LDFLAGS"
1952    LIBS="$save_LIBS"
1953    ;;
1954  esac
1955
1956  case $lt_cv_dlopen_self in
1957  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1958  *) enable_dlopen_self=unknown ;;
1959  esac
1960
1961  case $lt_cv_dlopen_self_static in
1962  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1963  *) enable_dlopen_self_static=unknown ;;
1964  esac
1965fi
1966_LT_DECL([dlopen_support], [enable_dlopen], [0],
1967	 [Whether dlopen is supported])
1968_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
1969	 [Whether dlopen of programs is supported])
1970_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
1971	 [Whether dlopen of statically linked programs is supported])
1972])# LT_SYS_DLOPEN_SELF
1973
1974# Old name:
1975AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
1976dnl aclocal-1.4 backwards compatibility:
1977dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1978
1979
1980# _LT_COMPILER_C_O([TAGNAME])
1981# ---------------------------
1982# Check to see if options -c and -o are simultaneously supported by compiler.
1983# This macro does not hard code the compiler like AC_PROG_CC_C_O.
1984m4_defun([_LT_COMPILER_C_O],
1985[m4_require([_LT_DECL_SED])dnl
1986m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1987m4_require([_LT_TAG_COMPILER])dnl
1988AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1989  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1990  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1991   $RM -r conftest 2>/dev/null
1992   mkdir conftest
1993   cd conftest
1994   mkdir out
1995   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1996
1997   lt_compiler_flag="-o out/conftest2.$ac_objext"
1998   # Insert the option either (1) after the last *FLAGS variable, or
1999   # (2) before a word containing "conftest.", or (3) at the end.
2000   # Note that $ac_compile itself does not contain backslashes and begins
2001   # with a dollar sign (not a hyphen), so the echo should work correctly.
2002   lt_compile=`echo "$ac_compile" | $SED \
2003   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2004   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2005   -e 's:$: $lt_compiler_flag:'`
2006   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2007   (eval "$lt_compile" 2>out/conftest.err)
2008   ac_status=$?
2009   cat out/conftest.err >&AS_MESSAGE_LOG_FD
2010   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2011   if (exit $ac_status) && test -s out/conftest2.$ac_objext
2012   then
2013     # The compiler can only warn and ignore the option if not recognized
2014     # So say no if there are warnings
2015     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
2016     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
2017     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
2018       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
2019     fi
2020   fi
2021   chmod u+w . 2>&AS_MESSAGE_LOG_FD
2022   $RM conftest*
2023   # SGI C++ compiler will create directory out/ii_files/ for
2024   # template instantiation
2025   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
2026   $RM out/* && rmdir out
2027   cd ..
2028   $RM -r conftest
2029   $RM conftest*
2030])
2031_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
2032	[Does compiler simultaneously support -c and -o options?])
2033])# _LT_COMPILER_C_O
2034
2035
2036# _LT_COMPILER_FILE_LOCKS([TAGNAME])
2037# ----------------------------------
2038# Check to see if we can do hard links to lock some files if needed
2039m4_defun([_LT_COMPILER_FILE_LOCKS],
2040[m4_require([_LT_ENABLE_LOCK])dnl
2041m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2042_LT_COMPILER_C_O([$1])
2043
2044hard_links="nottested"
2045if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
2046  # do not overwrite the value of need_locks provided by the user
2047  AC_MSG_CHECKING([if we can lock with hard links])
2048  hard_links=yes
2049  $RM conftest*
2050  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2051  touch conftest.a
2052  ln conftest.a conftest.b 2>&5 || hard_links=no
2053  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2054  AC_MSG_RESULT([$hard_links])
2055  if test "$hard_links" = no; then
2056    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
2057    need_locks=warn
2058  fi
2059else
2060  need_locks=no
2061fi
2062_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
2063])# _LT_COMPILER_FILE_LOCKS
2064
2065
2066# _LT_CHECK_OBJDIR
2067# ----------------
2068m4_defun([_LT_CHECK_OBJDIR],
2069[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
2070[rm -f .libs 2>/dev/null
2071mkdir .libs 2>/dev/null
2072if test -d .libs; then
2073  lt_cv_objdir=.libs
2074else
2075  # MS-DOS does not allow filenames that begin with a dot.
2076  lt_cv_objdir=_libs
2077fi
2078rmdir .libs 2>/dev/null])
2079objdir=$lt_cv_objdir
2080_LT_DECL([], [objdir], [0],
2081         [The name of the directory that contains temporary libtool files])dnl
2082m4_pattern_allow([LT_OBJDIR])dnl
2083AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
2084  [Define to the sub-directory in which libtool stores uninstalled libraries.])
2085])# _LT_CHECK_OBJDIR
2086
2087
2088# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
2089# --------------------------------------
2090# Check hardcoding attributes.
2091m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
2092[AC_MSG_CHECKING([how to hardcode library paths into programs])
2093_LT_TAGVAR(hardcode_action, $1)=
2094if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
2095   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
2096   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
2097
2098  # We can hardcode non-existent directories.
2099  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
2100     # If the only mechanism to avoid hardcoding is shlibpath_var, we
2101     # have to relink, otherwise we might link with an installed library
2102     # when we should be linking with a yet-to-be-installed one
2103     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
2104     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
2105    # Linking always hardcodes the temporary library directory.
2106    _LT_TAGVAR(hardcode_action, $1)=relink
2107  else
2108    # We can link without hardcoding, and we can hardcode nonexisting dirs.
2109    _LT_TAGVAR(hardcode_action, $1)=immediate
2110  fi
2111else
2112  # We cannot hardcode anything, or else we can only hardcode existing
2113  # directories.
2114  _LT_TAGVAR(hardcode_action, $1)=unsupported
2115fi
2116AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2117
2118if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
2119   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
2120  # Fast installation is not supported
2121  enable_fast_install=no
2122elif test "$shlibpath_overrides_runpath" = yes ||
2123     test "$enable_shared" = no; then
2124  # Fast installation is not necessary
2125  enable_fast_install=needless
2126fi
2127_LT_TAGDECL([], [hardcode_action], [0],
2128    [How to hardcode a shared library path into an executable])
2129])# _LT_LINKER_HARDCODE_LIBPATH
2130
2131
2132# _LT_CMD_STRIPLIB
2133# ----------------
2134m4_defun([_LT_CMD_STRIPLIB],
2135[m4_require([_LT_DECL_EGREP])
2136striplib=
2137old_striplib=
2138AC_MSG_CHECKING([whether stripping libraries is possible])
2139if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2140  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2141  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2142  AC_MSG_RESULT([yes])
2143else
2144# FIXME - insert some real tests, host_os isn't really good enough
2145  case $host_os in
2146  darwin*)
2147    if test -n "$STRIP" ; then
2148      striplib="$STRIP -x"
2149      old_striplib="$STRIP -S"
2150      AC_MSG_RESULT([yes])
2151    else
2152      AC_MSG_RESULT([no])
2153    fi
2154    ;;
2155  *)
2156    AC_MSG_RESULT([no])
2157    ;;
2158  esac
2159fi
2160_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2161_LT_DECL([], [striplib], [1])
2162])# _LT_CMD_STRIPLIB
2163
2164
2165# _LT_SYS_DYNAMIC_LINKER([TAG])
2166# -----------------------------
2167# PORTME Fill in your ld.so characteristics
2168m4_defun([_LT_SYS_DYNAMIC_LINKER],
2169[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2170m4_require([_LT_DECL_EGREP])dnl
2171m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2172m4_require([_LT_DECL_OBJDUMP])dnl
2173m4_require([_LT_DECL_SED])dnl
2174m4_require([_LT_CHECK_SHELL_FEATURES])dnl
2175AC_MSG_CHECKING([dynamic linker characteristics])
2176m4_if([$1],
2177	[], [
2178if test "$GCC" = yes; then
2179  case $host_os in
2180    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
2181    *) lt_awk_arg="/^libraries:/" ;;
2182  esac
2183  case $host_os in
2184    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
2185    *) lt_sed_strip_eq="s,=/,/,g" ;;
2186  esac
2187  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
2188  case $lt_search_path_spec in
2189  *\;*)
2190    # if the path contains ";" then we assume it to be the separator
2191    # otherwise default to the standard path separator (i.e. ":") - it is
2192    # assumed that no part of a normal pathname contains ";" but that should
2193    # okay in the real world where ";" in dirpaths is itself problematic.
2194    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
2195    ;;
2196  *)
2197    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
2198    ;;
2199  esac
2200  # Ok, now we have the path, separated by spaces, we can step through it
2201  # and add multilib dir if necessary.
2202  lt_tmp_lt_search_path_spec=
2203  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2204  for lt_sys_path in $lt_search_path_spec; do
2205    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
2206      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
2207    else
2208      test -d "$lt_sys_path" && \
2209	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2210    fi
2211  done
2212  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2213BEGIN {RS=" "; FS="/|\n";} {
2214  lt_foo="";
2215  lt_count=0;
2216  for (lt_i = NF; lt_i > 0; lt_i--) {
2217    if ($lt_i != "" && $lt_i != ".") {
2218      if ($lt_i == "..") {
2219        lt_count++;
2220      } else {
2221        if (lt_count == 0) {
2222          lt_foo="/" $lt_i lt_foo;
2223        } else {
2224          lt_count--;
2225        }
2226      }
2227    }
2228  }
2229  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2230  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2231}'`
2232  # AWK program above erroneously prepends '/' to C:/dos/paths
2233  # for these hosts.
2234  case $host_os in
2235    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
2236      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
2237  esac
2238  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
2239else
2240  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2241fi])
2242library_names_spec=
2243libname_spec='lib$name'
2244soname_spec=
2245shrext_cmds=".so"
2246postinstall_cmds=
2247postuninstall_cmds=
2248finish_cmds=
2249finish_eval=
2250shlibpath_var=
2251shlibpath_overrides_runpath=unknown
2252version_type=none
2253dynamic_linker="$host_os ld.so"
2254sys_lib_dlsearch_path_spec="/lib /usr/lib"
2255need_lib_prefix=unknown
2256hardcode_into_libs=no
2257
2258# when you set need_version to no, make sure it does not cause -set_version
2259# flags to be left without arguments
2260need_version=unknown
2261
2262case $host_os in
2263aix3*)
2264  version_type=linux # correct to gnu/linux during the next big refactor
2265  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
2266  shlibpath_var=LIBPATH
2267
2268  # AIX 3 has no versioning support, so we append a major version to the name.
2269  soname_spec='${libname}${release}${shared_ext}$major'
2270  ;;
2271
2272aix[[4-9]]*)
2273  version_type=linux # correct to gnu/linux during the next big refactor
2274  need_lib_prefix=no
2275  need_version=no
2276  hardcode_into_libs=yes
2277  if test "$host_cpu" = ia64; then
2278    # AIX 5 supports IA64
2279    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
2280    shlibpath_var=LD_LIBRARY_PATH
2281  else
2282    # With GCC up to 2.95.x, collect2 would create an import file
2283    # for dependence libraries.  The import file would start with
2284    # the line `#! .'.  This would cause the generated library to
2285    # depend on `.', always an invalid library.  This was fixed in
2286    # development snapshots of GCC prior to 3.0.
2287    case $host_os in
2288      aix4 | aix4.[[01]] | aix4.[[01]].*)
2289      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2290	   echo ' yes '
2291	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
2292	:
2293      else
2294	can_build_shared=no
2295      fi
2296      ;;
2297    esac
2298    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
2299    # soname into executable. Probably we can add versioning support to
2300    # collect2, so additional links can be useful in future.
2301    if test "$aix_use_runtimelinking" = yes; then
2302      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2303      # instead of lib<name>.a to let people know that these are not
2304      # typical AIX shared libraries.
2305      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2306    else
2307      # We preserve .a as extension for shared libraries through AIX4.2
2308      # and later when we are not doing run time linking.
2309      library_names_spec='${libname}${release}.a $libname.a'
2310      soname_spec='${libname}${release}${shared_ext}$major'
2311    fi
2312    shlibpath_var=LIBPATH
2313  fi
2314  ;;
2315
2316amigaos*)
2317  case $host_cpu in
2318  powerpc)
2319    # Since July 2007 AmigaOS4 officially supports .so libraries.
2320    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2321    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2322    ;;
2323  m68k)
2324    library_names_spec='$libname.ixlibrary $libname.a'
2325    # Create ${libname}_ixlibrary.a entries in /sys/libs.
2326    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''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'
2327    ;;
2328  esac
2329  ;;
2330
2331beos*)
2332  library_names_spec='${libname}${shared_ext}'
2333  dynamic_linker="$host_os ld.so"
2334  shlibpath_var=LIBRARY_PATH
2335  ;;
2336
2337bsdi[[45]]*)
2338  version_type=linux # correct to gnu/linux during the next big refactor
2339  need_version=no
2340  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2341  soname_spec='${libname}${release}${shared_ext}$major'
2342  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2343  shlibpath_var=LD_LIBRARY_PATH
2344  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2345  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2346  # the default ld.so.conf also contains /usr/contrib/lib and
2347  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2348  # libtool to hard-code these into programs
2349  ;;
2350
2351cygwin* | mingw* | pw32* | cegcc*)
2352  version_type=windows
2353  shrext_cmds=".dll"
2354  need_version=no
2355  need_lib_prefix=no
2356
2357  case $GCC,$cc_basename in
2358  yes,*)
2359    # gcc
2360    library_names_spec='$libname.dll.a'
2361    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2362    postinstall_cmds='base_file=`basename \${file}`~
2363      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2364      dldir=$destdir/`dirname \$dlpath`~
2365      test -d \$dldir || mkdir -p \$dldir~
2366      $install_prog $dir/$dlname \$dldir/$dlname~
2367      chmod a+x \$dldir/$dlname~
2368      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2369        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2370      fi'
2371    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2372      dlpath=$dir/\$dldll~
2373       $RM \$dlpath'
2374    shlibpath_overrides_runpath=yes
2375
2376    case $host_os in
2377    cygwin*)
2378      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2379      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2380m4_if([$1], [],[
2381      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
2382      ;;
2383    mingw* | cegcc*)
2384      # MinGW DLLs use traditional 'lib' prefix
2385      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2386      ;;
2387    pw32*)
2388      # pw32 DLLs use 'pw' prefix rather than 'lib'
2389      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2390      ;;
2391    esac
2392    dynamic_linker='Win32 ld.exe'
2393    ;;
2394
2395  *,cl*)
2396    # Native MSVC
2397    libname_spec='$name'
2398    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2399    library_names_spec='${libname}.dll.lib'
2400
2401    case $build_os in
2402    mingw*)
2403      sys_lib_search_path_spec=
2404      lt_save_ifs=$IFS
2405      IFS=';'
2406      for lt_path in $LIB
2407      do
2408        IFS=$lt_save_ifs
2409        # Let DOS variable expansion print the short 8.3 style file name.
2410        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
2411        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
2412      done
2413      IFS=$lt_save_ifs
2414      # Convert to MSYS style.
2415      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
2416      ;;
2417    cygwin*)
2418      # Convert to unix form, then to dos form, then back to unix form
2419      # but this time dos style (no spaces!) so that the unix form looks
2420      # like /cygdrive/c/PROGRA~1:/cygdr...
2421      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
2422      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
2423      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2424      ;;
2425    *)
2426      sys_lib_search_path_spec="$LIB"
2427      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2428        # It is most probably a Windows format PATH.
2429        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2430      else
2431        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2432      fi
2433      # FIXME: find the short name or the path components, as spaces are
2434      # common. (e.g. "Program Files" -> "PROGRA~1")
2435      ;;
2436    esac
2437
2438    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2439    postinstall_cmds='base_file=`basename \${file}`~
2440      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2441      dldir=$destdir/`dirname \$dlpath`~
2442      test -d \$dldir || mkdir -p \$dldir~
2443      $install_prog $dir/$dlname \$dldir/$dlname'
2444    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2445      dlpath=$dir/\$dldll~
2446       $RM \$dlpath'
2447    shlibpath_overrides_runpath=yes
2448    dynamic_linker='Win32 link.exe'
2449    ;;
2450
2451  *)
2452    # Assume MSVC wrapper
2453    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2454    dynamic_linker='Win32 ld.exe'
2455    ;;
2456  esac
2457  # FIXME: first we should search . and the directory the executable is in
2458  shlibpath_var=PATH
2459  ;;
2460
2461darwin* | rhapsody*)
2462  dynamic_linker="$host_os dyld"
2463  version_type=darwin
2464  need_lib_prefix=no
2465  need_version=no
2466  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
2467  soname_spec='${libname}${release}${major}$shared_ext'
2468  shlibpath_overrides_runpath=yes
2469  shlibpath_var=DYLD_LIBRARY_PATH
2470  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2471m4_if([$1], [],[
2472  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2473  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2474  ;;
2475
2476dgux*)
2477  version_type=linux # correct to gnu/linux during the next big refactor
2478  need_lib_prefix=no
2479  need_version=no
2480  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
2481  soname_spec='${libname}${release}${shared_ext}$major'
2482  shlibpath_var=LD_LIBRARY_PATH
2483  ;;
2484
2485freebsd* | dragonfly*)
2486  # DragonFly does not have aout.  When/if they implement a new
2487  # versioning mechanism, adjust this.
2488  if test -x /usr/bin/objformat; then
2489    objformat=`/usr/bin/objformat`
2490  else
2491    case $host_os in
2492    freebsd[[23]].*) objformat=aout ;;
2493    *) objformat=elf ;;
2494    esac
2495  fi
2496  # Handle Gentoo/FreeBSD as it was Linux
2497  case $host_vendor in
2498    gentoo)
2499      version_type=linux ;;
2500    *)
2501      version_type=freebsd-$objformat ;;
2502  esac
2503
2504  case $version_type in
2505    freebsd-elf*)
2506      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2507      need_version=no
2508      need_lib_prefix=no
2509      ;;
2510    freebsd-*)
2511      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
2512      need_version=yes
2513      ;;
2514    linux)
2515      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2516      soname_spec='${libname}${release}${shared_ext}$major'
2517      need_lib_prefix=no
2518      need_version=no
2519      ;;
2520  esac
2521  shlibpath_var=LD_LIBRARY_PATH
2522  case $host_os in
2523  freebsd2.*)
2524    shlibpath_overrides_runpath=yes
2525    ;;
2526  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2527    shlibpath_overrides_runpath=yes
2528    hardcode_into_libs=yes
2529    ;;
2530  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2531  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2532    shlibpath_overrides_runpath=no
2533    hardcode_into_libs=yes
2534    ;;
2535  *) # from 4.6 on, and DragonFly
2536    shlibpath_overrides_runpath=yes
2537    hardcode_into_libs=yes
2538    ;;
2539  esac
2540  ;;
2541
2542gnu*)
2543  version_type=linux # correct to gnu/linux during the next big refactor
2544  need_lib_prefix=no
2545  need_version=no
2546  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2547  soname_spec='${libname}${release}${shared_ext}$major'
2548  shlibpath_var=LD_LIBRARY_PATH
2549  shlibpath_overrides_runpath=no
2550  hardcode_into_libs=yes
2551  ;;
2552
2553haiku*)
2554  version_type=linux # correct to gnu/linux during the next big refactor
2555  need_lib_prefix=no
2556  need_version=no
2557  dynamic_linker="$host_os runtime_loader"
2558  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2559  soname_spec='${libname}${release}${shared_ext}$major'
2560  shlibpath_var=LIBRARY_PATH
2561  shlibpath_overrides_runpath=yes
2562  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
2563  hardcode_into_libs=yes
2564  ;;
2565
2566hpux9* | hpux10* | hpux11*)
2567  # Give a soname corresponding to the major version so that dld.sl refuses to
2568  # link against other versions.
2569  version_type=sunos
2570  need_lib_prefix=no
2571  need_version=no
2572  case $host_cpu in
2573  ia64*)
2574    shrext_cmds='.so'
2575    hardcode_into_libs=yes
2576    dynamic_linker="$host_os dld.so"
2577    shlibpath_var=LD_LIBRARY_PATH
2578    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2579    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2580    soname_spec='${libname}${release}${shared_ext}$major'
2581    if test "X$HPUX_IA64_MODE" = X32; then
2582      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2583    else
2584      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2585    fi
2586    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2587    ;;
2588  hppa*64*)
2589    shrext_cmds='.sl'
2590    hardcode_into_libs=yes
2591    dynamic_linker="$host_os dld.sl"
2592    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2593    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2594    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2595    soname_spec='${libname}${release}${shared_ext}$major'
2596    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2597    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2598    ;;
2599  *)
2600    shrext_cmds='.sl'
2601    dynamic_linker="$host_os dld.sl"
2602    shlibpath_var=SHLIB_PATH
2603    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2604    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2605    soname_spec='${libname}${release}${shared_ext}$major'
2606    ;;
2607  esac
2608  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
2609  postinstall_cmds='chmod 555 $lib'
2610  # or fails outright, so override atomically:
2611  install_override_mode=555
2612  ;;
2613
2614interix[[3-9]]*)
2615  version_type=linux # correct to gnu/linux during the next big refactor
2616  need_lib_prefix=no
2617  need_version=no
2618  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2619  soname_spec='${libname}${release}${shared_ext}$major'
2620  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2621  shlibpath_var=LD_LIBRARY_PATH
2622  shlibpath_overrides_runpath=no
2623  hardcode_into_libs=yes
2624  ;;
2625
2626irix5* | irix6* | nonstopux*)
2627  case $host_os in
2628    nonstopux*) version_type=nonstopux ;;
2629    *)
2630	if test "$lt_cv_prog_gnu_ld" = yes; then
2631		version_type=linux # correct to gnu/linux during the next big refactor
2632	else
2633		version_type=irix
2634	fi ;;
2635  esac
2636  need_lib_prefix=no
2637  need_version=no
2638  soname_spec='${libname}${release}${shared_ext}$major'
2639  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
2640  case $host_os in
2641  irix5* | nonstopux*)
2642    libsuff= shlibsuff=
2643    ;;
2644  *)
2645    case $LD in # libtool.m4 will add one of these switches to LD
2646    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2647      libsuff= shlibsuff= libmagic=32-bit;;
2648    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2649      libsuff=32 shlibsuff=N32 libmagic=N32;;
2650    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2651      libsuff=64 shlibsuff=64 libmagic=64-bit;;
2652    *) libsuff= shlibsuff= libmagic=never-match;;
2653    esac
2654    ;;
2655  esac
2656  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2657  shlibpath_overrides_runpath=no
2658  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2659  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2660  hardcode_into_libs=yes
2661  ;;
2662
2663# No shared lib support for Linux oldld, aout, or coff.
2664linux*oldld* | linux*aout* | linux*coff*)
2665  dynamic_linker=no
2666  ;;
2667
2668# This must be glibc/ELF.
2669linux* | k*bsd*-gnu | kopensolaris*-gnu)
2670  version_type=linux # correct to gnu/linux during the next big refactor
2671  need_lib_prefix=no
2672  need_version=no
2673  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2674  soname_spec='${libname}${release}${shared_ext}$major'
2675  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2676  shlibpath_var=LD_LIBRARY_PATH
2677  shlibpath_overrides_runpath=no
2678
2679  # Some binutils ld are patched to set DT_RUNPATH
2680  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
2681    [lt_cv_shlibpath_overrides_runpath=no
2682    save_LDFLAGS=$LDFLAGS
2683    save_libdir=$libdir
2684    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2685	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2686    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2687      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2688	 [lt_cv_shlibpath_overrides_runpath=yes])])
2689    LDFLAGS=$save_LDFLAGS
2690    libdir=$save_libdir
2691    ])
2692  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2693
2694  # This implies no fast_install, which is unacceptable.
2695  # Some rework will be needed to allow for fast_install
2696  # before this can be enabled.
2697  hardcode_into_libs=yes
2698
2699  # Append ld.so.conf contents to the search path
2700  if test -f /etc/ld.so.conf; then
2701    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/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
2702    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
2703  fi
2704
2705  # We used to test for /lib/ld.so.1 and disable shared libraries on
2706  # powerpc, because MkLinux only supported shared libraries with the
2707  # GNU dynamic linker.  Since this was broken with cross compilers,
2708  # most powerpc-linux boxes support dynamic linking these days and
2709  # people can always --disable-shared, the test was removed, and we
2710  # assume the GNU/Linux dynamic linker is in use.
2711  dynamic_linker='GNU/Linux ld.so'
2712  ;;
2713
2714netbsd*)
2715  version_type=sunos
2716  need_lib_prefix=no
2717  need_version=no
2718  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2719    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2720    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2721    dynamic_linker='NetBSD (a.out) ld.so'
2722  else
2723    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2724    soname_spec='${libname}${release}${shared_ext}$major'
2725    dynamic_linker='NetBSD ld.elf_so'
2726  fi
2727  shlibpath_var=LD_LIBRARY_PATH
2728  shlibpath_overrides_runpath=yes
2729  hardcode_into_libs=yes
2730  ;;
2731
2732newsos6)
2733  version_type=linux # correct to gnu/linux during the next big refactor
2734  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2735  shlibpath_var=LD_LIBRARY_PATH
2736  shlibpath_overrides_runpath=yes
2737  ;;
2738
2739*nto* | *qnx*)
2740  version_type=qnx
2741  need_lib_prefix=no
2742  need_version=no
2743  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2744  soname_spec='${libname}${release}${shared_ext}$major'
2745  shlibpath_var=LD_LIBRARY_PATH
2746  shlibpath_overrides_runpath=no
2747  hardcode_into_libs=yes
2748  dynamic_linker='ldqnx.so'
2749  ;;
2750
2751openbsd*)
2752  version_type=sunos
2753  sys_lib_dlsearch_path_spec="/usr/lib"
2754  need_lib_prefix=no
2755  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
2756  case $host_os in
2757    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
2758    *)				need_version=no  ;;
2759  esac
2760  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2761  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2762  shlibpath_var=LD_LIBRARY_PATH
2763  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2764    case $host_os in
2765      openbsd2.[[89]] | openbsd2.[[89]].*)
2766	shlibpath_overrides_runpath=no
2767	;;
2768      *)
2769	shlibpath_overrides_runpath=yes
2770	;;
2771      esac
2772  else
2773    shlibpath_overrides_runpath=yes
2774  fi
2775  ;;
2776
2777os2*)
2778  libname_spec='$name'
2779  shrext_cmds=".dll"
2780  need_lib_prefix=no
2781  library_names_spec='$libname${shared_ext} $libname.a'
2782  dynamic_linker='OS/2 ld.exe'
2783  shlibpath_var=LIBPATH
2784  ;;
2785
2786osf3* | osf4* | osf5*)
2787  version_type=osf
2788  need_lib_prefix=no
2789  need_version=no
2790  soname_spec='${libname}${release}${shared_ext}$major'
2791  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2792  shlibpath_var=LD_LIBRARY_PATH
2793  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2794  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2795  ;;
2796
2797rdos*)
2798  dynamic_linker=no
2799  ;;
2800
2801solaris*)
2802  version_type=linux # correct to gnu/linux during the next big refactor
2803  need_lib_prefix=no
2804  need_version=no
2805  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2806  soname_spec='${libname}${release}${shared_ext}$major'
2807  shlibpath_var=LD_LIBRARY_PATH
2808  shlibpath_overrides_runpath=yes
2809  hardcode_into_libs=yes
2810  # ldd complains unless libraries are executable
2811  postinstall_cmds='chmod +x $lib'
2812  ;;
2813
2814sunos4*)
2815  version_type=sunos
2816  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2817  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2818  shlibpath_var=LD_LIBRARY_PATH
2819  shlibpath_overrides_runpath=yes
2820  if test "$with_gnu_ld" = yes; then
2821    need_lib_prefix=no
2822  fi
2823  need_version=yes
2824  ;;
2825
2826sysv4 | sysv4.3*)
2827  version_type=linux # correct to gnu/linux during the next big refactor
2828  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2829  soname_spec='${libname}${release}${shared_ext}$major'
2830  shlibpath_var=LD_LIBRARY_PATH
2831  case $host_vendor in
2832    sni)
2833      shlibpath_overrides_runpath=no
2834      need_lib_prefix=no
2835      runpath_var=LD_RUN_PATH
2836      ;;
2837    siemens)
2838      need_lib_prefix=no
2839      ;;
2840    motorola)
2841      need_lib_prefix=no
2842      need_version=no
2843      shlibpath_overrides_runpath=no
2844      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2845      ;;
2846  esac
2847  ;;
2848
2849sysv4*MP*)
2850  if test -d /usr/nec ;then
2851    version_type=linux # correct to gnu/linux during the next big refactor
2852    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
2853    soname_spec='$libname${shared_ext}.$major'
2854    shlibpath_var=LD_LIBRARY_PATH
2855  fi
2856  ;;
2857
2858sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2859  version_type=freebsd-elf
2860  need_lib_prefix=no
2861  need_version=no
2862  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2863  soname_spec='${libname}${release}${shared_ext}$major'
2864  shlibpath_var=LD_LIBRARY_PATH
2865  shlibpath_overrides_runpath=yes
2866  hardcode_into_libs=yes
2867  if test "$with_gnu_ld" = yes; then
2868    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
2869  else
2870    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
2871    case $host_os in
2872      sco3.2v5*)
2873        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
2874	;;
2875    esac
2876  fi
2877  sys_lib_dlsearch_path_spec='/usr/lib'
2878  ;;
2879
2880tpf*)
2881  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
2882  version_type=linux # correct to gnu/linux during the next big refactor
2883  need_lib_prefix=no
2884  need_version=no
2885  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2886  shlibpath_var=LD_LIBRARY_PATH
2887  shlibpath_overrides_runpath=no
2888  hardcode_into_libs=yes
2889  ;;
2890
2891uts4*)
2892  version_type=linux # correct to gnu/linux during the next big refactor
2893  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2894  soname_spec='${libname}${release}${shared_ext}$major'
2895  shlibpath_var=LD_LIBRARY_PATH
2896  ;;
2897
2898*)
2899  dynamic_linker=no
2900  ;;
2901esac
2902AC_MSG_RESULT([$dynamic_linker])
2903test "$dynamic_linker" = no && can_build_shared=no
2904
2905variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2906if test "$GCC" = yes; then
2907  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2908fi
2909
2910if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
2911  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
2912fi
2913if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
2914  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
2915fi
2916
2917_LT_DECL([], [variables_saved_for_relink], [1],
2918    [Variables whose values should be saved in libtool wrapper scripts and
2919    restored at link time])
2920_LT_DECL([], [need_lib_prefix], [0],
2921    [Do we need the "lib" prefix for modules?])
2922_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
2923_LT_DECL([], [version_type], [0], [Library versioning type])
2924_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
2925_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
2926_LT_DECL([], [shlibpath_overrides_runpath], [0],
2927    [Is shlibpath searched before the hard-coded library search path?])
2928_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
2929_LT_DECL([], [library_names_spec], [1],
2930    [[List of archive names.  First name is the real one, the rest are links.
2931    The last name is the one that the linker finds with -lNAME]])
2932_LT_DECL([], [soname_spec], [1],
2933    [[The coded name of the library, if different from the real name]])
2934_LT_DECL([], [install_override_mode], [1],
2935    [Permission mode override for installation of shared libraries])
2936_LT_DECL([], [postinstall_cmds], [2],
2937    [Command to use after installation of a shared archive])
2938_LT_DECL([], [postuninstall_cmds], [2],
2939    [Command to use after uninstallation of a shared archive])
2940_LT_DECL([], [finish_cmds], [2],
2941    [Commands used to finish a libtool library installation in a directory])
2942_LT_DECL([], [finish_eval], [1],
2943    [[As "finish_cmds", except a single script fragment to be evaled but
2944    not shown]])
2945_LT_DECL([], [hardcode_into_libs], [0],
2946    [Whether we should hardcode library paths into libraries])
2947_LT_DECL([], [sys_lib_search_path_spec], [2],
2948    [Compile-time system search path for libraries])
2949_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
2950    [Run-time system search path for libraries])
2951])# _LT_SYS_DYNAMIC_LINKER
2952
2953
2954# _LT_PATH_TOOL_PREFIX(TOOL)
2955# --------------------------
2956# find a file program which can recognize shared library
2957AC_DEFUN([_LT_PATH_TOOL_PREFIX],
2958[m4_require([_LT_DECL_EGREP])dnl
2959AC_MSG_CHECKING([for $1])
2960AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
2961[case $MAGIC_CMD in
2962[[\\/*] |  ?:[\\/]*])
2963  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
2964  ;;
2965*)
2966  lt_save_MAGIC_CMD="$MAGIC_CMD"
2967  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2968dnl $ac_dummy forces splitting on constant user-supplied paths.
2969dnl POSIX.2 word splitting is done only on the output of word expansions,
2970dnl not every word.  This closes a longstanding sh security hole.
2971  ac_dummy="m4_if([$2], , $PATH, [$2])"
2972  for ac_dir in $ac_dummy; do
2973    IFS="$lt_save_ifs"
2974    test -z "$ac_dir" && ac_dir=.
2975    if test -f $ac_dir/$1; then
2976      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
2977      if test -n "$file_magic_test_file"; then
2978	case $deplibs_check_method in
2979	"file_magic "*)
2980	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
2981	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2982	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2983	    $EGREP "$file_magic_regex" > /dev/null; then
2984	    :
2985	  else
2986	    cat <<_LT_EOF 1>&2
2987
2988*** Warning: the command libtool uses to detect shared libraries,
2989*** $file_magic_cmd, produces output that libtool cannot recognize.
2990*** The result is that libtool may fail to recognize shared libraries
2991*** as such.  This will affect the creation of libtool libraries that
2992*** depend on shared libraries, but programs linked with such libtool
2993*** libraries will work regardless of this problem.  Nevertheless, you
2994*** may want to report the problem to your system manager and/or to
2995*** bug-libtool@gnu.org
2996
2997_LT_EOF
2998	  fi ;;
2999	esac
3000      fi
3001      break
3002    fi
3003  done
3004  IFS="$lt_save_ifs"
3005  MAGIC_CMD="$lt_save_MAGIC_CMD"
3006  ;;
3007esac])
3008MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3009if test -n "$MAGIC_CMD"; then
3010  AC_MSG_RESULT($MAGIC_CMD)
3011else
3012  AC_MSG_RESULT(no)
3013fi
3014_LT_DECL([], [MAGIC_CMD], [0],
3015	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
3016])# _LT_PATH_TOOL_PREFIX
3017
3018# Old name:
3019AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
3020dnl aclocal-1.4 backwards compatibility:
3021dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3022
3023
3024# _LT_PATH_MAGIC
3025# --------------
3026# find a file program which can recognize a shared library
3027m4_defun([_LT_PATH_MAGIC],
3028[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3029if test -z "$lt_cv_path_MAGIC_CMD"; then
3030  if test -n "$ac_tool_prefix"; then
3031    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
3032  else
3033    MAGIC_CMD=:
3034  fi
3035fi
3036])# _LT_PATH_MAGIC
3037
3038
3039# LT_PATH_LD
3040# ----------
3041# find the pathname to the GNU or non-GNU linker
3042AC_DEFUN([LT_PATH_LD],
3043[AC_REQUIRE([AC_PROG_CC])dnl
3044AC_REQUIRE([AC_CANONICAL_HOST])dnl
3045AC_REQUIRE([AC_CANONICAL_BUILD])dnl
3046m4_require([_LT_DECL_SED])dnl
3047m4_require([_LT_DECL_EGREP])dnl
3048m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3049
3050AC_ARG_WITH([gnu-ld],
3051    [AS_HELP_STRING([--with-gnu-ld],
3052	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
3053    [test "$withval" = no || with_gnu_ld=yes],
3054    [with_gnu_ld=no])dnl
3055
3056ac_prog=ld
3057if test "$GCC" = yes; then
3058  # Check if gcc -print-prog-name=ld gives a path.
3059  AC_MSG_CHECKING([for ld used by $CC])
3060  case $host in
3061  *-*-mingw*)
3062    # gcc leaves a trailing carriage return which upsets mingw
3063    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3064  *)
3065    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3066  esac
3067  case $ac_prog in
3068    # Accept absolute paths.
3069    [[\\/]]* | ?:[[\\/]]*)
3070      re_direlt='/[[^/]][[^/]]*/\.\./'
3071      # Canonicalize the pathname of ld
3072      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
3073      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
3074	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
3075      done
3076      test -z "$LD" && LD="$ac_prog"
3077      ;;
3078  "")
3079    # If it fails, then pretend we aren't using GCC.
3080    ac_prog=ld
3081    ;;
3082  *)
3083    # If it is relative, then search for the first ld in PATH.
3084    with_gnu_ld=unknown
3085    ;;
3086  esac
3087elif test "$with_gnu_ld" = yes; then
3088  AC_MSG_CHECKING([for GNU ld])
3089else
3090  AC_MSG_CHECKING([for non-GNU ld])
3091fi
3092AC_CACHE_VAL(lt_cv_path_LD,
3093[if test -z "$LD"; then
3094  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3095  for ac_dir in $PATH; do
3096    IFS="$lt_save_ifs"
3097    test -z "$ac_dir" && ac_dir=.
3098    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3099      lt_cv_path_LD="$ac_dir/$ac_prog"
3100      # Check to see if the program is GNU ld.  I'd rather use --version,
3101      # but apparently some variants of GNU ld only accept -v.
3102      # Break only if it was the GNU/non-GNU ld that we prefer.
3103      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
3104      *GNU* | *'with BFD'*)
3105	test "$with_gnu_ld" != no && break
3106	;;
3107      *)
3108	test "$with_gnu_ld" != yes && break
3109	;;
3110      esac
3111    fi
3112  done
3113  IFS="$lt_save_ifs"
3114else
3115  lt_cv_path_LD="$LD" # Let the user override the test with a path.
3116fi])
3117LD="$lt_cv_path_LD"
3118if test -n "$LD"; then
3119  AC_MSG_RESULT($LD)
3120else
3121  AC_MSG_RESULT(no)
3122fi
3123test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3124_LT_PATH_LD_GNU
3125AC_SUBST([LD])
3126
3127_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
3128])# LT_PATH_LD
3129
3130# Old names:
3131AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
3132AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
3133dnl aclocal-1.4 backwards compatibility:
3134dnl AC_DEFUN([AM_PROG_LD], [])
3135dnl AC_DEFUN([AC_PROG_LD], [])
3136
3137
3138# _LT_PATH_LD_GNU
3139#- --------------
3140m4_defun([_LT_PATH_LD_GNU],
3141[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3142[# I'd rather use --version here, but apparently some GNU lds only accept -v.
3143case `$LD -v 2>&1 </dev/null` in
3144*GNU* | *'with BFD'*)
3145  lt_cv_prog_gnu_ld=yes
3146  ;;
3147*)
3148  lt_cv_prog_gnu_ld=no
3149  ;;
3150esac])
3151with_gnu_ld=$lt_cv_prog_gnu_ld
3152])# _LT_PATH_LD_GNU
3153
3154
3155# _LT_CMD_RELOAD
3156# --------------
3157# find reload flag for linker
3158#   -- PORTME Some linkers may need a different reload flag.
3159m4_defun([_LT_CMD_RELOAD],
3160[AC_CACHE_CHECK([for $LD option to reload object files],
3161  lt_cv_ld_reload_flag,
3162  [lt_cv_ld_reload_flag='-r'])
3163reload_flag=$lt_cv_ld_reload_flag
3164case $reload_flag in
3165"" | " "*) ;;
3166*) reload_flag=" $reload_flag" ;;
3167esac
3168reload_cmds='$LD$reload_flag -o $output$reload_objs'
3169case $host_os in
3170  cygwin* | mingw* | pw32* | cegcc*)
3171    if test "$GCC" != yes; then
3172      reload_cmds=false
3173    fi
3174    ;;
3175  darwin*)
3176    if test "$GCC" = yes; then
3177      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
3178    else
3179      reload_cmds='$LD$reload_flag -o $output$reload_objs'
3180    fi
3181    ;;
3182esac
3183_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
3184_LT_TAGDECL([], [reload_cmds], [2])dnl
3185])# _LT_CMD_RELOAD
3186
3187
3188# _LT_CHECK_MAGIC_METHOD
3189# ----------------------
3190# how to check for library dependencies
3191#  -- PORTME fill in with the dynamic library characteristics
3192m4_defun([_LT_CHECK_MAGIC_METHOD],
3193[m4_require([_LT_DECL_EGREP])
3194m4_require([_LT_DECL_OBJDUMP])
3195AC_CACHE_CHECK([how to recognize dependent libraries],
3196lt_cv_deplibs_check_method,
3197[lt_cv_file_magic_cmd='$MAGIC_CMD'
3198lt_cv_file_magic_test_file=
3199lt_cv_deplibs_check_method='unknown'
3200# Need to set the preceding variable on all platforms that support
3201# interlibrary dependencies.
3202# 'none' -- dependencies not supported.
3203# `unknown' -- same as none, but documents that we really don't know.
3204# 'pass_all' -- all dependencies passed with no checks.
3205# 'test_compile' -- check by making test program.
3206# 'file_magic [[regex]]' -- check by looking for files in library path
3207# which responds to the $file_magic_cmd with a given extended regex.
3208# If you have `file' or equivalent on your system and you're not sure
3209# whether `pass_all' will *always* work, you probably want this one.
3210
3211case $host_os in
3212aix[[4-9]]*)
3213  lt_cv_deplibs_check_method=pass_all
3214  ;;
3215
3216beos*)
3217  lt_cv_deplibs_check_method=pass_all
3218  ;;
3219
3220bsdi[[45]]*)
3221  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3222  lt_cv_file_magic_cmd='/usr/bin/file -L'
3223  lt_cv_file_magic_test_file=/shlib/libc.so
3224  ;;
3225
3226cygwin*)
3227  # func_win32_libid is a shell function defined in ltmain.sh
3228  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3229  lt_cv_file_magic_cmd='func_win32_libid'
3230  ;;
3231
3232mingw* | pw32*)
3233  # Base MSYS/MinGW do not provide the 'file' command needed by
3234  # func_win32_libid shell function, so use a weaker test based on 'objdump',
3235  # unless we find 'file', for example because we are cross-compiling.
3236  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
3237  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
3238    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3239    lt_cv_file_magic_cmd='func_win32_libid'
3240  else
3241    # Keep this pattern in sync with the one in func_win32_libid.
3242    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
3243    lt_cv_file_magic_cmd='$OBJDUMP -f'
3244  fi
3245  ;;
3246
3247cegcc*)
3248  # use the weaker test based on 'objdump'. See mingw*.
3249  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3250  lt_cv_file_magic_cmd='$OBJDUMP -f'
3251  ;;
3252
3253darwin* | rhapsody*)
3254  lt_cv_deplibs_check_method=pass_all
3255  ;;
3256
3257freebsd* | dragonfly*)
3258  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3259    case $host_cpu in
3260    i*86 )
3261      # Not sure whether the presence of OpenBSD here was a mistake.
3262      # Let's accept both of them until this is cleared up.
3263      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3264      lt_cv_file_magic_cmd=/usr/bin/file
3265      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3266      ;;
3267    esac
3268  else
3269    lt_cv_deplibs_check_method=pass_all
3270  fi
3271  ;;
3272
3273gnu*)
3274  lt_cv_deplibs_check_method=pass_all
3275  ;;
3276
3277haiku*)
3278  lt_cv_deplibs_check_method=pass_all
3279  ;;
3280
3281hpux10.20* | hpux11*)
3282  lt_cv_file_magic_cmd=/usr/bin/file
3283  case $host_cpu in
3284  ia64*)
3285    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3286    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3287    ;;
3288  hppa*64*)
3289    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
3290    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3291    ;;
3292  *)
3293    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
3294    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3295    ;;
3296  esac
3297  ;;
3298
3299interix[[3-9]]*)
3300  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3301  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3302  ;;
3303
3304irix5* | irix6* | nonstopux*)
3305  case $LD in
3306  *-32|*"-32 ") libmagic=32-bit;;
3307  *-n32|*"-n32 ") libmagic=N32;;
3308  *-64|*"-64 ") libmagic=64-bit;;
3309  *) libmagic=never-match;;
3310  esac
3311  lt_cv_deplibs_check_method=pass_all
3312  ;;
3313
3314# This must be glibc/ELF.
3315linux* | k*bsd*-gnu | kopensolaris*-gnu)
3316  lt_cv_deplibs_check_method=pass_all
3317  ;;
3318
3319netbsd*)
3320  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3321    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3322  else
3323    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3324  fi
3325  ;;
3326
3327newos6*)
3328  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3329  lt_cv_file_magic_cmd=/usr/bin/file
3330  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3331  ;;
3332
3333*nto* | *qnx*)
3334  lt_cv_deplibs_check_method=pass_all
3335  ;;
3336
3337openbsd*)
3338  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3339    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3340  else
3341    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3342  fi
3343  ;;
3344
3345osf3* | osf4* | osf5*)
3346  lt_cv_deplibs_check_method=pass_all
3347  ;;
3348
3349rdos*)
3350  lt_cv_deplibs_check_method=pass_all
3351  ;;
3352
3353solaris*)
3354  lt_cv_deplibs_check_method=pass_all
3355  ;;
3356
3357sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3358  lt_cv_deplibs_check_method=pass_all
3359  ;;
3360
3361sysv4 | sysv4.3*)
3362  case $host_vendor in
3363  motorola)
3364    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]]'
3365    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3366    ;;
3367  ncr)
3368    lt_cv_deplibs_check_method=pass_all
3369    ;;
3370  sequent)
3371    lt_cv_file_magic_cmd='/bin/file'
3372    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3373    ;;
3374  sni)
3375    lt_cv_file_magic_cmd='/bin/file'
3376    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3377    lt_cv_file_magic_test_file=/lib/libc.so
3378    ;;
3379  siemens)
3380    lt_cv_deplibs_check_method=pass_all
3381    ;;
3382  pc)
3383    lt_cv_deplibs_check_method=pass_all
3384    ;;
3385  esac
3386  ;;
3387
3388tpf*)
3389  lt_cv_deplibs_check_method=pass_all
3390  ;;
3391esac
3392])
3393
3394file_magic_glob=
3395want_nocaseglob=no
3396if test "$build" = "$host"; then
3397  case $host_os in
3398  mingw* | pw32*)
3399    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
3400      want_nocaseglob=yes
3401    else
3402      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
3403    fi
3404    ;;
3405  esac
3406fi
3407
3408file_magic_cmd=$lt_cv_file_magic_cmd
3409deplibs_check_method=$lt_cv_deplibs_check_method
3410test -z "$deplibs_check_method" && deplibs_check_method=unknown
3411
3412_LT_DECL([], [deplibs_check_method], [1],
3413    [Method to check whether dependent libraries are shared objects])
3414_LT_DECL([], [file_magic_cmd], [1],
3415    [Command to use when deplibs_check_method = "file_magic"])
3416_LT_DECL([], [file_magic_glob], [1],
3417    [How to find potential files when deplibs_check_method = "file_magic"])
3418_LT_DECL([], [want_nocaseglob], [1],
3419    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
3420])# _LT_CHECK_MAGIC_METHOD
3421
3422
3423# LT_PATH_NM
3424# ----------
3425# find the pathname to a BSD- or MS-compatible name lister
3426AC_DEFUN([LT_PATH_NM],
3427[AC_REQUIRE([AC_PROG_CC])dnl
3428AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3429[if test -n "$NM"; then
3430  # Let the user override the test.
3431  lt_cv_path_NM="$NM"
3432else
3433  lt_nm_to_check="${ac_tool_prefix}nm"
3434  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3435    lt_nm_to_check="$lt_nm_to_check nm"
3436  fi
3437  for lt_tmp_nm in $lt_nm_to_check; do
3438    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3439    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3440      IFS="$lt_save_ifs"
3441      test -z "$ac_dir" && ac_dir=.
3442      tmp_nm="$ac_dir/$lt_tmp_nm"
3443      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
3444	# Check to see if the nm accepts a BSD-compat flag.
3445	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
3446	#   nm: unknown option "B" ignored
3447	# Tru64's nm complains that /dev/null is an invalid object file
3448	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
3449	*/dev/null* | *'Invalid file or object type'*)
3450	  lt_cv_path_NM="$tmp_nm -B"
3451	  break
3452	  ;;
3453	*)
3454	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3455	  */dev/null*)
3456	    lt_cv_path_NM="$tmp_nm -p"
3457	    break
3458	    ;;
3459	  *)
3460	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3461	    continue # so that we can try to find one that supports BSD flags
3462	    ;;
3463	  esac
3464	  ;;
3465	esac
3466      fi
3467    done
3468    IFS="$lt_save_ifs"
3469  done
3470  : ${lt_cv_path_NM=no}
3471fi])
3472if test "$lt_cv_path_NM" != "no"; then
3473  NM="$lt_cv_path_NM"
3474else
3475  # Didn't find any BSD compatible name lister, look for dumpbin.
3476  if test -n "$DUMPBIN"; then :
3477    # Let the user override the test.
3478  else
3479    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3480    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
3481    *COFF*)
3482      DUMPBIN="$DUMPBIN -symbols"
3483      ;;
3484    *)
3485      DUMPBIN=:
3486      ;;
3487    esac
3488  fi
3489  AC_SUBST([DUMPBIN])
3490  if test "$DUMPBIN" != ":"; then
3491    NM="$DUMPBIN"
3492  fi
3493fi
3494test -z "$NM" && NM=nm
3495AC_SUBST([NM])
3496_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3497
3498AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3499  [lt_cv_nm_interface="BSD nm"
3500  echo "int some_variable = 0;" > conftest.$ac_ext
3501  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3502  (eval "$ac_compile" 2>conftest.err)
3503  cat conftest.err >&AS_MESSAGE_LOG_FD
3504  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3505  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3506  cat conftest.err >&AS_MESSAGE_LOG_FD
3507  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
3508  cat conftest.out >&AS_MESSAGE_LOG_FD
3509  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3510    lt_cv_nm_interface="MS dumpbin"
3511  fi
3512  rm -f conftest*])
3513])# LT_PATH_NM
3514
3515# Old names:
3516AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3517AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3518dnl aclocal-1.4 backwards compatibility:
3519dnl AC_DEFUN([AM_PROG_NM], [])
3520dnl AC_DEFUN([AC_PROG_NM], [])
3521
3522# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3523# --------------------------------
3524# how to determine the name of the shared library
3525# associated with a specific link library.
3526#  -- PORTME fill in with the dynamic library characteristics
3527m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
3528[m4_require([_LT_DECL_EGREP])
3529m4_require([_LT_DECL_OBJDUMP])
3530m4_require([_LT_DECL_DLLTOOL])
3531AC_CACHE_CHECK([how to associate runtime and link libraries],
3532lt_cv_sharedlib_from_linklib_cmd,
3533[lt_cv_sharedlib_from_linklib_cmd='unknown'
3534
3535case $host_os in
3536cygwin* | mingw* | pw32* | cegcc*)
3537  # two different shell functions defined in ltmain.sh
3538  # decide which to use based on capabilities of $DLLTOOL
3539  case `$DLLTOOL --help 2>&1` in
3540  *--identify-strict*)
3541    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
3542    ;;
3543  *)
3544    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
3545    ;;
3546  esac
3547  ;;
3548*)
3549  # fallback: assume linklib IS sharedlib
3550  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
3551  ;;
3552esac
3553])
3554sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
3555test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3556
3557_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
3558    [Command to associate shared and link libraries])
3559])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3560
3561
3562# _LT_PATH_MANIFEST_TOOL
3563# ----------------------
3564# locate the manifest tool
3565m4_defun([_LT_PATH_MANIFEST_TOOL],
3566[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
3567test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
3568AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
3569  [lt_cv_path_mainfest_tool=no
3570  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
3571  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
3572  cat conftest.err >&AS_MESSAGE_LOG_FD
3573  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
3574    lt_cv_path_mainfest_tool=yes
3575  fi
3576  rm -f conftest*])
3577if test "x$lt_cv_path_mainfest_tool" != xyes; then
3578  MANIFEST_TOOL=:
3579fi
3580_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
3581])# _LT_PATH_MANIFEST_TOOL
3582
3583
3584# LT_LIB_M
3585# --------
3586# check for math library
3587AC_DEFUN([LT_LIB_M],
3588[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3589LIBM=
3590case $host in
3591*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
3592  # These system don't have libm, or don't need it
3593  ;;
3594*-ncr-sysv4.3*)
3595  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3596  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3597  ;;
3598*)
3599  AC_CHECK_LIB(m, cos, LIBM="-lm")
3600  ;;
3601esac
3602AC_SUBST([LIBM])
3603])# LT_LIB_M
3604
3605# Old name:
3606AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3607dnl aclocal-1.4 backwards compatibility:
3608dnl AC_DEFUN([AC_CHECK_LIBM], [])
3609
3610
3611# _LT_COMPILER_NO_RTTI([TAGNAME])
3612# -------------------------------
3613m4_defun([_LT_COMPILER_NO_RTTI],
3614[m4_require([_LT_TAG_COMPILER])dnl
3615
3616_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3617
3618if test "$GCC" = yes; then
3619  case $cc_basename in
3620  nvcc*)
3621    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
3622  *)
3623    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
3624  esac
3625
3626  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3627    lt_cv_prog_compiler_rtti_exceptions,
3628    [-fno-rtti -fno-exceptions], [],
3629    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3630fi
3631_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3632	[Compiler flag to turn off builtin functions])
3633])# _LT_COMPILER_NO_RTTI
3634
3635
3636# _LT_CMD_GLOBAL_SYMBOLS
3637# ----------------------
3638m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3639[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3640AC_REQUIRE([AC_PROG_CC])dnl
3641AC_REQUIRE([AC_PROG_AWK])dnl
3642AC_REQUIRE([LT_PATH_NM])dnl
3643AC_REQUIRE([LT_PATH_LD])dnl
3644m4_require([_LT_DECL_SED])dnl
3645m4_require([_LT_DECL_EGREP])dnl
3646m4_require([_LT_TAG_COMPILER])dnl
3647
3648# Check for command to grab the raw symbol name followed by C symbol from nm.
3649AC_MSG_CHECKING([command to parse $NM output from $compiler object])
3650AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3651[
3652# These are sane defaults that work on at least a few old systems.
3653# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3654
3655# Character class describing NM global symbol codes.
3656symcode='[[BCDEGRST]]'
3657
3658# Regexp to match symbols that can be accessed directly from C.
3659sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3660
3661# Define system-specific variables.
3662case $host_os in
3663aix*)
3664  symcode='[[BCDT]]'
3665  ;;
3666cygwin* | mingw* | pw32* | cegcc*)
3667  symcode='[[ABCDGISTW]]'
3668  ;;
3669hpux*)
3670  if test "$host_cpu" = ia64; then
3671    symcode='[[ABCDEGRST]]'
3672  fi
3673  ;;
3674irix* | nonstopux*)
3675  symcode='[[BCDEGRST]]'
3676  ;;
3677osf*)
3678  symcode='[[BCDEGQRST]]'
3679  ;;
3680solaris*)
3681  symcode='[[BDRT]]'
3682  ;;
3683sco3.2v5*)
3684  symcode='[[DT]]'
3685  ;;
3686sysv4.2uw2*)
3687  symcode='[[DT]]'
3688  ;;
3689sysv5* | sco5v6* | unixware* | OpenUNIX*)
3690  symcode='[[ABDT]]'
3691  ;;
3692sysv4)
3693  symcode='[[DFNSTU]]'
3694  ;;
3695esac
3696
3697# If we're using GNU nm, then use its standard symbol codes.
3698case `$NM -V 2>&1` in
3699*GNU* | *'with BFD'*)
3700  symcode='[[ABCDGIRSTW]]' ;;
3701esac
3702
3703# Transform an extracted symbol line into a proper C declaration.
3704# Some systems (esp. on ia64) link data and code symbols differently,
3705# so use this general approach.
3706lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3707
3708# Transform an extracted symbol line into symbol name and symbol address
3709lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
3710lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
3711
3712# Handle CRLF in mingw tool chain
3713opt_cr=
3714case $build_os in
3715mingw*)
3716  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
3717  ;;
3718esac
3719
3720# Try without a prefix underscore, then with it.
3721for ac_symprfx in "" "_"; do
3722
3723  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
3724  symxfrm="\\1 $ac_symprfx\\2 \\2"
3725
3726  # Write the raw and C identifiers.
3727  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3728    # Fake it for dumpbin and say T for any non-static function
3729    # and D for any global variable.
3730    # Also find C++ and __fastcall symbols from MSVC++,
3731    # which start with @ or ?.
3732    lt_cv_sys_global_symbol_pipe="$AWK ['"\
3733"     {last_section=section; section=\$ 3};"\
3734"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
3735"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
3736"     \$ 0!~/External *\|/{next};"\
3737"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
3738"     {if(hide[section]) next};"\
3739"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
3740"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
3741"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
3742"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
3743"     ' prfx=^$ac_symprfx]"
3744  else
3745    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
3746  fi
3747  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
3748
3749  # Check to see that the pipe works correctly.
3750  pipe_works=no
3751
3752  rm -f conftest*
3753  cat > conftest.$ac_ext <<_LT_EOF
3754#ifdef __cplusplus
3755extern "C" {
3756#endif
3757char nm_test_var;
3758void nm_test_func(void);
3759void nm_test_func(void){}
3760#ifdef __cplusplus
3761}
3762#endif
3763int main(){nm_test_var='a';nm_test_func();return(0);}
3764_LT_EOF
3765
3766  if AC_TRY_EVAL(ac_compile); then
3767    # Now try to grab the symbols.
3768    nlist=conftest.nm
3769    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
3770      # Try sorting and uniquifying the output.
3771      if sort "$nlist" | uniq > "$nlist"T; then
3772	mv -f "$nlist"T "$nlist"
3773      else
3774	rm -f "$nlist"T
3775      fi
3776
3777      # Make sure that we snagged all the symbols we need.
3778      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
3779	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
3780	  cat <<_LT_EOF > conftest.$ac_ext
3781/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
3782#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3783/* DATA imports from DLLs on WIN32 con't be const, because runtime
3784   relocations are performed -- see ld's documentation on pseudo-relocs.  */
3785# define LT@&t@_DLSYM_CONST
3786#elif defined(__osf__)
3787/* This system does not cope well with relocations in const data.  */
3788# define LT@&t@_DLSYM_CONST
3789#else
3790# define LT@&t@_DLSYM_CONST const
3791#endif
3792
3793#ifdef __cplusplus
3794extern "C" {
3795#endif
3796
3797_LT_EOF
3798	  # Now generate the symbol file.
3799	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3800
3801	  cat <<_LT_EOF >> conftest.$ac_ext
3802
3803/* The mapping between symbol names and symbols.  */
3804LT@&t@_DLSYM_CONST struct {
3805  const char *name;
3806  void       *address;
3807}
3808lt__PROGRAM__LTX_preloaded_symbols[[]] =
3809{
3810  { "@PROGRAM@", (void *) 0 },
3811_LT_EOF
3812	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
3813	  cat <<\_LT_EOF >> conftest.$ac_ext
3814  {0, (void *) 0}
3815};
3816
3817/* This works around a problem in FreeBSD linker */
3818#ifdef FREEBSD_WORKAROUND
3819static const void *lt_preloaded_setup() {
3820  return lt__PROGRAM__LTX_preloaded_symbols;
3821}
3822#endif
3823
3824#ifdef __cplusplus
3825}
3826#endif
3827_LT_EOF
3828	  # Now try linking the two files.
3829	  mv conftest.$ac_objext conftstm.$ac_objext
3830	  lt_globsym_save_LIBS=$LIBS
3831	  lt_globsym_save_CFLAGS=$CFLAGS
3832	  LIBS="conftstm.$ac_objext"
3833	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
3834	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
3835	    pipe_works=yes
3836	  fi
3837	  LIBS=$lt_globsym_save_LIBS
3838	  CFLAGS=$lt_globsym_save_CFLAGS
3839	else
3840	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
3841	fi
3842      else
3843	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
3844      fi
3845    else
3846      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
3847    fi
3848  else
3849    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
3850    cat conftest.$ac_ext >&5
3851  fi
3852  rm -rf conftest* conftst*
3853
3854  # Do not use the global_symbol_pipe unless it works.
3855  if test "$pipe_works" = yes; then
3856    break
3857  else
3858    lt_cv_sys_global_symbol_pipe=
3859  fi
3860done
3861])
3862if test -z "$lt_cv_sys_global_symbol_pipe"; then
3863  lt_cv_sys_global_symbol_to_cdecl=
3864fi
3865if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
3866  AC_MSG_RESULT(failed)
3867else
3868  AC_MSG_RESULT(ok)
3869fi
3870
3871# Response file support.
3872if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3873  nm_file_list_spec='@'
3874elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
3875  nm_file_list_spec='@'
3876fi
3877
3878_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
3879    [Take the output of nm and produce a listing of raw symbols and C names])
3880_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
3881    [Transform the output of nm in a proper C declaration])
3882_LT_DECL([global_symbol_to_c_name_address],
3883    [lt_cv_sys_global_symbol_to_c_name_address], [1],
3884    [Transform the output of nm in a C name address pair])
3885_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
3886    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
3887    [Transform the output of nm in a C name address pair when lib prefix is needed])
3888_LT_DECL([], [nm_file_list_spec], [1],
3889    [Specify filename containing input files for $NM])
3890]) # _LT_CMD_GLOBAL_SYMBOLS
3891
3892
3893# _LT_COMPILER_PIC([TAGNAME])
3894# ---------------------------
3895m4_defun([_LT_COMPILER_PIC],
3896[m4_require([_LT_TAG_COMPILER])dnl
3897_LT_TAGVAR(lt_prog_compiler_wl, $1)=
3898_LT_TAGVAR(lt_prog_compiler_pic, $1)=
3899_LT_TAGVAR(lt_prog_compiler_static, $1)=
3900
3901m4_if([$1], [CXX], [
3902  # C++ specific cases for pic, static, wl, etc.
3903  if test "$GXX" = yes; then
3904    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3905    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3906
3907    case $host_os in
3908    aix*)
3909      # All AIX code is PIC.
3910      if test "$host_cpu" = ia64; then
3911	# AIX 5 now supports IA64 processor
3912	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3913      fi
3914      ;;
3915
3916    amigaos*)
3917      case $host_cpu in
3918      powerpc)
3919            # see comment about AmigaOS4 .so support
3920            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3921        ;;
3922      m68k)
3923            # FIXME: we need at least 68020 code to build shared libraries, but
3924            # adding the `-m68020' flag to GCC prevents building anything better,
3925            # like `-m68040'.
3926            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3927        ;;
3928      esac
3929      ;;
3930
3931    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3932      # PIC is the default for these OSes.
3933      ;;
3934    mingw* | cygwin* | os2* | pw32* | cegcc*)
3935      # This hack is so that the source file can tell whether it is being
3936      # built for inclusion in a dll (and should export symbols for example).
3937      # Although the cygwin gcc ignores -fPIC, still need this for old-style
3938      # (--disable-auto-import) libraries
3939      m4_if([$1], [GCJ], [],
3940	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3941      ;;
3942    darwin* | rhapsody*)
3943      # PIC is the default on this platform
3944      # Common symbols not allowed in MH_DYLIB files
3945      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3946      ;;
3947    *djgpp*)
3948      # DJGPP does not support shared libraries at all
3949      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3950      ;;
3951    haiku*)
3952      # PIC is the default for Haiku.
3953      # The "-static" flag exists, but is broken.
3954      _LT_TAGVAR(lt_prog_compiler_static, $1)=
3955      ;;
3956    interix[[3-9]]*)
3957      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3958      # Instead, we relocate shared libraries at runtime.
3959      ;;
3960    sysv4*MP*)
3961      if test -d /usr/nec; then
3962	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3963      fi
3964      ;;
3965    hpux*)
3966      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3967      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
3968      # sets the default TLS model and affects inlining.
3969      case $host_cpu in
3970      hppa*64*)
3971	;;
3972      *)
3973	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3974	;;
3975      esac
3976      ;;
3977    *qnx* | *nto*)
3978      # QNX uses GNU C++, but need to define -shared option too, otherwise
3979      # it will coredump.
3980      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3981      ;;
3982    *)
3983      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3984      ;;
3985    esac
3986  else
3987    case $host_os in
3988      aix[[4-9]]*)
3989	# All AIX code is PIC.
3990	if test "$host_cpu" = ia64; then
3991	  # AIX 5 now supports IA64 processor
3992	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3993	else
3994	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3995	fi
3996	;;
3997      chorus*)
3998	case $cc_basename in
3999	cxch68*)
4000	  # Green Hills C++ Compiler
4001	  # _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"
4002	  ;;
4003	esac
4004	;;
4005      mingw* | cygwin* | os2* | pw32* | cegcc*)
4006	# This hack is so that the source file can tell whether it is being
4007	# built for inclusion in a dll (and should export symbols for example).
4008	m4_if([$1], [GCJ], [],
4009	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4010	;;
4011      dgux*)
4012	case $cc_basename in
4013	  ec++*)
4014	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4015	    ;;
4016	  ghcx*)
4017	    # Green Hills C++ Compiler
4018	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4019	    ;;
4020	  *)
4021	    ;;
4022	esac
4023	;;
4024      freebsd* | dragonfly*)
4025	# FreeBSD uses GNU C++
4026	;;
4027      hpux9* | hpux10* | hpux11*)
4028	case $cc_basename in
4029	  CC*)
4030	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4031	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4032	    if test "$host_cpu" != ia64; then
4033	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4034	    fi
4035	    ;;
4036	  aCC*)
4037	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4038	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4039	    case $host_cpu in
4040	    hppa*64*|ia64*)
4041	      # +Z the default
4042	      ;;
4043	    *)
4044	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4045	      ;;
4046	    esac
4047	    ;;
4048	  *)
4049	    ;;
4050	esac
4051	;;
4052      interix*)
4053	# This is c89, which is MS Visual C++ (no shared libs)
4054	# Anyone wants to do a port?
4055	;;
4056      irix5* | irix6* | nonstopux*)
4057	case $cc_basename in
4058	  CC*)
4059	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4060	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4061	    # CC pic flag -KPIC is the default.
4062	    ;;
4063	  *)
4064	    ;;
4065	esac
4066	;;
4067      linux* | k*bsd*-gnu | kopensolaris*-gnu)
4068	case $cc_basename in
4069	  KCC*)
4070	    # KAI C++ Compiler
4071	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4072	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4073	    ;;
4074	  ecpc* )
4075	    # old Intel C++ for x86_64 which still supported -KPIC.
4076	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4077	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4078	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4079	    ;;
4080	  icpc* )
4081	    # Intel C++, used to be incompatible with GCC.
4082	    # ICC 10 doesn't accept -KPIC any more.
4083	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4084	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4085	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4086	    ;;
4087	  pgCC* | pgcpp*)
4088	    # Portland Group C++ compiler
4089	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4090	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4091	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4092	    ;;
4093	  cxx*)
4094	    # Compaq C++
4095	    # Make sure the PIC flag is empty.  It appears that all Alpha
4096	    # Linux and Compaq Tru64 Unix objects are PIC.
4097	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4098	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4099	    ;;
4100	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
4101	    # IBM XL 8.0, 9.0 on PPC and BlueGene
4102	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4103	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4104	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4105	    ;;
4106	  *)
4107	    case `$CC -V 2>&1 | sed 5q` in
4108	    *Sun\ C*)
4109	      # Sun C++ 5.9
4110	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4111	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4112	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4113	      ;;
4114	    esac
4115	    ;;
4116	esac
4117	;;
4118      lynxos*)
4119	;;
4120      m88k*)
4121	;;
4122      mvs*)
4123	case $cc_basename in
4124	  cxx*)
4125	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
4126	    ;;
4127	  *)
4128	    ;;
4129	esac
4130	;;
4131      netbsd*)
4132	;;
4133      *qnx* | *nto*)
4134        # QNX uses GNU C++, but need to define -shared option too, otherwise
4135        # it will coredump.
4136        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4137        ;;
4138      osf3* | osf4* | osf5*)
4139	case $cc_basename in
4140	  KCC*)
4141	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4142	    ;;
4143	  RCC*)
4144	    # Rational C++ 2.4.1
4145	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4146	    ;;
4147	  cxx*)
4148	    # Digital/Compaq C++
4149	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4150	    # Make sure the PIC flag is empty.  It appears that all Alpha
4151	    # Linux and Compaq Tru64 Unix objects are PIC.
4152	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4153	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4154	    ;;
4155	  *)
4156	    ;;
4157	esac
4158	;;
4159      psos*)
4160	;;
4161      solaris*)
4162	case $cc_basename in
4163	  CC* | sunCC*)
4164	    # Sun C++ 4.2, 5.x and Centerline C++
4165	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4166	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4167	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4168	    ;;
4169	  gcx*)
4170	    # Green Hills C++ Compiler
4171	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4172	    ;;
4173	  *)
4174	    ;;
4175	esac
4176	;;
4177      sunos4*)
4178	case $cc_basename in
4179	  CC*)
4180	    # Sun C++ 4.x
4181	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4182	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4183	    ;;
4184	  lcc*)
4185	    # Lucid
4186	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4187	    ;;
4188	  *)
4189	    ;;
4190	esac
4191	;;
4192      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4193	case $cc_basename in
4194	  CC*)
4195	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4196	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4197	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4198	    ;;
4199	esac
4200	;;
4201      tandem*)
4202	case $cc_basename in
4203	  NCC*)
4204	    # NonStop-UX NCC 3.20
4205	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4206	    ;;
4207	  *)
4208	    ;;
4209	esac
4210	;;
4211      vxworks*)
4212	;;
4213      *)
4214	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4215	;;
4216    esac
4217  fi
4218],
4219[
4220  if test "$GCC" = yes; then
4221    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4222    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4223
4224    case $host_os in
4225      aix*)
4226      # All AIX code is PIC.
4227      if test "$host_cpu" = ia64; then
4228	# AIX 5 now supports IA64 processor
4229	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4230      fi
4231      ;;
4232
4233    amigaos*)
4234      case $host_cpu in
4235      powerpc)
4236            # see comment about AmigaOS4 .so support
4237            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4238        ;;
4239      m68k)
4240            # FIXME: we need at least 68020 code to build shared libraries, but
4241            # adding the `-m68020' flag to GCC prevents building anything better,
4242            # like `-m68040'.
4243            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4244        ;;
4245      esac
4246      ;;
4247
4248    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4249      # PIC is the default for these OSes.
4250      ;;
4251
4252    mingw* | cygwin* | pw32* | os2* | cegcc*)
4253      # This hack is so that the source file can tell whether it is being
4254      # built for inclusion in a dll (and should export symbols for example).
4255      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4256      # (--disable-auto-import) libraries
4257      m4_if([$1], [GCJ], [],
4258	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4259      ;;
4260
4261    darwin* | rhapsody*)
4262      # PIC is the default on this platform
4263      # Common symbols not allowed in MH_DYLIB files
4264      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4265      ;;
4266
4267    haiku*)
4268      # PIC is the default for Haiku.
4269      # The "-static" flag exists, but is broken.
4270      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4271      ;;
4272
4273    hpux*)
4274      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4275      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4276      # sets the default TLS model and affects inlining.
4277      case $host_cpu in
4278      hppa*64*)
4279	# +Z the default
4280	;;
4281      *)
4282	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4283	;;
4284      esac
4285      ;;
4286
4287    interix[[3-9]]*)
4288      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4289      # Instead, we relocate shared libraries at runtime.
4290      ;;
4291
4292    msdosdjgpp*)
4293      # Just because we use GCC doesn't mean we suddenly get shared libraries
4294      # on systems that don't support them.
4295      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4296      enable_shared=no
4297      ;;
4298
4299    *nto* | *qnx*)
4300      # QNX uses GNU C++, but need to define -shared option too, otherwise
4301      # it will coredump.
4302      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4303      ;;
4304
4305    sysv4*MP*)
4306      if test -d /usr/nec; then
4307	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4308      fi
4309      ;;
4310
4311    *)
4312      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4313      ;;
4314    esac
4315
4316    case $cc_basename in
4317    nvcc*) # Cuda Compiler Driver 2.2
4318      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
4319      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4320        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
4321      fi
4322      ;;
4323    esac
4324  else
4325    # PORTME Check for flag to pass linker flags through the system compiler.
4326    case $host_os in
4327    aix*)
4328      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4329      if test "$host_cpu" = ia64; then
4330	# AIX 5 now supports IA64 processor
4331	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4332      else
4333	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4334      fi
4335      ;;
4336
4337    mingw* | cygwin* | pw32* | os2* | cegcc*)
4338      # This hack is so that the source file can tell whether it is being
4339      # built for inclusion in a dll (and should export symbols for example).
4340      m4_if([$1], [GCJ], [],
4341	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4342      ;;
4343
4344    hpux9* | hpux10* | hpux11*)
4345      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4346      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
4347      # not for PA HP-UX.
4348      case $host_cpu in
4349      hppa*64*|ia64*)
4350	# +Z the default
4351	;;
4352      *)
4353	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4354	;;
4355      esac
4356      # Is there a better lt_prog_compiler_static that works with the bundled CC?
4357      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4358      ;;
4359
4360    irix5* | irix6* | nonstopux*)
4361      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4362      # PIC (with -KPIC) is the default.
4363      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4364      ;;
4365
4366    linux* | k*bsd*-gnu | kopensolaris*-gnu)
4367      case $cc_basename in
4368      # old Intel for x86_64 which still supported -KPIC.
4369      ecc*)
4370	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4371	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4372	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4373        ;;
4374      # icc used to be incompatible with GCC.
4375      # ICC 10 doesn't accept -KPIC any more.
4376      icc* | ifort*)
4377	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4378	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4379	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4380        ;;
4381      # Lahey Fortran 8.1.
4382      lf95*)
4383	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4384	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4385	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4386	;;
4387      nagfor*)
4388	# NAG Fortran compiler
4389	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4390	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4391	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4392	;;
4393      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
4394        # Portland Group compilers (*not* the Pentium gcc compiler,
4395	# which looks to be a dead project)
4396	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4397	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4398	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4399        ;;
4400      ccc*)
4401        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4402        # All Alpha code is PIC.
4403        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4404        ;;
4405      xl* | bgxl* | bgf* | mpixl*)
4406	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
4407	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4408	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4409	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4410	;;
4411      *)
4412	case `$CC -V 2>&1 | sed 5q` in
4413	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
4414	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
4415	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4416	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4417	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4418	  ;;
4419	*Sun\ F* | *Sun*Fortran*)
4420	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4421	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4422	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4423	  ;;
4424	*Sun\ C*)
4425	  # Sun C 5.9
4426	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4427	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4428	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4429	  ;;
4430        *Intel*\ [[CF]]*Compiler*)
4431	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4432	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4433	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4434	  ;;
4435	*Portland\ Group*)
4436	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4437	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4438	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4439	  ;;
4440	esac
4441	;;
4442      esac
4443      ;;
4444
4445    newsos6)
4446      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4447      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4448      ;;
4449
4450    *nto* | *qnx*)
4451      # QNX uses GNU C++, but need to define -shared option too, otherwise
4452      # it will coredump.
4453      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4454      ;;
4455
4456    osf3* | osf4* | osf5*)
4457      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4458      # All OSF/1 code is PIC.
4459      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4460      ;;
4461
4462    rdos*)
4463      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4464      ;;
4465
4466    solaris*)
4467      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4468      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4469      case $cc_basename in
4470      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
4471	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4472      *)
4473	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4474      esac
4475      ;;
4476
4477    sunos4*)
4478      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4479      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4480      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4481      ;;
4482
4483    sysv4 | sysv4.2uw2* | sysv4.3*)
4484      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4485      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4486      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4487      ;;
4488
4489    sysv4*MP*)
4490      if test -d /usr/nec ;then
4491	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4492	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4493      fi
4494      ;;
4495
4496    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4497      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4498      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4499      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4500      ;;
4501
4502    unicos*)
4503      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4504      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4505      ;;
4506
4507    uts4*)
4508      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4509      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4510      ;;
4511
4512    *)
4513      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4514      ;;
4515    esac
4516  fi
4517])
4518case $host_os in
4519  # For platforms which do not support PIC, -DPIC is meaningless:
4520  *djgpp*)
4521    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4522    ;;
4523  *)
4524    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4525    ;;
4526esac
4527
4528AC_CACHE_CHECK([for $compiler option to produce PIC],
4529  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
4530  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4531_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
4532
4533#
4534# Check to make sure the PIC flag actually works.
4535#
4536if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4537  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4538    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4539    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4540    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4541     "" | " "*) ;;
4542     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4543     esac],
4544    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4545     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4546fi
4547_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4548	[Additional compiler flags for building library objects])
4549
4550_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4551	[How to pass a linker flag through the compiler])
4552#
4553# Check to make sure the static flag actually works.
4554#
4555wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4556_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4557  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4558  $lt_tmp_static_flag,
4559  [],
4560  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4561_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4562	[Compiler flag to prevent dynamic linking])
4563])# _LT_COMPILER_PIC
4564
4565
4566# _LT_LINKER_SHLIBS([TAGNAME])
4567# ----------------------------
4568# See if the linker supports building shared libraries.
4569m4_defun([_LT_LINKER_SHLIBS],
4570[AC_REQUIRE([LT_PATH_LD])dnl
4571AC_REQUIRE([LT_PATH_NM])dnl
4572m4_require([_LT_PATH_MANIFEST_TOOL])dnl
4573m4_require([_LT_FILEUTILS_DEFAULTS])dnl
4574m4_require([_LT_DECL_EGREP])dnl
4575m4_require([_LT_DECL_SED])dnl
4576m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4577m4_require([_LT_TAG_COMPILER])dnl
4578AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4579m4_if([$1], [CXX], [
4580  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4581  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4582  case $host_os in
4583  aix[[4-9]]*)
4584    # If we're using GNU nm, then we don't want the "-C" option.
4585    # -C means demangle to AIX nm, but means don't demangle with GNU nm
4586    # Also, AIX nm treats weak defined symbols like other global defined
4587    # symbols, whereas GNU nm marks them as "W".
4588    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4589      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4590    else
4591      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4592    fi
4593    ;;
4594  pw32*)
4595    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
4596    ;;
4597  cygwin* | mingw* | cegcc*)
4598    case $cc_basename in
4599    cl*)
4600      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
4601      ;;
4602    *)
4603      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
4604      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4605      ;;
4606    esac
4607    ;;
4608  *)
4609    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4610    ;;
4611  esac
4612], [
4613  runpath_var=
4614  _LT_TAGVAR(allow_undefined_flag, $1)=
4615  _LT_TAGVAR(always_export_symbols, $1)=no
4616  _LT_TAGVAR(archive_cmds, $1)=
4617  _LT_TAGVAR(archive_expsym_cmds, $1)=
4618  _LT_TAGVAR(compiler_needs_object, $1)=no
4619  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4620  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4621  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4622  _LT_TAGVAR(hardcode_automatic, $1)=no
4623  _LT_TAGVAR(hardcode_direct, $1)=no
4624  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4625  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4626  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4627  _LT_TAGVAR(hardcode_minus_L, $1)=no
4628  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4629  _LT_TAGVAR(inherit_rpath, $1)=no
4630  _LT_TAGVAR(link_all_deplibs, $1)=unknown
4631  _LT_TAGVAR(module_cmds, $1)=
4632  _LT_TAGVAR(module_expsym_cmds, $1)=
4633  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4634  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4635  _LT_TAGVAR(thread_safe_flag_spec, $1)=
4636  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4637  # include_expsyms should be a list of space-separated symbols to be *always*
4638  # included in the symbol list
4639  _LT_TAGVAR(include_expsyms, $1)=
4640  # exclude_expsyms can be an extended regexp of symbols to exclude
4641  # it will be wrapped by ` (' and `)$', so one must not match beginning or
4642  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
4643  # as well as any symbol that contains `d'.
4644  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4645  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
4646  # platforms (ab)use it in PIC code, but their linkers get confused if
4647  # the symbol is explicitly referenced.  Since portable code cannot
4648  # rely on this symbol name, it's probably fine to never include it in
4649  # preloaded symbol tables.
4650  # Exclude shared library initialization/finalization symbols.
4651dnl Note also adjust exclude_expsyms for C++ above.
4652  extract_expsyms_cmds=
4653
4654  case $host_os in
4655  cygwin* | mingw* | pw32* | cegcc*)
4656    # FIXME: the MSVC++ port hasn't been tested in a loooong time
4657    # When not using gcc, we currently assume that we are using
4658    # Microsoft Visual C++.
4659    if test "$GCC" != yes; then
4660      with_gnu_ld=no
4661    fi
4662    ;;
4663  interix*)
4664    # we just hope/assume this is gcc and not c89 (= MSVC++)
4665    with_gnu_ld=yes
4666    ;;
4667  openbsd*)
4668    with_gnu_ld=no
4669    ;;
4670  esac
4671
4672  _LT_TAGVAR(ld_shlibs, $1)=yes
4673
4674  # On some targets, GNU ld is compatible enough with the native linker
4675  # that we're better off using the native interface for both.
4676  lt_use_gnu_ld_interface=no
4677  if test "$with_gnu_ld" = yes; then
4678    case $host_os in
4679      aix*)
4680	# The AIX port of GNU ld has always aspired to compatibility
4681	# with the native linker.  However, as the warning in the GNU ld
4682	# block says, versions before 2.19.5* couldn't really create working
4683	# shared libraries, regardless of the interface used.
4684	case `$LD -v 2>&1` in
4685	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
4686	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
4687	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
4688	  *)
4689	    lt_use_gnu_ld_interface=yes
4690	    ;;
4691	esac
4692	;;
4693      *)
4694	lt_use_gnu_ld_interface=yes
4695	;;
4696    esac
4697  fi
4698
4699  if test "$lt_use_gnu_ld_interface" = yes; then
4700    # If archive_cmds runs LD, not CC, wlarc should be empty
4701    wlarc='${wl}'
4702
4703    # Set some defaults for GNU ld with shared library support. These
4704    # are reset later if shared libraries are not supported. Putting them
4705    # here allows them to be overridden if necessary.
4706    runpath_var=LD_RUN_PATH
4707    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4708    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4709    # ancient GNU ld didn't support --whole-archive et. al.
4710    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
4711      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
4712    else
4713      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4714    fi
4715    supports_anon_versioning=no
4716    case `$LD -v 2>&1` in
4717      *GNU\ gold*) supports_anon_versioning=yes ;;
4718      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
4719      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
4720      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
4721      *\ 2.11.*) ;; # other 2.11 versions
4722      *) supports_anon_versioning=yes ;;
4723    esac
4724
4725    # See if GNU ld supports shared libraries.
4726    case $host_os in
4727    aix[[3-9]]*)
4728      # On AIX/PPC, the GNU linker is very broken
4729      if test "$host_cpu" != ia64; then
4730	_LT_TAGVAR(ld_shlibs, $1)=no
4731	cat <<_LT_EOF 1>&2
4732
4733*** Warning: the GNU linker, at least up to release 2.19, is reported
4734*** to be unable to reliably create shared libraries on AIX.
4735*** Therefore, libtool is disabling shared libraries support.  If you
4736*** really care for shared libraries, you may want to install binutils
4737*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
4738*** You will then need to restart the configuration process.
4739
4740_LT_EOF
4741      fi
4742      ;;
4743
4744    amigaos*)
4745      case $host_cpu in
4746      powerpc)
4747            # see comment about AmigaOS4 .so support
4748            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4749            _LT_TAGVAR(archive_expsym_cmds, $1)=''
4750        ;;
4751      m68k)
4752            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
4753            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4754            _LT_TAGVAR(hardcode_minus_L, $1)=yes
4755        ;;
4756      esac
4757      ;;
4758
4759    beos*)
4760      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4761	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4762	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
4763	# support --undefined.  This deserves some investigation.  FIXME
4764	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4765      else
4766	_LT_TAGVAR(ld_shlibs, $1)=no
4767      fi
4768      ;;
4769
4770    cygwin* | mingw* | pw32* | cegcc*)
4771      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
4772      # as there is no search path for DLLs.
4773      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4774      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
4775      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4776      _LT_TAGVAR(always_export_symbols, $1)=no
4777      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4778      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
4779      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4780
4781      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
4782        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4783	# If the export-symbols file already is a .def file (1st line
4784	# is EXPORTS), use it as is; otherwise, prepend...
4785	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
4786	  cp $export_symbols $output_objdir/$soname.def;
4787	else
4788	  echo EXPORTS > $output_objdir/$soname.def;
4789	  cat $export_symbols >> $output_objdir/$soname.def;
4790	fi~
4791	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4792      else
4793	_LT_TAGVAR(ld_shlibs, $1)=no
4794      fi
4795      ;;
4796
4797    haiku*)
4798      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4799      _LT_TAGVAR(link_all_deplibs, $1)=yes
4800      ;;
4801
4802    interix[[3-9]]*)
4803      _LT_TAGVAR(hardcode_direct, $1)=no
4804      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4805      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4806      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4807      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
4808      # Instead, shared libraries are loaded at an image base (0x10000000 by
4809      # default) and relocated if they conflict, which is a slow very memory
4810      # consuming and fragmenting process.  To avoid this, we pick a random,
4811      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
4812      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
4813      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
4814      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
4815      ;;
4816
4817    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
4818      tmp_diet=no
4819      if test "$host_os" = linux-dietlibc; then
4820	case $cc_basename in
4821	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
4822	esac
4823      fi
4824      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
4825	 && test "$tmp_diet" = no
4826      then
4827	tmp_addflag=' $pic_flag'
4828	tmp_sharedflag='-shared'
4829	case $cc_basename,$host_cpu in
4830        pgcc*)				# Portland Group C compiler
4831	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
4832	  tmp_addflag=' $pic_flag'
4833	  ;;
4834	pgf77* | pgf90* | pgf95* | pgfortran*)
4835					# Portland Group f77 and f90 compilers
4836	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
4837	  tmp_addflag=' $pic_flag -Mnomain' ;;
4838	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
4839	  tmp_addflag=' -i_dynamic' ;;
4840	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
4841	  tmp_addflag=' -i_dynamic -nofor_main' ;;
4842	ifc* | ifort*)			# Intel Fortran compiler
4843	  tmp_addflag=' -nofor_main' ;;
4844	lf95*)				# Lahey Fortran 8.1
4845	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4846	  tmp_sharedflag='--shared' ;;
4847	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
4848	  tmp_sharedflag='-qmkshrobj'
4849	  tmp_addflag= ;;
4850	nvcc*)	# Cuda Compiler Driver 2.2
4851	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
4852	  _LT_TAGVAR(compiler_needs_object, $1)=yes
4853	  ;;
4854	esac
4855	case `$CC -V 2>&1 | sed 5q` in
4856	*Sun\ C*)			# Sun C 5.9
4857	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
4858	  _LT_TAGVAR(compiler_needs_object, $1)=yes
4859	  tmp_sharedflag='-G' ;;
4860	*Sun\ F*)			# Sun Fortran 8.3
4861	  tmp_sharedflag='-G' ;;
4862	esac
4863	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4864
4865        if test "x$supports_anon_versioning" = xyes; then
4866          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4867	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4868	    echo "local: *; };" >> $output_objdir/$libname.ver~
4869	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
4870        fi
4871
4872	case $cc_basename in
4873	xlf* | bgf* | bgxlf* | mpixlf*)
4874	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
4875	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
4876	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4877	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
4878	  if test "x$supports_anon_versioning" = xyes; then
4879	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4880	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4881	      echo "local: *; };" >> $output_objdir/$libname.ver~
4882	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
4883	  fi
4884	  ;;
4885	esac
4886      else
4887        _LT_TAGVAR(ld_shlibs, $1)=no
4888      fi
4889      ;;
4890
4891    netbsd*)
4892      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4893	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
4894	wlarc=
4895      else
4896	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4897	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4898      fi
4899      ;;
4900
4901    solaris*)
4902      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
4903	_LT_TAGVAR(ld_shlibs, $1)=no
4904	cat <<_LT_EOF 1>&2
4905
4906*** Warning: The releases 2.8.* of the GNU linker cannot reliably
4907*** create shared libraries on Solaris systems.  Therefore, libtool
4908*** is disabling shared libraries support.  We urge you to upgrade GNU
4909*** binutils to release 2.9.1 or newer.  Another option is to modify
4910*** your PATH or compiler configuration so that the native linker is
4911*** used, and then restart.
4912
4913_LT_EOF
4914      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4915	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4916	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4917      else
4918	_LT_TAGVAR(ld_shlibs, $1)=no
4919      fi
4920      ;;
4921
4922    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
4923      case `$LD -v 2>&1` in
4924        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
4925	_LT_TAGVAR(ld_shlibs, $1)=no
4926	cat <<_LT_EOF 1>&2
4927
4928*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
4929*** reliably create shared libraries on SCO systems.  Therefore, libtool
4930*** is disabling shared libraries support.  We urge you to upgrade GNU
4931*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
4932*** your PATH or compiler configuration so that the native linker is
4933*** used, and then restart.
4934
4935_LT_EOF
4936	;;
4937	*)
4938	  # For security reasons, it is highly recommended that you always
4939	  # use absolute paths for naming shared libraries, and exclude the
4940	  # DT_RUNPATH tag from executables and libraries.  But doing so
4941	  # requires that you compile everything twice, which is a pain.
4942	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4943	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4944	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4945	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4946	  else
4947	    _LT_TAGVAR(ld_shlibs, $1)=no
4948	  fi
4949	;;
4950      esac
4951      ;;
4952
4953    sunos4*)
4954      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4955      wlarc=
4956      _LT_TAGVAR(hardcode_direct, $1)=yes
4957      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4958      ;;
4959
4960    *)
4961      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4962	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4963	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4964      else
4965	_LT_TAGVAR(ld_shlibs, $1)=no
4966      fi
4967      ;;
4968    esac
4969
4970    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
4971      runpath_var=
4972      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4973      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4974      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4975    fi
4976  else
4977    # PORTME fill in a description of your system's linker (not GNU ld)
4978    case $host_os in
4979    aix3*)
4980      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4981      _LT_TAGVAR(always_export_symbols, $1)=yes
4982      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
4983      # Note: this linker hardcodes the directories in LIBPATH if there
4984      # are no directories specified by -L.
4985      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4986      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
4987	# Neither direct hardcoding nor static linking is supported with a
4988	# broken collect2.
4989	_LT_TAGVAR(hardcode_direct, $1)=unsupported
4990      fi
4991      ;;
4992
4993    aix[[4-9]]*)
4994      if test "$host_cpu" = ia64; then
4995	# On IA64, the linker does run time linking by default, so we don't
4996	# have to do anything special.
4997	aix_use_runtimelinking=no
4998	exp_sym_flag='-Bexport'
4999	no_entry_flag=""
5000      else
5001	# If we're using GNU nm, then we don't want the "-C" option.
5002	# -C means demangle to AIX nm, but means don't demangle with GNU nm
5003	# Also, AIX nm treats weak defined symbols like other global
5004	# defined symbols, whereas GNU nm marks them as "W".
5005	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5006	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
5007	else
5008	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
5009	fi
5010	aix_use_runtimelinking=no
5011
5012	# Test if we are trying to use run time linking or normal
5013	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
5014	# need to do runtime linking.
5015	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5016	  for ld_flag in $LDFLAGS; do
5017	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
5018	    aix_use_runtimelinking=yes
5019	    break
5020	  fi
5021	  done
5022	  ;;
5023	esac
5024
5025	exp_sym_flag='-bexport'
5026	no_entry_flag='-bnoentry'
5027      fi
5028
5029      # When large executables or shared objects are built, AIX ld can
5030      # have problems creating the table of contents.  If linking a library
5031      # or program results in "error TOC overflow" add -mminimal-toc to
5032      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5033      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5034
5035      _LT_TAGVAR(archive_cmds, $1)=''
5036      _LT_TAGVAR(hardcode_direct, $1)=yes
5037      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5038      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5039      _LT_TAGVAR(link_all_deplibs, $1)=yes
5040      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
5041
5042      if test "$GCC" = yes; then
5043	case $host_os in aix4.[[012]]|aix4.[[012]].*)
5044	# We only want to do this on AIX 4.2 and lower, the check
5045	# below for broken collect2 doesn't work under 4.3+
5046	  collect2name=`${CC} -print-prog-name=collect2`
5047	  if test -f "$collect2name" &&
5048	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5049	  then
5050	  # We have reworked collect2
5051	  :
5052	  else
5053	  # We have old collect2
5054	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
5055	  # It fails to find uninstalled libraries when the uninstalled
5056	  # path is not listed in the libpath.  Setting hardcode_minus_L
5057	  # to unsupported forces relinking
5058	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5059	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5060	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5061	  fi
5062	  ;;
5063	esac
5064	shared_flag='-shared'
5065	if test "$aix_use_runtimelinking" = yes; then
5066	  shared_flag="$shared_flag "'${wl}-G'
5067	fi
5068      else
5069	# not using gcc
5070	if test "$host_cpu" = ia64; then
5071	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5072	# chokes on -Wl,-G. The following line is correct:
5073	  shared_flag='-G'
5074	else
5075	  if test "$aix_use_runtimelinking" = yes; then
5076	    shared_flag='${wl}-G'
5077	  else
5078	    shared_flag='${wl}-bM:SRE'
5079	  fi
5080	fi
5081      fi
5082
5083      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
5084      # It seems that -bexpall does not export symbols beginning with
5085      # underscore (_), so it is better to generate a list of symbols to export.
5086      _LT_TAGVAR(always_export_symbols, $1)=yes
5087      if test "$aix_use_runtimelinking" = yes; then
5088	# Warning - without using the other runtime loading flags (-brtl),
5089	# -berok will link without error, but may produce a broken library.
5090	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5091        # Determine the default libpath from the value encoded in an
5092        # empty executable.
5093        _LT_SYS_MODULE_PATH_AIX([$1])
5094        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5095        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
5096      else
5097	if test "$host_cpu" = ia64; then
5098	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5099	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5100	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
5101	else
5102	 # Determine the default libpath from the value encoded in an
5103	 # empty executable.
5104	 _LT_SYS_MODULE_PATH_AIX([$1])
5105	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5106	  # Warning - without using the other run time loading flags,
5107	  # -berok will link without error, but may produce a broken library.
5108	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5109	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
5110	  if test "$with_gnu_ld" = yes; then
5111	    # We only use this code for GNU lds that support --whole-archive.
5112	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
5113	  else
5114	    # Exported symbols can be pulled into shared objects from archives
5115	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5116	  fi
5117	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5118	  # This is similar to how AIX traditionally builds its shared libraries.
5119	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
5120	fi
5121      fi
5122      ;;
5123
5124    amigaos*)
5125      case $host_cpu in
5126      powerpc)
5127            # see comment about AmigaOS4 .so support
5128            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5129            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5130        ;;
5131      m68k)
5132            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
5133            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5134            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5135        ;;
5136      esac
5137      ;;
5138
5139    bsdi[[45]]*)
5140      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
5141      ;;
5142
5143    cygwin* | mingw* | pw32* | cegcc*)
5144      # When not using gcc, we currently assume that we are using
5145      # Microsoft Visual C++.
5146      # hardcode_libdir_flag_spec is actually meaningless, as there is
5147      # no search path for DLLs.
5148      case $cc_basename in
5149      cl*)
5150	# Native MSVC
5151	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5152	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5153	_LT_TAGVAR(always_export_symbols, $1)=yes
5154	_LT_TAGVAR(file_list_spec, $1)='@'
5155	# Tell ltmain to make .lib files, not .a files.
5156	libext=lib
5157	# Tell ltmain to make .dll files, not .so files.
5158	shrext_cmds=".dll"
5159	# FIXME: Setting linknames here is a bad hack.
5160	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
5161	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5162	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
5163	  else
5164	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
5165	  fi~
5166	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5167	  linknames='
5168	# The linker will not automatically build a static lib if we build a DLL.
5169	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5170	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5171	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5172	_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
5173	# Don't use ranlib
5174	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
5175	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5176	  lt_tool_outputfile="@TOOL_OUTPUT@"~
5177	  case $lt_outputfile in
5178	    *.exe|*.EXE) ;;
5179	    *)
5180	      lt_outputfile="$lt_outputfile.exe"
5181	      lt_tool_outputfile="$lt_tool_outputfile.exe"
5182	      ;;
5183	  esac~
5184	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
5185	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5186	    $RM "$lt_outputfile.manifest";
5187	  fi'
5188	;;
5189      *)
5190	# Assume MSVC wrapper
5191	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5192	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5193	# Tell ltmain to make .lib files, not .a files.
5194	libext=lib
5195	# Tell ltmain to make .dll files, not .so files.
5196	shrext_cmds=".dll"
5197	# FIXME: Setting linknames here is a bad hack.
5198	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
5199	# The linker will automatically build a .lib file if we build a DLL.
5200	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5201	# FIXME: Should let the user specify the lib program.
5202	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
5203	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5204	;;
5205      esac
5206      ;;
5207
5208    darwin* | rhapsody*)
5209      _LT_DARWIN_LINKER_FEATURES($1)
5210      ;;
5211
5212    dgux*)
5213      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5214      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5215      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5216      ;;
5217
5218    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5219    # support.  Future versions do this automatically, but an explicit c++rt0.o
5220    # does not break anything, and helps significantly (at the cost of a little
5221    # extra space).
5222    freebsd2.2*)
5223      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5224      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5225      _LT_TAGVAR(hardcode_direct, $1)=yes
5226      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5227      ;;
5228
5229    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5230    freebsd2.*)
5231      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5232      _LT_TAGVAR(hardcode_direct, $1)=yes
5233      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5234      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5235      ;;
5236
5237    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5238    freebsd* | dragonfly*)
5239      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5240      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5241      _LT_TAGVAR(hardcode_direct, $1)=yes
5242      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5243      ;;
5244
5245    hpux9*)
5246      if test "$GCC" = yes; then
5247	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5248      else
5249	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5250      fi
5251      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5252      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5253      _LT_TAGVAR(hardcode_direct, $1)=yes
5254
5255      # hardcode_minus_L: Not really in the search PATH,
5256      # but as the default location of the library.
5257      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5258      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5259      ;;
5260
5261    hpux10*)
5262      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
5263	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5264      else
5265	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
5266      fi
5267      if test "$with_gnu_ld" = no; then
5268	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5269	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5270	_LT_TAGVAR(hardcode_direct, $1)=yes
5271	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5272	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5273	# hardcode_minus_L: Not really in the search PATH,
5274	# but as the default location of the library.
5275	_LT_TAGVAR(hardcode_minus_L, $1)=yes
5276      fi
5277      ;;
5278
5279    hpux11*)
5280      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
5281	case $host_cpu in
5282	hppa*64*)
5283	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5284	  ;;
5285	ia64*)
5286	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5287	  ;;
5288	*)
5289	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5290	  ;;
5291	esac
5292      else
5293	case $host_cpu in
5294	hppa*64*)
5295	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5296	  ;;
5297	ia64*)
5298	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5299	  ;;
5300	*)
5301	m4_if($1, [], [
5302	  # Older versions of the 11.00 compiler do not understand -b yet
5303	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
5304	  _LT_LINKER_OPTION([if $CC understands -b],
5305	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
5306	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
5307	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
5308	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
5309	  ;;
5310	esac
5311      fi
5312      if test "$with_gnu_ld" = no; then
5313	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5314	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5315
5316	case $host_cpu in
5317	hppa*64*|ia64*)
5318	  _LT_TAGVAR(hardcode_direct, $1)=no
5319	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5320	  ;;
5321	*)
5322	  _LT_TAGVAR(hardcode_direct, $1)=yes
5323	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5324	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5325
5326	  # hardcode_minus_L: Not really in the search PATH,
5327	  # but as the default location of the library.
5328	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5329	  ;;
5330	esac
5331      fi
5332      ;;
5333
5334    irix5* | irix6* | nonstopux*)
5335      if test "$GCC" = yes; then
5336	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5337	# Try to use the -exported_symbol ld option, if it does not
5338	# work, assume that -exports_file does not work either and
5339	# implicitly export all symbols.
5340	# This should be the same for all languages, so no per-tag cache variable.
5341	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
5342	  [lt_cv_irix_exported_symbol],
5343	  [save_LDFLAGS="$LDFLAGS"
5344	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
5345	   AC_LINK_IFELSE(
5346	     [AC_LANG_SOURCE(
5347	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
5348			      [C++], [[int foo (void) { return 0; }]],
5349			      [Fortran 77], [[
5350      subroutine foo
5351      end]],
5352			      [Fortran], [[
5353      subroutine foo
5354      end]])])],
5355	      [lt_cv_irix_exported_symbol=yes],
5356	      [lt_cv_irix_exported_symbol=no])
5357           LDFLAGS="$save_LDFLAGS"])
5358	if test "$lt_cv_irix_exported_symbol" = yes; then
5359          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
5360	fi
5361      else
5362	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
5363	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
5364      fi
5365      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5366      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5367      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5368      _LT_TAGVAR(inherit_rpath, $1)=yes
5369      _LT_TAGVAR(link_all_deplibs, $1)=yes
5370      ;;
5371
5372    netbsd*)
5373      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5374	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5375      else
5376	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5377      fi
5378      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5379      _LT_TAGVAR(hardcode_direct, $1)=yes
5380      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5381      ;;
5382
5383    newsos6)
5384      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5385      _LT_TAGVAR(hardcode_direct, $1)=yes
5386      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5387      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5388      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5389      ;;
5390
5391    *nto* | *qnx*)
5392      ;;
5393
5394    openbsd*)
5395      if test -f /usr/libexec/ld.so; then
5396	_LT_TAGVAR(hardcode_direct, $1)=yes
5397	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5398	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5399	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5400	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5401	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
5402	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5403	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5404	else
5405	  case $host_os in
5406	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
5407	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5408	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5409	     ;;
5410	   *)
5411	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5412	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5413	     ;;
5414	  esac
5415	fi
5416      else
5417	_LT_TAGVAR(ld_shlibs, $1)=no
5418      fi
5419      ;;
5420
5421    os2*)
5422      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5423      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5424      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5425      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
5426      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
5427      ;;
5428
5429    osf3*)
5430      if test "$GCC" = yes; then
5431	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5432	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5433      else
5434	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5435	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
5436      fi
5437      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5438      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5439      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5440      ;;
5441
5442    osf4* | osf5*)	# as osf3* with the addition of -msym flag
5443      if test "$GCC" = yes; then
5444	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5445	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5446	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5447      else
5448	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5449	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
5450	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
5451	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
5452
5453	# Both c and cxx compiler support -rpath directly
5454	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5455      fi
5456      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5457      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5458      ;;
5459
5460    solaris*)
5461      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
5462      if test "$GCC" = yes; then
5463	wlarc='${wl}'
5464	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5465	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5466	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5467      else
5468	case `$CC -V 2>&1` in
5469	*"Compilers 5.0"*)
5470	  wlarc=''
5471	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
5472	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5473	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
5474	  ;;
5475	*)
5476	  wlarc='${wl}'
5477	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
5478	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5479	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5480	  ;;
5481	esac
5482      fi
5483      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5484      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5485      case $host_os in
5486      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
5487      *)
5488	# The compiler driver will combine and reorder linker options,
5489	# but understands `-z linker_flag'.  GCC discards it without `$wl',
5490	# but is careful enough not to reorder.
5491	# Supported since Solaris 2.6 (maybe 2.5.1?)
5492	if test "$GCC" = yes; then
5493	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
5494	else
5495	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
5496	fi
5497	;;
5498      esac
5499      _LT_TAGVAR(link_all_deplibs, $1)=yes
5500      ;;
5501
5502    sunos4*)
5503      if test "x$host_vendor" = xsequent; then
5504	# Use $CC to link under sequent, because it throws in some extra .o
5505	# files that make .init and .fini sections work.
5506	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5507      else
5508	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5509      fi
5510      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5511      _LT_TAGVAR(hardcode_direct, $1)=yes
5512      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5513      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5514      ;;
5515
5516    sysv4)
5517      case $host_vendor in
5518	sni)
5519	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5520	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5521	;;
5522	siemens)
5523	  ## LD is ld it makes a PLAMLIB
5524	  ## CC just makes a GrossModule.
5525	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5526	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5527	  _LT_TAGVAR(hardcode_direct, $1)=no
5528        ;;
5529	motorola)
5530	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5531	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5532	;;
5533      esac
5534      runpath_var='LD_RUN_PATH'
5535      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5536      ;;
5537
5538    sysv4.3*)
5539      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5540      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5541      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
5542      ;;
5543
5544    sysv4*MP*)
5545      if test -d /usr/nec; then
5546	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5547	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5548	runpath_var=LD_RUN_PATH
5549	hardcode_runpath_var=yes
5550	_LT_TAGVAR(ld_shlibs, $1)=yes
5551      fi
5552      ;;
5553
5554    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
5555      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5556      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5557      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5558      runpath_var='LD_RUN_PATH'
5559
5560      if test "$GCC" = yes; then
5561	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5562	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5563      else
5564	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5565	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5566      fi
5567      ;;
5568
5569    sysv5* | sco3.2v5* | sco5v6*)
5570      # Note: We can NOT use -z defs as we might desire, because we do not
5571      # link with -lc, and that would cause any symbols used from libc to
5572      # always be unresolved, which means just about no library would
5573      # ever link correctly.  If we're not using GNU ld we use -z text
5574      # though, which does catch some bad symbols but isn't as heavy-handed
5575      # as -z defs.
5576      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5577      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
5578      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5579      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5580      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
5581      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5582      _LT_TAGVAR(link_all_deplibs, $1)=yes
5583      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
5584      runpath_var='LD_RUN_PATH'
5585
5586      if test "$GCC" = yes; then
5587	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5588	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5589      else
5590	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5591	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5592      fi
5593      ;;
5594
5595    uts4*)
5596      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5597      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5598      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5599      ;;
5600
5601    *)
5602      _LT_TAGVAR(ld_shlibs, $1)=no
5603      ;;
5604    esac
5605
5606    if test x$host_vendor = xsni; then
5607      case $host in
5608      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5609	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
5610	;;
5611      esac
5612    fi
5613  fi
5614])
5615AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
5616test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5617
5618_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
5619
5620_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
5621_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
5622_LT_DECL([], [extract_expsyms_cmds], [2],
5623    [The commands to extract the exported symbol list from a shared archive])
5624
5625#
5626# Do we need to explicitly link libc?
5627#
5628case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
5629x|xyes)
5630  # Assume -lc should be added
5631  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5632
5633  if test "$enable_shared" = yes && test "$GCC" = yes; then
5634    case $_LT_TAGVAR(archive_cmds, $1) in
5635    *'~'*)
5636      # FIXME: we may have to deal with multi-command sequences.
5637      ;;
5638    '$CC '*)
5639      # Test whether the compiler implicitly links with -lc since on some
5640      # systems, -lgcc has to come before -lc. If gcc already passes -lc
5641      # to ld, don't add -lc before -lgcc.
5642      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
5643	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
5644	[$RM conftest*
5645	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5646
5647	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
5648	  soname=conftest
5649	  lib=conftest
5650	  libobjs=conftest.$ac_objext
5651	  deplibs=
5652	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
5653	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
5654	  compiler_flags=-v
5655	  linker_flags=-v
5656	  verstring=
5657	  output_objdir=.
5658	  libname=conftest
5659	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
5660	  _LT_TAGVAR(allow_undefined_flag, $1)=
5661	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
5662	  then
5663	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
5664	  else
5665	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5666	  fi
5667	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
5668	else
5669	  cat conftest.err 1>&5
5670	fi
5671	$RM conftest*
5672	])
5673      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
5674      ;;
5675    esac
5676  fi
5677  ;;
5678esac
5679
5680_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
5681    [Whether or not to add -lc for building shared libraries])
5682_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
5683    [enable_shared_with_static_runtimes], [0],
5684    [Whether or not to disallow shared libs when runtime libs are static])
5685_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
5686    [Compiler flag to allow reflexive dlopens])
5687_LT_TAGDECL([], [whole_archive_flag_spec], [1],
5688    [Compiler flag to generate shared objects directly from archives])
5689_LT_TAGDECL([], [compiler_needs_object], [1],
5690    [Whether the compiler copes with passing no objects directly])
5691_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
5692    [Create an old-style archive from a shared archive])
5693_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
5694    [Create a temporary old-style archive to link instead of a shared archive])
5695_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
5696_LT_TAGDECL([], [archive_expsym_cmds], [2])
5697_LT_TAGDECL([], [module_cmds], [2],
5698    [Commands used to build a loadable module if different from building
5699    a shared archive.])
5700_LT_TAGDECL([], [module_expsym_cmds], [2])
5701_LT_TAGDECL([], [with_gnu_ld], [1],
5702    [Whether we are building with GNU ld or not])
5703_LT_TAGDECL([], [allow_undefined_flag], [1],
5704    [Flag that allows shared libraries with undefined symbols to be built])
5705_LT_TAGDECL([], [no_undefined_flag], [1],
5706    [Flag that enforces no undefined symbols])
5707_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
5708    [Flag to hardcode $libdir into a binary during linking.
5709    This must work even if $libdir does not exist])
5710_LT_TAGDECL([], [hardcode_libdir_separator], [1],
5711    [Whether we need a single "-rpath" flag with a separated argument])
5712_LT_TAGDECL([], [hardcode_direct], [0],
5713    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5714    DIR into the resulting binary])
5715_LT_TAGDECL([], [hardcode_direct_absolute], [0],
5716    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5717    DIR into the resulting binary and the resulting library dependency is
5718    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
5719    library is relocated])
5720_LT_TAGDECL([], [hardcode_minus_L], [0],
5721    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
5722    into the resulting binary])
5723_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
5724    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
5725    into the resulting binary])
5726_LT_TAGDECL([], [hardcode_automatic], [0],
5727    [Set to "yes" if building a shared library automatically hardcodes DIR
5728    into the library and all subsequent libraries and executables linked
5729    against it])
5730_LT_TAGDECL([], [inherit_rpath], [0],
5731    [Set to yes if linker adds runtime paths of dependent libraries
5732    to runtime path list])
5733_LT_TAGDECL([], [link_all_deplibs], [0],
5734    [Whether libtool must link a program against all its dependency libraries])
5735_LT_TAGDECL([], [always_export_symbols], [0],
5736    [Set to "yes" if exported symbols are required])
5737_LT_TAGDECL([], [export_symbols_cmds], [2],
5738    [The commands to list exported symbols])
5739_LT_TAGDECL([], [exclude_expsyms], [1],
5740    [Symbols that should not be listed in the preloaded symbols])
5741_LT_TAGDECL([], [include_expsyms], [1],
5742    [Symbols that must always be exported])
5743_LT_TAGDECL([], [prelink_cmds], [2],
5744    [Commands necessary for linking programs (against libraries) with templates])
5745_LT_TAGDECL([], [postlink_cmds], [2],
5746    [Commands necessary for finishing linking programs])
5747_LT_TAGDECL([], [file_list_spec], [1],
5748    [Specify filename containing input files])
5749dnl FIXME: Not yet implemented
5750dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
5751dnl    [Compiler flag to generate thread safe objects])
5752])# _LT_LINKER_SHLIBS
5753
5754
5755# _LT_LANG_C_CONFIG([TAG])
5756# ------------------------
5757# Ensure that the configuration variables for a C compiler are suitably
5758# defined.  These variables are subsequently used by _LT_CONFIG to write
5759# the compiler configuration to `libtool'.
5760m4_defun([_LT_LANG_C_CONFIG],
5761[m4_require([_LT_DECL_EGREP])dnl
5762lt_save_CC="$CC"
5763AC_LANG_PUSH(C)
5764
5765# Source file extension for C test sources.
5766ac_ext=c
5767
5768# Object file extension for compiled C test sources.
5769objext=o
5770_LT_TAGVAR(objext, $1)=$objext
5771
5772# Code to be used in simple compile tests
5773lt_simple_compile_test_code="int some_variable = 0;"
5774
5775# Code to be used in simple link tests
5776lt_simple_link_test_code='int main(){return(0);}'
5777
5778_LT_TAG_COMPILER
5779# Save the default compiler, since it gets overwritten when the other
5780# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
5781compiler_DEFAULT=$CC
5782
5783# save warnings/boilerplate of simple test code
5784_LT_COMPILER_BOILERPLATE
5785_LT_LINKER_BOILERPLATE
5786
5787if test -n "$compiler"; then
5788  _LT_COMPILER_NO_RTTI($1)
5789  _LT_COMPILER_PIC($1)
5790  _LT_COMPILER_C_O($1)
5791  _LT_COMPILER_FILE_LOCKS($1)
5792  _LT_LINKER_SHLIBS($1)
5793  _LT_SYS_DYNAMIC_LINKER($1)
5794  _LT_LINKER_HARDCODE_LIBPATH($1)
5795  LT_SYS_DLOPEN_SELF
5796  _LT_CMD_STRIPLIB
5797
5798  # Report which library types will actually be built
5799  AC_MSG_CHECKING([if libtool supports shared libraries])
5800  AC_MSG_RESULT([$can_build_shared])
5801
5802  AC_MSG_CHECKING([whether to build shared libraries])
5803  test "$can_build_shared" = "no" && enable_shared=no
5804
5805  # On AIX, shared libraries and static libraries use the same namespace, and
5806  # are all built from PIC.
5807  case $host_os in
5808  aix3*)
5809    test "$enable_shared" = yes && enable_static=no
5810    if test -n "$RANLIB"; then
5811      archive_cmds="$archive_cmds~\$RANLIB \$lib"
5812      postinstall_cmds='$RANLIB $lib'
5813    fi
5814    ;;
5815
5816  aix[[4-9]]*)
5817    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
5818      test "$enable_shared" = yes && enable_static=no
5819    fi
5820    ;;
5821  esac
5822  AC_MSG_RESULT([$enable_shared])
5823
5824  AC_MSG_CHECKING([whether to build static libraries])
5825  # Make sure either enable_shared or enable_static is yes.
5826  test "$enable_shared" = yes || enable_static=yes
5827  AC_MSG_RESULT([$enable_static])
5828
5829  _LT_CONFIG($1)
5830fi
5831AC_LANG_POP
5832CC="$lt_save_CC"
5833])# _LT_LANG_C_CONFIG
5834
5835
5836# _LT_LANG_CXX_CONFIG([TAG])
5837# --------------------------
5838# Ensure that the configuration variables for a C++ compiler are suitably
5839# defined.  These variables are subsequently used by _LT_CONFIG to write
5840# the compiler configuration to `libtool'.
5841m4_defun([_LT_LANG_CXX_CONFIG],
5842[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5843m4_require([_LT_DECL_EGREP])dnl
5844m4_require([_LT_PATH_MANIFEST_TOOL])dnl
5845if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
5846    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
5847    (test "X$CXX" != "Xg++"))) ; then
5848  AC_PROG_CXXCPP
5849else
5850  _lt_caught_CXX_error=yes
5851fi
5852
5853AC_LANG_PUSH(C++)
5854_LT_TAGVAR(archive_cmds_need_lc, $1)=no
5855_LT_TAGVAR(allow_undefined_flag, $1)=
5856_LT_TAGVAR(always_export_symbols, $1)=no
5857_LT_TAGVAR(archive_expsym_cmds, $1)=
5858_LT_TAGVAR(compiler_needs_object, $1)=no
5859_LT_TAGVAR(export_dynamic_flag_spec, $1)=
5860_LT_TAGVAR(hardcode_direct, $1)=no
5861_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5862_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5863_LT_TAGVAR(hardcode_libdir_separator, $1)=
5864_LT_TAGVAR(hardcode_minus_L, $1)=no
5865_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5866_LT_TAGVAR(hardcode_automatic, $1)=no
5867_LT_TAGVAR(inherit_rpath, $1)=no
5868_LT_TAGVAR(module_cmds, $1)=
5869_LT_TAGVAR(module_expsym_cmds, $1)=
5870_LT_TAGVAR(link_all_deplibs, $1)=unknown
5871_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
5872_LT_TAGVAR(reload_flag, $1)=$reload_flag
5873_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
5874_LT_TAGVAR(no_undefined_flag, $1)=
5875_LT_TAGVAR(whole_archive_flag_spec, $1)=
5876_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5877
5878# Source file extension for C++ test sources.
5879ac_ext=cpp
5880
5881# Object file extension for compiled C++ test sources.
5882objext=o
5883_LT_TAGVAR(objext, $1)=$objext
5884
5885# No sense in running all these tests if we already determined that
5886# the CXX compiler isn't working.  Some variables (like enable_shared)
5887# are currently assumed to apply to all compilers on this platform,
5888# and will be corrupted by setting them based on a non-working compiler.
5889if test "$_lt_caught_CXX_error" != yes; then
5890  # Code to be used in simple compile tests
5891  lt_simple_compile_test_code="int some_variable = 0;"
5892
5893  # Code to be used in simple link tests
5894  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
5895
5896  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
5897  _LT_TAG_COMPILER
5898
5899  # save warnings/boilerplate of simple test code
5900  _LT_COMPILER_BOILERPLATE
5901  _LT_LINKER_BOILERPLATE
5902
5903  # Allow CC to be a program name with arguments.
5904  lt_save_CC=$CC
5905  lt_save_CFLAGS=$CFLAGS
5906  lt_save_LD=$LD
5907  lt_save_GCC=$GCC
5908  GCC=$GXX
5909  lt_save_with_gnu_ld=$with_gnu_ld
5910  lt_save_path_LD=$lt_cv_path_LD
5911  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
5912    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
5913  else
5914    $as_unset lt_cv_prog_gnu_ld
5915  fi
5916  if test -n "${lt_cv_path_LDCXX+set}"; then
5917    lt_cv_path_LD=$lt_cv_path_LDCXX
5918  else
5919    $as_unset lt_cv_path_LD
5920  fi
5921  test -z "${LDCXX+set}" || LD=$LDCXX
5922  CC=${CXX-"c++"}
5923  CFLAGS=$CXXFLAGS
5924  compiler=$CC
5925  _LT_TAGVAR(compiler, $1)=$CC
5926  _LT_CC_BASENAME([$compiler])
5927
5928  if test -n "$compiler"; then
5929    # We don't want -fno-exception when compiling C++ code, so set the
5930    # no_builtin_flag separately
5931    if test "$GXX" = yes; then
5932      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
5933    else
5934      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
5935    fi
5936
5937    if test "$GXX" = yes; then
5938      # Set up default GNU C++ configuration
5939
5940      LT_PATH_LD
5941
5942      # Check if GNU C++ uses GNU ld as the underlying linker, since the
5943      # archiving commands below assume that GNU ld is being used.
5944      if test "$with_gnu_ld" = yes; then
5945        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5946        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5947
5948        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5949        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5950
5951        # If archive_cmds runs LD, not CC, wlarc should be empty
5952        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
5953        #     investigate it a little bit more. (MM)
5954        wlarc='${wl}'
5955
5956        # ancient GNU ld didn't support --whole-archive et. al.
5957        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
5958	  $GREP 'no-whole-archive' > /dev/null; then
5959          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5960        else
5961          _LT_TAGVAR(whole_archive_flag_spec, $1)=
5962        fi
5963      else
5964        with_gnu_ld=no
5965        wlarc=
5966
5967        # A generic and very simple default shared library creation
5968        # command for GNU C++ for the case where it uses the native
5969        # linker, instead of GNU ld.  If possible, this setting should
5970        # overridden to take advantage of the native linker features on
5971        # the platform it is being used on.
5972        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
5973      fi
5974
5975      # Commands to make compiler produce verbose output that lists
5976      # what "hidden" libraries, object files and flags are used when
5977      # linking a shared library.
5978      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
5979
5980    else
5981      GXX=no
5982      with_gnu_ld=no
5983      wlarc=
5984    fi
5985
5986    # PORTME: fill in a description of your system's C++ link characteristics
5987    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5988    _LT_TAGVAR(ld_shlibs, $1)=yes
5989    case $host_os in
5990      aix3*)
5991        # FIXME: insert proper C++ library support
5992        _LT_TAGVAR(ld_shlibs, $1)=no
5993        ;;
5994      aix[[4-9]]*)
5995        if test "$host_cpu" = ia64; then
5996          # On IA64, the linker does run time linking by default, so we don't
5997          # have to do anything special.
5998          aix_use_runtimelinking=no
5999          exp_sym_flag='-Bexport'
6000          no_entry_flag=""
6001        else
6002          aix_use_runtimelinking=no
6003
6004          # Test if we are trying to use run time linking or normal
6005          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
6006          # need to do runtime linking.
6007          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6008	    for ld_flag in $LDFLAGS; do
6009	      case $ld_flag in
6010	      *-brtl*)
6011	        aix_use_runtimelinking=yes
6012	        break
6013	        ;;
6014	      esac
6015	    done
6016	    ;;
6017          esac
6018
6019          exp_sym_flag='-bexport'
6020          no_entry_flag='-bnoentry'
6021        fi
6022
6023        # When large executables or shared objects are built, AIX ld can
6024        # have problems creating the table of contents.  If linking a library
6025        # or program results in "error TOC overflow" add -mminimal-toc to
6026        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6027        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6028
6029        _LT_TAGVAR(archive_cmds, $1)=''
6030        _LT_TAGVAR(hardcode_direct, $1)=yes
6031        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6032        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6033        _LT_TAGVAR(link_all_deplibs, $1)=yes
6034        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6035
6036        if test "$GXX" = yes; then
6037          case $host_os in aix4.[[012]]|aix4.[[012]].*)
6038          # We only want to do this on AIX 4.2 and lower, the check
6039          # below for broken collect2 doesn't work under 4.3+
6040	  collect2name=`${CC} -print-prog-name=collect2`
6041	  if test -f "$collect2name" &&
6042	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6043	  then
6044	    # We have reworked collect2
6045	    :
6046	  else
6047	    # We have old collect2
6048	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
6049	    # It fails to find uninstalled libraries when the uninstalled
6050	    # path is not listed in the libpath.  Setting hardcode_minus_L
6051	    # to unsupported forces relinking
6052	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
6053	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6054	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
6055	  fi
6056          esac
6057          shared_flag='-shared'
6058	  if test "$aix_use_runtimelinking" = yes; then
6059	    shared_flag="$shared_flag "'${wl}-G'
6060	  fi
6061        else
6062          # not using gcc
6063          if test "$host_cpu" = ia64; then
6064	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6065	  # chokes on -Wl,-G. The following line is correct:
6066	  shared_flag='-G'
6067          else
6068	    if test "$aix_use_runtimelinking" = yes; then
6069	      shared_flag='${wl}-G'
6070	    else
6071	      shared_flag='${wl}-bM:SRE'
6072	    fi
6073          fi
6074        fi
6075
6076        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
6077        # It seems that -bexpall does not export symbols beginning with
6078        # underscore (_), so it is better to generate a list of symbols to
6079	# export.
6080        _LT_TAGVAR(always_export_symbols, $1)=yes
6081        if test "$aix_use_runtimelinking" = yes; then
6082          # Warning - without using the other runtime loading flags (-brtl),
6083          # -berok will link without error, but may produce a broken library.
6084          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
6085          # Determine the default libpath from the value encoded in an empty
6086          # executable.
6087          _LT_SYS_MODULE_PATH_AIX([$1])
6088          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6089
6090          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
6091        else
6092          if test "$host_cpu" = ia64; then
6093	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6094	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6095	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
6096          else
6097	    # Determine the default libpath from the value encoded in an
6098	    # empty executable.
6099	    _LT_SYS_MODULE_PATH_AIX([$1])
6100	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6101	    # Warning - without using the other run time loading flags,
6102	    # -berok will link without error, but may produce a broken library.
6103	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6104	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6105	    if test "$with_gnu_ld" = yes; then
6106	      # We only use this code for GNU lds that support --whole-archive.
6107	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6108	    else
6109	      # Exported symbols can be pulled into shared objects from archives
6110	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6111	    fi
6112	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6113	    # This is similar to how AIX traditionally builds its shared
6114	    # libraries.
6115	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
6116          fi
6117        fi
6118        ;;
6119
6120      beos*)
6121	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6122	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6123	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
6124	  # support --undefined.  This deserves some investigation.  FIXME
6125	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6126	else
6127	  _LT_TAGVAR(ld_shlibs, $1)=no
6128	fi
6129	;;
6130
6131      chorus*)
6132        case $cc_basename in
6133          *)
6134	  # FIXME: insert proper C++ library support
6135	  _LT_TAGVAR(ld_shlibs, $1)=no
6136	  ;;
6137        esac
6138        ;;
6139
6140      cygwin* | mingw* | pw32* | cegcc*)
6141	case $GXX,$cc_basename in
6142	,cl* | no,cl*)
6143	  # Native MSVC
6144	  # hardcode_libdir_flag_spec is actually meaningless, as there is
6145	  # no search path for DLLs.
6146	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6147	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6148	  _LT_TAGVAR(always_export_symbols, $1)=yes
6149	  _LT_TAGVAR(file_list_spec, $1)='@'
6150	  # Tell ltmain to make .lib files, not .a files.
6151	  libext=lib
6152	  # Tell ltmain to make .dll files, not .so files.
6153	  shrext_cmds=".dll"
6154	  # FIXME: Setting linknames here is a bad hack.
6155	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6156	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6157	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6158	    else
6159	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6160	    fi~
6161	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6162	    linknames='
6163	  # The linker will not automatically build a static lib if we build a DLL.
6164	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6165	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6166	  # Don't use ranlib
6167	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6168	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6169	    lt_tool_outputfile="@TOOL_OUTPUT@"~
6170	    case $lt_outputfile in
6171	      *.exe|*.EXE) ;;
6172	      *)
6173		lt_outputfile="$lt_outputfile.exe"
6174		lt_tool_outputfile="$lt_tool_outputfile.exe"
6175		;;
6176	    esac~
6177	    func_to_tool_file "$lt_outputfile"~
6178	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6179	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6180	      $RM "$lt_outputfile.manifest";
6181	    fi'
6182	  ;;
6183	*)
6184	  # g++
6185	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6186	  # as there is no search path for DLLs.
6187	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6188	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
6189	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6190	  _LT_TAGVAR(always_export_symbols, $1)=no
6191	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6192
6193	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6194	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
6195	    # If the export-symbols file already is a .def file (1st line
6196	    # is EXPORTS), use it as is; otherwise, prepend...
6197	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6198	      cp $export_symbols $output_objdir/$soname.def;
6199	    else
6200	      echo EXPORTS > $output_objdir/$soname.def;
6201	      cat $export_symbols >> $output_objdir/$soname.def;
6202	    fi~
6203	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
6204	  else
6205	    _LT_TAGVAR(ld_shlibs, $1)=no
6206	  fi
6207	  ;;
6208	esac
6209	;;
6210      darwin* | rhapsody*)
6211        _LT_DARWIN_LINKER_FEATURES($1)
6212	;;
6213
6214      dgux*)
6215        case $cc_basename in
6216          ec++*)
6217	    # FIXME: insert proper C++ library support
6218	    _LT_TAGVAR(ld_shlibs, $1)=no
6219	    ;;
6220          ghcx*)
6221	    # Green Hills C++ Compiler
6222	    # FIXME: insert proper C++ library support
6223	    _LT_TAGVAR(ld_shlibs, $1)=no
6224	    ;;
6225          *)
6226	    # FIXME: insert proper C++ library support
6227	    _LT_TAGVAR(ld_shlibs, $1)=no
6228	    ;;
6229        esac
6230        ;;
6231
6232      freebsd2.*)
6233        # C++ shared libraries reported to be fairly broken before
6234	# switch to ELF
6235        _LT_TAGVAR(ld_shlibs, $1)=no
6236        ;;
6237
6238      freebsd-elf*)
6239        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6240        ;;
6241
6242      freebsd* | dragonfly*)
6243        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
6244        # conventions
6245        _LT_TAGVAR(ld_shlibs, $1)=yes
6246        ;;
6247
6248      gnu*)
6249        ;;
6250
6251      haiku*)
6252        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6253        _LT_TAGVAR(link_all_deplibs, $1)=yes
6254        ;;
6255
6256      hpux9*)
6257        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6258        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6259        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6260        _LT_TAGVAR(hardcode_direct, $1)=yes
6261        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6262				             # but as the default
6263				             # location of the library.
6264
6265        case $cc_basename in
6266          CC*)
6267            # FIXME: insert proper C++ library support
6268            _LT_TAGVAR(ld_shlibs, $1)=no
6269            ;;
6270          aCC*)
6271            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6272            # Commands to make compiler produce verbose output that lists
6273            # what "hidden" libraries, object files and flags are used when
6274            # linking a shared library.
6275            #
6276            # There doesn't appear to be a way to prevent this compiler from
6277            # explicitly linking system object files so we need to strip them
6278            # from the output so that they don't get included in the library
6279            # dependencies.
6280            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6281            ;;
6282          *)
6283            if test "$GXX" = yes; then
6284              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6285            else
6286              # FIXME: insert proper C++ library support
6287              _LT_TAGVAR(ld_shlibs, $1)=no
6288            fi
6289            ;;
6290        esac
6291        ;;
6292
6293      hpux10*|hpux11*)
6294        if test $with_gnu_ld = no; then
6295	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6296	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6297
6298          case $host_cpu in
6299            hppa*64*|ia64*)
6300              ;;
6301            *)
6302	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6303              ;;
6304          esac
6305        fi
6306        case $host_cpu in
6307          hppa*64*|ia64*)
6308            _LT_TAGVAR(hardcode_direct, $1)=no
6309            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6310            ;;
6311          *)
6312            _LT_TAGVAR(hardcode_direct, $1)=yes
6313            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6314            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6315					         # but as the default
6316					         # location of the library.
6317            ;;
6318        esac
6319
6320        case $cc_basename in
6321          CC*)
6322	    # FIXME: insert proper C++ library support
6323	    _LT_TAGVAR(ld_shlibs, $1)=no
6324	    ;;
6325          aCC*)
6326	    case $host_cpu in
6327	      hppa*64*)
6328	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6329	        ;;
6330	      ia64*)
6331	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6332	        ;;
6333	      *)
6334	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6335	        ;;
6336	    esac
6337	    # Commands to make compiler produce verbose output that lists
6338	    # what "hidden" libraries, object files and flags are used when
6339	    # linking a shared library.
6340	    #
6341	    # There doesn't appear to be a way to prevent this compiler from
6342	    # explicitly linking system object files so we need to strip them
6343	    # from the output so that they don't get included in the library
6344	    # dependencies.
6345	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6346	    ;;
6347          *)
6348	    if test "$GXX" = yes; then
6349	      if test $with_gnu_ld = no; then
6350	        case $host_cpu in
6351	          hppa*64*)
6352	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6353	            ;;
6354	          ia64*)
6355	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6356	            ;;
6357	          *)
6358	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6359	            ;;
6360	        esac
6361	      fi
6362	    else
6363	      # FIXME: insert proper C++ library support
6364	      _LT_TAGVAR(ld_shlibs, $1)=no
6365	    fi
6366	    ;;
6367        esac
6368        ;;
6369
6370      interix[[3-9]]*)
6371	_LT_TAGVAR(hardcode_direct, $1)=no
6372	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6373	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6374	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6375	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
6376	# Instead, shared libraries are loaded at an image base (0x10000000 by
6377	# default) and relocated if they conflict, which is a slow very memory
6378	# consuming and fragmenting process.  To avoid this, we pick a random,
6379	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
6380	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
6381	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
6382	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
6383	;;
6384      irix5* | irix6*)
6385        case $cc_basename in
6386          CC*)
6387	    # SGI C++
6388	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
6389
6390	    # Archives containing C++ object files must be created using
6391	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
6392	    # necessary to make sure instantiated templates are included
6393	    # in the archive.
6394	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
6395	    ;;
6396          *)
6397	    if test "$GXX" = yes; then
6398	      if test "$with_gnu_ld" = no; then
6399	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6400	      else
6401	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
6402	      fi
6403	    fi
6404	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6405	    ;;
6406        esac
6407        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6408        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6409        _LT_TAGVAR(inherit_rpath, $1)=yes
6410        ;;
6411
6412      linux* | k*bsd*-gnu | kopensolaris*-gnu)
6413        case $cc_basename in
6414          KCC*)
6415	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6416
6417	    # KCC will only create a shared library if the output file
6418	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6419	    # to its proper name (with version) after linking.
6420	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
6421	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
6422	    # Commands to make compiler produce verbose output that lists
6423	    # what "hidden" libraries, object files and flags are used when
6424	    # linking a shared library.
6425	    #
6426	    # There doesn't appear to be a way to prevent this compiler from
6427	    # explicitly linking system object files so we need to strip them
6428	    # from the output so that they don't get included in the library
6429	    # dependencies.
6430	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6431
6432	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6433	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6434
6435	    # Archives containing C++ object files must be created using
6436	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
6437	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
6438	    ;;
6439	  icpc* | ecpc* )
6440	    # Intel C++
6441	    with_gnu_ld=yes
6442	    # version 8.0 and above of icpc choke on multiply defined symbols
6443	    # if we add $predep_objects and $postdep_objects, however 7.1 and
6444	    # earlier do not add the objects themselves.
6445	    case `$CC -V 2>&1` in
6446	      *"Version 7."*)
6447	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6448		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
6449		;;
6450	      *)  # Version 8.0 or newer
6451	        tmp_idyn=
6452	        case $host_cpu in
6453		  ia64*) tmp_idyn=' -i_dynamic';;
6454		esac
6455	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6456		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
6457		;;
6458	    esac
6459	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6460	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6461	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6462	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6463	    ;;
6464          pgCC* | pgcpp*)
6465            # Portland Group C++ compiler
6466	    case `$CC -V` in
6467	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
6468	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
6469		rm -rf $tpldir~
6470		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
6471		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
6472	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
6473		rm -rf $tpldir~
6474		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
6475		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
6476		$RANLIB $oldlib'
6477	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
6478		rm -rf $tpldir~
6479		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
6480		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
6481	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
6482		rm -rf $tpldir~
6483		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
6484		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
6485	      ;;
6486	    *) # Version 6 and above use weak symbols
6487	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
6488	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
6489	      ;;
6490	    esac
6491
6492	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
6493	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6494	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
6495            ;;
6496	  cxx*)
6497	    # Compaq C++
6498	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6499	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
6500
6501	    runpath_var=LD_RUN_PATH
6502	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6503	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6504
6505	    # Commands to make compiler produce verbose output that lists
6506	    # what "hidden" libraries, object files and flags are used when
6507	    # linking a shared library.
6508	    #
6509	    # There doesn't appear to be a way to prevent this compiler from
6510	    # explicitly linking system object files so we need to strip them
6511	    # from the output so that they don't get included in the library
6512	    # dependencies.
6513	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
6514	    ;;
6515	  xl* | mpixl* | bgxl*)
6516	    # IBM XL 8.0 on PPC, with GNU ld
6517	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6518	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6519	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6520	    if test "x$supports_anon_versioning" = xyes; then
6521	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
6522		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
6523		echo "local: *; };" >> $output_objdir/$libname.ver~
6524		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
6525	    fi
6526	    ;;
6527	  *)
6528	    case `$CC -V 2>&1 | sed 5q` in
6529	    *Sun\ C*)
6530	      # Sun C++ 5.9
6531	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6532	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6533	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
6534	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6535	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
6536	      _LT_TAGVAR(compiler_needs_object, $1)=yes
6537
6538	      # Not sure whether something based on
6539	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
6540	      # would be better.
6541	      output_verbose_link_cmd='func_echo_all'
6542
6543	      # Archives containing C++ object files must be created using
6544	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
6545	      # necessary to make sure instantiated templates are included
6546	      # in the archive.
6547	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6548	      ;;
6549	    esac
6550	    ;;
6551	esac
6552	;;
6553
6554      lynxos*)
6555        # FIXME: insert proper C++ library support
6556	_LT_TAGVAR(ld_shlibs, $1)=no
6557	;;
6558
6559      m88k*)
6560        # FIXME: insert proper C++ library support
6561        _LT_TAGVAR(ld_shlibs, $1)=no
6562	;;
6563
6564      mvs*)
6565        case $cc_basename in
6566          cxx*)
6567	    # FIXME: insert proper C++ library support
6568	    _LT_TAGVAR(ld_shlibs, $1)=no
6569	    ;;
6570	  *)
6571	    # FIXME: insert proper C++ library support
6572	    _LT_TAGVAR(ld_shlibs, $1)=no
6573	    ;;
6574	esac
6575	;;
6576
6577      netbsd*)
6578        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6579	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
6580	  wlarc=
6581	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6582	  _LT_TAGVAR(hardcode_direct, $1)=yes
6583	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6584	fi
6585	# Workaround some broken pre-1.5 toolchains
6586	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
6587	;;
6588
6589      *nto* | *qnx*)
6590        _LT_TAGVAR(ld_shlibs, $1)=yes
6591	;;
6592
6593      openbsd2*)
6594        # C++ shared libraries are fairly broken
6595	_LT_TAGVAR(ld_shlibs, $1)=no
6596	;;
6597
6598      openbsd*)
6599	if test -f /usr/libexec/ld.so; then
6600	  _LT_TAGVAR(hardcode_direct, $1)=yes
6601	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6602	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6603	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6604	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6605	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6606	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
6607	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6608	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6609	  fi
6610	  output_verbose_link_cmd=func_echo_all
6611	else
6612	  _LT_TAGVAR(ld_shlibs, $1)=no
6613	fi
6614	;;
6615
6616      osf3* | osf4* | osf5*)
6617        case $cc_basename in
6618          KCC*)
6619	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6620
6621	    # KCC will only create a shared library if the output file
6622	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6623	    # to its proper name (with version) after linking.
6624	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
6625
6626	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6627	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6628
6629	    # Archives containing C++ object files must be created using
6630	    # the KAI C++ compiler.
6631	    case $host in
6632	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
6633	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
6634	    esac
6635	    ;;
6636          RCC*)
6637	    # Rational C++ 2.4.1
6638	    # FIXME: insert proper C++ library support
6639	    _LT_TAGVAR(ld_shlibs, $1)=no
6640	    ;;
6641          cxx*)
6642	    case $host in
6643	      osf3*)
6644	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6645	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
6646	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6647		;;
6648	      *)
6649	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6650	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
6651	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
6652	          echo "-hidden">> $lib.exp~
6653	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
6654	          $RM $lib.exp'
6655	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6656		;;
6657	    esac
6658
6659	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6660
6661	    # Commands to make compiler produce verbose output that lists
6662	    # what "hidden" libraries, object files and flags are used when
6663	    # linking a shared library.
6664	    #
6665	    # There doesn't appear to be a way to prevent this compiler from
6666	    # explicitly linking system object files so we need to strip them
6667	    # from the output so that they don't get included in the library
6668	    # dependencies.
6669	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6670	    ;;
6671	  *)
6672	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6673	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6674	      case $host in
6675	        osf3*)
6676	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6677		  ;;
6678	        *)
6679	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6680		  ;;
6681	      esac
6682
6683	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6684	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6685
6686	      # Commands to make compiler produce verbose output that lists
6687	      # what "hidden" libraries, object files and flags are used when
6688	      # linking a shared library.
6689	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6690
6691	    else
6692	      # FIXME: insert proper C++ library support
6693	      _LT_TAGVAR(ld_shlibs, $1)=no
6694	    fi
6695	    ;;
6696        esac
6697        ;;
6698
6699      psos*)
6700        # FIXME: insert proper C++ library support
6701        _LT_TAGVAR(ld_shlibs, $1)=no
6702        ;;
6703
6704      sunos4*)
6705        case $cc_basename in
6706          CC*)
6707	    # Sun C++ 4.x
6708	    # FIXME: insert proper C++ library support
6709	    _LT_TAGVAR(ld_shlibs, $1)=no
6710	    ;;
6711          lcc*)
6712	    # Lucid
6713	    # FIXME: insert proper C++ library support
6714	    _LT_TAGVAR(ld_shlibs, $1)=no
6715	    ;;
6716          *)
6717	    # FIXME: insert proper C++ library support
6718	    _LT_TAGVAR(ld_shlibs, $1)=no
6719	    ;;
6720        esac
6721        ;;
6722
6723      solaris*)
6724        case $cc_basename in
6725          CC* | sunCC*)
6726	    # Sun C++ 4.2, 5.x and Centerline C++
6727            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
6728	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6729	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6730	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6731	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6732
6733	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6734	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6735	    case $host_os in
6736	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6737	      *)
6738		# The compiler driver will combine and reorder linker options,
6739		# but understands `-z linker_flag'.
6740	        # Supported since Solaris 2.6 (maybe 2.5.1?)
6741		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6742	        ;;
6743	    esac
6744	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6745
6746	    output_verbose_link_cmd='func_echo_all'
6747
6748	    # Archives containing C++ object files must be created using
6749	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
6750	    # necessary to make sure instantiated templates are included
6751	    # in the archive.
6752	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6753	    ;;
6754          gcx*)
6755	    # Green Hills C++ Compiler
6756	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6757
6758	    # The C++ compiler must be used to create the archive.
6759	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
6760	    ;;
6761          *)
6762	    # GNU C++ compiler with Solaris linker
6763	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6764	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
6765	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
6766	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6767	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6768		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6769
6770	        # Commands to make compiler produce verbose output that lists
6771	        # what "hidden" libraries, object files and flags are used when
6772	        # linking a shared library.
6773	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6774	      else
6775	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
6776	        # platform.
6777	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6778	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6779		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6780
6781	        # Commands to make compiler produce verbose output that lists
6782	        # what "hidden" libraries, object files and flags are used when
6783	        # linking a shared library.
6784	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6785	      fi
6786
6787	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
6788	      case $host_os in
6789		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6790		*)
6791		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6792		  ;;
6793	      esac
6794	    fi
6795	    ;;
6796        esac
6797        ;;
6798
6799    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6800      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6801      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6802      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6803      runpath_var='LD_RUN_PATH'
6804
6805      case $cc_basename in
6806        CC*)
6807	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6808	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6809	  ;;
6810	*)
6811	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6812	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6813	  ;;
6814      esac
6815      ;;
6816
6817      sysv5* | sco3.2v5* | sco5v6*)
6818	# Note: We can NOT use -z defs as we might desire, because we do not
6819	# link with -lc, and that would cause any symbols used from libc to
6820	# always be unresolved, which means just about no library would
6821	# ever link correctly.  If we're not using GNU ld we use -z text
6822	# though, which does catch some bad symbols but isn't as heavy-handed
6823	# as -z defs.
6824	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6825	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6826	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6827	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6828	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6829	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6830	_LT_TAGVAR(link_all_deplibs, $1)=yes
6831	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6832	runpath_var='LD_RUN_PATH'
6833
6834	case $cc_basename in
6835          CC*)
6836	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6837	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6838	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
6839	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
6840	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
6841	      '"$_LT_TAGVAR(reload_cmds, $1)"
6842	    ;;
6843	  *)
6844	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6845	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6846	    ;;
6847	esac
6848      ;;
6849
6850      tandem*)
6851        case $cc_basename in
6852          NCC*)
6853	    # NonStop-UX NCC 3.20
6854	    # FIXME: insert proper C++ library support
6855	    _LT_TAGVAR(ld_shlibs, $1)=no
6856	    ;;
6857          *)
6858	    # FIXME: insert proper C++ library support
6859	    _LT_TAGVAR(ld_shlibs, $1)=no
6860	    ;;
6861        esac
6862        ;;
6863
6864      vxworks*)
6865        # FIXME: insert proper C++ library support
6866        _LT_TAGVAR(ld_shlibs, $1)=no
6867        ;;
6868
6869      *)
6870        # FIXME: insert proper C++ library support
6871        _LT_TAGVAR(ld_shlibs, $1)=no
6872        ;;
6873    esac
6874
6875    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6876    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6877
6878    _LT_TAGVAR(GCC, $1)="$GXX"
6879    _LT_TAGVAR(LD, $1)="$LD"
6880
6881    ## CAVEAT EMPTOR:
6882    ## There is no encapsulation within the following macros, do not change
6883    ## the running order or otherwise move them around unless you know exactly
6884    ## what you are doing...
6885    _LT_SYS_HIDDEN_LIBDEPS($1)
6886    _LT_COMPILER_PIC($1)
6887    _LT_COMPILER_C_O($1)
6888    _LT_COMPILER_FILE_LOCKS($1)
6889    _LT_LINKER_SHLIBS($1)
6890    _LT_SYS_DYNAMIC_LINKER($1)
6891    _LT_LINKER_HARDCODE_LIBPATH($1)
6892
6893    _LT_CONFIG($1)
6894  fi # test -n "$compiler"
6895
6896  CC=$lt_save_CC
6897  CFLAGS=$lt_save_CFLAGS
6898  LDCXX=$LD
6899  LD=$lt_save_LD
6900  GCC=$lt_save_GCC
6901  with_gnu_ld=$lt_save_with_gnu_ld
6902  lt_cv_path_LDCXX=$lt_cv_path_LD
6903  lt_cv_path_LD=$lt_save_path_LD
6904  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
6905  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
6906fi # test "$_lt_caught_CXX_error" != yes
6907
6908AC_LANG_POP
6909])# _LT_LANG_CXX_CONFIG
6910
6911
6912# _LT_FUNC_STRIPNAME_CNF
6913# ----------------------
6914# func_stripname_cnf prefix suffix name
6915# strip PREFIX and SUFFIX off of NAME.
6916# PREFIX and SUFFIX must not contain globbing or regex special
6917# characters, hashes, percent signs, but SUFFIX may contain a leading
6918# dot (in which case that matches only a dot).
6919#
6920# This function is identical to the (non-XSI) version of func_stripname,
6921# except this one can be used by m4 code that may be executed by configure,
6922# rather than the libtool script.
6923m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
6924AC_REQUIRE([_LT_DECL_SED])
6925AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
6926func_stripname_cnf ()
6927{
6928  case ${2} in
6929  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
6930  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
6931  esac
6932} # func_stripname_cnf
6933])# _LT_FUNC_STRIPNAME_CNF
6934
6935# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
6936# ---------------------------------
6937# Figure out "hidden" library dependencies from verbose
6938# compiler output when linking a shared library.
6939# Parse the compiler output and extract the necessary
6940# objects, libraries and library flags.
6941m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
6942[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6943AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
6944# Dependencies to place before and after the object being linked:
6945_LT_TAGVAR(predep_objects, $1)=
6946_LT_TAGVAR(postdep_objects, $1)=
6947_LT_TAGVAR(predeps, $1)=
6948_LT_TAGVAR(postdeps, $1)=
6949_LT_TAGVAR(compiler_lib_search_path, $1)=
6950
6951dnl we can't use the lt_simple_compile_test_code here,
6952dnl because it contains code intended for an executable,
6953dnl not a library.  It's possible we should let each
6954dnl tag define a new lt_????_link_test_code variable,
6955dnl but it's only used here...
6956m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
6957int a;
6958void foo (void) { a = 0; }
6959_LT_EOF
6960], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
6961class Foo
6962{
6963public:
6964  Foo (void) { a = 0; }
6965private:
6966  int a;
6967};
6968_LT_EOF
6969], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
6970      subroutine foo
6971      implicit none
6972      integer*4 a
6973      a=0
6974      return
6975      end
6976_LT_EOF
6977], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
6978      subroutine foo
6979      implicit none
6980      integer a
6981      a=0
6982      return
6983      end
6984_LT_EOF
6985], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
6986public class foo {
6987  private int a;
6988  public void bar (void) {
6989    a = 0;
6990  }
6991};
6992_LT_EOF
6993], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
6994package foo
6995func foo() {
6996}
6997_LT_EOF
6998])
6999
7000_lt_libdeps_save_CFLAGS=$CFLAGS
7001case "$CC $CFLAGS " in #(
7002*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
7003*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
7004*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
7005esac
7006
7007dnl Parse the compiler output and extract the necessary
7008dnl objects, libraries and library flags.
7009if AC_TRY_EVAL(ac_compile); then
7010  # Parse the compiler output and extract the necessary
7011  # objects, libraries and library flags.
7012
7013  # Sentinel used to keep track of whether or not we are before
7014  # the conftest object file.
7015  pre_test_object_deps_done=no
7016
7017  for p in `eval "$output_verbose_link_cmd"`; do
7018    case ${prev}${p} in
7019
7020    -L* | -R* | -l*)
7021       # Some compilers place space between "-{L,R}" and the path.
7022       # Remove the space.
7023       if test $p = "-L" ||
7024          test $p = "-R"; then
7025	 prev=$p
7026	 continue
7027       fi
7028
7029       # Expand the sysroot to ease extracting the directories later.
7030       if test -z "$prev"; then
7031         case $p in
7032         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
7033         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
7034         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
7035         esac
7036       fi
7037       case $p in
7038       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
7039       esac
7040       if test "$pre_test_object_deps_done" = no; then
7041	 case ${prev} in
7042	 -L | -R)
7043	   # Internal compiler library paths should come after those
7044	   # provided the user.  The postdeps already come after the
7045	   # user supplied libs so there is no need to process them.
7046	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
7047	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
7048	   else
7049	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
7050	   fi
7051	   ;;
7052	 # The "-l" case would never come before the object being
7053	 # linked, so don't bother handling this case.
7054	 esac
7055       else
7056	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
7057	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
7058	 else
7059	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
7060	 fi
7061       fi
7062       prev=
7063       ;;
7064
7065    *.lto.$objext) ;; # Ignore GCC LTO objects
7066    *.$objext)
7067       # This assumes that the test object file only shows up
7068       # once in the compiler output.
7069       if test "$p" = "conftest.$objext"; then
7070	 pre_test_object_deps_done=yes
7071	 continue
7072       fi
7073
7074       if test "$pre_test_object_deps_done" = no; then
7075	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
7076	   _LT_TAGVAR(predep_objects, $1)="$p"
7077	 else
7078	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
7079	 fi
7080       else
7081	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
7082	   _LT_TAGVAR(postdep_objects, $1)="$p"
7083	 else
7084	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
7085	 fi
7086       fi
7087       ;;
7088
7089    *) ;; # Ignore the rest.
7090
7091    esac
7092  done
7093
7094  # Clean up.
7095  rm -f a.out a.exe
7096else
7097  echo "libtool.m4: error: problem compiling $1 test program"
7098fi
7099
7100$RM -f confest.$objext
7101CFLAGS=$_lt_libdeps_save_CFLAGS
7102
7103# PORTME: override above test on systems where it is broken
7104m4_if([$1], [CXX],
7105[case $host_os in
7106interix[[3-9]]*)
7107  # Interix 3.5 installs completely hosed .la files for C++, so rather than
7108  # hack all around it, let's just trust "g++" to DTRT.
7109  _LT_TAGVAR(predep_objects,$1)=
7110  _LT_TAGVAR(postdep_objects,$1)=
7111  _LT_TAGVAR(postdeps,$1)=
7112  ;;
7113
7114linux*)
7115  case `$CC -V 2>&1 | sed 5q` in
7116  *Sun\ C*)
7117    # Sun C++ 5.9
7118
7119    # The more standards-conforming stlport4 library is
7120    # incompatible with the Cstd library. Avoid specifying
7121    # it if it's in CXXFLAGS. Ignore libCrun as
7122    # -library=stlport4 depends on it.
7123    case " $CXX $CXXFLAGS " in
7124    *" -library=stlport4 "*)
7125      solaris_use_stlport4=yes
7126      ;;
7127    esac
7128
7129    if test "$solaris_use_stlport4" != yes; then
7130      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7131    fi
7132    ;;
7133  esac
7134  ;;
7135
7136solaris*)
7137  case $cc_basename in
7138  CC* | sunCC*)
7139    # The more standards-conforming stlport4 library is
7140    # incompatible with the Cstd library. Avoid specifying
7141    # it if it's in CXXFLAGS. Ignore libCrun as
7142    # -library=stlport4 depends on it.
7143    case " $CXX $CXXFLAGS " in
7144    *" -library=stlport4 "*)
7145      solaris_use_stlport4=yes
7146      ;;
7147    esac
7148
7149    # Adding this requires a known-good setup of shared libraries for
7150    # Sun compiler versions before 5.6, else PIC objects from an old
7151    # archive will be linked into the output, leading to subtle bugs.
7152    if test "$solaris_use_stlport4" != yes; then
7153      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7154    fi
7155    ;;
7156  esac
7157  ;;
7158esac
7159])
7160
7161case " $_LT_TAGVAR(postdeps, $1) " in
7162*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
7163esac
7164 _LT_TAGVAR(compiler_lib_search_dirs, $1)=
7165if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
7166 _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
7167fi
7168_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
7169    [The directories searched by this compiler when creating a shared library])
7170_LT_TAGDECL([], [predep_objects], [1],
7171    [Dependencies to place before and after the objects being linked to
7172    create a shared library])
7173_LT_TAGDECL([], [postdep_objects], [1])
7174_LT_TAGDECL([], [predeps], [1])
7175_LT_TAGDECL([], [postdeps], [1])
7176_LT_TAGDECL([], [compiler_lib_search_path], [1],
7177    [The library search path used internally by the compiler when linking
7178    a shared library])
7179])# _LT_SYS_HIDDEN_LIBDEPS
7180
7181
7182# _LT_LANG_F77_CONFIG([TAG])
7183# --------------------------
7184# Ensure that the configuration variables for a Fortran 77 compiler are
7185# suitably defined.  These variables are subsequently used by _LT_CONFIG
7186# to write the compiler configuration to `libtool'.
7187m4_defun([_LT_LANG_F77_CONFIG],
7188[AC_LANG_PUSH(Fortran 77)
7189if test -z "$F77" || test "X$F77" = "Xno"; then
7190  _lt_disable_F77=yes
7191fi
7192
7193_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7194_LT_TAGVAR(allow_undefined_flag, $1)=
7195_LT_TAGVAR(always_export_symbols, $1)=no
7196_LT_TAGVAR(archive_expsym_cmds, $1)=
7197_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7198_LT_TAGVAR(hardcode_direct, $1)=no
7199_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7200_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7201_LT_TAGVAR(hardcode_libdir_separator, $1)=
7202_LT_TAGVAR(hardcode_minus_L, $1)=no
7203_LT_TAGVAR(hardcode_automatic, $1)=no
7204_LT_TAGVAR(inherit_rpath, $1)=no
7205_LT_TAGVAR(module_cmds, $1)=
7206_LT_TAGVAR(module_expsym_cmds, $1)=
7207_LT_TAGVAR(link_all_deplibs, $1)=unknown
7208_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7209_LT_TAGVAR(reload_flag, $1)=$reload_flag
7210_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7211_LT_TAGVAR(no_undefined_flag, $1)=
7212_LT_TAGVAR(whole_archive_flag_spec, $1)=
7213_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7214
7215# Source file extension for f77 test sources.
7216ac_ext=f
7217
7218# Object file extension for compiled f77 test sources.
7219objext=o
7220_LT_TAGVAR(objext, $1)=$objext
7221
7222# No sense in running all these tests if we already determined that
7223# the F77 compiler isn't working.  Some variables (like enable_shared)
7224# are currently assumed to apply to all compilers on this platform,
7225# and will be corrupted by setting them based on a non-working compiler.
7226if test "$_lt_disable_F77" != yes; then
7227  # Code to be used in simple compile tests
7228  lt_simple_compile_test_code="\
7229      subroutine t
7230      return
7231      end
7232"
7233
7234  # Code to be used in simple link tests
7235  lt_simple_link_test_code="\
7236      program t
7237      end
7238"
7239
7240  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7241  _LT_TAG_COMPILER
7242
7243  # save warnings/boilerplate of simple test code
7244  _LT_COMPILER_BOILERPLATE
7245  _LT_LINKER_BOILERPLATE
7246
7247  # Allow CC to be a program name with arguments.
7248  lt_save_CC="$CC"
7249  lt_save_GCC=$GCC
7250  lt_save_CFLAGS=$CFLAGS
7251  CC=${F77-"f77"}
7252  CFLAGS=$FFLAGS
7253  compiler=$CC
7254  _LT_TAGVAR(compiler, $1)=$CC
7255  _LT_CC_BASENAME([$compiler])
7256  GCC=$G77
7257  if test -n "$compiler"; then
7258    AC_MSG_CHECKING([if libtool supports shared libraries])
7259    AC_MSG_RESULT([$can_build_shared])
7260
7261    AC_MSG_CHECKING([whether to build shared libraries])
7262    test "$can_build_shared" = "no" && enable_shared=no
7263
7264    # On AIX, shared libraries and static libraries use the same namespace, and
7265    # are all built from PIC.
7266    case $host_os in
7267      aix3*)
7268        test "$enable_shared" = yes && enable_static=no
7269        if test -n "$RANLIB"; then
7270          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7271          postinstall_cmds='$RANLIB $lib'
7272        fi
7273        ;;
7274      aix[[4-9]]*)
7275	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7276	  test "$enable_shared" = yes && enable_static=no
7277	fi
7278        ;;
7279    esac
7280    AC_MSG_RESULT([$enable_shared])
7281
7282    AC_MSG_CHECKING([whether to build static libraries])
7283    # Make sure either enable_shared or enable_static is yes.
7284    test "$enable_shared" = yes || enable_static=yes
7285    AC_MSG_RESULT([$enable_static])
7286
7287    _LT_TAGVAR(GCC, $1)="$G77"
7288    _LT_TAGVAR(LD, $1)="$LD"
7289
7290    ## CAVEAT EMPTOR:
7291    ## There is no encapsulation within the following macros, do not change
7292    ## the running order or otherwise move them around unless you know exactly
7293    ## what you are doing...
7294    _LT_COMPILER_PIC($1)
7295    _LT_COMPILER_C_O($1)
7296    _LT_COMPILER_FILE_LOCKS($1)
7297    _LT_LINKER_SHLIBS($1)
7298    _LT_SYS_DYNAMIC_LINKER($1)
7299    _LT_LINKER_HARDCODE_LIBPATH($1)
7300
7301    _LT_CONFIG($1)
7302  fi # test -n "$compiler"
7303
7304  GCC=$lt_save_GCC
7305  CC="$lt_save_CC"
7306  CFLAGS="$lt_save_CFLAGS"
7307fi # test "$_lt_disable_F77" != yes
7308
7309AC_LANG_POP
7310])# _LT_LANG_F77_CONFIG
7311
7312
7313# _LT_LANG_FC_CONFIG([TAG])
7314# -------------------------
7315# Ensure that the configuration variables for a Fortran compiler are
7316# suitably defined.  These variables are subsequently used by _LT_CONFIG
7317# to write the compiler configuration to `libtool'.
7318m4_defun([_LT_LANG_FC_CONFIG],
7319[AC_LANG_PUSH(Fortran)
7320
7321if test -z "$FC" || test "X$FC" = "Xno"; then
7322  _lt_disable_FC=yes
7323fi
7324
7325_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7326_LT_TAGVAR(allow_undefined_flag, $1)=
7327_LT_TAGVAR(always_export_symbols, $1)=no
7328_LT_TAGVAR(archive_expsym_cmds, $1)=
7329_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7330_LT_TAGVAR(hardcode_direct, $1)=no
7331_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7332_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7333_LT_TAGVAR(hardcode_libdir_separator, $1)=
7334_LT_TAGVAR(hardcode_minus_L, $1)=no
7335_LT_TAGVAR(hardcode_automatic, $1)=no
7336_LT_TAGVAR(inherit_rpath, $1)=no
7337_LT_TAGVAR(module_cmds, $1)=
7338_LT_TAGVAR(module_expsym_cmds, $1)=
7339_LT_TAGVAR(link_all_deplibs, $1)=unknown
7340_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7341_LT_TAGVAR(reload_flag, $1)=$reload_flag
7342_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7343_LT_TAGVAR(no_undefined_flag, $1)=
7344_LT_TAGVAR(whole_archive_flag_spec, $1)=
7345_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7346
7347# Source file extension for fc test sources.
7348ac_ext=${ac_fc_srcext-f}
7349
7350# Object file extension for compiled fc test sources.
7351objext=o
7352_LT_TAGVAR(objext, $1)=$objext
7353
7354# No sense in running all these tests if we already determined that
7355# the FC compiler isn't working.  Some variables (like enable_shared)
7356# are currently assumed to apply to all compilers on this platform,
7357# and will be corrupted by setting them based on a non-working compiler.
7358if test "$_lt_disable_FC" != yes; then
7359  # Code to be used in simple compile tests
7360  lt_simple_compile_test_code="\
7361      subroutine t
7362      return
7363      end
7364"
7365
7366  # Code to be used in simple link tests
7367  lt_simple_link_test_code="\
7368      program t
7369      end
7370"
7371
7372  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7373  _LT_TAG_COMPILER
7374
7375  # save warnings/boilerplate of simple test code
7376  _LT_COMPILER_BOILERPLATE
7377  _LT_LINKER_BOILERPLATE
7378
7379  # Allow CC to be a program name with arguments.
7380  lt_save_CC="$CC"
7381  lt_save_GCC=$GCC
7382  lt_save_CFLAGS=$CFLAGS
7383  CC=${FC-"f95"}
7384  CFLAGS=$FCFLAGS
7385  compiler=$CC
7386  GCC=$ac_cv_fc_compiler_gnu
7387
7388  _LT_TAGVAR(compiler, $1)=$CC
7389  _LT_CC_BASENAME([$compiler])
7390
7391  if test -n "$compiler"; then
7392    AC_MSG_CHECKING([if libtool supports shared libraries])
7393    AC_MSG_RESULT([$can_build_shared])
7394
7395    AC_MSG_CHECKING([whether to build shared libraries])
7396    test "$can_build_shared" = "no" && enable_shared=no
7397
7398    # On AIX, shared libraries and static libraries use the same namespace, and
7399    # are all built from PIC.
7400    case $host_os in
7401      aix3*)
7402        test "$enable_shared" = yes && enable_static=no
7403        if test -n "$RANLIB"; then
7404          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7405          postinstall_cmds='$RANLIB $lib'
7406        fi
7407        ;;
7408      aix[[4-9]]*)
7409	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7410	  test "$enable_shared" = yes && enable_static=no
7411	fi
7412        ;;
7413    esac
7414    AC_MSG_RESULT([$enable_shared])
7415
7416    AC_MSG_CHECKING([whether to build static libraries])
7417    # Make sure either enable_shared or enable_static is yes.
7418    test "$enable_shared" = yes || enable_static=yes
7419    AC_MSG_RESULT([$enable_static])
7420
7421    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
7422    _LT_TAGVAR(LD, $1)="$LD"
7423
7424    ## CAVEAT EMPTOR:
7425    ## There is no encapsulation within the following macros, do not change
7426    ## the running order or otherwise move them around unless you know exactly
7427    ## what you are doing...
7428    _LT_SYS_HIDDEN_LIBDEPS($1)
7429    _LT_COMPILER_PIC($1)
7430    _LT_COMPILER_C_O($1)
7431    _LT_COMPILER_FILE_LOCKS($1)
7432    _LT_LINKER_SHLIBS($1)
7433    _LT_SYS_DYNAMIC_LINKER($1)
7434    _LT_LINKER_HARDCODE_LIBPATH($1)
7435
7436    _LT_CONFIG($1)
7437  fi # test -n "$compiler"
7438
7439  GCC=$lt_save_GCC
7440  CC=$lt_save_CC
7441  CFLAGS=$lt_save_CFLAGS
7442fi # test "$_lt_disable_FC" != yes
7443
7444AC_LANG_POP
7445])# _LT_LANG_FC_CONFIG
7446
7447
7448# _LT_LANG_GCJ_CONFIG([TAG])
7449# --------------------------
7450# Ensure that the configuration variables for the GNU Java Compiler compiler
7451# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7452# to write the compiler configuration to `libtool'.
7453m4_defun([_LT_LANG_GCJ_CONFIG],
7454[AC_REQUIRE([LT_PROG_GCJ])dnl
7455AC_LANG_SAVE
7456
7457# Source file extension for Java test sources.
7458ac_ext=java
7459
7460# Object file extension for compiled Java test sources.
7461objext=o
7462_LT_TAGVAR(objext, $1)=$objext
7463
7464# Code to be used in simple compile tests
7465lt_simple_compile_test_code="class foo {}"
7466
7467# Code to be used in simple link tests
7468lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
7469
7470# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7471_LT_TAG_COMPILER
7472
7473# save warnings/boilerplate of simple test code
7474_LT_COMPILER_BOILERPLATE
7475_LT_LINKER_BOILERPLATE
7476
7477# Allow CC to be a program name with arguments.
7478lt_save_CC=$CC
7479lt_save_CFLAGS=$CFLAGS
7480lt_save_GCC=$GCC
7481GCC=yes
7482CC=${GCJ-"gcj"}
7483CFLAGS=$GCJFLAGS
7484compiler=$CC
7485_LT_TAGVAR(compiler, $1)=$CC
7486_LT_TAGVAR(LD, $1)="$LD"
7487_LT_CC_BASENAME([$compiler])
7488
7489# GCJ did not exist at the time GCC didn't implicitly link libc in.
7490_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7491
7492_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7493_LT_TAGVAR(reload_flag, $1)=$reload_flag
7494_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7495
7496if test -n "$compiler"; then
7497  _LT_COMPILER_NO_RTTI($1)
7498  _LT_COMPILER_PIC($1)
7499  _LT_COMPILER_C_O($1)
7500  _LT_COMPILER_FILE_LOCKS($1)
7501  _LT_LINKER_SHLIBS($1)
7502  _LT_LINKER_HARDCODE_LIBPATH($1)
7503
7504  _LT_CONFIG($1)
7505fi
7506
7507AC_LANG_RESTORE
7508
7509GCC=$lt_save_GCC
7510CC=$lt_save_CC
7511CFLAGS=$lt_save_CFLAGS
7512])# _LT_LANG_GCJ_CONFIG
7513
7514
7515# _LT_LANG_GO_CONFIG([TAG])
7516# --------------------------
7517# Ensure that the configuration variables for the GNU Go compiler
7518# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7519# to write the compiler configuration to `libtool'.
7520m4_defun([_LT_LANG_GO_CONFIG],
7521[AC_REQUIRE([LT_PROG_GO])dnl
7522AC_LANG_SAVE
7523
7524# Source file extension for Go test sources.
7525ac_ext=go
7526
7527# Object file extension for compiled Go test sources.
7528objext=o
7529_LT_TAGVAR(objext, $1)=$objext
7530
7531# Code to be used in simple compile tests
7532lt_simple_compile_test_code="package main; func main() { }"
7533
7534# Code to be used in simple link tests
7535lt_simple_link_test_code='package main; func main() { }'
7536
7537# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7538_LT_TAG_COMPILER
7539
7540# save warnings/boilerplate of simple test code
7541_LT_COMPILER_BOILERPLATE
7542_LT_LINKER_BOILERPLATE
7543
7544# Allow CC to be a program name with arguments.
7545lt_save_CC=$CC
7546lt_save_CFLAGS=$CFLAGS
7547lt_save_GCC=$GCC
7548GCC=yes
7549CC=${GOC-"gccgo"}
7550CFLAGS=$GOFLAGS
7551compiler=$CC
7552_LT_TAGVAR(compiler, $1)=$CC
7553_LT_TAGVAR(LD, $1)="$LD"
7554_LT_CC_BASENAME([$compiler])
7555
7556# Go did not exist at the time GCC didn't implicitly link libc in.
7557_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7558
7559_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7560_LT_TAGVAR(reload_flag, $1)=$reload_flag
7561_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7562
7563if test -n "$compiler"; then
7564  _LT_COMPILER_NO_RTTI($1)
7565  _LT_COMPILER_PIC($1)
7566  _LT_COMPILER_C_O($1)
7567  _LT_COMPILER_FILE_LOCKS($1)
7568  _LT_LINKER_SHLIBS($1)
7569  _LT_LINKER_HARDCODE_LIBPATH($1)
7570
7571  _LT_CONFIG($1)
7572fi
7573
7574AC_LANG_RESTORE
7575
7576GCC=$lt_save_GCC
7577CC=$lt_save_CC
7578CFLAGS=$lt_save_CFLAGS
7579])# _LT_LANG_GO_CONFIG
7580
7581
7582# _LT_LANG_RC_CONFIG([TAG])
7583# -------------------------
7584# Ensure that the configuration variables for the Windows resource compiler
7585# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7586# to write the compiler configuration to `libtool'.
7587m4_defun([_LT_LANG_RC_CONFIG],
7588[AC_REQUIRE([LT_PROG_RC])dnl
7589AC_LANG_SAVE
7590
7591# Source file extension for RC test sources.
7592ac_ext=rc
7593
7594# Object file extension for compiled RC test sources.
7595objext=o
7596_LT_TAGVAR(objext, $1)=$objext
7597
7598# Code to be used in simple compile tests
7599lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
7600
7601# Code to be used in simple link tests
7602lt_simple_link_test_code="$lt_simple_compile_test_code"
7603
7604# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7605_LT_TAG_COMPILER
7606
7607# save warnings/boilerplate of simple test code
7608_LT_COMPILER_BOILERPLATE
7609_LT_LINKER_BOILERPLATE
7610
7611# Allow CC to be a program name with arguments.
7612lt_save_CC="$CC"
7613lt_save_CFLAGS=$CFLAGS
7614lt_save_GCC=$GCC
7615GCC=
7616CC=${RC-"windres"}
7617CFLAGS=
7618compiler=$CC
7619_LT_TAGVAR(compiler, $1)=$CC
7620_LT_CC_BASENAME([$compiler])
7621_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
7622
7623if test -n "$compiler"; then
7624  :
7625  _LT_CONFIG($1)
7626fi
7627
7628GCC=$lt_save_GCC
7629AC_LANG_RESTORE
7630CC=$lt_save_CC
7631CFLAGS=$lt_save_CFLAGS
7632])# _LT_LANG_RC_CONFIG
7633
7634
7635# LT_PROG_GCJ
7636# -----------
7637AC_DEFUN([LT_PROG_GCJ],
7638[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
7639  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
7640    [AC_CHECK_TOOL(GCJ, gcj,)
7641      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
7642      AC_SUBST(GCJFLAGS)])])[]dnl
7643])
7644
7645# Old name:
7646AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
7647dnl aclocal-1.4 backwards compatibility:
7648dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
7649
7650
7651# LT_PROG_GO
7652# ----------
7653AC_DEFUN([LT_PROG_GO],
7654[AC_CHECK_TOOL(GOC, gccgo,)
7655])
7656
7657
7658# LT_PROG_RC
7659# ----------
7660AC_DEFUN([LT_PROG_RC],
7661[AC_CHECK_TOOL(RC, windres,)
7662])
7663
7664# Old name:
7665AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
7666dnl aclocal-1.4 backwards compatibility:
7667dnl AC_DEFUN([LT_AC_PROG_RC], [])
7668
7669
7670# _LT_DECL_EGREP
7671# --------------
7672# If we don't have a new enough Autoconf to choose the best grep
7673# available, choose the one first in the user's PATH.
7674m4_defun([_LT_DECL_EGREP],
7675[AC_REQUIRE([AC_PROG_EGREP])dnl
7676AC_REQUIRE([AC_PROG_FGREP])dnl
7677test -z "$GREP" && GREP=grep
7678_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
7679_LT_DECL([], [EGREP], [1], [An ERE matcher])
7680_LT_DECL([], [FGREP], [1], [A literal string matcher])
7681dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
7682AC_SUBST([GREP])
7683])
7684
7685
7686# _LT_DECL_OBJDUMP
7687# --------------
7688# If we don't have a new enough Autoconf to choose the best objdump
7689# available, choose the one first in the user's PATH.
7690m4_defun([_LT_DECL_OBJDUMP],
7691[AC_CHECK_TOOL(OBJDUMP, objdump, false)
7692test -z "$OBJDUMP" && OBJDUMP=objdump
7693_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
7694AC_SUBST([OBJDUMP])
7695])
7696
7697# _LT_DECL_DLLTOOL
7698# ----------------
7699# Ensure DLLTOOL variable is set.
7700m4_defun([_LT_DECL_DLLTOOL],
7701[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
7702test -z "$DLLTOOL" && DLLTOOL=dlltool
7703_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
7704AC_SUBST([DLLTOOL])
7705])
7706
7707# _LT_DECL_SED
7708# ------------
7709# Check for a fully-functional sed program, that truncates
7710# as few characters as possible.  Prefer GNU sed if found.
7711m4_defun([_LT_DECL_SED],
7712[AC_PROG_SED
7713test -z "$SED" && SED=sed
7714Xsed="$SED -e 1s/^X//"
7715_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
7716_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
7717    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
7718])# _LT_DECL_SED
7719
7720m4_ifndef([AC_PROG_SED], [
7721# NOTE: This macro has been submitted for inclusion into   #
7722#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
7723#  a released version of Autoconf we should remove this    #
7724#  macro and use it instead.                               #
7725
7726m4_defun([AC_PROG_SED],
7727[AC_MSG_CHECKING([for a sed that does not truncate output])
7728AC_CACHE_VAL(lt_cv_path_SED,
7729[# Loop through the user's path and test for sed and gsed.
7730# Then use that list of sed's as ones to test for truncation.
7731as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7732for as_dir in $PATH
7733do
7734  IFS=$as_save_IFS
7735  test -z "$as_dir" && as_dir=.
7736  for lt_ac_prog in sed gsed; do
7737    for ac_exec_ext in '' $ac_executable_extensions; do
7738      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
7739        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
7740      fi
7741    done
7742  done
7743done
7744IFS=$as_save_IFS
7745lt_ac_max=0
7746lt_ac_count=0
7747# Add /usr/xpg4/bin/sed as it is typically found on Solaris
7748# along with /bin/sed that truncates output.
7749for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
7750  test ! -f $lt_ac_sed && continue
7751  cat /dev/null > conftest.in
7752  lt_ac_count=0
7753  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
7754  # Check for GNU sed and select it if it is found.
7755  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
7756    lt_cv_path_SED=$lt_ac_sed
7757    break
7758  fi
7759  while true; do
7760    cat conftest.in conftest.in >conftest.tmp
7761    mv conftest.tmp conftest.in
7762    cp conftest.in conftest.nl
7763    echo >>conftest.nl
7764    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
7765    cmp -s conftest.out conftest.nl || break
7766    # 10000 chars as input seems more than enough
7767    test $lt_ac_count -gt 10 && break
7768    lt_ac_count=`expr $lt_ac_count + 1`
7769    if test $lt_ac_count -gt $lt_ac_max; then
7770      lt_ac_max=$lt_ac_count
7771      lt_cv_path_SED=$lt_ac_sed
7772    fi
7773  done
7774done
7775])
7776SED=$lt_cv_path_SED
7777AC_SUBST([SED])
7778AC_MSG_RESULT([$SED])
7779])#AC_PROG_SED
7780])#m4_ifndef
7781
7782# Old name:
7783AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
7784dnl aclocal-1.4 backwards compatibility:
7785dnl AC_DEFUN([LT_AC_PROG_SED], [])
7786
7787
7788# _LT_CHECK_SHELL_FEATURES
7789# ------------------------
7790# Find out whether the shell is Bourne or XSI compatible,
7791# or has some other useful features.
7792m4_defun([_LT_CHECK_SHELL_FEATURES],
7793[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
7794# Try some XSI features
7795xsi_shell=no
7796( _lt_dummy="a/b/c"
7797  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
7798      = c,a/b,b/c, \
7799    && eval 'test $(( 1 + 1 )) -eq 2 \
7800    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
7801  && xsi_shell=yes
7802AC_MSG_RESULT([$xsi_shell])
7803_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
7804
7805AC_MSG_CHECKING([whether the shell understands "+="])
7806lt_shell_append=no
7807( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
7808    >/dev/null 2>&1 \
7809  && lt_shell_append=yes
7810AC_MSG_RESULT([$lt_shell_append])
7811_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
7812
7813if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
7814  lt_unset=unset
7815else
7816  lt_unset=false
7817fi
7818_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
7819
7820# test EBCDIC or ASCII
7821case `echo X|tr X '\101'` in
7822 A) # ASCII based system
7823    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
7824  lt_SP2NL='tr \040 \012'
7825  lt_NL2SP='tr \015\012 \040\040'
7826  ;;
7827 *) # EBCDIC based system
7828  lt_SP2NL='tr \100 \n'
7829  lt_NL2SP='tr \r\n \100\100'
7830  ;;
7831esac
7832_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
7833_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
7834])# _LT_CHECK_SHELL_FEATURES
7835
7836
7837# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
7838# ------------------------------------------------------
7839# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
7840# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
7841m4_defun([_LT_PROG_FUNCTION_REPLACE],
7842[dnl {
7843sed -e '/^$1 ()$/,/^} # $1 /c\
7844$1 ()\
7845{\
7846m4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
7847} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
7848  && mv -f "$cfgfile.tmp" "$cfgfile" \
7849    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7850test 0 -eq $? || _lt_function_replace_fail=:
7851])
7852
7853
7854# _LT_PROG_REPLACE_SHELLFNS
7855# -------------------------
7856# Replace existing portable implementations of several shell functions with
7857# equivalent extended shell implementations where those features are available..
7858m4_defun([_LT_PROG_REPLACE_SHELLFNS],
7859[if test x"$xsi_shell" = xyes; then
7860  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
7861    case ${1} in
7862      */*) func_dirname_result="${1%/*}${2}" ;;
7863      *  ) func_dirname_result="${3}" ;;
7864    esac])
7865
7866  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
7867    func_basename_result="${1##*/}"])
7868
7869  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
7870    case ${1} in
7871      */*) func_dirname_result="${1%/*}${2}" ;;
7872      *  ) func_dirname_result="${3}" ;;
7873    esac
7874    func_basename_result="${1##*/}"])
7875
7876  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
7877    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
7878    # positional parameters, so assign one to ordinary parameter first.
7879    func_stripname_result=${3}
7880    func_stripname_result=${func_stripname_result#"${1}"}
7881    func_stripname_result=${func_stripname_result%"${2}"}])
7882
7883  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
7884    func_split_long_opt_name=${1%%=*}
7885    func_split_long_opt_arg=${1#*=}])
7886
7887  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
7888    func_split_short_opt_arg=${1#??}
7889    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
7890
7891  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
7892    case ${1} in
7893      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
7894      *)    func_lo2o_result=${1} ;;
7895    esac])
7896
7897  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
7898
7899  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
7900
7901  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
7902fi
7903
7904if test x"$lt_shell_append" = xyes; then
7905  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
7906
7907  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
7908    func_quote_for_eval "${2}"
7909dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
7910    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
7911
7912  # Save a `func_append' function call where possible by direct use of '+='
7913  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
7914    && mv -f "$cfgfile.tmp" "$cfgfile" \
7915      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7916  test 0 -eq $? || _lt_function_replace_fail=:
7917else
7918  # Save a `func_append' function call even when '+=' is not available
7919  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
7920    && mv -f "$cfgfile.tmp" "$cfgfile" \
7921      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7922  test 0 -eq $? || _lt_function_replace_fail=:
7923fi
7924
7925if test x"$_lt_function_replace_fail" = x":"; then
7926  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
7927fi
7928])
7929
7930# _LT_PATH_CONVERSION_FUNCTIONS
7931# -----------------------------
7932# Determine which file name conversion functions should be used by
7933# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
7934# for certain cross-compile configurations and native mingw.
7935m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
7936[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7937AC_REQUIRE([AC_CANONICAL_BUILD])dnl
7938AC_MSG_CHECKING([how to convert $build file names to $host format])
7939AC_CACHE_VAL(lt_cv_to_host_file_cmd,
7940[case $host in
7941  *-*-mingw* )
7942    case $build in
7943      *-*-mingw* ) # actually msys
7944        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
7945        ;;
7946      *-*-cygwin* )
7947        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
7948        ;;
7949      * ) # otherwise, assume *nix
7950        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
7951        ;;
7952    esac
7953    ;;
7954  *-*-cygwin* )
7955    case $build in
7956      *-*-mingw* ) # actually msys
7957        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
7958        ;;
7959      *-*-cygwin* )
7960        lt_cv_to_host_file_cmd=func_convert_file_noop
7961        ;;
7962      * ) # otherwise, assume *nix
7963        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
7964        ;;
7965    esac
7966    ;;
7967  * ) # unhandled hosts (and "normal" native builds)
7968    lt_cv_to_host_file_cmd=func_convert_file_noop
7969    ;;
7970esac
7971])
7972to_host_file_cmd=$lt_cv_to_host_file_cmd
7973AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
7974_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
7975         [0], [convert $build file names to $host format])dnl
7976
7977AC_MSG_CHECKING([how to convert $build file names to toolchain format])
7978AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
7979[#assume ordinary cross tools, or native build.
7980lt_cv_to_tool_file_cmd=func_convert_file_noop
7981case $host in
7982  *-*-mingw* )
7983    case $build in
7984      *-*-mingw* ) # actually msys
7985        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
7986        ;;
7987    esac
7988    ;;
7989esac
7990])
7991to_tool_file_cmd=$lt_cv_to_tool_file_cmd
7992AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
7993_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
7994         [0], [convert $build files to toolchain format])dnl
7995])# _LT_PATH_CONVERSION_FUNCTIONS
7996
7997# Helper functions for option handling.                    -*- Autoconf -*-
7998#
7999#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
8000#   Inc.
8001#   Written by Gary V. Vaughan, 2004
8002#
8003# This file is free software; the Free Software Foundation gives
8004# unlimited permission to copy and/or distribute it, with or without
8005# modifications, as long as this notice is preserved.
8006
8007# serial 7 ltoptions.m4
8008
8009# This is to help aclocal find these macros, as it can't see m4_define.
8010AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
8011
8012
8013# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
8014# ------------------------------------------
8015m4_define([_LT_MANGLE_OPTION],
8016[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
8017
8018
8019# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
8020# ---------------------------------------
8021# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
8022# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
8023# saved as a flag.
8024m4_define([_LT_SET_OPTION],
8025[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
8026m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
8027        _LT_MANGLE_DEFUN([$1], [$2]),
8028    [m4_warning([Unknown $1 option `$2'])])[]dnl
8029])
8030
8031
8032# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
8033# ------------------------------------------------------------
8034# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
8035m4_define([_LT_IF_OPTION],
8036[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
8037
8038
8039# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
8040# -------------------------------------------------------
8041# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
8042# are set.
8043m4_define([_LT_UNLESS_OPTIONS],
8044[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8045	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
8046		      [m4_define([$0_found])])])[]dnl
8047m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
8048])[]dnl
8049])
8050
8051
8052# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
8053# ----------------------------------------
8054# OPTION-LIST is a space-separated list of Libtool options associated
8055# with MACRO-NAME.  If any OPTION has a matching handler declared with
8056# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
8057# the unknown option and exit.
8058m4_defun([_LT_SET_OPTIONS],
8059[# Set options
8060m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8061    [_LT_SET_OPTION([$1], _LT_Option)])
8062
8063m4_if([$1],[LT_INIT],[
8064  dnl
8065  dnl Simply set some default values (i.e off) if boolean options were not
8066  dnl specified:
8067  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
8068  ])
8069  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
8070  ])
8071  dnl
8072  dnl If no reference was made to various pairs of opposing options, then
8073  dnl we run the default mode handler for the pair.  For example, if neither
8074  dnl `shared' nor `disable-shared' was passed, we enable building of shared
8075  dnl archives by default:
8076  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
8077  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
8078  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
8079  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
8080  		   [_LT_ENABLE_FAST_INSTALL])
8081  ])
8082])# _LT_SET_OPTIONS
8083
8084
8085
8086# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
8087# -----------------------------------------
8088m4_define([_LT_MANGLE_DEFUN],
8089[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
8090
8091
8092# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
8093# -----------------------------------------------
8094m4_define([LT_OPTION_DEFINE],
8095[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
8096])# LT_OPTION_DEFINE
8097
8098
8099# dlopen
8100# ------
8101LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
8102])
8103
8104AU_DEFUN([AC_LIBTOOL_DLOPEN],
8105[_LT_SET_OPTION([LT_INIT], [dlopen])
8106AC_DIAGNOSE([obsolete],
8107[$0: Remove this warning and the call to _LT_SET_OPTION when you
8108put the `dlopen' option into LT_INIT's first parameter.])
8109])
8110
8111dnl aclocal-1.4 backwards compatibility:
8112dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
8113
8114
8115# win32-dll
8116# ---------
8117# Declare package support for building win32 dll's.
8118LT_OPTION_DEFINE([LT_INIT], [win32-dll],
8119[enable_win32_dll=yes
8120
8121case $host in
8122*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
8123  AC_CHECK_TOOL(AS, as, false)
8124  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8125  AC_CHECK_TOOL(OBJDUMP, objdump, false)
8126  ;;
8127esac
8128
8129test -z "$AS" && AS=as
8130_LT_DECL([], [AS],      [1], [Assembler program])dnl
8131
8132test -z "$DLLTOOL" && DLLTOOL=dlltool
8133_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
8134
8135test -z "$OBJDUMP" && OBJDUMP=objdump
8136_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
8137])# win32-dll
8138
8139AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
8140[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8141_LT_SET_OPTION([LT_INIT], [win32-dll])
8142AC_DIAGNOSE([obsolete],
8143[$0: Remove this warning and the call to _LT_SET_OPTION when you
8144put the `win32-dll' option into LT_INIT's first parameter.])
8145])
8146
8147dnl aclocal-1.4 backwards compatibility:
8148dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
8149
8150
8151# _LT_ENABLE_SHARED([DEFAULT])
8152# ----------------------------
8153# implement the --enable-shared flag, and supports the `shared' and
8154# `disable-shared' LT_INIT options.
8155# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
8156m4_define([_LT_ENABLE_SHARED],
8157[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
8158AC_ARG_ENABLE([shared],
8159    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
8160	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
8161    [p=${PACKAGE-default}
8162    case $enableval in
8163    yes) enable_shared=yes ;;
8164    no) enable_shared=no ;;
8165    *)
8166      enable_shared=no
8167      # Look at the argument we got.  We use all the common list separators.
8168      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8169      for pkg in $enableval; do
8170	IFS="$lt_save_ifs"
8171	if test "X$pkg" = "X$p"; then
8172	  enable_shared=yes
8173	fi
8174      done
8175      IFS="$lt_save_ifs"
8176      ;;
8177    esac],
8178    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
8179
8180    _LT_DECL([build_libtool_libs], [enable_shared], [0],
8181	[Whether or not to build shared libraries])
8182])# _LT_ENABLE_SHARED
8183
8184LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
8185LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
8186
8187# Old names:
8188AC_DEFUN([AC_ENABLE_SHARED],
8189[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
8190])
8191
8192AC_DEFUN([AC_DISABLE_SHARED],
8193[_LT_SET_OPTION([LT_INIT], [disable-shared])
8194])
8195
8196AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
8197AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
8198
8199dnl aclocal-1.4 backwards compatibility:
8200dnl AC_DEFUN([AM_ENABLE_SHARED], [])
8201dnl AC_DEFUN([AM_DISABLE_SHARED], [])
8202
8203
8204
8205# _LT_ENABLE_STATIC([DEFAULT])
8206# ----------------------------
8207# implement the --enable-static flag, and support the `static' and
8208# `disable-static' LT_INIT options.
8209# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
8210m4_define([_LT_ENABLE_STATIC],
8211[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
8212AC_ARG_ENABLE([static],
8213    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
8214	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
8215    [p=${PACKAGE-default}
8216    case $enableval in
8217    yes) enable_static=yes ;;
8218    no) enable_static=no ;;
8219    *)
8220     enable_static=no
8221      # Look at the argument we got.  We use all the common list separators.
8222      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8223      for pkg in $enableval; do
8224	IFS="$lt_save_ifs"
8225	if test "X$pkg" = "X$p"; then
8226	  enable_static=yes
8227	fi
8228      done
8229      IFS="$lt_save_ifs"
8230      ;;
8231    esac],
8232    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
8233
8234    _LT_DECL([build_old_libs], [enable_static], [0],
8235	[Whether or not to build static libraries])
8236])# _LT_ENABLE_STATIC
8237
8238LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
8239LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
8240
8241# Old names:
8242AC_DEFUN([AC_ENABLE_STATIC],
8243[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
8244])
8245
8246AC_DEFUN([AC_DISABLE_STATIC],
8247[_LT_SET_OPTION([LT_INIT], [disable-static])
8248])
8249
8250AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
8251AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
8252
8253dnl aclocal-1.4 backwards compatibility:
8254dnl AC_DEFUN([AM_ENABLE_STATIC], [])
8255dnl AC_DEFUN([AM_DISABLE_STATIC], [])
8256
8257
8258
8259# _LT_ENABLE_FAST_INSTALL([DEFAULT])
8260# ----------------------------------
8261# implement the --enable-fast-install flag, and support the `fast-install'
8262# and `disable-fast-install' LT_INIT options.
8263# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
8264m4_define([_LT_ENABLE_FAST_INSTALL],
8265[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
8266AC_ARG_ENABLE([fast-install],
8267    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
8268    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
8269    [p=${PACKAGE-default}
8270    case $enableval in
8271    yes) enable_fast_install=yes ;;
8272    no) enable_fast_install=no ;;
8273    *)
8274      enable_fast_install=no
8275      # Look at the argument we got.  We use all the common list separators.
8276      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8277      for pkg in $enableval; do
8278	IFS="$lt_save_ifs"
8279	if test "X$pkg" = "X$p"; then
8280	  enable_fast_install=yes
8281	fi
8282      done
8283      IFS="$lt_save_ifs"
8284      ;;
8285    esac],
8286    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
8287
8288_LT_DECL([fast_install], [enable_fast_install], [0],
8289	 [Whether or not to optimize for fast installation])dnl
8290])# _LT_ENABLE_FAST_INSTALL
8291
8292LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
8293LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
8294
8295# Old names:
8296AU_DEFUN([AC_ENABLE_FAST_INSTALL],
8297[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
8298AC_DIAGNOSE([obsolete],
8299[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8300the `fast-install' option into LT_INIT's first parameter.])
8301])
8302
8303AU_DEFUN([AC_DISABLE_FAST_INSTALL],
8304[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
8305AC_DIAGNOSE([obsolete],
8306[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8307the `disable-fast-install' option into LT_INIT's first parameter.])
8308])
8309
8310dnl aclocal-1.4 backwards compatibility:
8311dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
8312dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
8313
8314
8315# _LT_WITH_PIC([MODE])
8316# --------------------
8317# implement the --with-pic flag, and support the `pic-only' and `no-pic'
8318# LT_INIT options.
8319# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
8320m4_define([_LT_WITH_PIC],
8321[AC_ARG_WITH([pic],
8322    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
8323	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
8324    [lt_p=${PACKAGE-default}
8325    case $withval in
8326    yes|no) pic_mode=$withval ;;
8327    *)
8328      pic_mode=default
8329      # Look at the argument we got.  We use all the common list separators.
8330      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8331      for lt_pkg in $withval; do
8332	IFS="$lt_save_ifs"
8333	if test "X$lt_pkg" = "X$lt_p"; then
8334	  pic_mode=yes
8335	fi
8336      done
8337      IFS="$lt_save_ifs"
8338      ;;
8339    esac],
8340    [pic_mode=default])
8341
8342test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
8343
8344_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
8345])# _LT_WITH_PIC
8346
8347LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
8348LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
8349
8350# Old name:
8351AU_DEFUN([AC_LIBTOOL_PICMODE],
8352[_LT_SET_OPTION([LT_INIT], [pic-only])
8353AC_DIAGNOSE([obsolete],
8354[$0: Remove this warning and the call to _LT_SET_OPTION when you
8355put the `pic-only' option into LT_INIT's first parameter.])
8356])
8357
8358dnl aclocal-1.4 backwards compatibility:
8359dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
8360
8361
8362m4_define([_LTDL_MODE], [])
8363LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
8364		 [m4_define([_LTDL_MODE], [nonrecursive])])
8365LT_OPTION_DEFINE([LTDL_INIT], [recursive],
8366		 [m4_define([_LTDL_MODE], [recursive])])
8367LT_OPTION_DEFINE([LTDL_INIT], [subproject],
8368		 [m4_define([_LTDL_MODE], [subproject])])
8369
8370m4_define([_LTDL_TYPE], [])
8371LT_OPTION_DEFINE([LTDL_INIT], [installable],
8372		 [m4_define([_LTDL_TYPE], [installable])])
8373LT_OPTION_DEFINE([LTDL_INIT], [convenience],
8374		 [m4_define([_LTDL_TYPE], [convenience])])
8375
8376# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
8377#
8378# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
8379# Written by Gary V. Vaughan, 2004
8380#
8381# This file is free software; the Free Software Foundation gives
8382# unlimited permission to copy and/or distribute it, with or without
8383# modifications, as long as this notice is preserved.
8384
8385# serial 6 ltsugar.m4
8386
8387# This is to help aclocal find these macros, as it can't see m4_define.
8388AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
8389
8390
8391# lt_join(SEP, ARG1, [ARG2...])
8392# -----------------------------
8393# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
8394# associated separator.
8395# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
8396# versions in m4sugar had bugs.
8397m4_define([lt_join],
8398[m4_if([$#], [1], [],
8399       [$#], [2], [[$2]],
8400       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
8401m4_define([_lt_join],
8402[m4_if([$#$2], [2], [],
8403       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
8404
8405
8406# lt_car(LIST)
8407# lt_cdr(LIST)
8408# ------------
8409# Manipulate m4 lists.
8410# These macros are necessary as long as will still need to support
8411# Autoconf-2.59 which quotes differently.
8412m4_define([lt_car], [[$1]])
8413m4_define([lt_cdr],
8414[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
8415       [$#], 1, [],
8416       [m4_dquote(m4_shift($@))])])
8417m4_define([lt_unquote], $1)
8418
8419
8420# lt_append(MACRO-NAME, STRING, [SEPARATOR])
8421# ------------------------------------------
8422# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
8423# Note that neither SEPARATOR nor STRING are expanded; they are appended
8424# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
8425# No SEPARATOR is output if MACRO-NAME was previously undefined (different
8426# than defined and empty).
8427#
8428# This macro is needed until we can rely on Autoconf 2.62, since earlier
8429# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
8430m4_define([lt_append],
8431[m4_define([$1],
8432	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
8433
8434
8435
8436# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
8437# ----------------------------------------------------------
8438# Produce a SEP delimited list of all paired combinations of elements of
8439# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
8440# has the form PREFIXmINFIXSUFFIXn.
8441# Needed until we can rely on m4_combine added in Autoconf 2.62.
8442m4_define([lt_combine],
8443[m4_if(m4_eval([$# > 3]), [1],
8444       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
8445[[m4_foreach([_Lt_prefix], [$2],
8446	     [m4_foreach([_Lt_suffix],
8447		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
8448	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
8449
8450
8451# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
8452# -----------------------------------------------------------------------
8453# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
8454# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
8455m4_define([lt_if_append_uniq],
8456[m4_ifdef([$1],
8457	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
8458		 [lt_append([$1], [$2], [$3])$4],
8459		 [$5])],
8460	  [lt_append([$1], [$2], [$3])$4])])
8461
8462
8463# lt_dict_add(DICT, KEY, VALUE)
8464# -----------------------------
8465m4_define([lt_dict_add],
8466[m4_define([$1($2)], [$3])])
8467
8468
8469# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
8470# --------------------------------------------
8471m4_define([lt_dict_add_subkey],
8472[m4_define([$1($2:$3)], [$4])])
8473
8474
8475# lt_dict_fetch(DICT, KEY, [SUBKEY])
8476# ----------------------------------
8477m4_define([lt_dict_fetch],
8478[m4_ifval([$3],
8479	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
8480    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
8481
8482
8483# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
8484# -----------------------------------------------------------------
8485m4_define([lt_if_dict_fetch],
8486[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
8487	[$5],
8488    [$6])])
8489
8490
8491# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
8492# --------------------------------------------------------------
8493m4_define([lt_dict_filter],
8494[m4_if([$5], [], [],
8495  [lt_join(m4_quote(m4_default([$4], [[, ]])),
8496           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
8497		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
8498])
8499
8500# ltversion.m4 -- version numbers			-*- Autoconf -*-
8501#
8502#   Copyright (C) 2004 Free Software Foundation, Inc.
8503#   Written by Scott James Remnant, 2004
8504#
8505# This file is free software; the Free Software Foundation gives
8506# unlimited permission to copy and/or distribute it, with or without
8507# modifications, as long as this notice is preserved.
8508
8509# @configure_input@
8510
8511# serial 3337 ltversion.m4
8512# This file is part of GNU Libtool
8513
8514m4_define([LT_PACKAGE_VERSION], [2.4.2])
8515m4_define([LT_PACKAGE_REVISION], [1.3337])
8516
8517AC_DEFUN([LTVERSION_VERSION],
8518[macro_version='2.4.2'
8519macro_revision='1.3337'
8520_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
8521_LT_DECL(, macro_revision, 0)
8522])
8523
8524# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
8525#
8526#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
8527#   Written by Scott James Remnant, 2004.
8528#
8529# This file is free software; the Free Software Foundation gives
8530# unlimited permission to copy and/or distribute it, with or without
8531# modifications, as long as this notice is preserved.
8532
8533# serial 5 lt~obsolete.m4
8534
8535# These exist entirely to fool aclocal when bootstrapping libtool.
8536#
8537# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
8538# which have later been changed to m4_define as they aren't part of the
8539# exported API, or moved to Autoconf or Automake where they belong.
8540#
8541# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
8542# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
8543# using a macro with the same name in our local m4/libtool.m4 it'll
8544# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
8545# and doesn't know about Autoconf macros at all.)
8546#
8547# So we provide this file, which has a silly filename so it's always
8548# included after everything else.  This provides aclocal with the
8549# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
8550# because those macros already exist, or will be overwritten later.
8551# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
8552#
8553# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
8554# Yes, that means every name once taken will need to remain here until
8555# we give up compatibility with versions before 1.7, at which point
8556# we need to keep only those names which we still refer to.
8557
8558# This is to help aclocal find these macros, as it can't see m4_define.
8559AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
8560
8561m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
8562m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
8563m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
8564m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
8565m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
8566m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
8567m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
8568m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
8569m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
8570m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
8571m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
8572m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
8573m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
8574m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
8575m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
8576m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
8577m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
8578m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
8579m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
8580m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
8581m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
8582m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
8583m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
8584m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
8585m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
8586m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
8587m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
8588m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
8589m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
8590m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
8591m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
8592m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
8593m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
8594m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
8595m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
8596m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
8597m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
8598m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
8599m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
8600m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
8601m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
8602m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
8603m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
8604m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
8605m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
8606m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
8607m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
8608m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
8609m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
8610m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
8611m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
8612m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
8613m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
8614m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
8615m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
8616m4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
8617m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
8618m4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
8619m4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
8620m4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
8621m4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
8622
8623# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
8624# serial 1 (pkg-config-0.24)
8625# 
8626# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
8627#
8628# This program is free software; you can redistribute it and/or modify
8629# it under the terms of the GNU General Public License as published by
8630# the Free Software Foundation; either version 2 of the License, or
8631# (at your option) any later version.
8632#
8633# This program is distributed in the hope that it will be useful, but
8634# WITHOUT ANY WARRANTY; without even the implied warranty of
8635# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
8636# General Public License for more details.
8637#
8638# You should have received a copy of the GNU General Public License
8639# along with this program; if not, write to the Free Software
8640# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
8641#
8642# As a special exception to the GNU General Public License, if you
8643# distribute this file as part of a program that contains a
8644# configuration script generated by Autoconf, you may include it under
8645# the same distribution terms that you use for the rest of that program.
8646
8647# PKG_PROG_PKG_CONFIG([MIN-VERSION])
8648# ----------------------------------
8649AC_DEFUN([PKG_PROG_PKG_CONFIG],
8650[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
8651m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
8652m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
8653AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
8654AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
8655AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
8656
8657if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
8658	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
8659fi
8660if test -n "$PKG_CONFIG"; then
8661	_pkg_min_version=m4_default([$1], [0.9.0])
8662	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
8663	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
8664		AC_MSG_RESULT([yes])
8665	else
8666		AC_MSG_RESULT([no])
8667		PKG_CONFIG=""
8668	fi
8669fi[]dnl
8670])# PKG_PROG_PKG_CONFIG
8671
8672# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
8673#
8674# Check to see whether a particular set of modules exists.  Similar
8675# to PKG_CHECK_MODULES(), but does not set variables or print errors.
8676#
8677# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
8678# only at the first occurence in configure.ac, so if the first place
8679# it's called might be skipped (such as if it is within an "if", you
8680# have to call PKG_CHECK_EXISTS manually
8681# --------------------------------------------------------------
8682AC_DEFUN([PKG_CHECK_EXISTS],
8683[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8684if test -n "$PKG_CONFIG" && \
8685    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
8686  m4_default([$2], [:])
8687m4_ifvaln([$3], [else
8688  $3])dnl
8689fi])
8690
8691# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
8692# ---------------------------------------------
8693m4_define([_PKG_CONFIG],
8694[if test -n "$$1"; then
8695    pkg_cv_[]$1="$$1"
8696 elif test -n "$PKG_CONFIG"; then
8697    PKG_CHECK_EXISTS([$3],
8698                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
8699		      test "x$?" != "x0" && pkg_failed=yes ],
8700		     [pkg_failed=yes])
8701 else
8702    pkg_failed=untried
8703fi[]dnl
8704])# _PKG_CONFIG
8705
8706# _PKG_SHORT_ERRORS_SUPPORTED
8707# -----------------------------
8708AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
8709[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
8710if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
8711        _pkg_short_errors_supported=yes
8712else
8713        _pkg_short_errors_supported=no
8714fi[]dnl
8715])# _PKG_SHORT_ERRORS_SUPPORTED
8716
8717
8718# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
8719# [ACTION-IF-NOT-FOUND])
8720#
8721#
8722# Note that if there is a possibility the first call to
8723# PKG_CHECK_MODULES might not happen, you should be sure to include an
8724# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
8725#
8726#
8727# --------------------------------------------------------------
8728AC_DEFUN([PKG_CHECK_MODULES],
8729[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8730AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
8731AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
8732
8733pkg_failed=no
8734AC_MSG_CHECKING([for $1])
8735
8736_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
8737_PKG_CONFIG([$1][_LIBS], [libs], [$2])
8738
8739m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
8740and $1[]_LIBS to avoid the need to call pkg-config.
8741See the pkg-config man page for more details.])
8742
8743if test $pkg_failed = yes; then
8744   	AC_MSG_RESULT([no])
8745        _PKG_SHORT_ERRORS_SUPPORTED
8746        if test $_pkg_short_errors_supported = yes; then
8747	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
8748        else 
8749	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
8750        fi
8751	# Put the nasty error message in config.log where it belongs
8752	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
8753
8754	m4_default([$4], [AC_MSG_ERROR(
8755[Package requirements ($2) were not met:
8756
8757$$1_PKG_ERRORS
8758
8759Consider adjusting the PKG_CONFIG_PATH environment variable if you
8760installed software in a non-standard prefix.
8761
8762_PKG_TEXT])[]dnl
8763        ])
8764elif test $pkg_failed = untried; then
8765     	AC_MSG_RESULT([no])
8766	m4_default([$4], [AC_MSG_FAILURE(
8767[The pkg-config script could not be found or is too old.  Make sure it
8768is in your PATH or set the PKG_CONFIG environment variable to the full
8769path to pkg-config.
8770
8771_PKG_TEXT
8772
8773To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
8774        ])
8775else
8776	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
8777	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
8778        AC_MSG_RESULT([yes])
8779	$3
8780fi[]dnl
8781])# PKG_CHECK_MODULES
8782
8783
8784# PKG_INSTALLDIR(DIRECTORY)
8785# -------------------------
8786# Substitutes the variable pkgconfigdir as the location where a module
8787# should install pkg-config .pc files. By default the directory is
8788# $libdir/pkgconfig, but the default can be changed by passing
8789# DIRECTORY. The user can override through the --with-pkgconfigdir
8790# parameter.
8791AC_DEFUN([PKG_INSTALLDIR],
8792[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
8793m4_pushdef([pkg_description],
8794    [pkg-config installation directory @<:@]pkg_default[@:>@])
8795AC_ARG_WITH([pkgconfigdir],
8796    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
8797    [with_pkgconfigdir=]pkg_default)
8798AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
8799m4_popdef([pkg_default])
8800m4_popdef([pkg_description])
8801]) dnl PKG_INSTALLDIR
8802
8803
8804# PKG_NOARCH_INSTALLDIR(DIRECTORY)
8805# -------------------------
8806# Substitutes the variable noarch_pkgconfigdir as the location where a
8807# module should install arch-independent pkg-config .pc files. By
8808# default the directory is $datadir/pkgconfig, but the default can be
8809# changed by passing DIRECTORY. The user can override through the
8810# --with-noarch-pkgconfigdir parameter.
8811AC_DEFUN([PKG_NOARCH_INSTALLDIR],
8812[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
8813m4_pushdef([pkg_description],
8814    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
8815AC_ARG_WITH([noarch-pkgconfigdir],
8816    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
8817    [with_noarch_pkgconfigdir=]pkg_default)
8818AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
8819m4_popdef([pkg_default])
8820m4_popdef([pkg_description])
8821]) dnl PKG_NOARCH_INSTALLDIR
8822
8823
8824# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
8825# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
8826# -------------------------------------------
8827# Retrieves the value of the pkg-config variable for the given module.
8828AC_DEFUN([PKG_CHECK_VAR],
8829[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8830AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
8831
8832_PKG_CONFIG([$1], [variable="][$3]["], [$2])
8833AS_VAR_COPY([$1], [pkg_cv_][$1])
8834
8835AS_VAR_IF([$1], [""], [$5], [$4])dnl
8836])# PKG_CHECK_VAR
8837
8838dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
8839dnl
8840dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
8841dnl
8842dnl Permission is hereby granted, free of charge, to any person obtaining a
8843dnl copy of this software and associated documentation files (the "Software"),
8844dnl to deal in the Software without restriction, including without limitation
8845dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
8846dnl and/or sell copies of the Software, and to permit persons to whom the
8847dnl Software is furnished to do so, subject to the following conditions:
8848dnl
8849dnl The above copyright notice and this permission notice (including the next
8850dnl paragraph) shall be included in all copies or substantial portions of the
8851dnl Software.
8852dnl
8853dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
8854dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
8855dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
8856dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
8857dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
8858dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
8859dnl DEALINGS IN THE SOFTWARE.
8860
8861# XORG_MACROS_VERSION(required-version)
8862# -------------------------------------
8863# Minimum version: 1.1.0
8864#
8865# If you're using a macro added in Version 1.1 or newer, include this in
8866# your configure.ac with the minimum required version, such as:
8867# XORG_MACROS_VERSION(1.1)
8868#
8869# To ensure that this macro is defined, also add:
8870# m4_ifndef([XORG_MACROS_VERSION],
8871#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
8872#
8873#
8874# See the "minimum version" comment for each macro you use to see what
8875# version you require.
8876m4_defun([XORG_MACROS_VERSION],[
8877m4_define([vers_have], [1.19.0])
8878m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
8879m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
8880m4_if(m4_cmp(maj_have, maj_needed), 0,,
8881    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
8882m4_if(m4_version_compare(vers_have, [$1]), -1,
8883    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
8884m4_undefine([vers_have])
8885m4_undefine([maj_have])
8886m4_undefine([maj_needed])
8887]) # XORG_MACROS_VERSION
8888
8889# XORG_PROG_RAWCPP()
8890# ------------------
8891# Minimum version: 1.0.0
8892#
8893# Find cpp program and necessary flags for use in pre-processing text files
8894# such as man pages and config files
8895AC_DEFUN([XORG_PROG_RAWCPP],[
8896AC_REQUIRE([AC_PROG_CPP])
8897AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
8898   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
8899
8900# Check for flag to avoid builtin definitions - assumes unix is predefined,
8901# which is not the best choice for supporting other OS'es, but covers most
8902# of the ones we need for now.
8903AC_MSG_CHECKING([if $RAWCPP requires -undef])
8904AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
8905if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
8906	AC_MSG_RESULT([no])
8907else
8908	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
8909		RAWCPPFLAGS=-undef
8910		AC_MSG_RESULT([yes])
8911	# under Cygwin unix is still defined even with -undef
8912	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
8913		RAWCPPFLAGS="-undef -ansi"
8914		AC_MSG_RESULT([yes, with -ansi])
8915	else
8916		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
8917	fi
8918fi
8919rm -f conftest.$ac_ext
8920
8921AC_MSG_CHECKING([if $RAWCPP requires -traditional])
8922AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
8923if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
8924	AC_MSG_RESULT([no])
8925else
8926	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
8927		TRADITIONALCPPFLAGS="-traditional"
8928		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
8929		AC_MSG_RESULT([yes])
8930	else
8931		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
8932	fi
8933fi
8934rm -f conftest.$ac_ext
8935AC_SUBST(RAWCPPFLAGS)
8936AC_SUBST(TRADITIONALCPPFLAGS)
8937]) # XORG_PROG_RAWCPP
8938
8939# XORG_MANPAGE_SECTIONS()
8940# -----------------------
8941# Minimum version: 1.0.0
8942#
8943# Determine which sections man pages go in for the different man page types
8944# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
8945# Not sure if there's any better way than just hardcoding by OS name.
8946# Override default settings by setting environment variables
8947# Added MAN_SUBSTS in version 1.8
8948# Added AC_PROG_SED in version 1.8
8949
8950AC_DEFUN([XORG_MANPAGE_SECTIONS],[
8951AC_REQUIRE([AC_CANONICAL_HOST])
8952AC_REQUIRE([AC_PROG_SED])
8953
8954if test x$APP_MAN_SUFFIX = x    ; then
8955    APP_MAN_SUFFIX=1
8956fi
8957if test x$APP_MAN_DIR = x    ; then
8958    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
8959fi
8960
8961if test x$LIB_MAN_SUFFIX = x    ; then
8962    LIB_MAN_SUFFIX=3
8963fi
8964if test x$LIB_MAN_DIR = x    ; then
8965    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
8966fi
8967
8968if test x$FILE_MAN_SUFFIX = x    ; then
8969    case $host_os in
8970	solaris*)	FILE_MAN_SUFFIX=4  ;;
8971	*)		FILE_MAN_SUFFIX=5  ;;
8972    esac
8973fi
8974if test x$FILE_MAN_DIR = x    ; then
8975    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
8976fi
8977
8978if test x$MISC_MAN_SUFFIX = x    ; then
8979    case $host_os in
8980	solaris*)	MISC_MAN_SUFFIX=5  ;;
8981	*)		MISC_MAN_SUFFIX=7  ;;
8982    esac
8983fi
8984if test x$MISC_MAN_DIR = x    ; then
8985    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
8986fi
8987
8988if test x$DRIVER_MAN_SUFFIX = x    ; then
8989    case $host_os in
8990	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
8991	*)		DRIVER_MAN_SUFFIX=4  ;;
8992    esac
8993fi
8994if test x$DRIVER_MAN_DIR = x    ; then
8995    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
8996fi
8997
8998if test x$ADMIN_MAN_SUFFIX = x    ; then
8999    case $host_os in
9000	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
9001	*)		ADMIN_MAN_SUFFIX=8  ;;
9002    esac
9003fi
9004if test x$ADMIN_MAN_DIR = x    ; then
9005    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
9006fi
9007
9008
9009AC_SUBST([APP_MAN_SUFFIX])
9010AC_SUBST([LIB_MAN_SUFFIX])
9011AC_SUBST([FILE_MAN_SUFFIX])
9012AC_SUBST([MISC_MAN_SUFFIX])
9013AC_SUBST([DRIVER_MAN_SUFFIX])
9014AC_SUBST([ADMIN_MAN_SUFFIX])
9015AC_SUBST([APP_MAN_DIR])
9016AC_SUBST([LIB_MAN_DIR])
9017AC_SUBST([FILE_MAN_DIR])
9018AC_SUBST([MISC_MAN_DIR])
9019AC_SUBST([DRIVER_MAN_DIR])
9020AC_SUBST([ADMIN_MAN_DIR])
9021
9022XORG_MAN_PAGE="X Version 11"
9023AC_SUBST([XORG_MAN_PAGE])
9024MAN_SUBSTS="\
9025	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9026	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9027	-e 's|__xservername__|Xorg|g' \
9028	-e 's|__xconfigfile__|xorg.conf|g' \
9029	-e 's|__projectroot__|\$(prefix)|g' \
9030	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
9031	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
9032	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
9033	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
9034	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
9035	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
9036	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
9037AC_SUBST([MAN_SUBSTS])
9038
9039]) # XORG_MANPAGE_SECTIONS
9040
9041# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
9042# ------------------------
9043# Minimum version: 1.7.0
9044#
9045# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
9046# provided by xorg-sgml-doctools, if installed.
9047AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
9048AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
9049XORG_SGML_PATH=
9050PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
9051    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
9052    [m4_ifval([$1],[:],
9053        [if test x"$cross_compiling" != x"yes" ; then
9054            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
9055                          [XORG_SGML_PATH=$prefix/share/sgml])
9056         fi])
9057    ])
9058
9059# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
9060# the path and the name of the doc stylesheet
9061if test "x$XORG_SGML_PATH" != "x" ; then
9062   AC_MSG_RESULT([$XORG_SGML_PATH])
9063   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
9064   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
9065else
9066   AC_MSG_RESULT([no])
9067fi
9068
9069AC_SUBST(XORG_SGML_PATH)
9070AC_SUBST(STYLESHEET_SRCDIR)
9071AC_SUBST(XSL_STYLESHEET)
9072AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
9073]) # XORG_CHECK_SGML_DOCTOOLS
9074
9075# XORG_CHECK_LINUXDOC
9076# -------------------
9077# Minimum version: 1.0.0
9078#
9079# Defines the variable MAKE_TEXT if the necessary tools and
9080# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
9081# Whether or not the necessary tools and files are found can be checked
9082# with the AM_CONDITIONAL "BUILD_LINUXDOC"
9083AC_DEFUN([XORG_CHECK_LINUXDOC],[
9084AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9085AC_REQUIRE([XORG_WITH_PS2PDF])
9086
9087AC_PATH_PROG(LINUXDOC, linuxdoc)
9088
9089AC_MSG_CHECKING([whether to build documentation])
9090
9091if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
9092   BUILDDOC=yes
9093else
9094   BUILDDOC=no
9095fi
9096
9097AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
9098
9099AC_MSG_RESULT([$BUILDDOC])
9100
9101AC_MSG_CHECKING([whether to build pdf documentation])
9102
9103if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
9104   BUILDPDFDOC=yes
9105else
9106   BUILDPDFDOC=no
9107fi
9108
9109AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9110
9111AC_MSG_RESULT([$BUILDPDFDOC])
9112
9113MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
9114MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
9115MAKE_PDF="$PS2PDF"
9116MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
9117
9118AC_SUBST(MAKE_TEXT)
9119AC_SUBST(MAKE_PS)
9120AC_SUBST(MAKE_PDF)
9121AC_SUBST(MAKE_HTML)
9122]) # XORG_CHECK_LINUXDOC
9123
9124# XORG_CHECK_DOCBOOK
9125# -------------------
9126# Minimum version: 1.0.0
9127#
9128# Checks for the ability to build output formats from SGML DocBook source.
9129# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
9130# indicates whether the necessary tools and files are found and, if set,
9131# $(MAKE_XXX) blah.sgml will produce blah.xxx.
9132AC_DEFUN([XORG_CHECK_DOCBOOK],[
9133AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9134
9135BUILDTXTDOC=no
9136BUILDPDFDOC=no
9137BUILDPSDOC=no
9138BUILDHTMLDOC=no
9139
9140AC_PATH_PROG(DOCBOOKPS, docbook2ps)
9141AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
9142AC_PATH_PROG(DOCBOOKHTML, docbook2html)
9143AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
9144
9145AC_MSG_CHECKING([whether to build text documentation])
9146if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
9147   test x$BUILD_TXTDOC != xno; then
9148	BUILDTXTDOC=yes
9149fi
9150AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
9151AC_MSG_RESULT([$BUILDTXTDOC])
9152
9153AC_MSG_CHECKING([whether to build PDF documentation])
9154if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
9155   test x$BUILD_PDFDOC != xno; then
9156	BUILDPDFDOC=yes
9157fi
9158AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9159AC_MSG_RESULT([$BUILDPDFDOC])
9160
9161AC_MSG_CHECKING([whether to build PostScript documentation])
9162if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
9163   test x$BUILD_PSDOC != xno; then
9164	BUILDPSDOC=yes
9165fi
9166AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
9167AC_MSG_RESULT([$BUILDPSDOC])
9168
9169AC_MSG_CHECKING([whether to build HTML documentation])
9170if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
9171   test x$BUILD_HTMLDOC != xno; then
9172	BUILDHTMLDOC=yes
9173fi
9174AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
9175AC_MSG_RESULT([$BUILDHTMLDOC])
9176
9177MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
9178MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
9179MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
9180MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
9181
9182AC_SUBST(MAKE_TEXT)
9183AC_SUBST(MAKE_PS)
9184AC_SUBST(MAKE_PDF)
9185AC_SUBST(MAKE_HTML)
9186]) # XORG_CHECK_DOCBOOK
9187
9188# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
9189# ----------------
9190# Minimum version: 1.5.0
9191# Minimum version for optional DEFAULT argument: 1.11.0
9192#
9193# Documentation tools are not always available on all platforms and sometimes
9194# not at the appropriate level. This macro enables a module to test for the
9195# presence of the tool and obtain it's path in separate variables. Coupled with
9196# the --with-xmlto option, it allows maximum flexibilty in making decisions
9197# as whether or not to use the xmlto package. When DEFAULT is not specified,
9198# --with-xmlto assumes 'auto'.
9199#
9200# Interface to module:
9201# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
9202# XMLTO:	returns the path of the xmlto program found
9203#		returns the path set by the user in the environment
9204# --with-xmlto:	'yes' user instructs the module to use xmlto
9205#		'no' user instructs the module not to use xmlto
9206#
9207# Added in version 1.10.0
9208# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
9209#                  xmlto for text output requires either lynx, links, or w3m browsers
9210#
9211# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
9212#
9213AC_DEFUN([XORG_WITH_XMLTO],[
9214AC_ARG_VAR([XMLTO], [Path to xmlto command])
9215m4_define([_defopt], m4_default([$2], [auto]))
9216AC_ARG_WITH(xmlto,
9217	AS_HELP_STRING([--with-xmlto],
9218	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
9219	   [use_xmlto=$withval], [use_xmlto=]_defopt)
9220m4_undefine([_defopt])
9221
9222if test "x$use_xmlto" = x"auto"; then
9223   AC_PATH_PROG([XMLTO], [xmlto])
9224   if test "x$XMLTO" = "x"; then
9225        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
9226	have_xmlto=no
9227   else
9228        have_xmlto=yes
9229   fi
9230elif test "x$use_xmlto" = x"yes" ; then
9231   AC_PATH_PROG([XMLTO], [xmlto])
9232   if test "x$XMLTO" = "x"; then
9233        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
9234   fi
9235   have_xmlto=yes
9236elif test "x$use_xmlto" = x"no" ; then
9237   if test "x$XMLTO" != "x"; then
9238      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
9239   fi
9240   have_xmlto=no
9241else
9242   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
9243fi
9244
9245# Test for a minimum version of xmlto, if provided.
9246m4_ifval([$1],
9247[if test "$have_xmlto" = yes; then
9248    # scrape the xmlto version
9249    AC_MSG_CHECKING([the xmlto version])
9250    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
9251    AC_MSG_RESULT([$xmlto_version])
9252    AS_VERSION_COMPARE([$xmlto_version], [$1],
9253        [if test "x$use_xmlto" = xauto; then
9254            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
9255            have_xmlto=no
9256        else
9257            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
9258        fi])
9259fi])
9260
9261# Test for the ability of xmlto to generate a text target
9262have_xmlto_text=no
9263cat > conftest.xml << "EOF"
9264EOF
9265AS_IF([test "$have_xmlto" = yes],
9266      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
9267             [have_xmlto_text=yes],
9268             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
9269rm -f conftest.xml
9270AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
9271AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
9272]) # XORG_WITH_XMLTO
9273
9274# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
9275# --------------------------------------------
9276# Minimum version: 1.12.0
9277# Minimum version for optional DEFAULT argument: 1.12.0
9278#
9279# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
9280# XML-based language used for the transformation of XML documents.
9281# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
9282# It is used under the cover by xmlto to generate html files from DocBook/XML.
9283# The XSLT processor is often used as a standalone tool for transformations.
9284# It should not be assumed that this tool is used only to work with documnetation.
9285# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
9286#
9287# Interface to module:
9288# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
9289# XSLTPROC:	 returns the path of the xsltproc program found
9290#		 returns the path set by the user in the environment
9291# --with-xsltproc: 'yes' user instructs the module to use xsltproc
9292#		  'no' user instructs the module not to use xsltproc
9293# have_xsltproc: returns yes if xsltproc found in PATH or no
9294#
9295# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
9296#
9297AC_DEFUN([XORG_WITH_XSLTPROC],[
9298AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
9299# Preserves the interface, should it be implemented later
9300m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
9301m4_define([_defopt], m4_default([$2], [auto]))
9302AC_ARG_WITH(xsltproc,
9303	AS_HELP_STRING([--with-xsltproc],
9304	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
9305	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
9306m4_undefine([_defopt])
9307
9308if test "x$use_xsltproc" = x"auto"; then
9309   AC_PATH_PROG([XSLTPROC], [xsltproc])
9310   if test "x$XSLTPROC" = "x"; then
9311        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
9312	have_xsltproc=no
9313   else
9314        have_xsltproc=yes
9315   fi
9316elif test "x$use_xsltproc" = x"yes" ; then
9317   AC_PATH_PROG([XSLTPROC], [xsltproc])
9318   if test "x$XSLTPROC" = "x"; then
9319        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
9320   fi
9321   have_xsltproc=yes
9322elif test "x$use_xsltproc" = x"no" ; then
9323   if test "x$XSLTPROC" != "x"; then
9324      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
9325   fi
9326   have_xsltproc=no
9327else
9328   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
9329fi
9330
9331AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
9332]) # XORG_WITH_XSLTPROC
9333
9334# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
9335# ----------------------------------------
9336# Minimum version: 1.15.0
9337#
9338# PERL (Practical Extraction and Report Language) is a language optimized for
9339# scanning arbitrary text files, extracting information from those text files,
9340# and printing reports based on that information.
9341#
9342# When DEFAULT is not specified, --with-perl assumes 'auto'.
9343#
9344# Interface to module:
9345# HAVE_PERL: used in makefiles to conditionally scan text files
9346# PERL:	     returns the path of the perl program found
9347#	     returns the path set by the user in the environment
9348# --with-perl: 'yes' user instructs the module to use perl
9349#	       'no' user instructs the module not to use perl
9350# have_perl: returns yes if perl found in PATH or no
9351#
9352# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
9353#
9354AC_DEFUN([XORG_WITH_PERL],[
9355AC_ARG_VAR([PERL], [Path to perl command])
9356# Preserves the interface, should it be implemented later
9357m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
9358m4_define([_defopt], m4_default([$2], [auto]))
9359AC_ARG_WITH(perl,
9360	AS_HELP_STRING([--with-perl],
9361	   [Use perl for extracting information from files (default: ]_defopt[)]),
9362	   [use_perl=$withval], [use_perl=]_defopt)
9363m4_undefine([_defopt])
9364
9365if test "x$use_perl" = x"auto"; then
9366   AC_PATH_PROG([PERL], [perl])
9367   if test "x$PERL" = "x"; then
9368        AC_MSG_WARN([perl not found - cannot extract information and report])
9369	have_perl=no
9370   else
9371        have_perl=yes
9372   fi
9373elif test "x$use_perl" = x"yes" ; then
9374   AC_PATH_PROG([PERL], [perl])
9375   if test "x$PERL" = "x"; then
9376        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
9377   fi
9378   have_perl=yes
9379elif test "x$use_perl" = x"no" ; then
9380   if test "x$PERL" != "x"; then
9381      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
9382   fi
9383   have_perl=no
9384else
9385   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
9386fi
9387
9388AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
9389]) # XORG_WITH_PERL
9390
9391# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
9392# ----------------
9393# Minimum version: 1.5.0
9394# Minimum version for optional DEFAULT argument: 1.11.0
9395#
9396# Documentation tools are not always available on all platforms and sometimes
9397# not at the appropriate level. This macro enables a module to test for the
9398# presence of the tool and obtain it's path in separate variables. Coupled with
9399# the --with-asciidoc option, it allows maximum flexibilty in making decisions
9400# as whether or not to use the asciidoc package. When DEFAULT is not specified,
9401# --with-asciidoc assumes 'auto'.
9402#
9403# Interface to module:
9404# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
9405# ASCIIDOC:	 returns the path of the asciidoc program found
9406#		 returns the path set by the user in the environment
9407# --with-asciidoc: 'yes' user instructs the module to use asciidoc
9408#		  'no' user instructs the module not to use asciidoc
9409#
9410# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
9411#
9412AC_DEFUN([XORG_WITH_ASCIIDOC],[
9413AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
9414m4_define([_defopt], m4_default([$2], [auto]))
9415AC_ARG_WITH(asciidoc,
9416	AS_HELP_STRING([--with-asciidoc],
9417	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
9418	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
9419m4_undefine([_defopt])
9420
9421if test "x$use_asciidoc" = x"auto"; then
9422   AC_PATH_PROG([ASCIIDOC], [asciidoc])
9423   if test "x$ASCIIDOC" = "x"; then
9424        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
9425	have_asciidoc=no
9426   else
9427        have_asciidoc=yes
9428   fi
9429elif test "x$use_asciidoc" = x"yes" ; then
9430   AC_PATH_PROG([ASCIIDOC], [asciidoc])
9431   if test "x$ASCIIDOC" = "x"; then
9432        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
9433   fi
9434   have_asciidoc=yes
9435elif test "x$use_asciidoc" = x"no" ; then
9436   if test "x$ASCIIDOC" != "x"; then
9437      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
9438   fi
9439   have_asciidoc=no
9440else
9441   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
9442fi
9443m4_ifval([$1],
9444[if test "$have_asciidoc" = yes; then
9445    # scrape the asciidoc version
9446    AC_MSG_CHECKING([the asciidoc version])
9447    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
9448    AC_MSG_RESULT([$asciidoc_version])
9449    AS_VERSION_COMPARE([$asciidoc_version], [$1],
9450        [if test "x$use_asciidoc" = xauto; then
9451            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
9452            have_asciidoc=no
9453        else
9454            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
9455        fi])
9456fi])
9457AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
9458]) # XORG_WITH_ASCIIDOC
9459
9460# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
9461# -------------------------------------------
9462# Minimum version: 1.5.0
9463# Minimum version for optional DEFAULT argument: 1.11.0
9464# Minimum version for optional DOT checking: 1.18.0
9465#
9466# Documentation tools are not always available on all platforms and sometimes
9467# not at the appropriate level. This macro enables a module to test for the
9468# presence of the tool and obtain it's path in separate variables. Coupled with
9469# the --with-doxygen option, it allows maximum flexibilty in making decisions
9470# as whether or not to use the doxygen package. When DEFAULT is not specified,
9471# --with-doxygen assumes 'auto'.
9472#
9473# Interface to module:
9474# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
9475# DOXYGEN:	 returns the path of the doxygen program found
9476#		 returns the path set by the user in the environment
9477# --with-doxygen: 'yes' user instructs the module to use doxygen
9478#		  'no' user instructs the module not to use doxygen
9479#
9480# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
9481#
9482AC_DEFUN([XORG_WITH_DOXYGEN],[
9483AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
9484AC_ARG_VAR([DOT], [Path to the dot graphics utility])
9485m4_define([_defopt], m4_default([$2], [auto]))
9486AC_ARG_WITH(doxygen,
9487	AS_HELP_STRING([--with-doxygen],
9488	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
9489	   [use_doxygen=$withval], [use_doxygen=]_defopt)
9490m4_undefine([_defopt])
9491
9492if test "x$use_doxygen" = x"auto"; then
9493   AC_PATH_PROG([DOXYGEN], [doxygen])
9494   if test "x$DOXYGEN" = "x"; then
9495        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
9496	have_doxygen=no
9497   else
9498        have_doxygen=yes
9499   fi
9500elif test "x$use_doxygen" = x"yes" ; then
9501   AC_PATH_PROG([DOXYGEN], [doxygen])
9502   if test "x$DOXYGEN" = "x"; then
9503        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
9504   fi
9505   have_doxygen=yes
9506elif test "x$use_doxygen" = x"no" ; then
9507   if test "x$DOXYGEN" != "x"; then
9508      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
9509   fi
9510   have_doxygen=no
9511else
9512   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
9513fi
9514m4_ifval([$1],
9515[if test "$have_doxygen" = yes; then
9516    # scrape the doxygen version
9517    AC_MSG_CHECKING([the doxygen version])
9518    doxygen_version=`$DOXYGEN --version 2>/dev/null`
9519    AC_MSG_RESULT([$doxygen_version])
9520    AS_VERSION_COMPARE([$doxygen_version], [$1],
9521        [if test "x$use_doxygen" = xauto; then
9522            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
9523            have_doxygen=no
9524        else
9525            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
9526        fi])
9527fi])
9528
9529dnl Check for DOT if we have doxygen. The caller decides if it is mandatory
9530dnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
9531dnl 	HAVE_DOT = @HAVE_DOT@
9532HAVE_DOT=no
9533if test "x$have_doxygen" = "xyes"; then
9534  AC_PATH_PROG([DOT], [dot])
9535    if test "x$DOT" != "x"; then
9536      HAVE_DOT=yes
9537    fi
9538fi
9539
9540AC_SUBST([HAVE_DOT])
9541AM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
9542AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
9543]) # XORG_WITH_DOXYGEN
9544
9545# XORG_WITH_GROFF([DEFAULT])
9546# ----------------
9547# Minimum version: 1.6.0
9548# Minimum version for optional DEFAULT argument: 1.11.0
9549#
9550# Documentation tools are not always available on all platforms and sometimes
9551# not at the appropriate level. This macro enables a module to test for the
9552# presence of the tool and obtain it's path in separate variables. Coupled with
9553# the --with-groff option, it allows maximum flexibilty in making decisions
9554# as whether or not to use the groff package. When DEFAULT is not specified,
9555# --with-groff assumes 'auto'.
9556#
9557# Interface to module:
9558# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
9559# HAVE_GROFF_MM: the memorandum macros (-mm) package
9560# HAVE_GROFF_MS: the -ms macros package
9561# GROFF:	 returns the path of the groff program found
9562#		 returns the path set by the user in the environment
9563# --with-groff:	 'yes' user instructs the module to use groff
9564#		 'no' user instructs the module not to use groff
9565#
9566# Added in version 1.9.0:
9567# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
9568#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
9569#		   psselect from the psutils package.
9570#		   the ghostcript package. Refer to the grohtml man pages
9571#
9572# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
9573#
9574# OS and distros often splits groff in a basic and full package, the former
9575# having the groff program and the later having devices, fonts and macros
9576# Checking for the groff executable is not enough.
9577#
9578# If macros are missing, we cannot assume that groff is useless, so we don't
9579# unset HAVE_GROFF or GROFF env variables.
9580# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
9581#
9582AC_DEFUN([XORG_WITH_GROFF],[
9583AC_ARG_VAR([GROFF], [Path to groff command])
9584m4_define([_defopt], m4_default([$1], [auto]))
9585AC_ARG_WITH(groff,
9586	AS_HELP_STRING([--with-groff],
9587	   [Use groff to regenerate documentation (default: ]_defopt[)]),
9588	   [use_groff=$withval], [use_groff=]_defopt)
9589m4_undefine([_defopt])
9590
9591if test "x$use_groff" = x"auto"; then
9592   AC_PATH_PROG([GROFF], [groff])
9593   if test "x$GROFF" = "x"; then
9594        AC_MSG_WARN([groff not found - documentation targets will be skipped])
9595	have_groff=no
9596   else
9597        have_groff=yes
9598   fi
9599elif test "x$use_groff" = x"yes" ; then
9600   AC_PATH_PROG([GROFF], [groff])
9601   if test "x$GROFF" = "x"; then
9602        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
9603   fi
9604   have_groff=yes
9605elif test "x$use_groff" = x"no" ; then
9606   if test "x$GROFF" != "x"; then
9607      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
9608   fi
9609   have_groff=no
9610else
9611   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
9612fi
9613
9614# We have groff, test for the presence of the macro packages
9615if test "x$have_groff" = x"yes"; then
9616    AC_MSG_CHECKING([for ${GROFF} -ms macros])
9617    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
9618        groff_ms_works=yes
9619    else
9620        groff_ms_works=no
9621    fi
9622    AC_MSG_RESULT([$groff_ms_works])
9623    AC_MSG_CHECKING([for ${GROFF} -mm macros])
9624    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
9625        groff_mm_works=yes
9626    else
9627        groff_mm_works=no
9628    fi
9629    AC_MSG_RESULT([$groff_mm_works])
9630fi
9631
9632# We have groff, test for HTML dependencies, one command per package
9633if test "x$have_groff" = x"yes"; then
9634   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
9635   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
9636   AC_PATH_PROG(PSSELECT_PATH, [psselect])
9637   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
9638      have_groff_html=yes
9639   else
9640      have_groff_html=no
9641      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
9642   fi
9643fi
9644
9645# Set Automake conditionals for Makefiles
9646AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
9647AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
9648AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
9649AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
9650]) # XORG_WITH_GROFF
9651
9652# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
9653# ---------------------------------------
9654# Minimum version: 1.6.0
9655# Minimum version for optional DEFAULT argument: 1.11.0
9656# Minimum version for optional MIN-VERSION argument: 1.15.0
9657#
9658# Documentation tools are not always available on all platforms and sometimes
9659# not at the appropriate level. This macro enables a module to test for the
9660# presence of the tool and obtain it's path in separate variables. Coupled with
9661# the --with-fop option, it allows maximum flexibilty in making decisions
9662# as whether or not to use the fop package. When DEFAULT is not specified,
9663# --with-fop assumes 'auto'.
9664#
9665# Interface to module:
9666# HAVE_FOP: 	used in makefiles to conditionally generate documentation
9667# FOP:	 	returns the path of the fop program found
9668#		returns the path set by the user in the environment
9669# --with-fop: 	'yes' user instructs the module to use fop
9670#		'no' user instructs the module not to use fop
9671#
9672# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
9673#
9674AC_DEFUN([XORG_WITH_FOP],[
9675AC_ARG_VAR([FOP], [Path to fop command])
9676m4_define([_defopt], m4_default([$2], [auto]))
9677AC_ARG_WITH(fop,
9678	AS_HELP_STRING([--with-fop],
9679	   [Use fop to regenerate documentation (default: ]_defopt[)]),
9680	   [use_fop=$withval], [use_fop=]_defopt)
9681m4_undefine([_defopt])
9682
9683if test "x$use_fop" = x"auto"; then
9684   AC_PATH_PROG([FOP], [fop])
9685   if test "x$FOP" = "x"; then
9686        AC_MSG_WARN([fop not found - documentation targets will be skipped])
9687	have_fop=no
9688   else
9689        have_fop=yes
9690   fi
9691elif test "x$use_fop" = x"yes" ; then
9692   AC_PATH_PROG([FOP], [fop])
9693   if test "x$FOP" = "x"; then
9694        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
9695   fi
9696   have_fop=yes
9697elif test "x$use_fop" = x"no" ; then
9698   if test "x$FOP" != "x"; then
9699      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
9700   fi
9701   have_fop=no
9702else
9703   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
9704fi
9705
9706# Test for a minimum version of fop, if provided.
9707m4_ifval([$1],
9708[if test "$have_fop" = yes; then
9709    # scrape the fop version
9710    AC_MSG_CHECKING([for fop minimum version])
9711    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
9712    AC_MSG_RESULT([$fop_version])
9713    AS_VERSION_COMPARE([$fop_version], [$1],
9714        [if test "x$use_fop" = xauto; then
9715            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
9716            have_fop=no
9717        else
9718            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
9719        fi])
9720fi])
9721AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
9722]) # XORG_WITH_FOP
9723
9724# XORG_WITH_M4([MIN-VERSION])
9725# ---------------------------
9726# Minimum version: 1.19.0
9727#
9728# This macro attempts to locate an m4 macro processor which supports
9729# -I option and is only useful for modules relying on M4 in order to
9730# expand macros in source code files.
9731#
9732# Interface to module:
9733# M4:	 	returns the path of the m4 program found
9734#		returns the path set by the user in the environment
9735#
9736AC_DEFUN([XORG_WITH_M4], [
9737AC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
9738   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
9739       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
9740         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
9741   [AC_MSG_ERROR([could not find m4 that supports -I option])],
9742   [$PATH:/usr/gnu/bin])])
9743
9744AC_SUBST([M4], [$ac_cv_path_M4])
9745]) # XORG_WITH_M4
9746
9747# XORG_WITH_PS2PDF([DEFAULT])
9748# ----------------
9749# Minimum version: 1.6.0
9750# Minimum version for optional DEFAULT argument: 1.11.0
9751#
9752# Documentation tools are not always available on all platforms and sometimes
9753# not at the appropriate level. This macro enables a module to test for the
9754# presence of the tool and obtain it's path in separate variables. Coupled with
9755# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
9756# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
9757# --with-ps2pdf assumes 'auto'.
9758#
9759# Interface to module:
9760# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
9761# PS2PDF:	returns the path of the ps2pdf program found
9762#		returns the path set by the user in the environment
9763# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
9764#		 'no' user instructs the module not to use ps2pdf
9765#
9766# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
9767#
9768AC_DEFUN([XORG_WITH_PS2PDF],[
9769AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
9770m4_define([_defopt], m4_default([$1], [auto]))
9771AC_ARG_WITH(ps2pdf,
9772	AS_HELP_STRING([--with-ps2pdf],
9773	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
9774	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
9775m4_undefine([_defopt])
9776
9777if test "x$use_ps2pdf" = x"auto"; then
9778   AC_PATH_PROG([PS2PDF], [ps2pdf])
9779   if test "x$PS2PDF" = "x"; then
9780        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
9781	have_ps2pdf=no
9782   else
9783        have_ps2pdf=yes
9784   fi
9785elif test "x$use_ps2pdf" = x"yes" ; then
9786   AC_PATH_PROG([PS2PDF], [ps2pdf])
9787   if test "x$PS2PDF" = "x"; then
9788        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
9789   fi
9790   have_ps2pdf=yes
9791elif test "x$use_ps2pdf" = x"no" ; then
9792   if test "x$PS2PDF" != "x"; then
9793      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
9794   fi
9795   have_ps2pdf=no
9796else
9797   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
9798fi
9799AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
9800]) # XORG_WITH_PS2PDF
9801
9802# XORG_ENABLE_DOCS (enable_docs=yes)
9803# ----------------
9804# Minimum version: 1.6.0
9805#
9806# Documentation tools are not always available on all platforms and sometimes
9807# not at the appropriate level. This macro enables a builder to skip all
9808# documentation targets except traditional man pages.
9809# Combined with the specific tool checking macros XORG_WITH_*, it provides
9810# maximum flexibilty in controlling documentation building.
9811# Refer to:
9812# XORG_WITH_XMLTO         --with-xmlto
9813# XORG_WITH_ASCIIDOC      --with-asciidoc
9814# XORG_WITH_DOXYGEN       --with-doxygen
9815# XORG_WITH_FOP           --with-fop
9816# XORG_WITH_GROFF         --with-groff
9817# XORG_WITH_PS2PDF        --with-ps2pdf
9818#
9819# Interface to module:
9820# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
9821# --enable-docs: 'yes' user instructs the module to generate docs
9822#		 'no' user instructs the module not to generate docs
9823# parm1:	specify the default value, yes or no.
9824#
9825AC_DEFUN([XORG_ENABLE_DOCS],[
9826m4_define([docs_default], m4_default([$1], [yes]))
9827AC_ARG_ENABLE(docs,
9828	AS_HELP_STRING([--enable-docs],
9829	   [Enable building the documentation (default: ]docs_default[)]),
9830	   [build_docs=$enableval], [build_docs=]docs_default)
9831m4_undefine([docs_default])
9832AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
9833AC_MSG_CHECKING([whether to build documentation])
9834AC_MSG_RESULT([$build_docs])
9835]) # XORG_ENABLE_DOCS
9836
9837# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
9838# ----------------
9839# Minimum version: 1.6.0
9840#
9841# This macro enables a builder to skip all developer documentation.
9842# Combined with the specific tool checking macros XORG_WITH_*, it provides
9843# maximum flexibilty in controlling documentation building.
9844# Refer to:
9845# XORG_WITH_XMLTO         --with-xmlto
9846# XORG_WITH_ASCIIDOC      --with-asciidoc
9847# XORG_WITH_DOXYGEN       --with-doxygen
9848# XORG_WITH_FOP           --with-fop
9849# XORG_WITH_GROFF         --with-groff
9850# XORG_WITH_PS2PDF        --with-ps2pdf
9851#
9852# Interface to module:
9853# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
9854# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
9855#			'no' user instructs the module not to generate developer docs
9856# parm1:		specify the default value, yes or no.
9857#
9858AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
9859m4_define([devel_default], m4_default([$1], [yes]))
9860AC_ARG_ENABLE(devel-docs,
9861	AS_HELP_STRING([--enable-devel-docs],
9862	   [Enable building the developer documentation (default: ]devel_default[)]),
9863	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
9864m4_undefine([devel_default])
9865AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
9866AC_MSG_CHECKING([whether to build developer documentation])
9867AC_MSG_RESULT([$build_devel_docs])
9868]) # XORG_ENABLE_DEVEL_DOCS
9869
9870# XORG_ENABLE_SPECS (enable_specs=yes)
9871# ----------------
9872# Minimum version: 1.6.0
9873#
9874# This macro enables a builder to skip all functional specification targets.
9875# Combined with the specific tool checking macros XORG_WITH_*, it provides
9876# maximum flexibilty in controlling documentation building.
9877# Refer to:
9878# XORG_WITH_XMLTO         --with-xmlto
9879# XORG_WITH_ASCIIDOC      --with-asciidoc
9880# XORG_WITH_DOXYGEN       --with-doxygen
9881# XORG_WITH_FOP           --with-fop
9882# XORG_WITH_GROFF         --with-groff
9883# XORG_WITH_PS2PDF        --with-ps2pdf
9884#
9885# Interface to module:
9886# ENABLE_SPECS:		used in makefiles to conditionally generate specs
9887# --enable-specs:	'yes' user instructs the module to generate specs
9888#			'no' user instructs the module not to generate specs
9889# parm1:		specify the default value, yes or no.
9890#
9891AC_DEFUN([XORG_ENABLE_SPECS],[
9892m4_define([spec_default], m4_default([$1], [yes]))
9893AC_ARG_ENABLE(specs,
9894	AS_HELP_STRING([--enable-specs],
9895	   [Enable building the specs (default: ]spec_default[)]),
9896	   [build_specs=$enableval], [build_specs=]spec_default)
9897m4_undefine([spec_default])
9898AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
9899AC_MSG_CHECKING([whether to build functional specifications])
9900AC_MSG_RESULT([$build_specs])
9901]) # XORG_ENABLE_SPECS
9902
9903# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
9904# ----------------------------------------------
9905# Minimum version: 1.13.0
9906#
9907# This macro enables a builder to enable/disable unit testing
9908# It makes no assumption about the test cases implementation
9909# Test cases may or may not use Automake "Support for test suites"
9910# They may or may not use the software utility library GLib
9911#
9912# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
9913# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
9914# The variable enable_unit_tests is used by other macros in this file.
9915#
9916# Interface to module:
9917# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
9918# enable_unit_tests:    used in configure.ac for additional configuration
9919# --enable-unit-tests:	'yes' user instructs the module to build tests
9920#			'no' user instructs the module not to build tests
9921# parm1:		specify the default value, yes or no.
9922#
9923AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
9924AC_BEFORE([$0], [XORG_WITH_GLIB])
9925AC_BEFORE([$0], [XORG_LD_WRAP])
9926AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
9927m4_define([_defopt], m4_default([$1], [auto]))
9928AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
9929	[Enable building unit test cases (default: ]_defopt[)]),
9930	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
9931m4_undefine([_defopt])
9932AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
9933AC_MSG_CHECKING([whether to build unit test cases])
9934AC_MSG_RESULT([$enable_unit_tests])
9935]) # XORG_ENABLE_UNIT_TESTS
9936
9937# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
9938# ------------------------------------------------------
9939# Minimum version: 1.17.0
9940#
9941# This macro enables a builder to enable/disable integration testing
9942# It makes no assumption about the test cases' implementation
9943# Test cases may or may not use Automake "Support for test suites"
9944#
9945# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
9946# usually requires less dependencies and may be built and run under less
9947# stringent environments than integration tests.
9948#
9949# Interface to module:
9950# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
9951# enable_integration_tests:   used in configure.ac for additional configuration
9952# --enable-integration-tests: 'yes' user instructs the module to build tests
9953#                             'no' user instructs the module not to build tests
9954# parm1:                      specify the default value, yes or no.
9955#
9956AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
9957AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
9958m4_define([_defopt], m4_default([$1], [auto]))
9959AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
9960	[Enable building integration test cases (default: ]_defopt[)]),
9961	[enable_integration_tests=$enableval],
9962	[enable_integration_tests=]_defopt)
9963m4_undefine([_defopt])
9964AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
9965	[test "x$enable_integration_tests" != xno])
9966AC_MSG_CHECKING([whether to build unit test cases])
9967AC_MSG_RESULT([$enable_integration_tests])
9968]) # XORG_ENABLE_INTEGRATION_TESTS
9969
9970# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
9971# ----------------------------------------
9972# Minimum version: 1.13.0
9973#
9974# GLib is a library which provides advanced data structures and functions.
9975# This macro enables a module to test for the presence of Glib.
9976#
9977# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
9978# Otherwise the value of $enable_unit_tests is blank.
9979#
9980# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
9981# test support usually requires less dependencies and may be built and run under
9982# less stringent environments than integration tests.
9983#
9984# Interface to module:
9985# HAVE_GLIB: used in makefiles to conditionally build targets
9986# with_glib: used in configure.ac to know if GLib has been found
9987# --with-glib:	'yes' user instructs the module to use glib
9988#		'no' user instructs the module not to use glib
9989#
9990AC_DEFUN([XORG_WITH_GLIB],[
9991AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9992m4_define([_defopt], m4_default([$2], [auto]))
9993AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
9994	[Use GLib library for unit testing (default: ]_defopt[)]),
9995	[with_glib=$withval], [with_glib=]_defopt)
9996m4_undefine([_defopt])
9997
9998have_glib=no
9999# Do not probe GLib if user explicitly disabled unit testing
10000if test "x$enable_unit_tests" != x"no"; then
10001  # Do not probe GLib if user explicitly disabled it
10002  if test "x$with_glib" != x"no"; then
10003    m4_ifval(
10004      [$1],
10005      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
10006      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
10007    )
10008  fi
10009fi
10010
10011# Not having GLib when unit testing has been explicitly requested is an error
10012if test "x$enable_unit_tests" = x"yes"; then
10013  if test "x$have_glib" = x"no"; then
10014    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10015  fi
10016fi
10017
10018# Having unit testing disabled when GLib has been explicitly requested is an error
10019if test "x$enable_unit_tests" = x"no"; then
10020  if test "x$with_glib" = x"yes"; then
10021    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10022  fi
10023fi
10024
10025# Not having GLib when it has been explicitly requested is an error
10026if test "x$with_glib" = x"yes"; then
10027  if test "x$have_glib" = x"no"; then
10028    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
10029  fi
10030fi
10031
10032AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
10033]) # XORG_WITH_GLIB
10034
10035# XORG_LD_WRAP([required|optional])
10036# ---------------------------------
10037# Minimum version: 1.13.0
10038#
10039# Check if linker supports -wrap, passed via compiler flags
10040#
10041# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
10042# Otherwise the value of $enable_unit_tests is blank.
10043#
10044# Argument added in 1.16.0 - default is "required", to match existing behavior
10045# of returning an error if enable_unit_tests is yes, and ld -wrap is not
10046# available, an argument of "optional" allows use when some unit tests require
10047# ld -wrap and others do not.
10048#
10049AC_DEFUN([XORG_LD_WRAP],[
10050XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
10051    [AC_LANG_PROGRAM([#include <stdlib.h>
10052                      void __wrap_exit(int status) { return; }],
10053                     [exit(0);])])
10054# Not having ld wrap when unit testing has been explicitly requested is an error
10055if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
10056  if test "x$have_ld_wrap" = x"no"; then
10057    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
10058  fi
10059fi
10060AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
10061#
10062]) # XORG_LD_WRAP
10063
10064# XORG_CHECK_LINKER_FLAGS
10065# -----------------------
10066# SYNOPSIS
10067#
10068#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
10069#
10070# DESCRIPTION
10071#
10072#   Check whether the given linker FLAGS work with the current language's
10073#   linker, or whether they give an error.
10074#
10075#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
10076#   success/failure.
10077#
10078#   PROGRAM-SOURCE is the program source to link with, if needed
10079#
10080#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
10081#
10082# LICENSE
10083#
10084#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
10085#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
10086#   Copyright (c) 2009 Matteo Frigo
10087#
10088#   This program is free software: you can redistribute it and/or modify it
10089#   under the terms of the GNU General Public License as published by the
10090#   Free Software Foundation, either version 3 of the License, or (at your
10091#   option) any later version.
10092#
10093#   This program is distributed in the hope that it will be useful, but
10094#   WITHOUT ANY WARRANTY; without even the implied warranty of
10095#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
10096#   Public License for more details.
10097#
10098#   You should have received a copy of the GNU General Public License along
10099#   with this program. If not, see <http://www.gnu.org/licenses/>.
10100#
10101#   As a special exception, the respective Autoconf Macro's copyright owner
10102#   gives unlimited permission to copy, distribute and modify the configure
10103#   scripts that are the output of Autoconf when processing the Macro. You
10104#   need not follow the terms of the GNU General Public License when using
10105#   or distributing such scripts, even though portions of the text of the
10106#   Macro appear in them. The GNU General Public License (GPL) does govern
10107#   all other use of the material that constitutes the Autoconf Macro.
10108#
10109#   This special exception to the GPL applies to versions of the Autoconf
10110#   Macro released by the Autoconf Archive. When you make and distribute a
10111#   modified version of the Autoconf Macro, you may extend this special
10112#   exception to the GPL to apply to your modified version as well.#
10113AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
10114[AC_MSG_CHECKING([whether the linker accepts $1])
10115dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
10116AS_LITERAL_IF([$1],
10117  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
10118      ax_save_FLAGS=$LDFLAGS
10119      LDFLAGS="$1"
10120      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
10121        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
10122        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
10123      LDFLAGS=$ax_save_FLAGS])],
10124  [ax_save_FLAGS=$LDFLAGS
10125   LDFLAGS="$1"
10126   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
10127     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
10128     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
10129   LDFLAGS=$ax_save_FLAGS])
10130eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
10131AC_MSG_RESULT($xorg_check_linker_flags)
10132if test "x$xorg_check_linker_flags" = xyes; then
10133	m4_default([$2], :)
10134else
10135	m4_default([$3], :)
10136fi
10137]) # XORG_CHECK_LINKER_FLAGS
10138
10139# XORG_MEMORY_CHECK_FLAGS
10140# -----------------------
10141# Minimum version: 1.16.0
10142#
10143# This macro attempts to find appropriate memory checking functionality
10144# for various platforms which unit testing code may use to catch various
10145# forms of memory allocation and access errors in testing.
10146#
10147# Interface to module:
10148# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
10149#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
10150#
10151# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
10152#
10153AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
10154
10155AC_REQUIRE([AC_CANONICAL_HOST])
10156AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
10157           [Environment variables to enable memory checking in tests])
10158
10159# Check for different types of support on different platforms
10160case $host_os in
10161    solaris*)
10162        AC_CHECK_LIB([umem], [umem_alloc],
10163            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
10164        ;;
10165    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
10166        # both directly and inverted, so should not be 0 or 255.
10167        malloc_debug_env='MALLOC_PERTURB_=15'
10168        ;;
10169    darwin*)
10170        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
10171        ;;
10172    *bsd*)
10173        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
10174        ;;
10175esac
10176
10177# User supplied flags override default flags
10178if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
10179    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
10180fi
10181
10182AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
10183]) # XORG_WITH_LINT
10184
10185# XORG_CHECK_MALLOC_ZERO
10186# ----------------------
10187# Minimum version: 1.0.0
10188#
10189# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
10190# malloc(0) returns NULL.  Packages should add one of these cflags to
10191# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
10192AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
10193AC_ARG_ENABLE(malloc0returnsnull,
10194	AS_HELP_STRING([--enable-malloc0returnsnull],
10195		       [malloc(0) returns NULL (default: auto)]),
10196	[MALLOC_ZERO_RETURNS_NULL=$enableval],
10197	[MALLOC_ZERO_RETURNS_NULL=auto])
10198
10199AC_MSG_CHECKING([whether malloc(0) returns NULL])
10200if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
10201AC_CACHE_VAL([xorg_cv_malloc0_returns_null],
10202	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
10203#include <stdlib.h>
10204],[
10205    char *m0, *r0, *c0, *p;
10206    m0 = malloc(0);
10207    p = malloc(10);
10208    r0 = realloc(p,0);
10209    c0 = calloc(0,10);
10210    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
10211])],
10212		[xorg_cv_malloc0_returns_null=yes],
10213		[xorg_cv_malloc0_returns_null=no])])
10214MALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
10215fi
10216AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
10217
10218if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
10219	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
10220	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
10221	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
10222else
10223	MALLOC_ZERO_CFLAGS=""
10224	XMALLOC_ZERO_CFLAGS=""
10225	XTMALLOC_ZERO_CFLAGS=""
10226fi
10227
10228AC_SUBST([MALLOC_ZERO_CFLAGS])
10229AC_SUBST([XMALLOC_ZERO_CFLAGS])
10230AC_SUBST([XTMALLOC_ZERO_CFLAGS])
10231]) # XORG_CHECK_MALLOC_ZERO
10232
10233# XORG_WITH_LINT()
10234# ----------------
10235# Minimum version: 1.1.0
10236#
10237# This macro enables the use of a tool that flags some suspicious and
10238# non-portable constructs (likely to be bugs) in C language source code.
10239# It will attempt to locate the tool and use appropriate options.
10240# There are various lint type tools on different platforms.
10241#
10242# Interface to module:
10243# LINT:		returns the path to the tool found on the platform
10244#		or the value set to LINT on the configure cmd line
10245#		also an Automake conditional
10246# LINT_FLAGS:	an Automake variable with appropriate flags
10247#
10248# --with-lint:	'yes' user instructs the module to use lint
10249#		'no' user instructs the module not to use lint (default)
10250#
10251# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
10252# If the user sets the value of LINT_FLAGS, they are used verbatim.
10253#
10254AC_DEFUN([XORG_WITH_LINT],[
10255
10256AC_ARG_VAR([LINT], [Path to a lint-style command])
10257AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
10258AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
10259		[Use a lint-style source code checker (default: disabled)])],
10260		[use_lint=$withval], [use_lint=no])
10261
10262# Obtain platform specific info like program name and options
10263# The lint program on FreeBSD and NetBSD is different from the one on Solaris
10264case $host_os in
10265  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
10266	lint_name=splint
10267	lint_options="-badflag"
10268	;;
10269  *freebsd* | *netbsd*)
10270	lint_name=lint
10271	lint_options="-u -b"
10272	;;
10273  *solaris*)
10274	lint_name=lint
10275	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
10276	;;
10277esac
10278
10279# Test for the presence of the program (either guessed by the code or spelled out by the user)
10280if test "x$use_lint" = x"yes" ; then
10281   AC_PATH_PROG([LINT], [$lint_name])
10282   if test "x$LINT" = "x"; then
10283        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
10284   fi
10285elif test "x$use_lint" = x"no" ; then
10286   if test "x$LINT" != "x"; then
10287      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
10288   fi
10289else
10290   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
10291fi
10292
10293# User supplied flags override default flags
10294if test "x$LINT_FLAGS" != "x"; then
10295   lint_options=$LINT_FLAGS
10296fi
10297
10298AC_SUBST([LINT_FLAGS],[$lint_options])
10299AM_CONDITIONAL(LINT, [test "x$LINT" != x])
10300
10301]) # XORG_WITH_LINT
10302
10303# XORG_LINT_LIBRARY(LIBNAME)
10304# --------------------------
10305# Minimum version: 1.1.0
10306#
10307# Sets up flags for building lint libraries for checking programs that call
10308# functions in the library.
10309#
10310# Interface to module:
10311# LINTLIB		- Automake variable with the name of lint library file to make
10312# MAKE_LINT_LIB		- Automake conditional
10313#
10314# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
10315#			  - 'no' user instructs the module not to create a lint library (default)
10316
10317AC_DEFUN([XORG_LINT_LIBRARY],[
10318AC_REQUIRE([XORG_WITH_LINT])
10319AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
10320	[Create lint library (default: disabled)])],
10321	[make_lint_lib=$enableval], [make_lint_lib=no])
10322
10323if test "x$make_lint_lib" = x"yes" ; then
10324   LINTLIB=llib-l$1.ln
10325   if test "x$LINT" = "x"; then
10326        AC_MSG_ERROR([Cannot make lint library without --with-lint])
10327   fi
10328elif test "x$make_lint_lib" != x"no" ; then
10329   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
10330fi
10331
10332AC_SUBST(LINTLIB)
10333AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
10334
10335]) # XORG_LINT_LIBRARY
10336
10337# XORG_COMPILER_BRAND
10338# -------------------
10339# Minimum version: 1.14.0
10340#
10341# Checks for various brands of compilers and sets flags as appropriate:
10342#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
10343#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
10344#   clang compiler - sets CLANGCC to "yes"
10345#   Intel compiler - sets INTELCC to "yes"
10346#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
10347#
10348AC_DEFUN([XORG_COMPILER_BRAND], [
10349AC_LANG_CASE(
10350	[C], [
10351		AC_REQUIRE([AC_PROG_CC_C99])
10352	],
10353	[C++], [
10354		AC_REQUIRE([AC_PROG_CXX])
10355	]
10356)
10357AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
10358AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
10359AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
10360]) # XORG_COMPILER_BRAND
10361
10362# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
10363# ---------------
10364# Minimum version: 1.16.0
10365#
10366# Test if the compiler works when passed the given flag as a command line argument.
10367# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
10368# next flag in the list until there are no more options.
10369#
10370# Note that this does not guarantee that the compiler supports the flag as some
10371# compilers will simply ignore arguments that they do not understand, but we do
10372# attempt to weed out false positives by using -Werror=unknown-warning-option and
10373# -Werror=unused-command-line-argument
10374#
10375AC_DEFUN([XORG_TESTSET_CFLAG], [
10376m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
10377m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
10378
10379AC_LANG_COMPILER_REQUIRE
10380
10381AC_LANG_CASE(
10382	[C], [
10383		AC_REQUIRE([AC_PROG_CC_C99])
10384		define([PREFIX], [C])
10385		define([CACHE_PREFIX], [cc])
10386		define([COMPILER], [$CC])
10387	],
10388	[C++], [
10389		define([PREFIX], [CXX])
10390		define([CACHE_PREFIX], [cxx])
10391		define([COMPILER], [$CXX])
10392	]
10393)
10394
10395[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
10396
10397if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
10398	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10399	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
10400			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
10401			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
10402					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
10403					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
10404	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
10405	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10406fi
10407
10408if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
10409	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
10410		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10411	fi
10412	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
10413	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
10414			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
10415			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
10416					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
10417					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
10418	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
10419	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10420fi
10421
10422found="no"
10423m4_foreach([flag], m4_cdr($@), [
10424	if test $found = "no" ; then
10425		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
10426			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10427		fi
10428
10429		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
10430			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
10431		fi
10432
10433		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
10434
10435dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
10436		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
10437		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
10438		AC_CACHE_VAL($cacheid,
10439			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
10440					     [eval $cacheid=yes],
10441					     [eval $cacheid=no])])
10442
10443		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10444
10445		eval supported=\$$cacheid
10446		AC_MSG_RESULT([$supported])
10447		if test "$supported" = "yes" ; then
10448			$1="$$1 ]flag["
10449			found="yes"
10450		fi
10451	fi
10452])
10453]) # XORG_TESTSET_CFLAG
10454
10455# XORG_COMPILER_FLAGS
10456# ---------------
10457# Minimum version: 1.16.0
10458#
10459# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
10460# arguments supported by the selected compiler which do NOT alter the generated
10461# code.  These arguments will cause the compiler to print various warnings
10462# during compilation AND turn a conservative set of warnings into errors.
10463#
10464# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
10465# future versions of util-macros as options are added to new compilers.
10466#
10467AC_DEFUN([XORG_COMPILER_FLAGS], [
10468AC_REQUIRE([XORG_COMPILER_BRAND])
10469
10470AC_ARG_ENABLE(selective-werror,
10471              AS_HELP_STRING([--disable-selective-werror],
10472                             [Turn off selective compiler errors. (default: enabled)]),
10473              [SELECTIVE_WERROR=$enableval],
10474              [SELECTIVE_WERROR=yes])
10475
10476AC_LANG_CASE(
10477        [C], [
10478                define([PREFIX], [C])
10479        ],
10480        [C++], [
10481                define([PREFIX], [CXX])
10482        ]
10483)
10484# -v is too short to test reliably with XORG_TESTSET_CFLAG
10485if test "x$SUNCC" = "xyes"; then
10486    [BASE_]PREFIX[FLAGS]="-v"
10487else
10488    [BASE_]PREFIX[FLAGS]=""
10489fi
10490
10491# This chunk of warnings were those that existed in the legacy CWARNFLAGS
10492XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
10493XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
10494XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
10495XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
10496
10497AC_LANG_CASE(
10498	[C], [
10499		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
10500		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
10501		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
10502		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
10503		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
10504		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
10505	]
10506)
10507
10508# This chunk adds additional warnings that could catch undesired effects.
10509XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
10510XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
10511XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
10512XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
10513XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
10514XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
10515XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
10516
10517# These are currently disabled because they are noisy.  They will be enabled
10518# in the future once the codebase is sufficiently modernized to silence
10519# them.  For now, I don't want them to drown out the other warnings.
10520# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
10521# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
10522# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
10523
10524# Turn some warnings into errors, so we don't accidently get successful builds
10525# when there are problems that should be fixed.
10526
10527if test "x$SELECTIVE_WERROR" = "xyes" ; then
10528XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
10529XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
10530XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
10531XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
10532XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
10533XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
10534XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
10535XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
10536XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
10537XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
10538XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
10539XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
10540XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
10541else
10542AC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors.  This should not be necessary.  Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT])
10543XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
10544XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
10545XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
10546XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
10547XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
10548XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
10549XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
10550XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
10551XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
10552XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
10553XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
10554XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
10555XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
10556fi
10557
10558AC_SUBST([BASE_]PREFIX[FLAGS])
10559]) # XORG_COMPILER_FLAGS
10560
10561# XORG_CWARNFLAGS
10562# ---------------
10563# Minimum version: 1.2.0
10564# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
10565#
10566# Defines CWARNFLAGS to enable C compiler warnings.
10567#
10568# This function is deprecated because it defines -fno-strict-aliasing
10569# which alters the code generated by the compiler.  If -fno-strict-aliasing
10570# is needed, then it should be added explicitly in the module when
10571# it is updated to use BASE_CFLAGS.
10572#
10573AC_DEFUN([XORG_CWARNFLAGS], [
10574AC_REQUIRE([XORG_COMPILER_FLAGS])
10575AC_REQUIRE([XORG_COMPILER_BRAND])
10576AC_LANG_CASE(
10577	[C], [
10578		CWARNFLAGS="$BASE_CFLAGS"
10579		if  test "x$GCC" = xyes ; then
10580		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
10581		fi
10582		AC_SUBST(CWARNFLAGS)
10583	]
10584)
10585]) # XORG_CWARNFLAGS
10586
10587# XORG_STRICT_OPTION
10588# -----------------------
10589# Minimum version: 1.3.0
10590#
10591# Add configure option to enable strict compilation flags, such as treating
10592# warnings as fatal errors.
10593# If --enable-strict-compilation is passed to configure, adds strict flags to
10594# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
10595#
10596# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
10597# when strict compilation is unconditionally desired.
10598AC_DEFUN([XORG_STRICT_OPTION], [
10599AC_REQUIRE([XORG_CWARNFLAGS])
10600AC_REQUIRE([XORG_COMPILER_FLAGS])
10601
10602AC_ARG_ENABLE(strict-compilation,
10603			  AS_HELP_STRING([--enable-strict-compilation],
10604			  [Enable all warnings from compiler and make them errors (default: disabled)]),
10605			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
10606
10607AC_LANG_CASE(
10608        [C], [
10609                define([PREFIX], [C])
10610        ],
10611        [C++], [
10612                define([PREFIX], [CXX])
10613        ]
10614)
10615
10616[STRICT_]PREFIX[FLAGS]=""
10617XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
10618XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
10619
10620# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
10621# activate it with -Werror, so we add it here explicitly.
10622XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
10623
10624if test "x$STRICT_COMPILE" = "xyes"; then
10625    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
10626    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
10627fi
10628AC_SUBST([STRICT_]PREFIX[FLAGS])
10629AC_SUBST([BASE_]PREFIX[FLAGS])
10630AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
10631]) # XORG_STRICT_OPTION
10632
10633# XORG_DEFAULT_OPTIONS
10634# --------------------
10635# Minimum version: 1.3.0
10636#
10637# Defines default options for X.Org modules.
10638#
10639AC_DEFUN([XORG_DEFAULT_OPTIONS], [
10640AC_REQUIRE([AC_PROG_INSTALL])
10641XORG_COMPILER_FLAGS
10642XORG_CWARNFLAGS
10643XORG_STRICT_OPTION
10644XORG_RELEASE_VERSION
10645XORG_CHANGELOG
10646XORG_INSTALL
10647XORG_MANPAGE_SECTIONS
10648m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
10649    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
10650]) # XORG_DEFAULT_OPTIONS
10651
10652# XORG_INSTALL()
10653# ----------------
10654# Minimum version: 1.4.0
10655#
10656# Defines the variable INSTALL_CMD as the command to copy
10657# INSTALL from $prefix/share/util-macros.
10658#
10659AC_DEFUN([XORG_INSTALL], [
10660AC_REQUIRE([PKG_PROG_PKG_CONFIG])
10661macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
10662INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
10663mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
10664|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
10665echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
10666AC_SUBST([INSTALL_CMD])
10667]) # XORG_INSTALL
10668dnl Copyright 2005 Red Hat, Inc
10669dnl
10670dnl Permission to use, copy, modify, distribute, and sell this software and its
10671dnl documentation for any purpose is hereby granted without fee, provided that
10672dnl the above copyright notice appear in all copies and that both that
10673dnl copyright notice and this permission notice appear in supporting
10674dnl documentation.
10675dnl
10676dnl The above copyright notice and this permission notice shall be included
10677dnl in all copies or substantial portions of the Software.
10678dnl
10679dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10680dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
10681dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
10682dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
10683dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
10684dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
10685dnl OTHER DEALINGS IN THE SOFTWARE.
10686dnl
10687dnl Except as contained in this notice, the name of the copyright holders shall
10688dnl not be used in advertising or otherwise to promote the sale, use or
10689dnl other dealings in this Software without prior written authorization
10690dnl from the copyright holders.
10691dnl
10692
10693# XORG_RELEASE_VERSION
10694# --------------------
10695# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
10696
10697AC_DEFUN([XORG_RELEASE_VERSION],[
10698	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
10699		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
10700		[Major version of this package])
10701	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
10702	if test "x$PVM" = "x"; then
10703		PVM="0"
10704	fi
10705	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
10706		[$PVM],
10707		[Minor version of this package])
10708	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
10709	if test "x$PVP" = "x"; then
10710		PVP="0"
10711	fi
10712	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
10713		[$PVP],
10714		[Patch version of this package])
10715])
10716
10717# XORG_CHANGELOG()
10718# ----------------
10719# Minimum version: 1.2.0
10720#
10721# Defines the variable CHANGELOG_CMD as the command to generate
10722# ChangeLog from git.
10723#
10724#
10725AC_DEFUN([XORG_CHANGELOG], [
10726CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
10727mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
10728|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
10729echo 'git directory not found: installing possibly empty changelog.' >&2)"
10730AC_SUBST([CHANGELOG_CMD])
10731]) # XORG_CHANGELOG
10732
10733dnl Copyright 2005 Red Hat, Inc
10734dnl 
10735dnl Permission to use, copy, modify, distribute, and sell this software and its
10736dnl documentation for any purpose is hereby granted without fee, provided that
10737dnl the above copyright notice appear in all copies and that both that
10738dnl copyright notice and this permission notice appear in supporting
10739dnl documentation.
10740dnl 
10741dnl The above copyright notice and this permission notice shall be included
10742dnl in all copies or substantial portions of the Software.
10743dnl 
10744dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10745dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
10746dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
10747dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
10748dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
10749dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
10750dnl OTHER DEALINGS IN THE SOFTWARE.
10751dnl 
10752dnl Except as contained in this notice, the name of the copyright holders shall
10753dnl not be used in advertising or otherwise to promote the sale, use or
10754dnl other dealings in this Software without prior written authorization
10755dnl from the copyright holders.
10756dnl 
10757
10758# XORG_DRIVER_CHECK_EXT(MACRO, PROTO)
10759# --------------------------
10760# Checks for the MACRO define in xorg-server.h (from the sdk).  If it
10761# is defined, then add the given PROTO to $REQUIRED_MODULES.
10762
10763AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
10764	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
10765	SAVE_CFLAGS="$CFLAGS"
10766	CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
10767	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
10768#include "xorg-server.h"
10769#if !defined $1
10770#error $1 not defined
10771#endif
10772		]])],
10773		[_EXT_CHECK=yes],
10774		[_EXT_CHECK=no])
10775	CFLAGS="$SAVE_CFLAGS"
10776	AC_MSG_CHECKING([if $1 is defined])
10777	AC_MSG_RESULT([$_EXT_CHECK])
10778	if test "$_EXT_CHECK" != no; then
10779		REQUIRED_MODULES="$REQUIRED_MODULES $2"
10780	fi
10781])
10782
10783# Copyright (C) 2002-2013 Free Software Foundation, Inc.
10784#
10785# This file is free software; the Free Software Foundation
10786# gives unlimited permission to copy and/or distribute it,
10787# with or without modifications, as long as this notice is preserved.
10788
10789# AM_AUTOMAKE_VERSION(VERSION)
10790# ----------------------------
10791# Automake X.Y traces this macro to ensure aclocal.m4 has been
10792# generated from the m4 files accompanying Automake X.Y.
10793# (This private macro should not be called outside this file.)
10794AC_DEFUN([AM_AUTOMAKE_VERSION],
10795[am__api_version='1.13'
10796dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
10797dnl require some minimum version.  Point them to the right macro.
10798m4_if([$1], [1.13.4], [],
10799      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
10800])
10801
10802# _AM_AUTOCONF_VERSION(VERSION)
10803# -----------------------------
10804# aclocal traces this macro to find the Autoconf version.
10805# This is a private macro too.  Using m4_define simplifies
10806# the logic in aclocal, which can simply ignore this definition.
10807m4_define([_AM_AUTOCONF_VERSION], [])
10808
10809# AM_SET_CURRENT_AUTOMAKE_VERSION
10810# -------------------------------
10811# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
10812# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
10813AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
10814[AM_AUTOMAKE_VERSION([1.13.4])dnl
10815m4_ifndef([AC_AUTOCONF_VERSION],
10816  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
10817_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
10818
10819# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
10820
10821# Copyright (C) 2001-2013 Free Software Foundation, Inc.
10822#
10823# This file is free software; the Free Software Foundation
10824# gives unlimited permission to copy and/or distribute it,
10825# with or without modifications, as long as this notice is preserved.
10826
10827# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
10828# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
10829# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
10830#
10831# Of course, Automake must honor this variable whenever it calls a
10832# tool from the auxiliary directory.  The problem is that $srcdir (and
10833# therefore $ac_aux_dir as well) can be either absolute or relative,
10834# depending on how configure is run.  This is pretty annoying, since
10835# it makes $ac_aux_dir quite unusable in subdirectories: in the top
10836# source directory, any form will work fine, but in subdirectories a
10837# relative path needs to be adjusted first.
10838#
10839# $ac_aux_dir/missing
10840#    fails when called from a subdirectory if $ac_aux_dir is relative
10841# $top_srcdir/$ac_aux_dir/missing
10842#    fails if $ac_aux_dir is absolute,
10843#    fails when called from a subdirectory in a VPATH build with
10844#          a relative $ac_aux_dir
10845#
10846# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
10847# are both prefixed by $srcdir.  In an in-source build this is usually
10848# harmless because $srcdir is '.', but things will broke when you
10849# start a VPATH build or use an absolute $srcdir.
10850#
10851# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
10852# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
10853#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
10854# and then we would define $MISSING as
10855#   MISSING="\${SHELL} $am_aux_dir/missing"
10856# This will work as long as MISSING is not called from configure, because
10857# unfortunately $(top_srcdir) has no meaning in configure.
10858# However there are other variables, like CC, which are often used in
10859# configure, and could therefore not use this "fixed" $ac_aux_dir.
10860#
10861# Another solution, used here, is to always expand $ac_aux_dir to an
10862# absolute PATH.  The drawback is that using absolute paths prevent a
10863# configured tree to be moved without reconfiguration.
10864
10865AC_DEFUN([AM_AUX_DIR_EXPAND],
10866[dnl Rely on autoconf to set up CDPATH properly.
10867AC_PREREQ([2.50])dnl
10868# expand $ac_aux_dir to an absolute path
10869am_aux_dir=`cd $ac_aux_dir && pwd`
10870])
10871
10872# AM_CONDITIONAL                                            -*- Autoconf -*-
10873
10874# Copyright (C) 1997-2013 Free Software Foundation, Inc.
10875#
10876# This file is free software; the Free Software Foundation
10877# gives unlimited permission to copy and/or distribute it,
10878# with or without modifications, as long as this notice is preserved.
10879
10880# AM_CONDITIONAL(NAME, SHELL-CONDITION)
10881# -------------------------------------
10882# Define a conditional.
10883AC_DEFUN([AM_CONDITIONAL],
10884[AC_PREREQ([2.52])dnl
10885 m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
10886       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
10887AC_SUBST([$1_TRUE])dnl
10888AC_SUBST([$1_FALSE])dnl
10889_AM_SUBST_NOTMAKE([$1_TRUE])dnl
10890_AM_SUBST_NOTMAKE([$1_FALSE])dnl
10891m4_define([_AM_COND_VALUE_$1], [$2])dnl
10892if $2; then
10893  $1_TRUE=
10894  $1_FALSE='#'
10895else
10896  $1_TRUE='#'
10897  $1_FALSE=
10898fi
10899AC_CONFIG_COMMANDS_PRE(
10900[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
10901  AC_MSG_ERROR([[conditional "$1" was never defined.
10902Usually this means the macro was only invoked conditionally.]])
10903fi])])
10904
10905# Copyright (C) 1999-2013 Free Software Foundation, Inc.
10906#
10907# This file is free software; the Free Software Foundation
10908# gives unlimited permission to copy and/or distribute it,
10909# with or without modifications, as long as this notice is preserved.
10910
10911
10912# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
10913# written in clear, in which case automake, when reading aclocal.m4,
10914# will think it sees a *use*, and therefore will trigger all it's
10915# C support machinery.  Also note that it means that autoscan, seeing
10916# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
10917
10918
10919# _AM_DEPENDENCIES(NAME)
10920# ----------------------
10921# See how the compiler implements dependency checking.
10922# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
10923# We try a few techniques and use that to set a single cache variable.
10924#
10925# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
10926# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
10927# dependency, and given that the user is not expected to run this macro,
10928# just rely on AC_PROG_CC.
10929AC_DEFUN([_AM_DEPENDENCIES],
10930[AC_REQUIRE([AM_SET_DEPDIR])dnl
10931AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
10932AC_REQUIRE([AM_MAKE_INCLUDE])dnl
10933AC_REQUIRE([AM_DEP_TRACK])dnl
10934
10935m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
10936      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
10937      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
10938      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
10939      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
10940      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
10941                    [depcc="$$1"   am_compiler_list=])
10942
10943AC_CACHE_CHECK([dependency style of $depcc],
10944               [am_cv_$1_dependencies_compiler_type],
10945[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
10946  # We make a subdir and do the tests there.  Otherwise we can end up
10947  # making bogus files that we don't know about and never remove.  For
10948  # instance it was reported that on HP-UX the gcc test will end up
10949  # making a dummy file named 'D' -- because '-MD' means "put the output
10950  # in D".
10951  rm -rf conftest.dir
10952  mkdir conftest.dir
10953  # Copy depcomp to subdir because otherwise we won't find it if we're
10954  # using a relative directory.
10955  cp "$am_depcomp" conftest.dir
10956  cd conftest.dir
10957  # We will build objects and dependencies in a subdirectory because
10958  # it helps to detect inapplicable dependency modes.  For instance
10959  # both Tru64's cc and ICC support -MD to output dependencies as a
10960  # side effect of compilation, but ICC will put the dependencies in
10961  # the current directory while Tru64 will put them in the object
10962  # directory.
10963  mkdir sub
10964
10965  am_cv_$1_dependencies_compiler_type=none
10966  if test "$am_compiler_list" = ""; then
10967     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
10968  fi
10969  am__universal=false
10970  m4_case([$1], [CC],
10971    [case " $depcc " in #(
10972     *\ -arch\ *\ -arch\ *) am__universal=true ;;
10973     esac],
10974    [CXX],
10975    [case " $depcc " in #(
10976     *\ -arch\ *\ -arch\ *) am__universal=true ;;
10977     esac])
10978
10979  for depmode in $am_compiler_list; do
10980    # Setup a source with many dependencies, because some compilers
10981    # like to wrap large dependency lists on column 80 (with \), and
10982    # we should not choose a depcomp mode which is confused by this.
10983    #
10984    # We need to recreate these files for each test, as the compiler may
10985    # overwrite some of them when testing with obscure command lines.
10986    # This happens at least with the AIX C compiler.
10987    : > sub/conftest.c
10988    for i in 1 2 3 4 5 6; do
10989      echo '#include "conftst'$i'.h"' >> sub/conftest.c
10990      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
10991      # Solaris 10 /bin/sh.
10992      echo '/* dummy */' > sub/conftst$i.h
10993    done
10994    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
10995
10996    # We check with '-c' and '-o' for the sake of the "dashmstdout"
10997    # mode.  It turns out that the SunPro C++ compiler does not properly
10998    # handle '-M -o', and we need to detect this.  Also, some Intel
10999    # versions had trouble with output in subdirs.
11000    am__obj=sub/conftest.${OBJEXT-o}
11001    am__minus_obj="-o $am__obj"
11002    case $depmode in
11003    gcc)
11004      # This depmode causes a compiler race in universal mode.
11005      test "$am__universal" = false || continue
11006      ;;
11007    nosideeffect)
11008      # After this tag, mechanisms are not by side-effect, so they'll
11009      # only be used when explicitly requested.
11010      if test "x$enable_dependency_tracking" = xyes; then
11011	continue
11012      else
11013	break
11014      fi
11015      ;;
11016    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
11017      # This compiler won't grok '-c -o', but also, the minuso test has
11018      # not run yet.  These depmodes are late enough in the game, and
11019      # so weak that their functioning should not be impacted.
11020      am__obj=conftest.${OBJEXT-o}
11021      am__minus_obj=
11022      ;;
11023    none) break ;;
11024    esac
11025    if depmode=$depmode \
11026       source=sub/conftest.c object=$am__obj \
11027       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
11028       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
11029         >/dev/null 2>conftest.err &&
11030       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
11031       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
11032       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
11033       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
11034      # icc doesn't choke on unknown options, it will just issue warnings
11035      # or remarks (even with -Werror).  So we grep stderr for any message
11036      # that says an option was ignored or not supported.
11037      # When given -MP, icc 7.0 and 7.1 complain thusly:
11038      #   icc: Command line warning: ignoring option '-M'; no argument required
11039      # The diagnosis changed in icc 8.0:
11040      #   icc: Command line remark: option '-MP' not supported
11041      if (grep 'ignoring option' conftest.err ||
11042          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
11043        am_cv_$1_dependencies_compiler_type=$depmode
11044        break
11045      fi
11046    fi
11047  done
11048
11049  cd ..
11050  rm -rf conftest.dir
11051else
11052  am_cv_$1_dependencies_compiler_type=none
11053fi
11054])
11055AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
11056AM_CONDITIONAL([am__fastdep$1], [
11057  test "x$enable_dependency_tracking" != xno \
11058  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
11059])
11060
11061
11062# AM_SET_DEPDIR
11063# -------------
11064# Choose a directory name for dependency files.
11065# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
11066AC_DEFUN([AM_SET_DEPDIR],
11067[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
11068AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
11069])
11070
11071
11072# AM_DEP_TRACK
11073# ------------
11074AC_DEFUN([AM_DEP_TRACK],
11075[AC_ARG_ENABLE([dependency-tracking], [dnl
11076AS_HELP_STRING(
11077  [--enable-dependency-tracking],
11078  [do not reject slow dependency extractors])
11079AS_HELP_STRING(
11080  [--disable-dependency-tracking],
11081  [speeds up one-time build])])
11082if test "x$enable_dependency_tracking" != xno; then
11083  am_depcomp="$ac_aux_dir/depcomp"
11084  AMDEPBACKSLASH='\'
11085  am__nodep='_no'
11086fi
11087AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
11088AC_SUBST([AMDEPBACKSLASH])dnl
11089_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
11090AC_SUBST([am__nodep])dnl
11091_AM_SUBST_NOTMAKE([am__nodep])dnl
11092])
11093
11094# Generate code to set up dependency tracking.              -*- Autoconf -*-
11095
11096# Copyright (C) 1999-2013 Free Software Foundation, Inc.
11097#
11098# This file is free software; the Free Software Foundation
11099# gives unlimited permission to copy and/or distribute it,
11100# with or without modifications, as long as this notice is preserved.
11101
11102
11103# _AM_OUTPUT_DEPENDENCY_COMMANDS
11104# ------------------------------
11105AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
11106[{
11107  # Older Autoconf quotes --file arguments for eval, but not when files
11108  # are listed without --file.  Let's play safe and only enable the eval
11109  # if we detect the quoting.
11110  case $CONFIG_FILES in
11111  *\'*) eval set x "$CONFIG_FILES" ;;
11112  *)   set x $CONFIG_FILES ;;
11113  esac
11114  shift
11115  for mf
11116  do
11117    # Strip MF so we end up with the name of the file.
11118    mf=`echo "$mf" | sed -e 's/:.*$//'`
11119    # Check whether this is an Automake generated Makefile or not.
11120    # We used to match only the files named 'Makefile.in', but
11121    # some people rename them; so instead we look at the file content.
11122    # Grep'ing the first line is not enough: some people post-process
11123    # each Makefile.in and add a new line on top of each file to say so.
11124    # Grep'ing the whole file is not good either: AIX grep has a line
11125    # limit of 2048, but all sed's we know have understand at least 4000.
11126    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
11127      dirpart=`AS_DIRNAME("$mf")`
11128    else
11129      continue
11130    fi
11131    # Extract the definition of DEPDIR, am__include, and am__quote
11132    # from the Makefile without running 'make'.
11133    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
11134    test -z "$DEPDIR" && continue
11135    am__include=`sed -n 's/^am__include = //p' < "$mf"`
11136    test -z "$am__include" && continue
11137    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
11138    # Find all dependency output files, they are included files with
11139    # $(DEPDIR) in their names.  We invoke sed twice because it is the
11140    # simplest approach to changing $(DEPDIR) to its actual value in the
11141    # expansion.
11142    for file in `sed -n "
11143      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
11144	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
11145      # Make sure the directory exists.
11146      test -f "$dirpart/$file" && continue
11147      fdir=`AS_DIRNAME(["$file"])`
11148      AS_MKDIR_P([$dirpart/$fdir])
11149      # echo "creating $dirpart/$file"
11150      echo '# dummy' > "$dirpart/$file"
11151    done
11152  done
11153}
11154])# _AM_OUTPUT_DEPENDENCY_COMMANDS
11155
11156
11157# AM_OUTPUT_DEPENDENCY_COMMANDS
11158# -----------------------------
11159# This macro should only be invoked once -- use via AC_REQUIRE.
11160#
11161# This code is only required when automatic dependency tracking
11162# is enabled.  FIXME.  This creates each '.P' file that we will
11163# need in order to bootstrap the dependency handling code.
11164AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
11165[AC_CONFIG_COMMANDS([depfiles],
11166     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
11167     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
11168])
11169
11170# Do all the work for Automake.                             -*- Autoconf -*-
11171
11172# Copyright (C) 1996-2013 Free Software Foundation, Inc.
11173#
11174# This file is free software; the Free Software Foundation
11175# gives unlimited permission to copy and/or distribute it,
11176# with or without modifications, as long as this notice is preserved.
11177
11178# This macro actually does too much.  Some checks are only needed if
11179# your package does certain things.  But this isn't really a big deal.
11180
11181# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
11182# AM_INIT_AUTOMAKE([OPTIONS])
11183# -----------------------------------------------
11184# The call with PACKAGE and VERSION arguments is the old style
11185# call (pre autoconf-2.50), which is being phased out.  PACKAGE
11186# and VERSION should now be passed to AC_INIT and removed from
11187# the call to AM_INIT_AUTOMAKE.
11188# We support both call styles for the transition.  After
11189# the next Automake release, Autoconf can make the AC_INIT
11190# arguments mandatory, and then we can depend on a new Autoconf
11191# release and drop the old call support.
11192AC_DEFUN([AM_INIT_AUTOMAKE],
11193[AC_PREREQ([2.65])dnl
11194dnl Autoconf wants to disallow AM_ names.  We explicitly allow
11195dnl the ones we care about.
11196m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
11197AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
11198AC_REQUIRE([AC_PROG_INSTALL])dnl
11199if test "`cd $srcdir && pwd`" != "`pwd`"; then
11200  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
11201  # is not polluted with repeated "-I."
11202  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
11203  # test to see if srcdir already configured
11204  if test -f $srcdir/config.status; then
11205    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
11206  fi
11207fi
11208
11209# test whether we have cygpath
11210if test -z "$CYGPATH_W"; then
11211  if (cygpath --version) >/dev/null 2>/dev/null; then
11212    CYGPATH_W='cygpath -w'
11213  else
11214    CYGPATH_W=echo
11215  fi
11216fi
11217AC_SUBST([CYGPATH_W])
11218
11219# Define the identity of the package.
11220dnl Distinguish between old-style and new-style calls.
11221m4_ifval([$2],
11222[AC_DIAGNOSE([obsolete],
11223             [$0: two- and three-arguments forms are deprecated.])
11224m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
11225 AC_SUBST([PACKAGE], [$1])dnl
11226 AC_SUBST([VERSION], [$2])],
11227[_AM_SET_OPTIONS([$1])dnl
11228dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
11229m4_if(
11230  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
11231  [ok:ok],,
11232  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
11233 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
11234 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
11235
11236_AM_IF_OPTION([no-define],,
11237[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
11238 AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
11239
11240# Some tools Automake needs.
11241AC_REQUIRE([AM_SANITY_CHECK])dnl
11242AC_REQUIRE([AC_ARG_PROGRAM])dnl
11243AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
11244AM_MISSING_PROG([AUTOCONF], [autoconf])
11245AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
11246AM_MISSING_PROG([AUTOHEADER], [autoheader])
11247AM_MISSING_PROG([MAKEINFO], [makeinfo])
11248AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
11249AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
11250AC_REQUIRE([AC_PROG_MKDIR_P])dnl
11251# For better backward compatibility.  To be removed once Automake 1.9.x
11252# dies out for good.  For more background, see:
11253# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
11254# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
11255AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
11256# We need awk for the "check" target.  The system "awk" is bad on
11257# some platforms.
11258AC_REQUIRE([AC_PROG_AWK])dnl
11259AC_REQUIRE([AC_PROG_MAKE_SET])dnl
11260AC_REQUIRE([AM_SET_LEADING_DOT])dnl
11261_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
11262	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
11263			     [_AM_PROG_TAR([v7])])])
11264_AM_IF_OPTION([no-dependencies],,
11265[AC_PROVIDE_IFELSE([AC_PROG_CC],
11266		  [_AM_DEPENDENCIES([CC])],
11267		  [m4_define([AC_PROG_CC],
11268			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
11269AC_PROVIDE_IFELSE([AC_PROG_CXX],
11270		  [_AM_DEPENDENCIES([CXX])],
11271		  [m4_define([AC_PROG_CXX],
11272			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
11273AC_PROVIDE_IFELSE([AC_PROG_OBJC],
11274		  [_AM_DEPENDENCIES([OBJC])],
11275		  [m4_define([AC_PROG_OBJC],
11276			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
11277AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
11278		  [_AM_DEPENDENCIES([OBJCXX])],
11279		  [m4_define([AC_PROG_OBJCXX],
11280			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
11281])
11282AC_REQUIRE([AM_SILENT_RULES])dnl
11283dnl The testsuite driver may need to know about EXEEXT, so add the
11284dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
11285dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
11286AC_CONFIG_COMMANDS_PRE(dnl
11287[m4_provide_if([_AM_COMPILER_EXEEXT],
11288  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
11289])
11290
11291dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
11292dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
11293dnl mangled by Autoconf and run in a shell conditional statement.
11294m4_define([_AC_COMPILER_EXEEXT],
11295m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
11296
11297
11298# When config.status generates a header, we must update the stamp-h file.
11299# This file resides in the same directory as the config header
11300# that is generated.  The stamp files are numbered to have different names.
11301
11302# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
11303# loop where config.status creates the headers, so we can generate
11304# our stamp files there.
11305AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
11306[# Compute $1's index in $config_headers.
11307_am_arg=$1
11308_am_stamp_count=1
11309for _am_header in $config_headers :; do
11310  case $_am_header in
11311    $_am_arg | $_am_arg:* )
11312      break ;;
11313    * )
11314      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
11315  esac
11316done
11317echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
11318
11319# Copyright (C) 2001-2013 Free Software Foundation, Inc.
11320#
11321# This file is free software; the Free Software Foundation
11322# gives unlimited permission to copy and/or distribute it,
11323# with or without modifications, as long as this notice is preserved.
11324
11325# AM_PROG_INSTALL_SH
11326# ------------------
11327# Define $install_sh.
11328AC_DEFUN([AM_PROG_INSTALL_SH],
11329[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
11330if test x"${install_sh}" != xset; then
11331  case $am_aux_dir in
11332  *\ * | *\	*)
11333    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
11334  *)
11335    install_sh="\${SHELL} $am_aux_dir/install-sh"
11336  esac
11337fi
11338AC_SUBST([install_sh])])
11339
11340# Copyright (C) 2003-2013 Free Software Foundation, Inc.
11341#
11342# This file is free software; the Free Software Foundation
11343# gives unlimited permission to copy and/or distribute it,
11344# with or without modifications, as long as this notice is preserved.
11345
11346# Check whether the underlying file-system supports filenames
11347# with a leading dot.  For instance MS-DOS doesn't.
11348AC_DEFUN([AM_SET_LEADING_DOT],
11349[rm -rf .tst 2>/dev/null
11350mkdir .tst 2>/dev/null
11351if test -d .tst; then
11352  am__leading_dot=.
11353else
11354  am__leading_dot=_
11355fi
11356rmdir .tst 2>/dev/null
11357AC_SUBST([am__leading_dot])])
11358
11359# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
11360# From Jim Meyering
11361
11362# Copyright (C) 1996-2013 Free Software Foundation, Inc.
11363#
11364# This file is free software; the Free Software Foundation
11365# gives unlimited permission to copy and/or distribute it,
11366# with or without modifications, as long as this notice is preserved.
11367
11368# AM_MAINTAINER_MODE([DEFAULT-MODE])
11369# ----------------------------------
11370# Control maintainer-specific portions of Makefiles.
11371# Default is to disable them, unless 'enable' is passed literally.
11372# For symmetry, 'disable' may be passed as well.  Anyway, the user
11373# can override the default with the --enable/--disable switch.
11374AC_DEFUN([AM_MAINTAINER_MODE],
11375[m4_case(m4_default([$1], [disable]),
11376       [enable], [m4_define([am_maintainer_other], [disable])],
11377       [disable], [m4_define([am_maintainer_other], [enable])],
11378       [m4_define([am_maintainer_other], [enable])
11379        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
11380AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
11381  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
11382  AC_ARG_ENABLE([maintainer-mode],
11383    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
11384      am_maintainer_other[ make rules and dependencies not useful
11385      (and sometimes confusing) to the casual installer])],
11386    [USE_MAINTAINER_MODE=$enableval],
11387    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
11388  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
11389  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
11390  MAINT=$MAINTAINER_MODE_TRUE
11391  AC_SUBST([MAINT])dnl
11392]
11393)
11394
11395# Check to see how 'make' treats includes.	            -*- Autoconf -*-
11396
11397# Copyright (C) 2001-2013 Free Software Foundation, Inc.
11398#
11399# This file is free software; the Free Software Foundation
11400# gives unlimited permission to copy and/or distribute it,
11401# with or without modifications, as long as this notice is preserved.
11402
11403# AM_MAKE_INCLUDE()
11404# -----------------
11405# Check to see how make treats includes.
11406AC_DEFUN([AM_MAKE_INCLUDE],
11407[am_make=${MAKE-make}
11408cat > confinc << 'END'
11409am__doit:
11410	@echo this is the am__doit target
11411.PHONY: am__doit
11412END
11413# If we don't find an include directive, just comment out the code.
11414AC_MSG_CHECKING([for style of include used by $am_make])
11415am__include="#"
11416am__quote=
11417_am_result=none
11418# First try GNU make style include.
11419echo "include confinc" > confmf
11420# Ignore all kinds of additional output from 'make'.
11421case `$am_make -s -f confmf 2> /dev/null` in #(
11422*the\ am__doit\ target*)
11423  am__include=include
11424  am__quote=
11425  _am_result=GNU
11426  ;;
11427esac
11428# Now try BSD make style include.
11429if test "$am__include" = "#"; then
11430   echo '.include "confinc"' > confmf
11431   case `$am_make -s -f confmf 2> /dev/null` in #(
11432   *the\ am__doit\ target*)
11433     am__include=.include
11434     am__quote="\""
11435     _am_result=BSD
11436     ;;
11437   esac
11438fi
11439AC_SUBST([am__include])
11440AC_SUBST([am__quote])
11441AC_MSG_RESULT([$_am_result])
11442rm -f confinc confmf
11443])
11444
11445# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
11446
11447# Copyright (C) 1997-2013 Free Software Foundation, Inc.
11448#
11449# This file is free software; the Free Software Foundation
11450# gives unlimited permission to copy and/or distribute it,
11451# with or without modifications, as long as this notice is preserved.
11452
11453# AM_MISSING_PROG(NAME, PROGRAM)
11454# ------------------------------
11455AC_DEFUN([AM_MISSING_PROG],
11456[AC_REQUIRE([AM_MISSING_HAS_RUN])
11457$1=${$1-"${am_missing_run}$2"}
11458AC_SUBST($1)])
11459
11460# AM_MISSING_HAS_RUN
11461# ------------------
11462# Define MISSING if not defined so far and test if it is modern enough.
11463# If it is, set am_missing_run to use it, otherwise, to nothing.
11464AC_DEFUN([AM_MISSING_HAS_RUN],
11465[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
11466AC_REQUIRE_AUX_FILE([missing])dnl
11467if test x"${MISSING+set}" != xset; then
11468  case $am_aux_dir in
11469  *\ * | *\	*)
11470    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
11471  *)
11472    MISSING="\${SHELL} $am_aux_dir/missing" ;;
11473  esac
11474fi
11475# Use eval to expand $SHELL
11476if eval "$MISSING --is-lightweight"; then
11477  am_missing_run="$MISSING "
11478else
11479  am_missing_run=
11480  AC_MSG_WARN(['missing' script is too old or missing])
11481fi
11482])
11483
11484# Helper functions for option handling.                     -*- Autoconf -*-
11485
11486# Copyright (C) 2001-2013 Free Software Foundation, Inc.
11487#
11488# This file is free software; the Free Software Foundation
11489# gives unlimited permission to copy and/or distribute it,
11490# with or without modifications, as long as this notice is preserved.
11491
11492# _AM_MANGLE_OPTION(NAME)
11493# -----------------------
11494AC_DEFUN([_AM_MANGLE_OPTION],
11495[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
11496
11497# _AM_SET_OPTION(NAME)
11498# --------------------
11499# Set option NAME.  Presently that only means defining a flag for this option.
11500AC_DEFUN([_AM_SET_OPTION],
11501[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
11502
11503# _AM_SET_OPTIONS(OPTIONS)
11504# ------------------------
11505# OPTIONS is a space-separated list of Automake options.
11506AC_DEFUN([_AM_SET_OPTIONS],
11507[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
11508
11509# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
11510# -------------------------------------------
11511# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
11512AC_DEFUN([_AM_IF_OPTION],
11513[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
11514
11515# Check to make sure that the build environment is sane.    -*- Autoconf -*-
11516
11517# Copyright (C) 1996-2013 Free Software Foundation, Inc.
11518#
11519# This file is free software; the Free Software Foundation
11520# gives unlimited permission to copy and/or distribute it,
11521# with or without modifications, as long as this notice is preserved.
11522
11523# AM_SANITY_CHECK
11524# ---------------
11525AC_DEFUN([AM_SANITY_CHECK],
11526[AC_MSG_CHECKING([whether build environment is sane])
11527# Reject unsafe characters in $srcdir or the absolute working directory
11528# name.  Accept space and tab only in the latter.
11529am_lf='
11530'
11531case `pwd` in
11532  *[[\\\"\#\$\&\'\`$am_lf]]*)
11533    AC_MSG_ERROR([unsafe absolute working directory name]);;
11534esac
11535case $srcdir in
11536  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
11537    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
11538esac
11539
11540# Do 'set' in a subshell so we don't clobber the current shell's
11541# arguments.  Must try -L first in case configure is actually a
11542# symlink; some systems play weird games with the mod time of symlinks
11543# (eg FreeBSD returns the mod time of the symlink's containing
11544# directory).
11545if (
11546   am_has_slept=no
11547   for am_try in 1 2; do
11548     echo "timestamp, slept: $am_has_slept" > conftest.file
11549     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
11550     if test "$[*]" = "X"; then
11551	# -L didn't work.
11552	set X `ls -t "$srcdir/configure" conftest.file`
11553     fi
11554     if test "$[*]" != "X $srcdir/configure conftest.file" \
11555	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
11556
11557	# If neither matched, then we have a broken ls.  This can happen
11558	# if, for instance, CONFIG_SHELL is bash and it inherits a
11559	# broken ls alias from the environment.  This has actually
11560	# happened.  Such a system could not be considered "sane".
11561	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
11562  alias in your environment])
11563     fi
11564     if test "$[2]" = conftest.file || test $am_try -eq 2; then
11565       break
11566     fi
11567     # Just in case.
11568     sleep 1
11569     am_has_slept=yes
11570   done
11571   test "$[2]" = conftest.file
11572   )
11573then
11574   # Ok.
11575   :
11576else
11577   AC_MSG_ERROR([newly created file is older than distributed files!
11578Check your system clock])
11579fi
11580AC_MSG_RESULT([yes])
11581# If we didn't sleep, we still need to ensure time stamps of config.status and
11582# generated files are strictly newer.
11583am_sleep_pid=
11584if grep 'slept: no' conftest.file >/dev/null 2>&1; then
11585  ( sleep 1 ) &
11586  am_sleep_pid=$!
11587fi
11588AC_CONFIG_COMMANDS_PRE(
11589  [AC_MSG_CHECKING([that generated files are newer than configure])
11590   if test -n "$am_sleep_pid"; then
11591     # Hide warnings about reused PIDs.
11592     wait $am_sleep_pid 2>/dev/null
11593   fi
11594   AC_MSG_RESULT([done])])
11595rm -f conftest.file
11596])
11597
11598# Copyright (C) 2009-2013 Free Software Foundation, Inc.
11599#
11600# This file is free software; the Free Software Foundation
11601# gives unlimited permission to copy and/or distribute it,
11602# with or without modifications, as long as this notice is preserved.
11603
11604# AM_SILENT_RULES([DEFAULT])
11605# --------------------------
11606# Enable less verbose build rules; with the default set to DEFAULT
11607# ("yes" being less verbose, "no" or empty being verbose).
11608AC_DEFUN([AM_SILENT_RULES],
11609[AC_ARG_ENABLE([silent-rules], [dnl
11610AS_HELP_STRING(
11611  [--enable-silent-rules],
11612  [less verbose build output (undo: "make V=1")])
11613AS_HELP_STRING(
11614  [--disable-silent-rules],
11615  [verbose build output (undo: "make V=0")])dnl
11616])
11617case $enable_silent_rules in @%:@ (((
11618  yes) AM_DEFAULT_VERBOSITY=0;;
11619   no) AM_DEFAULT_VERBOSITY=1;;
11620    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
11621esac
11622dnl
11623dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
11624dnl do not support nested variable expansions.
11625dnl See automake bug#9928 and bug#10237.
11626am_make=${MAKE-make}
11627AC_CACHE_CHECK([whether $am_make supports nested variables],
11628   [am_cv_make_support_nested_variables],
11629   [if AS_ECHO([['TRUE=$(BAR$(V))
11630BAR0=false
11631BAR1=true
11632V=1
11633am__doit:
11634	@$(TRUE)
11635.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
11636  am_cv_make_support_nested_variables=yes
11637else
11638  am_cv_make_support_nested_variables=no
11639fi])
11640if test $am_cv_make_support_nested_variables = yes; then
11641  dnl Using '$V' instead of '$(V)' breaks IRIX make.
11642  AM_V='$(V)'
11643  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
11644else
11645  AM_V=$AM_DEFAULT_VERBOSITY
11646  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
11647fi
11648AC_SUBST([AM_V])dnl
11649AM_SUBST_NOTMAKE([AM_V])dnl
11650AC_SUBST([AM_DEFAULT_V])dnl
11651AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
11652AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
11653AM_BACKSLASH='\'
11654AC_SUBST([AM_BACKSLASH])dnl
11655_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
11656])
11657
11658# Copyright (C) 2001-2013 Free Software Foundation, Inc.
11659#
11660# This file is free software; the Free Software Foundation
11661# gives unlimited permission to copy and/or distribute it,
11662# with or without modifications, as long as this notice is preserved.
11663
11664# AM_PROG_INSTALL_STRIP
11665# ---------------------
11666# One issue with vendor 'install' (even GNU) is that you can't
11667# specify the program used to strip binaries.  This is especially
11668# annoying in cross-compiling environments, where the build's strip
11669# is unlikely to handle the host's binaries.
11670# Fortunately install-sh will honor a STRIPPROG variable, so we
11671# always use install-sh in "make install-strip", and initialize
11672# STRIPPROG with the value of the STRIP variable (set by the user).
11673AC_DEFUN([AM_PROG_INSTALL_STRIP],
11674[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
11675# Installed binaries are usually stripped using 'strip' when the user
11676# run "make install-strip".  However 'strip' might not be the right
11677# tool to use in cross-compilation environments, therefore Automake
11678# will honor the 'STRIP' environment variable to overrule this program.
11679dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
11680if test "$cross_compiling" != no; then
11681  AC_CHECK_TOOL([STRIP], [strip], :)
11682fi
11683INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
11684AC_SUBST([INSTALL_STRIP_PROGRAM])])
11685
11686# Copyright (C) 2006-2013 Free Software Foundation, Inc.
11687#
11688# This file is free software; the Free Software Foundation
11689# gives unlimited permission to copy and/or distribute it,
11690# with or without modifications, as long as this notice is preserved.
11691
11692# _AM_SUBST_NOTMAKE(VARIABLE)
11693# ---------------------------
11694# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
11695# This macro is traced by Automake.
11696AC_DEFUN([_AM_SUBST_NOTMAKE])
11697
11698# AM_SUBST_NOTMAKE(VARIABLE)
11699# --------------------------
11700# Public sister of _AM_SUBST_NOTMAKE.
11701AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
11702
11703# Check how to create a tarball.                            -*- Autoconf -*-
11704
11705# Copyright (C) 2004-2013 Free Software Foundation, Inc.
11706#
11707# This file is free software; the Free Software Foundation
11708# gives unlimited permission to copy and/or distribute it,
11709# with or without modifications, as long as this notice is preserved.
11710
11711# _AM_PROG_TAR(FORMAT)
11712# --------------------
11713# Check how to create a tarball in format FORMAT.
11714# FORMAT should be one of 'v7', 'ustar', or 'pax'.
11715#
11716# Substitute a variable $(am__tar) that is a command
11717# writing to stdout a FORMAT-tarball containing the directory
11718# $tardir.
11719#     tardir=directory && $(am__tar) > result.tar
11720#
11721# Substitute a variable $(am__untar) that extract such
11722# a tarball read from stdin.
11723#     $(am__untar) < result.tar
11724#
11725AC_DEFUN([_AM_PROG_TAR],
11726[# Always define AMTAR for backward compatibility.  Yes, it's still used
11727# in the wild :-(  We should find a proper way to deprecate it ...
11728AC_SUBST([AMTAR], ['$${TAR-tar}'])
11729
11730# We'll loop over all known methods to create a tar archive until one works.
11731_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
11732
11733m4_if([$1], [v7],
11734  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
11735
11736  [m4_case([$1],
11737    [ustar],
11738     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
11739      # There is notably a 21 bits limit for the UID and the GID.  In fact,
11740      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
11741      # and bug#13588).
11742      am_max_uid=2097151 # 2^21 - 1
11743      am_max_gid=$am_max_uid
11744      # The $UID and $GID variables are not portable, so we need to resort
11745      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
11746      # below are definitely unexpected, so allow the users to see them
11747      # (that is, avoid stderr redirection).
11748      am_uid=`id -u || echo unknown`
11749      am_gid=`id -g || echo unknown`
11750      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
11751      if test $am_uid -le $am_max_uid; then
11752         AC_MSG_RESULT([yes])
11753      else
11754         AC_MSG_RESULT([no])
11755         _am_tools=none
11756      fi
11757      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
11758      if test $am_gid -le $am_max_gid; then
11759         AC_MSG_RESULT([yes])
11760      else
11761        AC_MSG_RESULT([no])
11762        _am_tools=none
11763      fi],
11764
11765  [pax],
11766    [],
11767
11768  [m4_fatal([Unknown tar format])])
11769
11770  AC_MSG_CHECKING([how to create a $1 tar archive])
11771
11772  # Go ahead even if we have the value already cached.  We do so because we
11773  # need to set the values for the 'am__tar' and 'am__untar' variables.
11774  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
11775
11776  for _am_tool in $_am_tools; do
11777    case $_am_tool in
11778    gnutar)
11779      for _am_tar in tar gnutar gtar; do
11780        AM_RUN_LOG([$_am_tar --version]) && break
11781      done
11782      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
11783      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
11784      am__untar="$_am_tar -xf -"
11785      ;;
11786    plaintar)
11787      # Must skip GNU tar: if it does not support --format= it doesn't create
11788      # ustar tarball either.
11789      (tar --version) >/dev/null 2>&1 && continue
11790      am__tar='tar chf - "$$tardir"'
11791      am__tar_='tar chf - "$tardir"'
11792      am__untar='tar xf -'
11793      ;;
11794    pax)
11795      am__tar='pax -L -x $1 -w "$$tardir"'
11796      am__tar_='pax -L -x $1 -w "$tardir"'
11797      am__untar='pax -r'
11798      ;;
11799    cpio)
11800      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
11801      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
11802      am__untar='cpio -i -H $1 -d'
11803      ;;
11804    none)
11805      am__tar=false
11806      am__tar_=false
11807      am__untar=false
11808      ;;
11809    esac
11810
11811    # If the value was cached, stop now.  We just wanted to have am__tar
11812    # and am__untar set.
11813    test -n "${am_cv_prog_tar_$1}" && break
11814
11815    # tar/untar a dummy directory, and stop if the command works.
11816    rm -rf conftest.dir
11817    mkdir conftest.dir
11818    echo GrepMe > conftest.dir/file
11819    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
11820    rm -rf conftest.dir
11821    if test -s conftest.tar; then
11822      AM_RUN_LOG([$am__untar <conftest.tar])
11823      AM_RUN_LOG([cat conftest.dir/file])
11824      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
11825    fi
11826  done
11827  rm -rf conftest.dir
11828
11829  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
11830  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
11831
11832AC_SUBST([am__tar])
11833AC_SUBST([am__untar])
11834]) # _AM_PROG_TAR
11835
11836