aclocal.m4 revision 48c85eb7
1# generated automatically by aclocal 1.11.2 -*- Autoconf -*-
2
3# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
5# Inc.
6# This file is free software; the Free Software Foundation
7# gives unlimited permission to copy and/or distribute it,
8# with or without modifications, as long as this notice is preserved.
9
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13# PARTICULAR PURPOSE.
14
15m4_ifndef([AC_AUTOCONF_VERSION],
16  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
18[m4_warning([this file was generated for autoconf 2.68.
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# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
24# Foundation, Inc.
25#
26# This file is free software; the Free Software Foundation
27# gives unlimited permission to copy and/or distribute it,
28# with or without modifications, as long as this notice is preserved.
29
30# serial 1
31
32# AM_AUTOMAKE_VERSION(VERSION)
33# ----------------------------
34# Automake X.Y traces this macro to ensure aclocal.m4 has been
35# generated from the m4 files accompanying Automake X.Y.
36# (This private macro should not be called outside this file.)
37AC_DEFUN([AM_AUTOMAKE_VERSION],
38[am__api_version='1.11'
39dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
40dnl require some minimum version.  Point them to the right macro.
41m4_if([$1], [1.11.2], [],
42      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
43])
44
45# _AM_AUTOCONF_VERSION(VERSION)
46# -----------------------------
47# aclocal traces this macro to find the Autoconf version.
48# This is a private macro too.  Using m4_define simplifies
49# the logic in aclocal, which can simply ignore this definition.
50m4_define([_AM_AUTOCONF_VERSION], [])
51
52# AM_SET_CURRENT_AUTOMAKE_VERSION
53# -------------------------------
54# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
55# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
56AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
57[AM_AUTOMAKE_VERSION([1.11.2])dnl
58m4_ifndef([AC_AUTOCONF_VERSION],
59  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
60_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
61
62# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
63
64# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
65#
66# This file is free software; the Free Software Foundation
67# gives unlimited permission to copy and/or distribute it,
68# with or without modifications, as long as this notice is preserved.
69
70# serial 1
71
72# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
73# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
74# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
75#
76# Of course, Automake must honor this variable whenever it calls a
77# tool from the auxiliary directory.  The problem is that $srcdir (and
78# therefore $ac_aux_dir as well) can be either absolute or relative,
79# depending on how configure is run.  This is pretty annoying, since
80# it makes $ac_aux_dir quite unusable in subdirectories: in the top
81# source directory, any form will work fine, but in subdirectories a
82# relative path needs to be adjusted first.
83#
84# $ac_aux_dir/missing
85#    fails when called from a subdirectory if $ac_aux_dir is relative
86# $top_srcdir/$ac_aux_dir/missing
87#    fails if $ac_aux_dir is absolute,
88#    fails when called from a subdirectory in a VPATH build with
89#          a relative $ac_aux_dir
90#
91# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
92# are both prefixed by $srcdir.  In an in-source build this is usually
93# harmless because $srcdir is `.', but things will broke when you
94# start a VPATH build or use an absolute $srcdir.
95#
96# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
97# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
98#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
99# and then we would define $MISSING as
100#   MISSING="\${SHELL} $am_aux_dir/missing"
101# This will work as long as MISSING is not called from configure, because
102# unfortunately $(top_srcdir) has no meaning in configure.
103# However there are other variables, like CC, which are often used in
104# configure, and could therefore not use this "fixed" $ac_aux_dir.
105#
106# Another solution, used here, is to always expand $ac_aux_dir to an
107# absolute PATH.  The drawback is that using absolute paths prevent a
108# configured tree to be moved without reconfiguration.
109
110AC_DEFUN([AM_AUX_DIR_EXPAND],
111[dnl Rely on autoconf to set up CDPATH properly.
112AC_PREREQ([2.50])dnl
113# expand $ac_aux_dir to an absolute path
114am_aux_dir=`cd $ac_aux_dir && pwd`
115])
116
117# AM_CONDITIONAL                                            -*- Autoconf -*-
118
119# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
120# Free Software Foundation, Inc.
121#
122# This file is free software; the Free Software Foundation
123# gives unlimited permission to copy and/or distribute it,
124# with or without modifications, as long as this notice is preserved.
125
126# serial 9
127
128# AM_CONDITIONAL(NAME, SHELL-CONDITION)
129# -------------------------------------
130# Define a conditional.
131AC_DEFUN([AM_CONDITIONAL],
132[AC_PREREQ(2.52)dnl
133 ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
134	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
135AC_SUBST([$1_TRUE])dnl
136AC_SUBST([$1_FALSE])dnl
137_AM_SUBST_NOTMAKE([$1_TRUE])dnl
138_AM_SUBST_NOTMAKE([$1_FALSE])dnl
139m4_define([_AM_COND_VALUE_$1], [$2])dnl
140if $2; then
141  $1_TRUE=
142  $1_FALSE='#'
143else
144  $1_TRUE='#'
145  $1_FALSE=
146fi
147AC_CONFIG_COMMANDS_PRE(
148[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
149  AC_MSG_ERROR([[conditional "$1" was never defined.
150Usually this means the macro was only invoked conditionally.]])
151fi])])
152
153# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
154# 2010, 2011 Free Software Foundation, Inc.
155#
156# This file is free software; the Free Software Foundation
157# gives unlimited permission to copy and/or distribute it,
158# with or without modifications, as long as this notice is preserved.
159
160# serial 12
161
162# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
163# written in clear, in which case automake, when reading aclocal.m4,
164# will think it sees a *use*, and therefore will trigger all it's
165# C support machinery.  Also note that it means that autoscan, seeing
166# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
167
168
169# _AM_DEPENDENCIES(NAME)
170# ----------------------
171# See how the compiler implements dependency checking.
172# NAME is "CC", "CXX", "GCJ", or "OBJC".
173# We try a few techniques and use that to set a single cache variable.
174#
175# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
176# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
177# dependency, and given that the user is not expected to run this macro,
178# just rely on AC_PROG_CC.
179AC_DEFUN([_AM_DEPENDENCIES],
180[AC_REQUIRE([AM_SET_DEPDIR])dnl
181AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
182AC_REQUIRE([AM_MAKE_INCLUDE])dnl
183AC_REQUIRE([AM_DEP_TRACK])dnl
184
185ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
186       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
187       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
188       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
189       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
190                   [depcc="$$1"   am_compiler_list=])
191
192AC_CACHE_CHECK([dependency style of $depcc],
193               [am_cv_$1_dependencies_compiler_type],
194[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
195  # We make a subdir and do the tests there.  Otherwise we can end up
196  # making bogus files that we don't know about and never remove.  For
197  # instance it was reported that on HP-UX the gcc test will end up
198  # making a dummy file named `D' -- because `-MD' means `put the output
199  # in D'.
200  rm -rf conftest.dir
201  mkdir conftest.dir
202  # Copy depcomp to subdir because otherwise we won't find it if we're
203  # using a relative directory.
204  cp "$am_depcomp" conftest.dir
205  cd conftest.dir
206  # We will build objects and dependencies in a subdirectory because
207  # it helps to detect inapplicable dependency modes.  For instance
208  # both Tru64's cc and ICC support -MD to output dependencies as a
209  # side effect of compilation, but ICC will put the dependencies in
210  # the current directory while Tru64 will put them in the object
211  # directory.
212  mkdir sub
213
214  am_cv_$1_dependencies_compiler_type=none
215  if test "$am_compiler_list" = ""; then
216     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
217  fi
218  am__universal=false
219  m4_case([$1], [CC],
220    [case " $depcc " in #(
221     *\ -arch\ *\ -arch\ *) am__universal=true ;;
222     esac],
223    [CXX],
224    [case " $depcc " in #(
225     *\ -arch\ *\ -arch\ *) am__universal=true ;;
226     esac])
227
228  for depmode in $am_compiler_list; do
229    # Setup a source with many dependencies, because some compilers
230    # like to wrap large dependency lists on column 80 (with \), and
231    # we should not choose a depcomp mode which is confused by this.
232    #
233    # We need to recreate these files for each test, as the compiler may
234    # overwrite some of them when testing with obscure command lines.
235    # This happens at least with the AIX C compiler.
236    : > sub/conftest.c
237    for i in 1 2 3 4 5 6; do
238      echo '#include "conftst'$i'.h"' >> sub/conftest.c
239      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
240      # Solaris 8's {/usr,}/bin/sh.
241      touch sub/conftst$i.h
242    done
243    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
244
245    # We check with `-c' and `-o' for the sake of the "dashmstdout"
246    # mode.  It turns out that the SunPro C++ compiler does not properly
247    # handle `-M -o', and we need to detect this.  Also, some Intel
248    # versions had trouble with output in subdirs
249    am__obj=sub/conftest.${OBJEXT-o}
250    am__minus_obj="-o $am__obj"
251    case $depmode in
252    gcc)
253      # This depmode causes a compiler race in universal mode.
254      test "$am__universal" = false || continue
255      ;;
256    nosideeffect)
257      # after this tag, mechanisms are not by side-effect, so they'll
258      # only be used when explicitly requested
259      if test "x$enable_dependency_tracking" = xyes; then
260	continue
261      else
262	break
263      fi
264      ;;
265    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
266      # This compiler won't grok `-c -o', but also, the minuso test has
267      # not run yet.  These depmodes are late enough in the game, and
268      # so weak that their functioning should not be impacted.
269      am__obj=conftest.${OBJEXT-o}
270      am__minus_obj=
271      ;;
272    none) break ;;
273    esac
274    if depmode=$depmode \
275       source=sub/conftest.c object=$am__obj \
276       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
277       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
278         >/dev/null 2>conftest.err &&
279       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
280       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
281       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
282       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
283      # icc doesn't choke on unknown options, it will just issue warnings
284      # or remarks (even with -Werror).  So we grep stderr for any message
285      # that says an option was ignored or not supported.
286      # When given -MP, icc 7.0 and 7.1 complain thusly:
287      #   icc: Command line warning: ignoring option '-M'; no argument required
288      # The diagnosis changed in icc 8.0:
289      #   icc: Command line remark: option '-MP' not supported
290      if (grep 'ignoring option' conftest.err ||
291          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
292        am_cv_$1_dependencies_compiler_type=$depmode
293        break
294      fi
295    fi
296  done
297
298  cd ..
299  rm -rf conftest.dir
300else
301  am_cv_$1_dependencies_compiler_type=none
302fi
303])
304AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
305AM_CONDITIONAL([am__fastdep$1], [
306  test "x$enable_dependency_tracking" != xno \
307  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
308])
309
310
311# AM_SET_DEPDIR
312# -------------
313# Choose a directory name for dependency files.
314# This macro is AC_REQUIREd in _AM_DEPENDENCIES
315AC_DEFUN([AM_SET_DEPDIR],
316[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
317AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
318])
319
320
321# AM_DEP_TRACK
322# ------------
323AC_DEFUN([AM_DEP_TRACK],
324[AC_ARG_ENABLE(dependency-tracking,
325[  --disable-dependency-tracking  speeds up one-time build
326  --enable-dependency-tracking   do not reject slow dependency extractors])
327if test "x$enable_dependency_tracking" != xno; then
328  am_depcomp="$ac_aux_dir/depcomp"
329  AMDEPBACKSLASH='\'
330  am__nodep='_no'
331fi
332AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
333AC_SUBST([AMDEPBACKSLASH])dnl
334_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
335AC_SUBST([am__nodep])dnl
336_AM_SUBST_NOTMAKE([am__nodep])dnl
337])
338
339# Generate code to set up dependency tracking.              -*- Autoconf -*-
340
341# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
342# Free Software Foundation, Inc.
343#
344# This file is free software; the Free Software Foundation
345# gives unlimited permission to copy and/or distribute it,
346# with or without modifications, as long as this notice is preserved.
347
348#serial 5
349
350# _AM_OUTPUT_DEPENDENCY_COMMANDS
351# ------------------------------
352AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
353[{
354  # Autoconf 2.62 quotes --file arguments for eval, but not when files
355  # are listed without --file.  Let's play safe and only enable the eval
356  # if we detect the quoting.
357  case $CONFIG_FILES in
358  *\'*) eval set x "$CONFIG_FILES" ;;
359  *)   set x $CONFIG_FILES ;;
360  esac
361  shift
362  for mf
363  do
364    # Strip MF so we end up with the name of the file.
365    mf=`echo "$mf" | sed -e 's/:.*$//'`
366    # Check whether this is an Automake generated Makefile or not.
367    # We used to match only the files named `Makefile.in', but
368    # some people rename them; so instead we look at the file content.
369    # Grep'ing the first line is not enough: some people post-process
370    # each Makefile.in and add a new line on top of each file to say so.
371    # Grep'ing the whole file is not good either: AIX grep has a line
372    # limit of 2048, but all sed's we know have understand at least 4000.
373    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
374      dirpart=`AS_DIRNAME("$mf")`
375    else
376      continue
377    fi
378    # Extract the definition of DEPDIR, am__include, and am__quote
379    # from the Makefile without running `make'.
380    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
381    test -z "$DEPDIR" && continue
382    am__include=`sed -n 's/^am__include = //p' < "$mf"`
383    test -z "am__include" && continue
384    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
385    # When using ansi2knr, U may be empty or an underscore; expand it
386    U=`sed -n 's/^U = //p' < "$mf"`
387    # Find all dependency output files, they are included files with
388    # $(DEPDIR) in their names.  We invoke sed twice because it is the
389    # simplest approach to changing $(DEPDIR) to its actual value in the
390    # expansion.
391    for file in `sed -n "
392      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
393	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
394      # Make sure the directory exists.
395      test -f "$dirpart/$file" && continue
396      fdir=`AS_DIRNAME(["$file"])`
397      AS_MKDIR_P([$dirpart/$fdir])
398      # echo "creating $dirpart/$file"
399      echo '# dummy' > "$dirpart/$file"
400    done
401  done
402}
403])# _AM_OUTPUT_DEPENDENCY_COMMANDS
404
405
406# AM_OUTPUT_DEPENDENCY_COMMANDS
407# -----------------------------
408# This macro should only be invoked once -- use via AC_REQUIRE.
409#
410# This code is only required when automatic dependency tracking
411# is enabled.  FIXME.  This creates each `.P' file that we will
412# need in order to bootstrap the dependency handling code.
413AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
414[AC_CONFIG_COMMANDS([depfiles],
415     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
416     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
417])
418
419# Do all the work for Automake.                             -*- Autoconf -*-
420
421# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
422# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
423#
424# This file is free software; the Free Software Foundation
425# gives unlimited permission to copy and/or distribute it,
426# with or without modifications, as long as this notice is preserved.
427
428# serial 16
429
430# This macro actually does too much.  Some checks are only needed if
431# your package does certain things.  But this isn't really a big deal.
432
433# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
434# AM_INIT_AUTOMAKE([OPTIONS])
435# -----------------------------------------------
436# The call with PACKAGE and VERSION arguments is the old style
437# call (pre autoconf-2.50), which is being phased out.  PACKAGE
438# and VERSION should now be passed to AC_INIT and removed from
439# the call to AM_INIT_AUTOMAKE.
440# We support both call styles for the transition.  After
441# the next Automake release, Autoconf can make the AC_INIT
442# arguments mandatory, and then we can depend on a new Autoconf
443# release and drop the old call support.
444AC_DEFUN([AM_INIT_AUTOMAKE],
445[AC_PREREQ([2.62])dnl
446dnl Autoconf wants to disallow AM_ names.  We explicitly allow
447dnl the ones we care about.
448m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
449AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
450AC_REQUIRE([AC_PROG_INSTALL])dnl
451if test "`cd $srcdir && pwd`" != "`pwd`"; then
452  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
453  # is not polluted with repeated "-I."
454  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
455  # test to see if srcdir already configured
456  if test -f $srcdir/config.status; then
457    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
458  fi
459fi
460
461# test whether we have cygpath
462if test -z "$CYGPATH_W"; then
463  if (cygpath --version) >/dev/null 2>/dev/null; then
464    CYGPATH_W='cygpath -w'
465  else
466    CYGPATH_W=echo
467  fi
468fi
469AC_SUBST([CYGPATH_W])
470
471# Define the identity of the package.
472dnl Distinguish between old-style and new-style calls.
473m4_ifval([$2],
474[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
475 AC_SUBST([PACKAGE], [$1])dnl
476 AC_SUBST([VERSION], [$2])],
477[_AM_SET_OPTIONS([$1])dnl
478dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
479m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
480  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
481 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
482 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
483
484_AM_IF_OPTION([no-define],,
485[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
486 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
487
488# Some tools Automake needs.
489AC_REQUIRE([AM_SANITY_CHECK])dnl
490AC_REQUIRE([AC_ARG_PROGRAM])dnl
491AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
492AM_MISSING_PROG(AUTOCONF, autoconf)
493AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
494AM_MISSING_PROG(AUTOHEADER, autoheader)
495AM_MISSING_PROG(MAKEINFO, makeinfo)
496AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
497AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
498AC_REQUIRE([AM_PROG_MKDIR_P])dnl
499# We need awk for the "check" target.  The system "awk" is bad on
500# some platforms.
501AC_REQUIRE([AC_PROG_AWK])dnl
502AC_REQUIRE([AC_PROG_MAKE_SET])dnl
503AC_REQUIRE([AM_SET_LEADING_DOT])dnl
504_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
505	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
506			     [_AM_PROG_TAR([v7])])])
507_AM_IF_OPTION([no-dependencies],,
508[AC_PROVIDE_IFELSE([AC_PROG_CC],
509		  [_AM_DEPENDENCIES(CC)],
510		  [define([AC_PROG_CC],
511			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
512AC_PROVIDE_IFELSE([AC_PROG_CXX],
513		  [_AM_DEPENDENCIES(CXX)],
514		  [define([AC_PROG_CXX],
515			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
516AC_PROVIDE_IFELSE([AC_PROG_OBJC],
517		  [_AM_DEPENDENCIES(OBJC)],
518		  [define([AC_PROG_OBJC],
519			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
520])
521_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
522dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
523dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
524dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
525AC_CONFIG_COMMANDS_PRE(dnl
526[m4_provide_if([_AM_COMPILER_EXEEXT],
527  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
528])
529
530dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
531dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
532dnl mangled by Autoconf and run in a shell conditional statement.
533m4_define([_AC_COMPILER_EXEEXT],
534m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
535
536
537# When config.status generates a header, we must update the stamp-h file.
538# This file resides in the same directory as the config header
539# that is generated.  The stamp files are numbered to have different names.
540
541# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
542# loop where config.status creates the headers, so we can generate
543# our stamp files there.
544AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
545[# Compute $1's index in $config_headers.
546_am_arg=$1
547_am_stamp_count=1
548for _am_header in $config_headers :; do
549  case $_am_header in
550    $_am_arg | $_am_arg:* )
551      break ;;
552    * )
553      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
554  esac
555done
556echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
557
558# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
559# Inc.
560#
561# This file is free software; the Free Software Foundation
562# gives unlimited permission to copy and/or distribute it,
563# with or without modifications, as long as this notice is preserved.
564
565# serial 1
566
567# AM_PROG_INSTALL_SH
568# ------------------
569# Define $install_sh.
570AC_DEFUN([AM_PROG_INSTALL_SH],
571[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
572if test x"${install_sh}" != xset; then
573  case $am_aux_dir in
574  *\ * | *\	*)
575    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
576  *)
577    install_sh="\${SHELL} $am_aux_dir/install-sh"
578  esac
579fi
580AC_SUBST(install_sh)])
581
582# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
583#
584# This file is free software; the Free Software Foundation
585# gives unlimited permission to copy and/or distribute it,
586# with or without modifications, as long as this notice is preserved.
587
588# serial 2
589
590# Check whether the underlying file-system supports filenames
591# with a leading dot.  For instance MS-DOS doesn't.
592AC_DEFUN([AM_SET_LEADING_DOT],
593[rm -rf .tst 2>/dev/null
594mkdir .tst 2>/dev/null
595if test -d .tst; then
596  am__leading_dot=.
597else
598  am__leading_dot=_
599fi
600rmdir .tst 2>/dev/null
601AC_SUBST([am__leading_dot])])
602
603# Check to see how 'make' treats includes.	            -*- Autoconf -*-
604
605# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
606#
607# This file is free software; the Free Software Foundation
608# gives unlimited permission to copy and/or distribute it,
609# with or without modifications, as long as this notice is preserved.
610
611# serial 4
612
613# AM_MAKE_INCLUDE()
614# -----------------
615# Check to see how make treats includes.
616AC_DEFUN([AM_MAKE_INCLUDE],
617[am_make=${MAKE-make}
618cat > confinc << 'END'
619am__doit:
620	@echo this is the am__doit target
621.PHONY: am__doit
622END
623# If we don't find an include directive, just comment out the code.
624AC_MSG_CHECKING([for style of include used by $am_make])
625am__include="#"
626am__quote=
627_am_result=none
628# First try GNU make style include.
629echo "include confinc" > confmf
630# Ignore all kinds of additional output from `make'.
631case `$am_make -s -f confmf 2> /dev/null` in #(
632*the\ am__doit\ target*)
633  am__include=include
634  am__quote=
635  _am_result=GNU
636  ;;
637esac
638# Now try BSD make style include.
639if test "$am__include" = "#"; then
640   echo '.include "confinc"' > confmf
641   case `$am_make -s -f confmf 2> /dev/null` in #(
642   *the\ am__doit\ target*)
643     am__include=.include
644     am__quote="\""
645     _am_result=BSD
646     ;;
647   esac
648fi
649AC_SUBST([am__include])
650AC_SUBST([am__quote])
651AC_MSG_RESULT([$_am_result])
652rm -f confinc confmf
653])
654
655# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
656
657# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
658# Free Software Foundation, Inc.
659#
660# This file is free software; the Free Software Foundation
661# gives unlimited permission to copy and/or distribute it,
662# with or without modifications, as long as this notice is preserved.
663
664# serial 6
665
666# AM_MISSING_PROG(NAME, PROGRAM)
667# ------------------------------
668AC_DEFUN([AM_MISSING_PROG],
669[AC_REQUIRE([AM_MISSING_HAS_RUN])
670$1=${$1-"${am_missing_run}$2"}
671AC_SUBST($1)])
672
673
674# AM_MISSING_HAS_RUN
675# ------------------
676# Define MISSING if not defined so far and test if it supports --run.
677# If it does, set am_missing_run to use it, otherwise, to nothing.
678AC_DEFUN([AM_MISSING_HAS_RUN],
679[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
680AC_REQUIRE_AUX_FILE([missing])dnl
681if test x"${MISSING+set}" != xset; then
682  case $am_aux_dir in
683  *\ * | *\	*)
684    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
685  *)
686    MISSING="\${SHELL} $am_aux_dir/missing" ;;
687  esac
688fi
689# Use eval to expand $SHELL
690if eval "$MISSING --run true"; then
691  am_missing_run="$MISSING --run "
692else
693  am_missing_run=
694  AC_MSG_WARN([`missing' script is too old or missing])
695fi
696])
697
698# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
699# Inc.
700#
701# This file is free software; the Free Software Foundation
702# gives unlimited permission to copy and/or distribute it,
703# with or without modifications, as long as this notice is preserved.
704
705# serial 1
706
707# AM_PROG_MKDIR_P
708# ---------------
709# Check for `mkdir -p'.
710AC_DEFUN([AM_PROG_MKDIR_P],
711[AC_PREREQ([2.60])dnl
712AC_REQUIRE([AC_PROG_MKDIR_P])dnl
713dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
714dnl while keeping a definition of mkdir_p for backward compatibility.
715dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
716dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
717dnl Makefile.ins that do not define MKDIR_P, so we do our own
718dnl adjustment using top_builddir (which is defined more often than
719dnl MKDIR_P).
720AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
721case $mkdir_p in
722  [[\\/$]]* | ?:[[\\/]]*) ;;
723  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
724esac
725])
726
727# Helper functions for option handling.                     -*- Autoconf -*-
728
729# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
730# Foundation, Inc.
731#
732# This file is free software; the Free Software Foundation
733# gives unlimited permission to copy and/or distribute it,
734# with or without modifications, as long as this notice is preserved.
735
736# serial 5
737
738# _AM_MANGLE_OPTION(NAME)
739# -----------------------
740AC_DEFUN([_AM_MANGLE_OPTION],
741[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
742
743# _AM_SET_OPTION(NAME)
744# --------------------
745# Set option NAME.  Presently that only means defining a flag for this option.
746AC_DEFUN([_AM_SET_OPTION],
747[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
748
749# _AM_SET_OPTIONS(OPTIONS)
750# ------------------------
751# OPTIONS is a space-separated list of Automake options.
752AC_DEFUN([_AM_SET_OPTIONS],
753[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
754
755# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
756# -------------------------------------------
757# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
758AC_DEFUN([_AM_IF_OPTION],
759[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
760
761# Check to make sure that the build environment is sane.    -*- Autoconf -*-
762
763# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
764# Free Software Foundation, Inc.
765#
766# This file is free software; the Free Software Foundation
767# gives unlimited permission to copy and/or distribute it,
768# with or without modifications, as long as this notice is preserved.
769
770# serial 5
771
772# AM_SANITY_CHECK
773# ---------------
774AC_DEFUN([AM_SANITY_CHECK],
775[AC_MSG_CHECKING([whether build environment is sane])
776# Just in case
777sleep 1
778echo timestamp > conftest.file
779# Reject unsafe characters in $srcdir or the absolute working directory
780# name.  Accept space and tab only in the latter.
781am_lf='
782'
783case `pwd` in
784  *[[\\\"\#\$\&\'\`$am_lf]]*)
785    AC_MSG_ERROR([unsafe absolute working directory name]);;
786esac
787case $srcdir in
788  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
789    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
790esac
791
792# Do `set' in a subshell so we don't clobber the current shell's
793# arguments.  Must try -L first in case configure is actually a
794# symlink; some systems play weird games with the mod time of symlinks
795# (eg FreeBSD returns the mod time of the symlink's containing
796# directory).
797if (
798   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
799   if test "$[*]" = "X"; then
800      # -L didn't work.
801      set X `ls -t "$srcdir/configure" conftest.file`
802   fi
803   rm -f conftest.file
804   if test "$[*]" != "X $srcdir/configure conftest.file" \
805      && test "$[*]" != "X conftest.file $srcdir/configure"; then
806
807      # If neither matched, then we have a broken ls.  This can happen
808      # if, for instance, CONFIG_SHELL is bash and it inherits a
809      # broken ls alias from the environment.  This has actually
810      # happened.  Such a system could not be considered "sane".
811      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
812alias in your environment])
813   fi
814
815   test "$[2]" = conftest.file
816   )
817then
818   # Ok.
819   :
820else
821   AC_MSG_ERROR([newly created file is older than distributed files!
822Check your system clock])
823fi
824AC_MSG_RESULT(yes)])
825
826# Copyright (C) 2009  Free Software Foundation, Inc.
827#
828# This file is free software; the Free Software Foundation
829# gives unlimited permission to copy and/or distribute it,
830# with or without modifications, as long as this notice is preserved.
831
832# serial 1
833
834# AM_SILENT_RULES([DEFAULT])
835# --------------------------
836# Enable less verbose build rules; with the default set to DEFAULT
837# (`yes' being less verbose, `no' or empty being verbose).
838AC_DEFUN([AM_SILENT_RULES],
839[AC_ARG_ENABLE([silent-rules],
840[  --enable-silent-rules          less verbose build output (undo: `make V=1')
841  --disable-silent-rules         verbose build output (undo: `make V=0')])
842case $enable_silent_rules in
843yes) AM_DEFAULT_VERBOSITY=0;;
844no)  AM_DEFAULT_VERBOSITY=1;;
845*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
846esac
847AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
848AM_BACKSLASH='\'
849AC_SUBST([AM_BACKSLASH])dnl
850_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
851])
852
853# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
854#
855# This file is free software; the Free Software Foundation
856# gives unlimited permission to copy and/or distribute it,
857# with or without modifications, as long as this notice is preserved.
858
859# serial 1
860
861# AM_PROG_INSTALL_STRIP
862# ---------------------
863# One issue with vendor `install' (even GNU) is that you can't
864# specify the program used to strip binaries.  This is especially
865# annoying in cross-compiling environments, where the build's strip
866# is unlikely to handle the host's binaries.
867# Fortunately install-sh will honor a STRIPPROG variable, so we
868# always use install-sh in `make install-strip', and initialize
869# STRIPPROG with the value of the STRIP variable (set by the user).
870AC_DEFUN([AM_PROG_INSTALL_STRIP],
871[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
872# Installed binaries are usually stripped using `strip' when the user
873# run `make install-strip'.  However `strip' might not be the right
874# tool to use in cross-compilation environments, therefore Automake
875# will honor the `STRIP' environment variable to overrule this program.
876dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
877if test "$cross_compiling" != no; then
878  AC_CHECK_TOOL([STRIP], [strip], :)
879fi
880INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
881AC_SUBST([INSTALL_STRIP_PROGRAM])])
882
883# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
884#
885# This file is free software; the Free Software Foundation
886# gives unlimited permission to copy and/or distribute it,
887# with or without modifications, as long as this notice is preserved.
888
889# serial 3
890
891# _AM_SUBST_NOTMAKE(VARIABLE)
892# ---------------------------
893# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
894# This macro is traced by Automake.
895AC_DEFUN([_AM_SUBST_NOTMAKE])
896
897# AM_SUBST_NOTMAKE(VARIABLE)
898# --------------------------
899# Public sister of _AM_SUBST_NOTMAKE.
900AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
901
902# Check how to create a tarball.                            -*- Autoconf -*-
903
904# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
905#
906# This file is free software; the Free Software Foundation
907# gives unlimited permission to copy and/or distribute it,
908# with or without modifications, as long as this notice is preserved.
909
910# serial 2
911
912# _AM_PROG_TAR(FORMAT)
913# --------------------
914# Check how to create a tarball in format FORMAT.
915# FORMAT should be one of `v7', `ustar', or `pax'.
916#
917# Substitute a variable $(am__tar) that is a command
918# writing to stdout a FORMAT-tarball containing the directory
919# $tardir.
920#     tardir=directory && $(am__tar) > result.tar
921#
922# Substitute a variable $(am__untar) that extract such
923# a tarball read from stdin.
924#     $(am__untar) < result.tar
925AC_DEFUN([_AM_PROG_TAR],
926[# Always define AMTAR for backward compatibility.
927AM_MISSING_PROG([AMTAR], [tar])
928m4_if([$1], [v7],
929     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
930     [m4_case([$1], [ustar],, [pax],,
931              [m4_fatal([Unknown tar format])])
932AC_MSG_CHECKING([how to create a $1 tar archive])
933# Loop over all known methods to create a tar archive until one works.
934_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
935_am_tools=${am_cv_prog_tar_$1-$_am_tools}
936# Do not fold the above two line into one, because Tru64 sh and
937# Solaris sh will not grok spaces in the rhs of `-'.
938for _am_tool in $_am_tools
939do
940  case $_am_tool in
941  gnutar)
942    for _am_tar in tar gnutar gtar;
943    do
944      AM_RUN_LOG([$_am_tar --version]) && break
945    done
946    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
947    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
948    am__untar="$_am_tar -xf -"
949    ;;
950  plaintar)
951    # Must skip GNU tar: if it does not support --format= it doesn't create
952    # ustar tarball either.
953    (tar --version) >/dev/null 2>&1 && continue
954    am__tar='tar chf - "$$tardir"'
955    am__tar_='tar chf - "$tardir"'
956    am__untar='tar xf -'
957    ;;
958  pax)
959    am__tar='pax -L -x $1 -w "$$tardir"'
960    am__tar_='pax -L -x $1 -w "$tardir"'
961    am__untar='pax -r'
962    ;;
963  cpio)
964    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
965    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
966    am__untar='cpio -i -H $1 -d'
967    ;;
968  none)
969    am__tar=false
970    am__tar_=false
971    am__untar=false
972    ;;
973  esac
974
975  # If the value was cached, stop now.  We just wanted to have am__tar
976  # and am__untar set.
977  test -n "${am_cv_prog_tar_$1}" && break
978
979  # tar/untar a dummy directory, and stop if the command works
980  rm -rf conftest.dir
981  mkdir conftest.dir
982  echo GrepMe > conftest.dir/file
983  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
984  rm -rf conftest.dir
985  if test -s conftest.tar; then
986    AM_RUN_LOG([$am__untar <conftest.tar])
987    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
988  fi
989done
990rm -rf conftest.dir
991
992AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
993AC_MSG_RESULT([$am_cv_prog_tar_$1])])
994AC_SUBST([am__tar])
995AC_SUBST([am__untar])
996]) # _AM_PROG_TAR
997
998# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
999#
1000#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1001#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
1002#                 Foundation, Inc.
1003#   Written by Gordon Matzigkeit, 1996
1004#
1005# This file is free software; the Free Software Foundation gives
1006# unlimited permission to copy and/or distribute it, with or without
1007# modifications, as long as this notice is preserved.
1008
1009m4_define([_LT_COPYING], [dnl
1010#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
1011#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
1012#                 Foundation, Inc.
1013#   Written by Gordon Matzigkeit, 1996
1014#
1015#   This file is part of GNU Libtool.
1016#
1017# GNU Libtool is free software; you can redistribute it and/or
1018# modify it under the terms of the GNU General Public License as
1019# published by the Free Software Foundation; either version 2 of
1020# the License, or (at your option) any later version.
1021#
1022# As a special exception to the GNU General Public License,
1023# if you distribute this file as part of a program or library that
1024# is built using GNU Libtool, you may include this file under the
1025# same distribution terms that you use for the rest of that program.
1026#
1027# GNU Libtool is distributed in the hope that it will be useful,
1028# but WITHOUT ANY WARRANTY; without even the implied warranty of
1029# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1030# GNU General Public License for more details.
1031#
1032# You should have received a copy of the GNU General Public License
1033# along with GNU Libtool; see the file COPYING.  If not, a copy
1034# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
1035# obtained by writing to the Free Software Foundation, Inc.,
1036# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1037])
1038
1039# serial 57 LT_INIT
1040
1041
1042# LT_PREREQ(VERSION)
1043# ------------------
1044# Complain and exit if this libtool version is less that VERSION.
1045m4_defun([LT_PREREQ],
1046[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
1047       [m4_default([$3],
1048		   [m4_fatal([Libtool version $1 or higher is required],
1049		             63)])],
1050       [$2])])
1051
1052
1053# _LT_CHECK_BUILDDIR
1054# ------------------
1055# Complain if the absolute build directory name contains unusual characters
1056m4_defun([_LT_CHECK_BUILDDIR],
1057[case `pwd` in
1058  *\ * | *\	*)
1059    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
1060esac
1061])
1062
1063
1064# LT_INIT([OPTIONS])
1065# ------------------
1066AC_DEFUN([LT_INIT],
1067[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
1068AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1069AC_BEFORE([$0], [LT_LANG])dnl
1070AC_BEFORE([$0], [LT_OUTPUT])dnl
1071AC_BEFORE([$0], [LTDL_INIT])dnl
1072m4_require([_LT_CHECK_BUILDDIR])dnl
1073
1074dnl Autoconf doesn't catch unexpanded LT_ macros by default:
1075m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
1076m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
1077dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
1078dnl unless we require an AC_DEFUNed macro:
1079AC_REQUIRE([LTOPTIONS_VERSION])dnl
1080AC_REQUIRE([LTSUGAR_VERSION])dnl
1081AC_REQUIRE([LTVERSION_VERSION])dnl
1082AC_REQUIRE([LTOBSOLETE_VERSION])dnl
1083m4_require([_LT_PROG_LTMAIN])dnl
1084
1085_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
1086
1087dnl Parse OPTIONS
1088_LT_SET_OPTIONS([$0], [$1])
1089
1090# This can be used to rebuild libtool when needed
1091LIBTOOL_DEPS="$ltmain"
1092
1093# Always use our own libtool.
1094LIBTOOL='$(SHELL) $(top_builddir)/libtool'
1095AC_SUBST(LIBTOOL)dnl
1096
1097_LT_SETUP
1098
1099# Only expand once:
1100m4_define([LT_INIT])
1101])# LT_INIT
1102
1103# Old names:
1104AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
1105AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
1106dnl aclocal-1.4 backwards compatibility:
1107dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
1108dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
1109
1110
1111# _LT_CC_BASENAME(CC)
1112# -------------------
1113# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
1114m4_defun([_LT_CC_BASENAME],
1115[for cc_temp in $1""; do
1116  case $cc_temp in
1117    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
1118    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
1119    \-*) ;;
1120    *) break;;
1121  esac
1122done
1123cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
1124])
1125
1126
1127# _LT_FILEUTILS_DEFAULTS
1128# ----------------------
1129# It is okay to use these file commands and assume they have been set
1130# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
1131m4_defun([_LT_FILEUTILS_DEFAULTS],
1132[: ${CP="cp -f"}
1133: ${MV="mv -f"}
1134: ${RM="rm -f"}
1135])# _LT_FILEUTILS_DEFAULTS
1136
1137
1138# _LT_SETUP
1139# ---------
1140m4_defun([_LT_SETUP],
1141[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1142AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1143AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
1144AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1145
1146_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
1147dnl
1148_LT_DECL([], [host_alias], [0], [The host system])dnl
1149_LT_DECL([], [host], [0])dnl
1150_LT_DECL([], [host_os], [0])dnl
1151dnl
1152_LT_DECL([], [build_alias], [0], [The build system])dnl
1153_LT_DECL([], [build], [0])dnl
1154_LT_DECL([], [build_os], [0])dnl
1155dnl
1156AC_REQUIRE([AC_PROG_CC])dnl
1157AC_REQUIRE([LT_PATH_LD])dnl
1158AC_REQUIRE([LT_PATH_NM])dnl
1159dnl
1160AC_REQUIRE([AC_PROG_LN_S])dnl
1161test -z "$LN_S" && LN_S="ln -s"
1162_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
1163dnl
1164AC_REQUIRE([LT_CMD_MAX_LEN])dnl
1165_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
1166_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
1167dnl
1168m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1169m4_require([_LT_CHECK_SHELL_FEATURES])dnl
1170m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
1171m4_require([_LT_CMD_RELOAD])dnl
1172m4_require([_LT_CHECK_MAGIC_METHOD])dnl
1173m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
1174m4_require([_LT_CMD_OLD_ARCHIVE])dnl
1175m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
1176m4_require([_LT_WITH_SYSROOT])dnl
1177
1178_LT_CONFIG_LIBTOOL_INIT([
1179# See if we are running on zsh, and set the options which allow our
1180# commands through without removal of \ escapes INIT.
1181if test -n "\${ZSH_VERSION+set}" ; then
1182   setopt NO_GLOB_SUBST
1183fi
1184])
1185if test -n "${ZSH_VERSION+set}" ; then
1186   setopt NO_GLOB_SUBST
1187fi
1188
1189_LT_CHECK_OBJDIR
1190
1191m4_require([_LT_TAG_COMPILER])dnl
1192
1193case $host_os in
1194aix3*)
1195  # AIX sometimes has problems with the GCC collect2 program.  For some
1196  # reason, if we set the COLLECT_NAMES environment variable, the problems
1197  # vanish in a puff of smoke.
1198  if test "X${COLLECT_NAMES+set}" != Xset; then
1199    COLLECT_NAMES=
1200    export COLLECT_NAMES
1201  fi
1202  ;;
1203esac
1204
1205# Global variables:
1206ofile=libtool
1207can_build_shared=yes
1208
1209# All known linkers require a `.a' archive for static linking (except MSVC,
1210# which needs '.lib').
1211libext=a
1212
1213with_gnu_ld="$lt_cv_prog_gnu_ld"
1214
1215old_CC="$CC"
1216old_CFLAGS="$CFLAGS"
1217
1218# Set sane defaults for various variables
1219test -z "$CC" && CC=cc
1220test -z "$LTCC" && LTCC=$CC
1221test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
1222test -z "$LD" && LD=ld
1223test -z "$ac_objext" && ac_objext=o
1224
1225_LT_CC_BASENAME([$compiler])
1226
1227# Only perform the check for file, if the check method requires it
1228test -z "$MAGIC_CMD" && MAGIC_CMD=file
1229case $deplibs_check_method in
1230file_magic*)
1231  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
1232    _LT_PATH_MAGIC
1233  fi
1234  ;;
1235esac
1236
1237# Use C for the default configuration in the libtool script
1238LT_SUPPORTED_TAG([CC])
1239_LT_LANG_C_CONFIG
1240_LT_LANG_DEFAULT_CONFIG
1241_LT_CONFIG_COMMANDS
1242])# _LT_SETUP
1243
1244
1245# _LT_PREPARE_SED_QUOTE_VARS
1246# --------------------------
1247# Define a few sed substitution that help us do robust quoting.
1248m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
1249[# Backslashify metacharacters that are still active within
1250# double-quoted strings.
1251sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
1252
1253# Same as above, but do not quote variable references.
1254double_quote_subst='s/\([["`\\]]\)/\\\1/g'
1255
1256# Sed substitution to delay expansion of an escaped shell variable in a
1257# double_quote_subst'ed string.
1258delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1259
1260# Sed substitution to delay expansion of an escaped single quote.
1261delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
1262
1263# Sed substitution to avoid accidental globbing in evaled expressions
1264no_glob_subst='s/\*/\\\*/g'
1265])
1266
1267# _LT_PROG_LTMAIN
1268# ---------------
1269# Note that this code is called both from `configure', and `config.status'
1270# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
1271# `config.status' has no value for ac_aux_dir unless we are using Automake,
1272# so we pass a copy along to make sure it has a sensible value anyway.
1273m4_defun([_LT_PROG_LTMAIN],
1274[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
1275_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
1276ltmain="$ac_aux_dir/ltmain.sh"
1277])# _LT_PROG_LTMAIN
1278
1279
1280
1281# So that we can recreate a full libtool script including additional
1282# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
1283# in macros and then make a single call at the end using the `libtool'
1284# label.
1285
1286
1287# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
1288# ----------------------------------------
1289# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
1290m4_define([_LT_CONFIG_LIBTOOL_INIT],
1291[m4_ifval([$1],
1292          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
1293                     [$1
1294])])])
1295
1296# Initialize.
1297m4_define([_LT_OUTPUT_LIBTOOL_INIT])
1298
1299
1300# _LT_CONFIG_LIBTOOL([COMMANDS])
1301# ------------------------------
1302# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
1303m4_define([_LT_CONFIG_LIBTOOL],
1304[m4_ifval([$1],
1305          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
1306                     [$1
1307])])])
1308
1309# Initialize.
1310m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
1311
1312
1313# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
1314# -----------------------------------------------------
1315m4_defun([_LT_CONFIG_SAVE_COMMANDS],
1316[_LT_CONFIG_LIBTOOL([$1])
1317_LT_CONFIG_LIBTOOL_INIT([$2])
1318])
1319
1320
1321# _LT_FORMAT_COMMENT([COMMENT])
1322# -----------------------------
1323# Add leading comment marks to the start of each line, and a trailing
1324# full-stop to the whole comment if one is not present already.
1325m4_define([_LT_FORMAT_COMMENT],
1326[m4_ifval([$1], [
1327m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
1328              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
1329)])
1330
1331
1332
1333
1334
1335# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
1336# -------------------------------------------------------------------
1337# CONFIGNAME is the name given to the value in the libtool script.
1338# VARNAME is the (base) name used in the configure script.
1339# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
1340# VARNAME.  Any other value will be used directly.
1341m4_define([_LT_DECL],
1342[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
1343    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
1344	[m4_ifval([$1], [$1], [$2])])
1345    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
1346    m4_ifval([$4],
1347	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
1348    lt_dict_add_subkey([lt_decl_dict], [$2],
1349	[tagged?], [m4_ifval([$5], [yes], [no])])])
1350])
1351
1352
1353# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
1354# --------------------------------------------------------
1355m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
1356
1357
1358# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
1359# ------------------------------------------------
1360m4_define([lt_decl_tag_varnames],
1361[_lt_decl_filter([tagged?], [yes], $@)])
1362
1363
1364# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
1365# ---------------------------------------------------------
1366m4_define([_lt_decl_filter],
1367[m4_case([$#],
1368  [0], [m4_fatal([$0: too few arguments: $#])],
1369  [1], [m4_fatal([$0: too few arguments: $#: $1])],
1370  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
1371  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
1372  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
1373])
1374
1375
1376# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
1377# --------------------------------------------------
1378m4_define([lt_decl_quote_varnames],
1379[_lt_decl_filter([value], [1], $@)])
1380
1381
1382# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
1383# ---------------------------------------------------
1384m4_define([lt_decl_dquote_varnames],
1385[_lt_decl_filter([value], [2], $@)])
1386
1387
1388# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
1389# ---------------------------------------------------
1390m4_define([lt_decl_varnames_tagged],
1391[m4_assert([$# <= 2])dnl
1392_$0(m4_quote(m4_default([$1], [[, ]])),
1393    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
1394    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
1395m4_define([_lt_decl_varnames_tagged],
1396[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
1397
1398
1399# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
1400# ------------------------------------------------
1401m4_define([lt_decl_all_varnames],
1402[_$0(m4_quote(m4_default([$1], [[, ]])),
1403     m4_if([$2], [],
1404	   m4_quote(lt_decl_varnames),
1405	m4_quote(m4_shift($@))))[]dnl
1406])
1407m4_define([_lt_decl_all_varnames],
1408[lt_join($@, lt_decl_varnames_tagged([$1],
1409			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
1410])
1411
1412
1413# _LT_CONFIG_STATUS_DECLARE([VARNAME])
1414# ------------------------------------
1415# Quote a variable value, and forward it to `config.status' so that its
1416# declaration there will have the same value as in `configure'.  VARNAME
1417# must have a single quote delimited value for this to work.
1418m4_define([_LT_CONFIG_STATUS_DECLARE],
1419[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
1420
1421
1422# _LT_CONFIG_STATUS_DECLARATIONS
1423# ------------------------------
1424# We delimit libtool config variables with single quotes, so when
1425# we write them to config.status, we have to be sure to quote all
1426# embedded single quotes properly.  In configure, this macro expands
1427# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
1428#
1429#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
1430m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
1431[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
1432    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
1433
1434
1435# _LT_LIBTOOL_TAGS
1436# ----------------
1437# Output comment and list of tags supported by the script
1438m4_defun([_LT_LIBTOOL_TAGS],
1439[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
1440available_tags="_LT_TAGS"dnl
1441])
1442
1443
1444# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
1445# -----------------------------------
1446# Extract the dictionary values for VARNAME (optionally with TAG) and
1447# expand to a commented shell variable setting:
1448#
1449#    # Some comment about what VAR is for.
1450#    visible_name=$lt_internal_name
1451m4_define([_LT_LIBTOOL_DECLARE],
1452[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
1453					   [description])))[]dnl
1454m4_pushdef([_libtool_name],
1455    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
1456m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
1457    [0], [_libtool_name=[$]$1],
1458    [1], [_libtool_name=$lt_[]$1],
1459    [2], [_libtool_name=$lt_[]$1],
1460    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
1461m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
1462])
1463
1464
1465# _LT_LIBTOOL_CONFIG_VARS
1466# -----------------------
1467# Produce commented declarations of non-tagged libtool config variables
1468# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
1469# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
1470# section) are produced by _LT_LIBTOOL_TAG_VARS.
1471m4_defun([_LT_LIBTOOL_CONFIG_VARS],
1472[m4_foreach([_lt_var],
1473    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
1474    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
1475
1476
1477# _LT_LIBTOOL_TAG_VARS(TAG)
1478# -------------------------
1479m4_define([_LT_LIBTOOL_TAG_VARS],
1480[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
1481    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
1482
1483
1484# _LT_TAGVAR(VARNAME, [TAGNAME])
1485# ------------------------------
1486m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
1487
1488
1489# _LT_CONFIG_COMMANDS
1490# -------------------
1491# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
1492# variables for single and double quote escaping we saved from calls
1493# to _LT_DECL, we can put quote escaped variables declarations
1494# into `config.status', and then the shell code to quote escape them in
1495# for loops in `config.status'.  Finally, any additional code accumulated
1496# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
1497m4_defun([_LT_CONFIG_COMMANDS],
1498[AC_PROVIDE_IFELSE([LT_OUTPUT],
1499	dnl If the libtool generation code has been placed in $CONFIG_LT,
1500	dnl instead of duplicating it all over again into config.status,
1501	dnl then we will have config.status run $CONFIG_LT later, so it
1502	dnl needs to know what name is stored there:
1503        [AC_CONFIG_COMMANDS([libtool],
1504            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
1505    dnl If the libtool generation code is destined for config.status,
1506    dnl expand the accumulated commands and init code now:
1507    [AC_CONFIG_COMMANDS([libtool],
1508        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
1509])#_LT_CONFIG_COMMANDS
1510
1511
1512# Initialize.
1513m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
1514[
1515
1516# The HP-UX ksh and POSIX shell print the target directory to stdout
1517# if CDPATH is set.
1518(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1519
1520sed_quote_subst='$sed_quote_subst'
1521double_quote_subst='$double_quote_subst'
1522delay_variable_subst='$delay_variable_subst'
1523_LT_CONFIG_STATUS_DECLARATIONS
1524LTCC='$LTCC'
1525LTCFLAGS='$LTCFLAGS'
1526compiler='$compiler_DEFAULT'
1527
1528# A function that is used when there is no print builtin or printf.
1529func_fallback_echo ()
1530{
1531  eval 'cat <<_LTECHO_EOF
1532\$[]1
1533_LTECHO_EOF'
1534}
1535
1536# Quote evaled strings.
1537for var in lt_decl_all_varnames([[ \
1538]], lt_decl_quote_varnames); do
1539    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1540    *[[\\\\\\\`\\"\\\$]]*)
1541      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
1542      ;;
1543    *)
1544      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1545      ;;
1546    esac
1547done
1548
1549# Double-quote double-evaled strings.
1550for var in lt_decl_all_varnames([[ \
1551]], lt_decl_dquote_varnames); do
1552    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1553    *[[\\\\\\\`\\"\\\$]]*)
1554      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
1555      ;;
1556    *)
1557      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1558      ;;
1559    esac
1560done
1561
1562_LT_OUTPUT_LIBTOOL_INIT
1563])
1564
1565# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
1566# ------------------------------------
1567# Generate a child script FILE with all initialization necessary to
1568# reuse the environment learned by the parent script, and make the
1569# file executable.  If COMMENT is supplied, it is inserted after the
1570# `#!' sequence but before initialization text begins.  After this
1571# macro, additional text can be appended to FILE to form the body of
1572# the child script.  The macro ends with non-zero status if the
1573# file could not be fully written (such as if the disk is full).
1574m4_ifdef([AS_INIT_GENERATED],
1575[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
1576[m4_defun([_LT_GENERATED_FILE_INIT],
1577[m4_require([AS_PREPARE])]dnl
1578[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
1579[lt_write_fail=0
1580cat >$1 <<_ASEOF || lt_write_fail=1
1581#! $SHELL
1582# Generated by $as_me.
1583$2
1584SHELL=\${CONFIG_SHELL-$SHELL}
1585export SHELL
1586_ASEOF
1587cat >>$1 <<\_ASEOF || lt_write_fail=1
1588AS_SHELL_SANITIZE
1589_AS_PREPARE
1590exec AS_MESSAGE_FD>&1
1591_ASEOF
1592test $lt_write_fail = 0 && chmod +x $1[]dnl
1593m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
1594
1595# LT_OUTPUT
1596# ---------
1597# This macro allows early generation of the libtool script (before
1598# AC_OUTPUT is called), incase it is used in configure for compilation
1599# tests.
1600AC_DEFUN([LT_OUTPUT],
1601[: ${CONFIG_LT=./config.lt}
1602AC_MSG_NOTICE([creating $CONFIG_LT])
1603_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
1604[# Run this file to recreate a libtool stub with the current configuration.])
1605
1606cat >>"$CONFIG_LT" <<\_LTEOF
1607lt_cl_silent=false
1608exec AS_MESSAGE_LOG_FD>>config.log
1609{
1610  echo
1611  AS_BOX([Running $as_me.])
1612} >&AS_MESSAGE_LOG_FD
1613
1614lt_cl_help="\
1615\`$as_me' creates a local libtool stub from the current configuration,
1616for use in further configure time tests before the real libtool is
1617generated.
1618
1619Usage: $[0] [[OPTIONS]]
1620
1621  -h, --help      print this help, then exit
1622  -V, --version   print version number, then exit
1623  -q, --quiet     do not print progress messages
1624  -d, --debug     don't remove temporary files
1625
1626Report bugs to <bug-libtool@gnu.org>."
1627
1628lt_cl_version="\
1629m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
1630m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
1631configured by $[0], generated by m4_PACKAGE_STRING.
1632
1633Copyright (C) 2011 Free Software Foundation, Inc.
1634This config.lt script is free software; the Free Software Foundation
1635gives unlimited permision to copy, distribute and modify it."
1636
1637while test $[#] != 0
1638do
1639  case $[1] in
1640    --version | --v* | -V )
1641      echo "$lt_cl_version"; exit 0 ;;
1642    --help | --h* | -h )
1643      echo "$lt_cl_help"; exit 0 ;;
1644    --debug | --d* | -d )
1645      debug=: ;;
1646    --quiet | --q* | --silent | --s* | -q )
1647      lt_cl_silent=: ;;
1648
1649    -*) AC_MSG_ERROR([unrecognized option: $[1]
1650Try \`$[0] --help' for more information.]) ;;
1651
1652    *) AC_MSG_ERROR([unrecognized argument: $[1]
1653Try \`$[0] --help' for more information.]) ;;
1654  esac
1655  shift
1656done
1657
1658if $lt_cl_silent; then
1659  exec AS_MESSAGE_FD>/dev/null
1660fi
1661_LTEOF
1662
1663cat >>"$CONFIG_LT" <<_LTEOF
1664_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
1665_LTEOF
1666
1667cat >>"$CONFIG_LT" <<\_LTEOF
1668AC_MSG_NOTICE([creating $ofile])
1669_LT_OUTPUT_LIBTOOL_COMMANDS
1670AS_EXIT(0)
1671_LTEOF
1672chmod +x "$CONFIG_LT"
1673
1674# configure is writing to config.log, but config.lt does its own redirection,
1675# appending to config.log, which fails on DOS, as config.log is still kept
1676# open by configure.  Here we exec the FD to /dev/null, effectively closing
1677# config.log, so it can be properly (re)opened and appended to by config.lt.
1678lt_cl_success=:
1679test "$silent" = yes &&
1680  lt_config_lt_args="$lt_config_lt_args --quiet"
1681exec AS_MESSAGE_LOG_FD>/dev/null
1682$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
1683exec AS_MESSAGE_LOG_FD>>config.log
1684$lt_cl_success || AS_EXIT(1)
1685])# LT_OUTPUT
1686
1687
1688# _LT_CONFIG(TAG)
1689# ---------------
1690# If TAG is the built-in tag, create an initial libtool script with a
1691# default configuration from the untagged config vars.  Otherwise add code
1692# to config.status for appending the configuration named by TAG from the
1693# matching tagged config vars.
1694m4_defun([_LT_CONFIG],
1695[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1696_LT_CONFIG_SAVE_COMMANDS([
1697  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
1698  m4_if(_LT_TAG, [C], [
1699    # See if we are running on zsh, and set the options which allow our
1700    # commands through without removal of \ escapes.
1701    if test -n "${ZSH_VERSION+set}" ; then
1702      setopt NO_GLOB_SUBST
1703    fi
1704
1705    cfgfile="${ofile}T"
1706    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
1707    $RM "$cfgfile"
1708
1709    cat <<_LT_EOF >> "$cfgfile"
1710#! $SHELL
1711
1712# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
1713# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
1714# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1715# NOTE: Changes made to this file will be lost: look at ltmain.sh.
1716#
1717_LT_COPYING
1718_LT_LIBTOOL_TAGS
1719
1720# ### BEGIN LIBTOOL CONFIG
1721_LT_LIBTOOL_CONFIG_VARS
1722_LT_LIBTOOL_TAG_VARS
1723# ### END LIBTOOL CONFIG
1724
1725_LT_EOF
1726
1727  case $host_os in
1728  aix3*)
1729    cat <<\_LT_EOF >> "$cfgfile"
1730# AIX sometimes has problems with the GCC collect2 program.  For some
1731# reason, if we set the COLLECT_NAMES environment variable, the problems
1732# vanish in a puff of smoke.
1733if test "X${COLLECT_NAMES+set}" != Xset; then
1734  COLLECT_NAMES=
1735  export COLLECT_NAMES
1736fi
1737_LT_EOF
1738    ;;
1739  esac
1740
1741  _LT_PROG_LTMAIN
1742
1743  # We use sed instead of cat because bash on DJGPP gets confused if
1744  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
1745  # text mode, it properly converts lines to CR/LF.  This bash problem
1746  # is reportedly fixed, but why not run on old versions too?
1747  sed '$q' "$ltmain" >> "$cfgfile" \
1748     || (rm -f "$cfgfile"; exit 1)
1749
1750  _LT_PROG_REPLACE_SHELLFNS
1751
1752   mv -f "$cfgfile" "$ofile" ||
1753    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
1754  chmod +x "$ofile"
1755],
1756[cat <<_LT_EOF >> "$ofile"
1757
1758dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
1759dnl in a comment (ie after a #).
1760# ### BEGIN LIBTOOL TAG CONFIG: $1
1761_LT_LIBTOOL_TAG_VARS(_LT_TAG)
1762# ### END LIBTOOL TAG CONFIG: $1
1763_LT_EOF
1764])dnl /m4_if
1765],
1766[m4_if([$1], [], [
1767    PACKAGE='$PACKAGE'
1768    VERSION='$VERSION'
1769    TIMESTAMP='$TIMESTAMP'
1770    RM='$RM'
1771    ofile='$ofile'], [])
1772])dnl /_LT_CONFIG_SAVE_COMMANDS
1773])# _LT_CONFIG
1774
1775
1776# LT_SUPPORTED_TAG(TAG)
1777# ---------------------
1778# Trace this macro to discover what tags are supported by the libtool
1779# --tag option, using:
1780#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
1781AC_DEFUN([LT_SUPPORTED_TAG], [])
1782
1783
1784# C support is built-in for now
1785m4_define([_LT_LANG_C_enabled], [])
1786m4_define([_LT_TAGS], [])
1787
1788
1789# LT_LANG(LANG)
1790# -------------
1791# Enable libtool support for the given language if not already enabled.
1792AC_DEFUN([LT_LANG],
1793[AC_BEFORE([$0], [LT_OUTPUT])dnl
1794m4_case([$1],
1795  [C],			[_LT_LANG(C)],
1796  [C++],		[_LT_LANG(CXX)],
1797  [Go],			[_LT_LANG(GO)],
1798  [Java],		[_LT_LANG(GCJ)],
1799  [Fortran 77],		[_LT_LANG(F77)],
1800  [Fortran],		[_LT_LANG(FC)],
1801  [Windows Resource],	[_LT_LANG(RC)],
1802  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
1803    [_LT_LANG($1)],
1804    [m4_fatal([$0: unsupported language: "$1"])])])dnl
1805])# LT_LANG
1806
1807
1808# _LT_LANG(LANGNAME)
1809# ------------------
1810m4_defun([_LT_LANG],
1811[m4_ifdef([_LT_LANG_]$1[_enabled], [],
1812  [LT_SUPPORTED_TAG([$1])dnl
1813  m4_append([_LT_TAGS], [$1 ])dnl
1814  m4_define([_LT_LANG_]$1[_enabled], [])dnl
1815  _LT_LANG_$1_CONFIG($1)])dnl
1816])# _LT_LANG
1817
1818
1819m4_ifndef([AC_PROG_GO], [
1820# NOTE: This macro has been submitted for inclusion into   #
1821#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
1822#  a released version of Autoconf we should remove this    #
1823#  macro and use it instead.                               #
1824m4_defun([AC_PROG_GO],
1825[AC_LANG_PUSH(Go)dnl
1826AC_ARG_VAR([GOC],     [Go compiler command])dnl
1827AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
1828_AC_ARG_VAR_LDFLAGS()dnl
1829AC_CHECK_TOOL(GOC, gccgo)
1830if test -z "$GOC"; then
1831  if test -n "$ac_tool_prefix"; then
1832    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
1833  fi
1834fi
1835if test -z "$GOC"; then
1836  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
1837fi
1838])#m4_defun
1839])#m4_ifndef
1840
1841
1842# _LT_LANG_DEFAULT_CONFIG
1843# -----------------------
1844m4_defun([_LT_LANG_DEFAULT_CONFIG],
1845[AC_PROVIDE_IFELSE([AC_PROG_CXX],
1846  [LT_LANG(CXX)],
1847  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
1848
1849AC_PROVIDE_IFELSE([AC_PROG_F77],
1850  [LT_LANG(F77)],
1851  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
1852
1853AC_PROVIDE_IFELSE([AC_PROG_FC],
1854  [LT_LANG(FC)],
1855  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
1856
1857dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
1858dnl pulling things in needlessly.
1859AC_PROVIDE_IFELSE([AC_PROG_GCJ],
1860  [LT_LANG(GCJ)],
1861  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
1862    [LT_LANG(GCJ)],
1863    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
1864      [LT_LANG(GCJ)],
1865      [m4_ifdef([AC_PROG_GCJ],
1866	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
1867       m4_ifdef([A][M_PROG_GCJ],
1868	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
1869       m4_ifdef([LT_PROG_GCJ],
1870	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
1871
1872AC_PROVIDE_IFELSE([AC_PROG_GO],
1873  [LT_LANG(GO)],
1874  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
1875
1876AC_PROVIDE_IFELSE([LT_PROG_RC],
1877  [LT_LANG(RC)],
1878  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
1879])# _LT_LANG_DEFAULT_CONFIG
1880
1881# Obsolete macros:
1882AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
1883AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
1884AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
1885AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
1886AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
1887dnl aclocal-1.4 backwards compatibility:
1888dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
1889dnl AC_DEFUN([AC_LIBTOOL_F77], [])
1890dnl AC_DEFUN([AC_LIBTOOL_FC], [])
1891dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
1892dnl AC_DEFUN([AC_LIBTOOL_RC], [])
1893
1894
1895# _LT_TAG_COMPILER
1896# ----------------
1897m4_defun([_LT_TAG_COMPILER],
1898[AC_REQUIRE([AC_PROG_CC])dnl
1899
1900_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
1901_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
1902_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
1903_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
1904
1905# If no C compiler was specified, use CC.
1906LTCC=${LTCC-"$CC"}
1907
1908# If no C compiler flags were specified, use CFLAGS.
1909LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
1910
1911# Allow CC to be a program name with arguments.
1912compiler=$CC
1913])# _LT_TAG_COMPILER
1914
1915
1916# _LT_COMPILER_BOILERPLATE
1917# ------------------------
1918# Check for compiler boilerplate output or warnings with
1919# the simple compiler test code.
1920m4_defun([_LT_COMPILER_BOILERPLATE],
1921[m4_require([_LT_DECL_SED])dnl
1922ac_outfile=conftest.$ac_objext
1923echo "$lt_simple_compile_test_code" >conftest.$ac_ext
1924eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
1925_lt_compiler_boilerplate=`cat conftest.err`
1926$RM conftest*
1927])# _LT_COMPILER_BOILERPLATE
1928
1929
1930# _LT_LINKER_BOILERPLATE
1931# ----------------------
1932# Check for linker boilerplate output or warnings with
1933# the simple link test code.
1934m4_defun([_LT_LINKER_BOILERPLATE],
1935[m4_require([_LT_DECL_SED])dnl
1936ac_outfile=conftest.$ac_objext
1937echo "$lt_simple_link_test_code" >conftest.$ac_ext
1938eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
1939_lt_linker_boilerplate=`cat conftest.err`
1940$RM -r conftest*
1941])# _LT_LINKER_BOILERPLATE
1942
1943# _LT_REQUIRED_DARWIN_CHECKS
1944# -------------------------
1945m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
1946  case $host_os in
1947    rhapsody* | darwin*)
1948    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
1949    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
1950    AC_CHECK_TOOL([LIPO], [lipo], [:])
1951    AC_CHECK_TOOL([OTOOL], [otool], [:])
1952    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
1953    _LT_DECL([], [DSYMUTIL], [1],
1954      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
1955    _LT_DECL([], [NMEDIT], [1],
1956      [Tool to change global to local symbols on Mac OS X])
1957    _LT_DECL([], [LIPO], [1],
1958      [Tool to manipulate fat objects and archives on Mac OS X])
1959    _LT_DECL([], [OTOOL], [1],
1960      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
1961    _LT_DECL([], [OTOOL64], [1],
1962      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
1963
1964    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
1965      [lt_cv_apple_cc_single_mod=no
1966      if test -z "${LT_MULTI_MODULE}"; then
1967	# By default we will add the -single_module flag. You can override
1968	# by either setting the environment variable LT_MULTI_MODULE
1969	# non-empty at configure time, or by adding -multi_module to the
1970	# link flags.
1971	rm -rf libconftest.dylib*
1972	echo "int foo(void){return 1;}" > conftest.c
1973	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1974-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
1975	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1976	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
1977        _lt_result=$?
1978	# If there is a non-empty error log, and "single_module"
1979	# appears in it, assume the flag caused a linker warning
1980        if test -s conftest.err && $GREP single_module conftest.err; then
1981	  cat conftest.err >&AS_MESSAGE_LOG_FD
1982	# Otherwise, if the output was created with a 0 exit code from
1983	# the compiler, it worked.
1984	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
1985	  lt_cv_apple_cc_single_mod=yes
1986	else
1987	  cat conftest.err >&AS_MESSAGE_LOG_FD
1988	fi
1989	rm -rf libconftest.dylib*
1990	rm -f conftest.*
1991      fi])
1992
1993    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
1994      [lt_cv_ld_exported_symbols_list],
1995      [lt_cv_ld_exported_symbols_list=no
1996      save_LDFLAGS=$LDFLAGS
1997      echo "_main" > conftest.sym
1998      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
1999      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2000	[lt_cv_ld_exported_symbols_list=yes],
2001	[lt_cv_ld_exported_symbols_list=no])
2002	LDFLAGS="$save_LDFLAGS"
2003    ])
2004
2005    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
2006      [lt_cv_ld_force_load=no
2007      cat > conftest.c << _LT_EOF
2008int forced_loaded() { return 2;}
2009_LT_EOF
2010      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
2011      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
2012      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
2013      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
2014      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
2015      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
2016      cat > conftest.c << _LT_EOF
2017int main() { return 0;}
2018_LT_EOF
2019      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
2020      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
2021      _lt_result=$?
2022      if test -s conftest.err && $GREP force_load conftest.err; then
2023	cat conftest.err >&AS_MESSAGE_LOG_FD
2024      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
2025	lt_cv_ld_force_load=yes
2026      else
2027	cat conftest.err >&AS_MESSAGE_LOG_FD
2028      fi
2029        rm -f conftest.err libconftest.a conftest conftest.c
2030        rm -rf conftest.dSYM
2031    ])
2032    case $host_os in
2033    rhapsody* | darwin1.[[012]])
2034      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
2035    darwin1.*)
2036      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
2037    darwin*) # darwin 5.x on
2038      # if running on 10.5 or later, the deployment target defaults
2039      # to the OS version, if on x86, and 10.4, the deployment
2040      # target defaults to 10.4. Don't you love it?
2041      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
2042	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
2043	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
2044	10.[[012]]*)
2045	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
2046	10.*)
2047	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
2048      esac
2049    ;;
2050  esac
2051    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
2052      _lt_dar_single_mod='$single_module'
2053    fi
2054    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
2055      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
2056    else
2057      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
2058    fi
2059    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
2060      _lt_dsymutil='~$DSYMUTIL $lib || :'
2061    else
2062      _lt_dsymutil=
2063    fi
2064    ;;
2065  esac
2066])
2067
2068
2069# _LT_DARWIN_LINKER_FEATURES([TAG])
2070# ---------------------------------
2071# Checks for linker and compiler features on darwin
2072m4_defun([_LT_DARWIN_LINKER_FEATURES],
2073[
2074  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
2075  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
2076  _LT_TAGVAR(hardcode_direct, $1)=no
2077  _LT_TAGVAR(hardcode_automatic, $1)=yes
2078  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
2079  if test "$lt_cv_ld_force_load" = "yes"; then
2080    _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\"`'
2081    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
2082                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
2083  else
2084    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
2085  fi
2086  _LT_TAGVAR(link_all_deplibs, $1)=yes
2087  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
2088  case $cc_basename in
2089     ifort*) _lt_dar_can_shared=yes ;;
2090     *) _lt_dar_can_shared=$GCC ;;
2091  esac
2092  if test "$_lt_dar_can_shared" = "yes"; then
2093    output_verbose_link_cmd=func_echo_all
2094    _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}"
2095    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
2096    _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}"
2097    _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}"
2098    m4_if([$1], [CXX],
2099[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
2100      _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}"
2101      _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}"
2102    fi
2103],[])
2104  else
2105  _LT_TAGVAR(ld_shlibs, $1)=no
2106  fi
2107])
2108
2109# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
2110# ----------------------------------
2111# Links a minimal program and checks the executable
2112# for the system default hardcoded library path. In most cases,
2113# this is /usr/lib:/lib, but when the MPI compilers are used
2114# the location of the communication and MPI libs are included too.
2115# If we don't find anything, use the default library path according
2116# to the aix ld manual.
2117# Store the results from the different compilers for each TAGNAME.
2118# Allow to override them for all tags through lt_cv_aix_libpath.
2119m4_defun([_LT_SYS_MODULE_PATH_AIX],
2120[m4_require([_LT_DECL_SED])dnl
2121if test "${lt_cv_aix_libpath+set}" = set; then
2122  aix_libpath=$lt_cv_aix_libpath
2123else
2124  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
2125  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
2126  lt_aix_libpath_sed='[
2127      /Import File Strings/,/^$/ {
2128	  /^0/ {
2129	      s/^0  *\([^ ]*\) *$/\1/
2130	      p
2131	  }
2132      }]'
2133  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
2134  # Check for a 64-bit object if we didn't find anything.
2135  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
2136    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
2137  fi],[])
2138  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
2139    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
2140  fi
2141  ])
2142  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
2143fi
2144])# _LT_SYS_MODULE_PATH_AIX
2145
2146
2147# _LT_SHELL_INIT(ARG)
2148# -------------------
2149m4_define([_LT_SHELL_INIT],
2150[m4_divert_text([M4SH-INIT], [$1
2151])])# _LT_SHELL_INIT
2152
2153
2154
2155# _LT_PROG_ECHO_BACKSLASH
2156# -----------------------
2157# Find how we can fake an echo command that does not interpret backslash.
2158# In particular, with Autoconf 2.60 or later we add some code to the start
2159# of the generated configure script which will find a shell with a builtin
2160# printf (which we can use as an echo command).
2161m4_defun([_LT_PROG_ECHO_BACKSLASH],
2162[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
2163ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
2164ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2165
2166AC_MSG_CHECKING([how to print strings])
2167# Test print first, because it will be a builtin if present.
2168if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
2169   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
2170  ECHO='print -r --'
2171elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
2172  ECHO='printf %s\n'
2173else
2174  # Use this function as a fallback that always works.
2175  func_fallback_echo ()
2176  {
2177    eval 'cat <<_LTECHO_EOF
2178$[]1
2179_LTECHO_EOF'
2180  }
2181  ECHO='func_fallback_echo'
2182fi
2183
2184# func_echo_all arg...
2185# Invoke $ECHO with all args, space-separated.
2186func_echo_all ()
2187{
2188    $ECHO "$*" 
2189}
2190
2191case "$ECHO" in
2192  printf*) AC_MSG_RESULT([printf]) ;;
2193  print*) AC_MSG_RESULT([print -r]) ;;
2194  *) AC_MSG_RESULT([cat]) ;;
2195esac
2196
2197m4_ifdef([_AS_DETECT_SUGGESTED],
2198[_AS_DETECT_SUGGESTED([
2199  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
2200    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
2201    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
2202    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2203    PATH=/empty FPATH=/empty; export PATH FPATH
2204    test "X`printf %s $ECHO`" = "X$ECHO" \
2205      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
2206
2207_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
2208_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
2209])# _LT_PROG_ECHO_BACKSLASH
2210
2211
2212# _LT_WITH_SYSROOT
2213# ----------------
2214AC_DEFUN([_LT_WITH_SYSROOT],
2215[AC_MSG_CHECKING([for sysroot])
2216AC_ARG_WITH([sysroot],
2217[  --with-sysroot[=DIR] Search for dependent libraries within DIR
2218                        (or the compiler's sysroot if not specified).],
2219[], [with_sysroot=no])
2220
2221dnl lt_sysroot will always be passed unquoted.  We quote it here
2222dnl in case the user passed a directory name.
2223lt_sysroot=
2224case ${with_sysroot} in #(
2225 yes)
2226   if test "$GCC" = yes; then
2227     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
2228   fi
2229   ;; #(
2230 /*)
2231   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
2232   ;; #(
2233 no|'')
2234   ;; #(
2235 *)
2236   AC_MSG_RESULT([${with_sysroot}])
2237   AC_MSG_ERROR([The sysroot must be an absolute path.])
2238   ;;
2239esac
2240
2241 AC_MSG_RESULT([${lt_sysroot:-no}])
2242_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
2243[dependent libraries, and in which our libraries should be installed.])])
2244
2245# _LT_ENABLE_LOCK
2246# ---------------
2247m4_defun([_LT_ENABLE_LOCK],
2248[AC_ARG_ENABLE([libtool-lock],
2249  [AS_HELP_STRING([--disable-libtool-lock],
2250    [avoid locking (might break parallel builds)])])
2251test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
2252
2253# Some flags need to be propagated to the compiler or linker for good
2254# libtool support.
2255case $host in
2256ia64-*-hpux*)
2257  # Find out which ABI we are using.
2258  echo 'int i;' > conftest.$ac_ext
2259  if AC_TRY_EVAL(ac_compile); then
2260    case `/usr/bin/file conftest.$ac_objext` in
2261      *ELF-32*)
2262	HPUX_IA64_MODE="32"
2263	;;
2264      *ELF-64*)
2265	HPUX_IA64_MODE="64"
2266	;;
2267    esac
2268  fi
2269  rm -rf conftest*
2270  ;;
2271*-*-irix6*)
2272  # Find out which ABI we are using.
2273  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
2274  if AC_TRY_EVAL(ac_compile); then
2275    if test "$lt_cv_prog_gnu_ld" = yes; then
2276      case `/usr/bin/file conftest.$ac_objext` in
2277	*32-bit*)
2278	  LD="${LD-ld} -melf32bsmip"
2279	  ;;
2280	*N32*)
2281	  LD="${LD-ld} -melf32bmipn32"
2282	  ;;
2283	*64-bit*)
2284	  LD="${LD-ld} -melf64bmip"
2285	;;
2286      esac
2287    else
2288      case `/usr/bin/file conftest.$ac_objext` in
2289	*32-bit*)
2290	  LD="${LD-ld} -32"
2291	  ;;
2292	*N32*)
2293	  LD="${LD-ld} -n32"
2294	  ;;
2295	*64-bit*)
2296	  LD="${LD-ld} -64"
2297	  ;;
2298      esac
2299    fi
2300  fi
2301  rm -rf conftest*
2302  ;;
2303
2304x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
2305s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
2306  # Find out which ABI we are using.
2307  echo 'int i;' > conftest.$ac_ext
2308  if AC_TRY_EVAL(ac_compile); then
2309    case `/usr/bin/file conftest.o` in
2310      *32-bit*)
2311	case $host in
2312	  x86_64-*kfreebsd*-gnu)
2313	    LD="${LD-ld} -m elf_i386_fbsd"
2314	    ;;
2315	  x86_64-*linux*)
2316	    LD="${LD-ld} -m elf_i386"
2317	    ;;
2318	  ppc64-*linux*|powerpc64-*linux*)
2319	    LD="${LD-ld} -m elf32ppclinux"
2320	    ;;
2321	  s390x-*linux*)
2322	    LD="${LD-ld} -m elf_s390"
2323	    ;;
2324	  sparc64-*linux*)
2325	    LD="${LD-ld} -m elf32_sparc"
2326	    ;;
2327	esac
2328	;;
2329      *64-bit*)
2330	case $host in
2331	  x86_64-*kfreebsd*-gnu)
2332	    LD="${LD-ld} -m elf_x86_64_fbsd"
2333	    ;;
2334	  x86_64-*linux*)
2335	    LD="${LD-ld} -m elf_x86_64"
2336	    ;;
2337	  ppc*-*linux*|powerpc*-*linux*)
2338	    LD="${LD-ld} -m elf64ppc"
2339	    ;;
2340	  s390*-*linux*|s390*-*tpf*)
2341	    LD="${LD-ld} -m elf64_s390"
2342	    ;;
2343	  sparc*-*linux*)
2344	    LD="${LD-ld} -m elf64_sparc"
2345	    ;;
2346	esac
2347	;;
2348    esac
2349  fi
2350  rm -rf conftest*
2351  ;;
2352
2353*-*-sco3.2v5*)
2354  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2355  SAVE_CFLAGS="$CFLAGS"
2356  CFLAGS="$CFLAGS -belf"
2357  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
2358    [AC_LANG_PUSH(C)
2359     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
2360     AC_LANG_POP])
2361  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2362    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2363    CFLAGS="$SAVE_CFLAGS"
2364  fi
2365  ;;
2366*-*solaris*)
2367  # Find out which ABI we are using.
2368  echo 'int i;' > conftest.$ac_ext
2369  if AC_TRY_EVAL(ac_compile); then
2370    case `/usr/bin/file conftest.o` in
2371    *64-bit*)
2372      case $lt_cv_prog_gnu_ld in
2373      yes*)
2374        case $host in
2375        i?86-*-solaris*)
2376          LD="${LD-ld} -m elf_x86_64"
2377          ;;
2378        sparc*-*-solaris*)
2379          LD="${LD-ld} -m elf64_sparc"
2380          ;;
2381        esac
2382        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
2383        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
2384          LD="${LD-ld}_sol2"
2385        fi
2386        ;;
2387      *)
2388	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
2389	  LD="${LD-ld} -64"
2390	fi
2391	;;
2392      esac
2393      ;;
2394    esac
2395  fi
2396  rm -rf conftest*
2397  ;;
2398esac
2399
2400need_locks="$enable_libtool_lock"
2401])# _LT_ENABLE_LOCK
2402
2403
2404# _LT_PROG_AR
2405# -----------
2406m4_defun([_LT_PROG_AR],
2407[AC_CHECK_TOOLS(AR, [ar], false)
2408: ${AR=ar}
2409: ${AR_FLAGS=cru}
2410_LT_DECL([], [AR], [1], [The archiver])
2411_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
2412
2413AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
2414  [lt_cv_ar_at_file=no
2415   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
2416     [echo conftest.$ac_objext > conftest.lst
2417      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
2418      AC_TRY_EVAL([lt_ar_try])
2419      if test "$ac_status" -eq 0; then
2420	# Ensure the archiver fails upon bogus file names.
2421	rm -f conftest.$ac_objext libconftest.a
2422	AC_TRY_EVAL([lt_ar_try])
2423	if test "$ac_status" -ne 0; then
2424          lt_cv_ar_at_file=@
2425        fi
2426      fi
2427      rm -f conftest.* libconftest.a
2428     ])
2429  ])
2430
2431if test "x$lt_cv_ar_at_file" = xno; then
2432  archiver_list_spec=
2433else
2434  archiver_list_spec=$lt_cv_ar_at_file
2435fi
2436_LT_DECL([], [archiver_list_spec], [1],
2437  [How to feed a file listing to the archiver])
2438])# _LT_PROG_AR
2439
2440
2441# _LT_CMD_OLD_ARCHIVE
2442# -------------------
2443m4_defun([_LT_CMD_OLD_ARCHIVE],
2444[_LT_PROG_AR
2445
2446AC_CHECK_TOOL(STRIP, strip, :)
2447test -z "$STRIP" && STRIP=:
2448_LT_DECL([], [STRIP], [1], [A symbol stripping program])
2449
2450AC_CHECK_TOOL(RANLIB, ranlib, :)
2451test -z "$RANLIB" && RANLIB=:
2452_LT_DECL([], [RANLIB], [1],
2453    [Commands used to install an old-style archive])
2454
2455# Determine commands to create old-style static archives.
2456old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
2457old_postinstall_cmds='chmod 644 $oldlib'
2458old_postuninstall_cmds=
2459
2460if test -n "$RANLIB"; then
2461  case $host_os in
2462  openbsd*)
2463    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
2464    ;;
2465  *)
2466    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
2467    ;;
2468  esac
2469  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
2470fi
2471
2472case $host_os in
2473  darwin*)
2474    lock_old_archive_extraction=yes ;;
2475  *)
2476    lock_old_archive_extraction=no ;;
2477esac
2478_LT_DECL([], [old_postinstall_cmds], [2])
2479_LT_DECL([], [old_postuninstall_cmds], [2])
2480_LT_TAGDECL([], [old_archive_cmds], [2],
2481    [Commands used to build an old-style archive])
2482_LT_DECL([], [lock_old_archive_extraction], [0],
2483    [Whether to use a lock for old archive extraction])
2484])# _LT_CMD_OLD_ARCHIVE
2485
2486
2487# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2488#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
2489# ----------------------------------------------------------------
2490# Check whether the given compiler option works
2491AC_DEFUN([_LT_COMPILER_OPTION],
2492[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2493m4_require([_LT_DECL_SED])dnl
2494AC_CACHE_CHECK([$1], [$2],
2495  [$2=no
2496   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
2497   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2498   lt_compiler_flag="$3"
2499   # Insert the option either (1) after the last *FLAGS variable, or
2500   # (2) before a word containing "conftest.", or (3) at the end.
2501   # Note that $ac_compile itself does not contain backslashes and begins
2502   # with a dollar sign (not a hyphen), so the echo should work correctly.
2503   # The option is referenced via a variable to avoid confusing sed.
2504   lt_compile=`echo "$ac_compile" | $SED \
2505   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2506   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2507   -e 's:$: $lt_compiler_flag:'`
2508   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2509   (eval "$lt_compile" 2>conftest.err)
2510   ac_status=$?
2511   cat conftest.err >&AS_MESSAGE_LOG_FD
2512   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2513   if (exit $ac_status) && test -s "$ac_outfile"; then
2514     # The compiler can only warn and ignore the option if not recognized
2515     # So say no if there are warnings other than the usual output.
2516     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
2517     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2518     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
2519       $2=yes
2520     fi
2521   fi
2522   $RM conftest*
2523])
2524
2525if test x"[$]$2" = xyes; then
2526    m4_if([$5], , :, [$5])
2527else
2528    m4_if([$6], , :, [$6])
2529fi
2530])# _LT_COMPILER_OPTION
2531
2532# Old name:
2533AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
2534dnl aclocal-1.4 backwards compatibility:
2535dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
2536
2537
2538# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
2539#                  [ACTION-SUCCESS], [ACTION-FAILURE])
2540# ----------------------------------------------------
2541# Check whether the given linker option works
2542AC_DEFUN([_LT_LINKER_OPTION],
2543[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2544m4_require([_LT_DECL_SED])dnl
2545AC_CACHE_CHECK([$1], [$2],
2546  [$2=no
2547   save_LDFLAGS="$LDFLAGS"
2548   LDFLAGS="$LDFLAGS $3"
2549   echo "$lt_simple_link_test_code" > conftest.$ac_ext
2550   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
2551     # The linker can only warn and ignore the option if not recognized
2552     # So say no if there are warnings
2553     if test -s conftest.err; then
2554       # Append any errors to the config.log.
2555       cat conftest.err 1>&AS_MESSAGE_LOG_FD
2556       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
2557       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
2558       if diff conftest.exp conftest.er2 >/dev/null; then
2559         $2=yes
2560       fi
2561     else
2562       $2=yes
2563     fi
2564   fi
2565   $RM -r conftest*
2566   LDFLAGS="$save_LDFLAGS"
2567])
2568
2569if test x"[$]$2" = xyes; then
2570    m4_if([$4], , :, [$4])
2571else
2572    m4_if([$5], , :, [$5])
2573fi
2574])# _LT_LINKER_OPTION
2575
2576# Old name:
2577AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
2578dnl aclocal-1.4 backwards compatibility:
2579dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
2580
2581
2582# LT_CMD_MAX_LEN
2583#---------------
2584AC_DEFUN([LT_CMD_MAX_LEN],
2585[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2586# find the maximum length of command line arguments
2587AC_MSG_CHECKING([the maximum length of command line arguments])
2588AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
2589  i=0
2590  teststring="ABCD"
2591
2592  case $build_os in
2593  msdosdjgpp*)
2594    # On DJGPP, this test can blow up pretty badly due to problems in libc
2595    # (any single argument exceeding 2000 bytes causes a buffer overrun
2596    # during glob expansion).  Even if it were fixed, the result of this
2597    # check would be larger than it should be.
2598    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
2599    ;;
2600
2601  gnu*)
2602    # Under GNU Hurd, this test is not required because there is
2603    # no limit to the length of command line arguments.
2604    # Libtool will interpret -1 as no limit whatsoever
2605    lt_cv_sys_max_cmd_len=-1;
2606    ;;
2607
2608  cygwin* | mingw* | cegcc*)
2609    # On Win9x/ME, this test blows up -- it succeeds, but takes
2610    # about 5 minutes as the teststring grows exponentially.
2611    # Worse, since 9x/ME are not pre-emptively multitasking,
2612    # you end up with a "frozen" computer, even though with patience
2613    # the test eventually succeeds (with a max line length of 256k).
2614    # Instead, let's just punt: use the minimum linelength reported by
2615    # all of the supported platforms: 8192 (on NT/2K/XP).
2616    lt_cv_sys_max_cmd_len=8192;
2617    ;;
2618
2619  mint*)
2620    # On MiNT this can take a long time and run out of memory.
2621    lt_cv_sys_max_cmd_len=8192;
2622    ;;
2623
2624  amigaos*)
2625    # On AmigaOS with pdksh, this test takes hours, literally.
2626    # So we just punt and use a minimum line length of 8192.
2627    lt_cv_sys_max_cmd_len=8192;
2628    ;;
2629
2630  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
2631    # This has been around since 386BSD, at least.  Likely further.
2632    if test -x /sbin/sysctl; then
2633      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
2634    elif test -x /usr/sbin/sysctl; then
2635      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
2636    else
2637      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
2638    fi
2639    # And add a safety zone
2640    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2641    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2642    ;;
2643
2644  interix*)
2645    # We know the value 262144 and hardcode it with a safety zone (like BSD)
2646    lt_cv_sys_max_cmd_len=196608
2647    ;;
2648
2649  os2*)
2650    # The test takes a long time on OS/2.
2651    lt_cv_sys_max_cmd_len=8192
2652    ;;
2653
2654  osf*)
2655    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
2656    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
2657    # nice to cause kernel panics so lets avoid the loop below.
2658    # First set a reasonable default.
2659    lt_cv_sys_max_cmd_len=16384
2660    #
2661    if test -x /sbin/sysconfig; then
2662      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
2663        *1*) lt_cv_sys_max_cmd_len=-1 ;;
2664      esac
2665    fi
2666    ;;
2667  sco3.2v5*)
2668    lt_cv_sys_max_cmd_len=102400
2669    ;;
2670  sysv5* | sco5v6* | sysv4.2uw2*)
2671    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
2672    if test -n "$kargmax"; then
2673      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
2674    else
2675      lt_cv_sys_max_cmd_len=32768
2676    fi
2677    ;;
2678  *)
2679    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
2680    if test -n "$lt_cv_sys_max_cmd_len"; then
2681      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
2682      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2683    else
2684      # Make teststring a little bigger before we do anything with it.
2685      # a 1K string should be a reasonable start.
2686      for i in 1 2 3 4 5 6 7 8 ; do
2687        teststring=$teststring$teststring
2688      done
2689      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
2690      # If test is not a shell built-in, we'll probably end up computing a
2691      # maximum length that is only half of the actual maximum length, but
2692      # we can't tell.
2693      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
2694	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
2695	      test $i != 17 # 1/2 MB should be enough
2696      do
2697        i=`expr $i + 1`
2698        teststring=$teststring$teststring
2699      done
2700      # Only check the string length outside the loop.
2701      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
2702      teststring=
2703      # Add a significant safety factor because C++ compilers can tack on
2704      # massive amounts of additional arguments before passing them to the
2705      # linker.  It appears as though 1/2 is a usable value.
2706      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
2707    fi
2708    ;;
2709  esac
2710])
2711if test -n $lt_cv_sys_max_cmd_len ; then
2712  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
2713else
2714  AC_MSG_RESULT(none)
2715fi
2716max_cmd_len=$lt_cv_sys_max_cmd_len
2717_LT_DECL([], [max_cmd_len], [0],
2718    [What is the maximum length of a command?])
2719])# LT_CMD_MAX_LEN
2720
2721# Old name:
2722AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
2723dnl aclocal-1.4 backwards compatibility:
2724dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
2725
2726
2727# _LT_HEADER_DLFCN
2728# ----------------
2729m4_defun([_LT_HEADER_DLFCN],
2730[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
2731])# _LT_HEADER_DLFCN
2732
2733
2734# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
2735#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
2736# ----------------------------------------------------------------
2737m4_defun([_LT_TRY_DLOPEN_SELF],
2738[m4_require([_LT_HEADER_DLFCN])dnl
2739if test "$cross_compiling" = yes; then :
2740  [$4]
2741else
2742  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
2743  lt_status=$lt_dlunknown
2744  cat > conftest.$ac_ext <<_LT_EOF
2745[#line $LINENO "configure"
2746#include "confdefs.h"
2747
2748#if HAVE_DLFCN_H
2749#include <dlfcn.h>
2750#endif
2751
2752#include <stdio.h>
2753
2754#ifdef RTLD_GLOBAL
2755#  define LT_DLGLOBAL		RTLD_GLOBAL
2756#else
2757#  ifdef DL_GLOBAL
2758#    define LT_DLGLOBAL		DL_GLOBAL
2759#  else
2760#    define LT_DLGLOBAL		0
2761#  endif
2762#endif
2763
2764/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
2765   find out it does not work in some platform. */
2766#ifndef LT_DLLAZY_OR_NOW
2767#  ifdef RTLD_LAZY
2768#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
2769#  else
2770#    ifdef DL_LAZY
2771#      define LT_DLLAZY_OR_NOW		DL_LAZY
2772#    else
2773#      ifdef RTLD_NOW
2774#        define LT_DLLAZY_OR_NOW	RTLD_NOW
2775#      else
2776#        ifdef DL_NOW
2777#          define LT_DLLAZY_OR_NOW	DL_NOW
2778#        else
2779#          define LT_DLLAZY_OR_NOW	0
2780#        endif
2781#      endif
2782#    endif
2783#  endif
2784#endif
2785
2786/* When -fvisbility=hidden is used, assume the code has been annotated
2787   correspondingly for the symbols needed.  */
2788#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
2789int fnord () __attribute__((visibility("default")));
2790#endif
2791
2792int fnord () { return 42; }
2793int main ()
2794{
2795  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
2796  int status = $lt_dlunknown;
2797
2798  if (self)
2799    {
2800      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
2801      else
2802        {
2803	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
2804          else puts (dlerror ());
2805	}
2806      /* dlclose (self); */
2807    }
2808  else
2809    puts (dlerror ());
2810
2811  return status;
2812}]
2813_LT_EOF
2814  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
2815    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
2816    lt_status=$?
2817    case x$lt_status in
2818      x$lt_dlno_uscore) $1 ;;
2819      x$lt_dlneed_uscore) $2 ;;
2820      x$lt_dlunknown|x*) $3 ;;
2821    esac
2822  else :
2823    # compilation failed
2824    $3
2825  fi
2826fi
2827rm -fr conftest*
2828])# _LT_TRY_DLOPEN_SELF
2829
2830
2831# LT_SYS_DLOPEN_SELF
2832# ------------------
2833AC_DEFUN([LT_SYS_DLOPEN_SELF],
2834[m4_require([_LT_HEADER_DLFCN])dnl
2835if test "x$enable_dlopen" != xyes; then
2836  enable_dlopen=unknown
2837  enable_dlopen_self=unknown
2838  enable_dlopen_self_static=unknown
2839else
2840  lt_cv_dlopen=no
2841  lt_cv_dlopen_libs=
2842
2843  case $host_os in
2844  beos*)
2845    lt_cv_dlopen="load_add_on"
2846    lt_cv_dlopen_libs=
2847    lt_cv_dlopen_self=yes
2848    ;;
2849
2850  mingw* | pw32* | cegcc*)
2851    lt_cv_dlopen="LoadLibrary"
2852    lt_cv_dlopen_libs=
2853    ;;
2854
2855  cygwin*)
2856    lt_cv_dlopen="dlopen"
2857    lt_cv_dlopen_libs=
2858    ;;
2859
2860  darwin*)
2861  # if libdl is installed we need to link against it
2862    AC_CHECK_LIB([dl], [dlopen],
2863		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
2864    lt_cv_dlopen="dyld"
2865    lt_cv_dlopen_libs=
2866    lt_cv_dlopen_self=yes
2867    ])
2868    ;;
2869
2870  *)
2871    AC_CHECK_FUNC([shl_load],
2872	  [lt_cv_dlopen="shl_load"],
2873      [AC_CHECK_LIB([dld], [shl_load],
2874	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
2875	[AC_CHECK_FUNC([dlopen],
2876	      [lt_cv_dlopen="dlopen"],
2877	  [AC_CHECK_LIB([dl], [dlopen],
2878		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
2879	    [AC_CHECK_LIB([svld], [dlopen],
2880		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
2881	      [AC_CHECK_LIB([dld], [dld_link],
2882		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
2883	      ])
2884	    ])
2885	  ])
2886	])
2887      ])
2888    ;;
2889  esac
2890
2891  if test "x$lt_cv_dlopen" != xno; then
2892    enable_dlopen=yes
2893  else
2894    enable_dlopen=no
2895  fi
2896
2897  case $lt_cv_dlopen in
2898  dlopen)
2899    save_CPPFLAGS="$CPPFLAGS"
2900    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2901
2902    save_LDFLAGS="$LDFLAGS"
2903    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2904
2905    save_LIBS="$LIBS"
2906    LIBS="$lt_cv_dlopen_libs $LIBS"
2907
2908    AC_CACHE_CHECK([whether a program can dlopen itself],
2909	  lt_cv_dlopen_self, [dnl
2910	  _LT_TRY_DLOPEN_SELF(
2911	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
2912	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
2913    ])
2914
2915    if test "x$lt_cv_dlopen_self" = xyes; then
2916      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
2917      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
2918	  lt_cv_dlopen_self_static, [dnl
2919	  _LT_TRY_DLOPEN_SELF(
2920	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
2921	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
2922      ])
2923    fi
2924
2925    CPPFLAGS="$save_CPPFLAGS"
2926    LDFLAGS="$save_LDFLAGS"
2927    LIBS="$save_LIBS"
2928    ;;
2929  esac
2930
2931  case $lt_cv_dlopen_self in
2932  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2933  *) enable_dlopen_self=unknown ;;
2934  esac
2935
2936  case $lt_cv_dlopen_self_static in
2937  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2938  *) enable_dlopen_self_static=unknown ;;
2939  esac
2940fi
2941_LT_DECL([dlopen_support], [enable_dlopen], [0],
2942	 [Whether dlopen is supported])
2943_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
2944	 [Whether dlopen of programs is supported])
2945_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
2946	 [Whether dlopen of statically linked programs is supported])
2947])# LT_SYS_DLOPEN_SELF
2948
2949# Old name:
2950AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
2951dnl aclocal-1.4 backwards compatibility:
2952dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
2953
2954
2955# _LT_COMPILER_C_O([TAGNAME])
2956# ---------------------------
2957# Check to see if options -c and -o are simultaneously supported by compiler.
2958# This macro does not hard code the compiler like AC_PROG_CC_C_O.
2959m4_defun([_LT_COMPILER_C_O],
2960[m4_require([_LT_DECL_SED])dnl
2961m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2962m4_require([_LT_TAG_COMPILER])dnl
2963AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
2964  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
2965  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
2966   $RM -r conftest 2>/dev/null
2967   mkdir conftest
2968   cd conftest
2969   mkdir out
2970   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2971
2972   lt_compiler_flag="-o out/conftest2.$ac_objext"
2973   # Insert the option either (1) after the last *FLAGS variable, or
2974   # (2) before a word containing "conftest.", or (3) at the end.
2975   # Note that $ac_compile itself does not contain backslashes and begins
2976   # with a dollar sign (not a hyphen), so the echo should work correctly.
2977   lt_compile=`echo "$ac_compile" | $SED \
2978   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2979   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2980   -e 's:$: $lt_compiler_flag:'`
2981   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2982   (eval "$lt_compile" 2>out/conftest.err)
2983   ac_status=$?
2984   cat out/conftest.err >&AS_MESSAGE_LOG_FD
2985   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2986   if (exit $ac_status) && test -s out/conftest2.$ac_objext
2987   then
2988     # The compiler can only warn and ignore the option if not recognized
2989     # So say no if there are warnings
2990     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
2991     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
2992     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
2993       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
2994     fi
2995   fi
2996   chmod u+w . 2>&AS_MESSAGE_LOG_FD
2997   $RM conftest*
2998   # SGI C++ compiler will create directory out/ii_files/ for
2999   # template instantiation
3000   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
3001   $RM out/* && rmdir out
3002   cd ..
3003   $RM -r conftest
3004   $RM conftest*
3005])
3006_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
3007	[Does compiler simultaneously support -c and -o options?])
3008])# _LT_COMPILER_C_O
3009
3010
3011# _LT_COMPILER_FILE_LOCKS([TAGNAME])
3012# ----------------------------------
3013# Check to see if we can do hard links to lock some files if needed
3014m4_defun([_LT_COMPILER_FILE_LOCKS],
3015[m4_require([_LT_ENABLE_LOCK])dnl
3016m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3017_LT_COMPILER_C_O([$1])
3018
3019hard_links="nottested"
3020if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
3021  # do not overwrite the value of need_locks provided by the user
3022  AC_MSG_CHECKING([if we can lock with hard links])
3023  hard_links=yes
3024  $RM conftest*
3025  ln conftest.a conftest.b 2>/dev/null && hard_links=no
3026  touch conftest.a
3027  ln conftest.a conftest.b 2>&5 || hard_links=no
3028  ln conftest.a conftest.b 2>/dev/null && hard_links=no
3029  AC_MSG_RESULT([$hard_links])
3030  if test "$hard_links" = no; then
3031    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
3032    need_locks=warn
3033  fi
3034else
3035  need_locks=no
3036fi
3037_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
3038])# _LT_COMPILER_FILE_LOCKS
3039
3040
3041# _LT_CHECK_OBJDIR
3042# ----------------
3043m4_defun([_LT_CHECK_OBJDIR],
3044[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
3045[rm -f .libs 2>/dev/null
3046mkdir .libs 2>/dev/null
3047if test -d .libs; then
3048  lt_cv_objdir=.libs
3049else
3050  # MS-DOS does not allow filenames that begin with a dot.
3051  lt_cv_objdir=_libs
3052fi
3053rmdir .libs 2>/dev/null])
3054objdir=$lt_cv_objdir
3055_LT_DECL([], [objdir], [0],
3056         [The name of the directory that contains temporary libtool files])dnl
3057m4_pattern_allow([LT_OBJDIR])dnl
3058AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
3059  [Define to the sub-directory in which libtool stores uninstalled libraries.])
3060])# _LT_CHECK_OBJDIR
3061
3062
3063# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
3064# --------------------------------------
3065# Check hardcoding attributes.
3066m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
3067[AC_MSG_CHECKING([how to hardcode library paths into programs])
3068_LT_TAGVAR(hardcode_action, $1)=
3069if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
3070   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
3071   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
3072
3073  # We can hardcode non-existent directories.
3074  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
3075     # If the only mechanism to avoid hardcoding is shlibpath_var, we
3076     # have to relink, otherwise we might link with an installed library
3077     # when we should be linking with a yet-to-be-installed one
3078     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
3079     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
3080    # Linking always hardcodes the temporary library directory.
3081    _LT_TAGVAR(hardcode_action, $1)=relink
3082  else
3083    # We can link without hardcoding, and we can hardcode nonexisting dirs.
3084    _LT_TAGVAR(hardcode_action, $1)=immediate
3085  fi
3086else
3087  # We cannot hardcode anything, or else we can only hardcode existing
3088  # directories.
3089  _LT_TAGVAR(hardcode_action, $1)=unsupported
3090fi
3091AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
3092
3093if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
3094   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
3095  # Fast installation is not supported
3096  enable_fast_install=no
3097elif test "$shlibpath_overrides_runpath" = yes ||
3098     test "$enable_shared" = no; then
3099  # Fast installation is not necessary
3100  enable_fast_install=needless
3101fi
3102_LT_TAGDECL([], [hardcode_action], [0],
3103    [How to hardcode a shared library path into an executable])
3104])# _LT_LINKER_HARDCODE_LIBPATH
3105
3106
3107# _LT_CMD_STRIPLIB
3108# ----------------
3109m4_defun([_LT_CMD_STRIPLIB],
3110[m4_require([_LT_DECL_EGREP])
3111striplib=
3112old_striplib=
3113AC_MSG_CHECKING([whether stripping libraries is possible])
3114if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
3115  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
3116  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
3117  AC_MSG_RESULT([yes])
3118else
3119# FIXME - insert some real tests, host_os isn't really good enough
3120  case $host_os in
3121  darwin*)
3122    if test -n "$STRIP" ; then
3123      striplib="$STRIP -x"
3124      old_striplib="$STRIP -S"
3125      AC_MSG_RESULT([yes])
3126    else
3127      AC_MSG_RESULT([no])
3128    fi
3129    ;;
3130  *)
3131    AC_MSG_RESULT([no])
3132    ;;
3133  esac
3134fi
3135_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
3136_LT_DECL([], [striplib], [1])
3137])# _LT_CMD_STRIPLIB
3138
3139
3140# _LT_SYS_DYNAMIC_LINKER([TAG])
3141# -----------------------------
3142# PORTME Fill in your ld.so characteristics
3143m4_defun([_LT_SYS_DYNAMIC_LINKER],
3144[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3145m4_require([_LT_DECL_EGREP])dnl
3146m4_require([_LT_FILEUTILS_DEFAULTS])dnl
3147m4_require([_LT_DECL_OBJDUMP])dnl
3148m4_require([_LT_DECL_SED])dnl
3149m4_require([_LT_CHECK_SHELL_FEATURES])dnl
3150AC_MSG_CHECKING([dynamic linker characteristics])
3151m4_if([$1],
3152	[], [
3153if test "$GCC" = yes; then
3154  case $host_os in
3155    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
3156    *) lt_awk_arg="/^libraries:/" ;;
3157  esac
3158  case $host_os in
3159    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
3160    *) lt_sed_strip_eq="s,=/,/,g" ;;
3161  esac
3162  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
3163  case $lt_search_path_spec in
3164  *\;*)
3165    # if the path contains ";" then we assume it to be the separator
3166    # otherwise default to the standard path separator (i.e. ":") - it is
3167    # assumed that no part of a normal pathname contains ";" but that should
3168    # okay in the real world where ";" in dirpaths is itself problematic.
3169    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
3170    ;;
3171  *)
3172    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
3173    ;;
3174  esac
3175  # Ok, now we have the path, separated by spaces, we can step through it
3176  # and add multilib dir if necessary.
3177  lt_tmp_lt_search_path_spec=
3178  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
3179  for lt_sys_path in $lt_search_path_spec; do
3180    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
3181      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
3182    else
3183      test -d "$lt_sys_path" && \
3184	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
3185    fi
3186  done
3187  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
3188BEGIN {RS=" "; FS="/|\n";} {
3189  lt_foo="";
3190  lt_count=0;
3191  for (lt_i = NF; lt_i > 0; lt_i--) {
3192    if ($lt_i != "" && $lt_i != ".") {
3193      if ($lt_i == "..") {
3194        lt_count++;
3195      } else {
3196        if (lt_count == 0) {
3197          lt_foo="/" $lt_i lt_foo;
3198        } else {
3199          lt_count--;
3200        }
3201      }
3202    }
3203  }
3204  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
3205  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
3206}'`
3207  # AWK program above erroneously prepends '/' to C:/dos/paths
3208  # for these hosts.
3209  case $host_os in
3210    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
3211      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
3212  esac
3213  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
3214else
3215  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
3216fi])
3217library_names_spec=
3218libname_spec='lib$name'
3219soname_spec=
3220shrext_cmds=".so"
3221postinstall_cmds=
3222postuninstall_cmds=
3223finish_cmds=
3224finish_eval=
3225shlibpath_var=
3226shlibpath_overrides_runpath=unknown
3227version_type=none
3228dynamic_linker="$host_os ld.so"
3229sys_lib_dlsearch_path_spec="/lib /usr/lib"
3230need_lib_prefix=unknown
3231hardcode_into_libs=no
3232
3233# when you set need_version to no, make sure it does not cause -set_version
3234# flags to be left without arguments
3235need_version=unknown
3236
3237case $host_os in
3238aix3*)
3239  version_type=linux # correct to gnu/linux during the next big refactor
3240  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
3241  shlibpath_var=LIBPATH
3242
3243  # AIX 3 has no versioning support, so we append a major version to the name.
3244  soname_spec='${libname}${release}${shared_ext}$major'
3245  ;;
3246
3247aix[[4-9]]*)
3248  version_type=linux # correct to gnu/linux during the next big refactor
3249  need_lib_prefix=no
3250  need_version=no
3251  hardcode_into_libs=yes
3252  if test "$host_cpu" = ia64; then
3253    # AIX 5 supports IA64
3254    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
3255    shlibpath_var=LD_LIBRARY_PATH
3256  else
3257    # With GCC up to 2.95.x, collect2 would create an import file
3258    # for dependence libraries.  The import file would start with
3259    # the line `#! .'.  This would cause the generated library to
3260    # depend on `.', always an invalid library.  This was fixed in
3261    # development snapshots of GCC prior to 3.0.
3262    case $host_os in
3263      aix4 | aix4.[[01]] | aix4.[[01]].*)
3264      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
3265	   echo ' yes '
3266	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
3267	:
3268      else
3269	can_build_shared=no
3270      fi
3271      ;;
3272    esac
3273    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
3274    # soname into executable. Probably we can add versioning support to
3275    # collect2, so additional links can be useful in future.
3276    if test "$aix_use_runtimelinking" = yes; then
3277      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
3278      # instead of lib<name>.a to let people know that these are not
3279      # typical AIX shared libraries.
3280      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3281    else
3282      # We preserve .a as extension for shared libraries through AIX4.2
3283      # and later when we are not doing run time linking.
3284      library_names_spec='${libname}${release}.a $libname.a'
3285      soname_spec='${libname}${release}${shared_ext}$major'
3286    fi
3287    shlibpath_var=LIBPATH
3288  fi
3289  ;;
3290
3291amigaos*)
3292  case $host_cpu in
3293  powerpc)
3294    # Since July 2007 AmigaOS4 officially supports .so libraries.
3295    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
3296    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3297    ;;
3298  m68k)
3299    library_names_spec='$libname.ixlibrary $libname.a'
3300    # Create ${libname}_ixlibrary.a entries in /sys/libs.
3301    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'
3302    ;;
3303  esac
3304  ;;
3305
3306beos*)
3307  library_names_spec='${libname}${shared_ext}'
3308  dynamic_linker="$host_os ld.so"
3309  shlibpath_var=LIBRARY_PATH
3310  ;;
3311
3312bsdi[[45]]*)
3313  version_type=linux # correct to gnu/linux during the next big refactor
3314  need_version=no
3315  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3316  soname_spec='${libname}${release}${shared_ext}$major'
3317  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
3318  shlibpath_var=LD_LIBRARY_PATH
3319  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
3320  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
3321  # the default ld.so.conf also contains /usr/contrib/lib and
3322  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
3323  # libtool to hard-code these into programs
3324  ;;
3325
3326cygwin* | mingw* | pw32* | cegcc*)
3327  version_type=windows
3328  shrext_cmds=".dll"
3329  need_version=no
3330  need_lib_prefix=no
3331
3332  case $GCC,$cc_basename in
3333  yes,*)
3334    # gcc
3335    library_names_spec='$libname.dll.a'
3336    # DLL is installed to $(libdir)/../bin by postinstall_cmds
3337    postinstall_cmds='base_file=`basename \${file}`~
3338      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
3339      dldir=$destdir/`dirname \$dlpath`~
3340      test -d \$dldir || mkdir -p \$dldir~
3341      $install_prog $dir/$dlname \$dldir/$dlname~
3342      chmod a+x \$dldir/$dlname~
3343      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
3344        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
3345      fi'
3346    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3347      dlpath=$dir/\$dldll~
3348       $RM \$dlpath'
3349    shlibpath_overrides_runpath=yes
3350
3351    case $host_os in
3352    cygwin*)
3353      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
3354      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3355m4_if([$1], [],[
3356      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
3357      ;;
3358    mingw* | cegcc*)
3359      # MinGW DLLs use traditional 'lib' prefix
3360      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3361      ;;
3362    pw32*)
3363      # pw32 DLLs use 'pw' prefix rather than 'lib'
3364      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3365      ;;
3366    esac
3367    dynamic_linker='Win32 ld.exe'
3368    ;;
3369
3370  *,cl*)
3371    # Native MSVC
3372    libname_spec='$name'
3373    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3374    library_names_spec='${libname}.dll.lib'
3375
3376    case $build_os in
3377    mingw*)
3378      sys_lib_search_path_spec=
3379      lt_save_ifs=$IFS
3380      IFS=';'
3381      for lt_path in $LIB
3382      do
3383        IFS=$lt_save_ifs
3384        # Let DOS variable expansion print the short 8.3 style file name.
3385        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
3386        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
3387      done
3388      IFS=$lt_save_ifs
3389      # Convert to MSYS style.
3390      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
3391      ;;
3392    cygwin*)
3393      # Convert to unix form, then to dos form, then back to unix form
3394      # but this time dos style (no spaces!) so that the unix form looks
3395      # like /cygdrive/c/PROGRA~1:/cygdr...
3396      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
3397      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
3398      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3399      ;;
3400    *)
3401      sys_lib_search_path_spec="$LIB"
3402      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
3403        # It is most probably a Windows format PATH.
3404        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
3405      else
3406        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3407      fi
3408      # FIXME: find the short name or the path components, as spaces are
3409      # common. (e.g. "Program Files" -> "PROGRA~1")
3410      ;;
3411    esac
3412
3413    # DLL is installed to $(libdir)/../bin by postinstall_cmds
3414    postinstall_cmds='base_file=`basename \${file}`~
3415      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
3416      dldir=$destdir/`dirname \$dlpath`~
3417      test -d \$dldir || mkdir -p \$dldir~
3418      $install_prog $dir/$dlname \$dldir/$dlname'
3419    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
3420      dlpath=$dir/\$dldll~
3421       $RM \$dlpath'
3422    shlibpath_overrides_runpath=yes
3423    dynamic_linker='Win32 link.exe'
3424    ;;
3425
3426  *)
3427    # Assume MSVC wrapper
3428    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
3429    dynamic_linker='Win32 ld.exe'
3430    ;;
3431  esac
3432  # FIXME: first we should search . and the directory the executable is in
3433  shlibpath_var=PATH
3434  ;;
3435
3436darwin* | rhapsody*)
3437  dynamic_linker="$host_os dyld"
3438  version_type=darwin
3439  need_lib_prefix=no
3440  need_version=no
3441  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
3442  soname_spec='${libname}${release}${major}$shared_ext'
3443  shlibpath_overrides_runpath=yes
3444  shlibpath_var=DYLD_LIBRARY_PATH
3445  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
3446m4_if([$1], [],[
3447  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
3448  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
3449  ;;
3450
3451dgux*)
3452  version_type=linux # correct to gnu/linux during the next big refactor
3453  need_lib_prefix=no
3454  need_version=no
3455  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
3456  soname_spec='${libname}${release}${shared_ext}$major'
3457  shlibpath_var=LD_LIBRARY_PATH
3458  ;;
3459
3460freebsd* | dragonfly*)
3461  # DragonFly does not have aout.  When/if they implement a new
3462  # versioning mechanism, adjust this.
3463  if test -x /usr/bin/objformat; then
3464    objformat=`/usr/bin/objformat`
3465  else
3466    case $host_os in
3467    freebsd[[23]].*) objformat=aout ;;
3468    *) objformat=elf ;;
3469    esac
3470  fi
3471  version_type=freebsd-$objformat
3472  case $version_type in
3473    freebsd-elf*)
3474      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3475      need_version=no
3476      need_lib_prefix=no
3477      ;;
3478    freebsd-*)
3479      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
3480      need_version=yes
3481      ;;
3482  esac
3483  shlibpath_var=LD_LIBRARY_PATH
3484  case $host_os in
3485  freebsd2.*)
3486    shlibpath_overrides_runpath=yes
3487    ;;
3488  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
3489    shlibpath_overrides_runpath=yes
3490    hardcode_into_libs=yes
3491    ;;
3492  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
3493  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
3494    shlibpath_overrides_runpath=no
3495    hardcode_into_libs=yes
3496    ;;
3497  *) # from 4.6 on, and DragonFly
3498    shlibpath_overrides_runpath=yes
3499    hardcode_into_libs=yes
3500    ;;
3501  esac
3502  ;;
3503
3504gnu*)
3505  version_type=linux # correct to gnu/linux during the next big refactor
3506  need_lib_prefix=no
3507  need_version=no
3508  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
3509  soname_spec='${libname}${release}${shared_ext}$major'
3510  shlibpath_var=LD_LIBRARY_PATH
3511  shlibpath_overrides_runpath=no
3512  hardcode_into_libs=yes
3513  ;;
3514
3515haiku*)
3516  version_type=linux # correct to gnu/linux during the next big refactor
3517  need_lib_prefix=no
3518  need_version=no
3519  dynamic_linker="$host_os runtime_loader"
3520  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
3521  soname_spec='${libname}${release}${shared_ext}$major'
3522  shlibpath_var=LIBRARY_PATH
3523  shlibpath_overrides_runpath=yes
3524  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
3525  hardcode_into_libs=yes
3526  ;;
3527
3528hpux9* | hpux10* | hpux11*)
3529  # Give a soname corresponding to the major version so that dld.sl refuses to
3530  # link against other versions.
3531  version_type=sunos
3532  need_lib_prefix=no
3533  need_version=no
3534  case $host_cpu in
3535  ia64*)
3536    shrext_cmds='.so'
3537    hardcode_into_libs=yes
3538    dynamic_linker="$host_os dld.so"
3539    shlibpath_var=LD_LIBRARY_PATH
3540    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3541    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3542    soname_spec='${libname}${release}${shared_ext}$major'
3543    if test "X$HPUX_IA64_MODE" = X32; then
3544      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
3545    else
3546      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
3547    fi
3548    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3549    ;;
3550  hppa*64*)
3551    shrext_cmds='.sl'
3552    hardcode_into_libs=yes
3553    dynamic_linker="$host_os dld.sl"
3554    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
3555    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
3556    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3557    soname_spec='${libname}${release}${shared_ext}$major'
3558    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
3559    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3560    ;;
3561  *)
3562    shrext_cmds='.sl'
3563    dynamic_linker="$host_os dld.sl"
3564    shlibpath_var=SHLIB_PATH
3565    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
3566    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3567    soname_spec='${libname}${release}${shared_ext}$major'
3568    ;;
3569  esac
3570  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
3571  postinstall_cmds='chmod 555 $lib'
3572  # or fails outright, so override atomically:
3573  install_override_mode=555
3574  ;;
3575
3576interix[[3-9]]*)
3577  version_type=linux # correct to gnu/linux during the next big refactor
3578  need_lib_prefix=no
3579  need_version=no
3580  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3581  soname_spec='${libname}${release}${shared_ext}$major'
3582  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
3583  shlibpath_var=LD_LIBRARY_PATH
3584  shlibpath_overrides_runpath=no
3585  hardcode_into_libs=yes
3586  ;;
3587
3588irix5* | irix6* | nonstopux*)
3589  case $host_os in
3590    nonstopux*) version_type=nonstopux ;;
3591    *)
3592	if test "$lt_cv_prog_gnu_ld" = yes; then
3593		version_type=linux # correct to gnu/linux during the next big refactor
3594	else
3595		version_type=irix
3596	fi ;;
3597  esac
3598  need_lib_prefix=no
3599  need_version=no
3600  soname_spec='${libname}${release}${shared_ext}$major'
3601  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
3602  case $host_os in
3603  irix5* | nonstopux*)
3604    libsuff= shlibsuff=
3605    ;;
3606  *)
3607    case $LD in # libtool.m4 will add one of these switches to LD
3608    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
3609      libsuff= shlibsuff= libmagic=32-bit;;
3610    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
3611      libsuff=32 shlibsuff=N32 libmagic=N32;;
3612    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
3613      libsuff=64 shlibsuff=64 libmagic=64-bit;;
3614    *) libsuff= shlibsuff= libmagic=never-match;;
3615    esac
3616    ;;
3617  esac
3618  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
3619  shlibpath_overrides_runpath=no
3620  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
3621  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
3622  hardcode_into_libs=yes
3623  ;;
3624
3625# No shared lib support for Linux oldld, aout, or coff.
3626linux*oldld* | linux*aout* | linux*coff*)
3627  dynamic_linker=no
3628  ;;
3629
3630# This must be glibc/ELF.
3631linux* | k*bsd*-gnu | kopensolaris*-gnu)
3632  version_type=linux # correct to gnu/linux during the next big refactor
3633  need_lib_prefix=no
3634  need_version=no
3635  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3636  soname_spec='${libname}${release}${shared_ext}$major'
3637  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
3638  shlibpath_var=LD_LIBRARY_PATH
3639  shlibpath_overrides_runpath=no
3640
3641  # Some binutils ld are patched to set DT_RUNPATH
3642  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
3643    [lt_cv_shlibpath_overrides_runpath=no
3644    save_LDFLAGS=$LDFLAGS
3645    save_libdir=$libdir
3646    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
3647	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
3648    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
3649      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
3650	 [lt_cv_shlibpath_overrides_runpath=yes])])
3651    LDFLAGS=$save_LDFLAGS
3652    libdir=$save_libdir
3653    ])
3654  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
3655
3656  # This implies no fast_install, which is unacceptable.
3657  # Some rework will be needed to allow for fast_install
3658  # before this can be enabled.
3659  hardcode_into_libs=yes
3660
3661  # Append ld.so.conf contents to the search path
3662  if test -f /etc/ld.so.conf; then
3663    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' ' '`
3664    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
3665  fi
3666
3667  # We used to test for /lib/ld.so.1 and disable shared libraries on
3668  # powerpc, because MkLinux only supported shared libraries with the
3669  # GNU dynamic linker.  Since this was broken with cross compilers,
3670  # most powerpc-linux boxes support dynamic linking these days and
3671  # people can always --disable-shared, the test was removed, and we
3672  # assume the GNU/Linux dynamic linker is in use.
3673  dynamic_linker='GNU/Linux ld.so'
3674  ;;
3675
3676netbsd*)
3677  version_type=sunos
3678  need_lib_prefix=no
3679  need_version=no
3680  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
3681    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3682    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3683    dynamic_linker='NetBSD (a.out) ld.so'
3684  else
3685    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
3686    soname_spec='${libname}${release}${shared_ext}$major'
3687    dynamic_linker='NetBSD ld.elf_so'
3688  fi
3689  shlibpath_var=LD_LIBRARY_PATH
3690  shlibpath_overrides_runpath=yes
3691  hardcode_into_libs=yes
3692  ;;
3693
3694newsos6)
3695  version_type=linux # correct to gnu/linux during the next big refactor
3696  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3697  shlibpath_var=LD_LIBRARY_PATH
3698  shlibpath_overrides_runpath=yes
3699  ;;
3700
3701*nto* | *qnx*)
3702  version_type=qnx
3703  need_lib_prefix=no
3704  need_version=no
3705  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3706  soname_spec='${libname}${release}${shared_ext}$major'
3707  shlibpath_var=LD_LIBRARY_PATH
3708  shlibpath_overrides_runpath=no
3709  hardcode_into_libs=yes
3710  dynamic_linker='ldqnx.so'
3711  ;;
3712
3713openbsd*)
3714  version_type=sunos
3715  sys_lib_dlsearch_path_spec="/usr/lib"
3716  need_lib_prefix=no
3717  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
3718  case $host_os in
3719    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
3720    *)				need_version=no  ;;
3721  esac
3722  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3723  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
3724  shlibpath_var=LD_LIBRARY_PATH
3725  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3726    case $host_os in
3727      openbsd2.[[89]] | openbsd2.[[89]].*)
3728	shlibpath_overrides_runpath=no
3729	;;
3730      *)
3731	shlibpath_overrides_runpath=yes
3732	;;
3733      esac
3734  else
3735    shlibpath_overrides_runpath=yes
3736  fi
3737  ;;
3738
3739os2*)
3740  libname_spec='$name'
3741  shrext_cmds=".dll"
3742  need_lib_prefix=no
3743  library_names_spec='$libname${shared_ext} $libname.a'
3744  dynamic_linker='OS/2 ld.exe'
3745  shlibpath_var=LIBPATH
3746  ;;
3747
3748osf3* | osf4* | osf5*)
3749  version_type=osf
3750  need_lib_prefix=no
3751  need_version=no
3752  soname_spec='${libname}${release}${shared_ext}$major'
3753  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3754  shlibpath_var=LD_LIBRARY_PATH
3755  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
3756  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
3757  ;;
3758
3759rdos*)
3760  dynamic_linker=no
3761  ;;
3762
3763solaris*)
3764  version_type=linux # correct to gnu/linux during the next big refactor
3765  need_lib_prefix=no
3766  need_version=no
3767  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3768  soname_spec='${libname}${release}${shared_ext}$major'
3769  shlibpath_var=LD_LIBRARY_PATH
3770  shlibpath_overrides_runpath=yes
3771  hardcode_into_libs=yes
3772  # ldd complains unless libraries are executable
3773  postinstall_cmds='chmod +x $lib'
3774  ;;
3775
3776sunos4*)
3777  version_type=sunos
3778  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
3779  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3780  shlibpath_var=LD_LIBRARY_PATH
3781  shlibpath_overrides_runpath=yes
3782  if test "$with_gnu_ld" = yes; then
3783    need_lib_prefix=no
3784  fi
3785  need_version=yes
3786  ;;
3787
3788sysv4 | sysv4.3*)
3789  version_type=linux # correct to gnu/linux during the next big refactor
3790  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3791  soname_spec='${libname}${release}${shared_ext}$major'
3792  shlibpath_var=LD_LIBRARY_PATH
3793  case $host_vendor in
3794    sni)
3795      shlibpath_overrides_runpath=no
3796      need_lib_prefix=no
3797      runpath_var=LD_RUN_PATH
3798      ;;
3799    siemens)
3800      need_lib_prefix=no
3801      ;;
3802    motorola)
3803      need_lib_prefix=no
3804      need_version=no
3805      shlibpath_overrides_runpath=no
3806      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3807      ;;
3808  esac
3809  ;;
3810
3811sysv4*MP*)
3812  if test -d /usr/nec ;then
3813    version_type=linux # correct to gnu/linux during the next big refactor
3814    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
3815    soname_spec='$libname${shared_ext}.$major'
3816    shlibpath_var=LD_LIBRARY_PATH
3817  fi
3818  ;;
3819
3820sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3821  version_type=freebsd-elf
3822  need_lib_prefix=no
3823  need_version=no
3824  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
3825  soname_spec='${libname}${release}${shared_ext}$major'
3826  shlibpath_var=LD_LIBRARY_PATH
3827  shlibpath_overrides_runpath=yes
3828  hardcode_into_libs=yes
3829  if test "$with_gnu_ld" = yes; then
3830    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3831  else
3832    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3833    case $host_os in
3834      sco3.2v5*)
3835        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3836	;;
3837    esac
3838  fi
3839  sys_lib_dlsearch_path_spec='/usr/lib'
3840  ;;
3841
3842tpf*)
3843  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
3844  version_type=linux # correct to gnu/linux during the next big refactor
3845  need_lib_prefix=no
3846  need_version=no
3847  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3848  shlibpath_var=LD_LIBRARY_PATH
3849  shlibpath_overrides_runpath=no
3850  hardcode_into_libs=yes
3851  ;;
3852
3853uts4*)
3854  version_type=linux # correct to gnu/linux during the next big refactor
3855  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3856  soname_spec='${libname}${release}${shared_ext}$major'
3857  shlibpath_var=LD_LIBRARY_PATH
3858  ;;
3859
3860*)
3861  dynamic_linker=no
3862  ;;
3863esac
3864AC_MSG_RESULT([$dynamic_linker])
3865test "$dynamic_linker" = no && can_build_shared=no
3866
3867variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3868if test "$GCC" = yes; then
3869  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3870fi
3871
3872if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
3873  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
3874fi
3875if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
3876  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
3877fi
3878
3879_LT_DECL([], [variables_saved_for_relink], [1],
3880    [Variables whose values should be saved in libtool wrapper scripts and
3881    restored at link time])
3882_LT_DECL([], [need_lib_prefix], [0],
3883    [Do we need the "lib" prefix for modules?])
3884_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
3885_LT_DECL([], [version_type], [0], [Library versioning type])
3886_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
3887_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
3888_LT_DECL([], [shlibpath_overrides_runpath], [0],
3889    [Is shlibpath searched before the hard-coded library search path?])
3890_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
3891_LT_DECL([], [library_names_spec], [1],
3892    [[List of archive names.  First name is the real one, the rest are links.
3893    The last name is the one that the linker finds with -lNAME]])
3894_LT_DECL([], [soname_spec], [1],
3895    [[The coded name of the library, if different from the real name]])
3896_LT_DECL([], [install_override_mode], [1],
3897    [Permission mode override for installation of shared libraries])
3898_LT_DECL([], [postinstall_cmds], [2],
3899    [Command to use after installation of a shared archive])
3900_LT_DECL([], [postuninstall_cmds], [2],
3901    [Command to use after uninstallation of a shared archive])
3902_LT_DECL([], [finish_cmds], [2],
3903    [Commands used to finish a libtool library installation in a directory])
3904_LT_DECL([], [finish_eval], [1],
3905    [[As "finish_cmds", except a single script fragment to be evaled but
3906    not shown]])
3907_LT_DECL([], [hardcode_into_libs], [0],
3908    [Whether we should hardcode library paths into libraries])
3909_LT_DECL([], [sys_lib_search_path_spec], [2],
3910    [Compile-time system search path for libraries])
3911_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
3912    [Run-time system search path for libraries])
3913])# _LT_SYS_DYNAMIC_LINKER
3914
3915
3916# _LT_PATH_TOOL_PREFIX(TOOL)
3917# --------------------------
3918# find a file program which can recognize shared library
3919AC_DEFUN([_LT_PATH_TOOL_PREFIX],
3920[m4_require([_LT_DECL_EGREP])dnl
3921AC_MSG_CHECKING([for $1])
3922AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3923[case $MAGIC_CMD in
3924[[\\/*] |  ?:[\\/]*])
3925  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
3926  ;;
3927*)
3928  lt_save_MAGIC_CMD="$MAGIC_CMD"
3929  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3930dnl $ac_dummy forces splitting on constant user-supplied paths.
3931dnl POSIX.2 word splitting is done only on the output of word expansions,
3932dnl not every word.  This closes a longstanding sh security hole.
3933  ac_dummy="m4_if([$2], , $PATH, [$2])"
3934  for ac_dir in $ac_dummy; do
3935    IFS="$lt_save_ifs"
3936    test -z "$ac_dir" && ac_dir=.
3937    if test -f $ac_dir/$1; then
3938      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
3939      if test -n "$file_magic_test_file"; then
3940	case $deplibs_check_method in
3941	"file_magic "*)
3942	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
3943	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3944	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3945	    $EGREP "$file_magic_regex" > /dev/null; then
3946	    :
3947	  else
3948	    cat <<_LT_EOF 1>&2
3949
3950*** Warning: the command libtool uses to detect shared libraries,
3951*** $file_magic_cmd, produces output that libtool cannot recognize.
3952*** The result is that libtool may fail to recognize shared libraries
3953*** as such.  This will affect the creation of libtool libraries that
3954*** depend on shared libraries, but programs linked with such libtool
3955*** libraries will work regardless of this problem.  Nevertheless, you
3956*** may want to report the problem to your system manager and/or to
3957*** bug-libtool@gnu.org
3958
3959_LT_EOF
3960	  fi ;;
3961	esac
3962      fi
3963      break
3964    fi
3965  done
3966  IFS="$lt_save_ifs"
3967  MAGIC_CMD="$lt_save_MAGIC_CMD"
3968  ;;
3969esac])
3970MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3971if test -n "$MAGIC_CMD"; then
3972  AC_MSG_RESULT($MAGIC_CMD)
3973else
3974  AC_MSG_RESULT(no)
3975fi
3976_LT_DECL([], [MAGIC_CMD], [0],
3977	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
3978])# _LT_PATH_TOOL_PREFIX
3979
3980# Old name:
3981AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
3982dnl aclocal-1.4 backwards compatibility:
3983dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3984
3985
3986# _LT_PATH_MAGIC
3987# --------------
3988# find a file program which can recognize a shared library
3989m4_defun([_LT_PATH_MAGIC],
3990[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3991if test -z "$lt_cv_path_MAGIC_CMD"; then
3992  if test -n "$ac_tool_prefix"; then
3993    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
3994  else
3995    MAGIC_CMD=:
3996  fi
3997fi
3998])# _LT_PATH_MAGIC
3999
4000
4001# LT_PATH_LD
4002# ----------
4003# find the pathname to the GNU or non-GNU linker
4004AC_DEFUN([LT_PATH_LD],
4005[AC_REQUIRE([AC_PROG_CC])dnl
4006AC_REQUIRE([AC_CANONICAL_HOST])dnl
4007AC_REQUIRE([AC_CANONICAL_BUILD])dnl
4008m4_require([_LT_DECL_SED])dnl
4009m4_require([_LT_DECL_EGREP])dnl
4010m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
4011
4012AC_ARG_WITH([gnu-ld],
4013    [AS_HELP_STRING([--with-gnu-ld],
4014	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
4015    [test "$withval" = no || with_gnu_ld=yes],
4016    [with_gnu_ld=no])dnl
4017
4018ac_prog=ld
4019if test "$GCC" = yes; then
4020  # Check if gcc -print-prog-name=ld gives a path.
4021  AC_MSG_CHECKING([for ld used by $CC])
4022  case $host in
4023  *-*-mingw*)
4024    # gcc leaves a trailing carriage return which upsets mingw
4025    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4026  *)
4027    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4028  esac
4029  case $ac_prog in
4030    # Accept absolute paths.
4031    [[\\/]]* | ?:[[\\/]]*)
4032      re_direlt='/[[^/]][[^/]]*/\.\./'
4033      # Canonicalize the pathname of ld
4034      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
4035      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
4036	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
4037      done
4038      test -z "$LD" && LD="$ac_prog"
4039      ;;
4040  "")
4041    # If it fails, then pretend we aren't using GCC.
4042    ac_prog=ld
4043    ;;
4044  *)
4045    # If it is relative, then search for the first ld in PATH.
4046    with_gnu_ld=unknown
4047    ;;
4048  esac
4049elif test "$with_gnu_ld" = yes; then
4050  AC_MSG_CHECKING([for GNU ld])
4051else
4052  AC_MSG_CHECKING([for non-GNU ld])
4053fi
4054AC_CACHE_VAL(lt_cv_path_LD,
4055[if test -z "$LD"; then
4056  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4057  for ac_dir in $PATH; do
4058    IFS="$lt_save_ifs"
4059    test -z "$ac_dir" && ac_dir=.
4060    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4061      lt_cv_path_LD="$ac_dir/$ac_prog"
4062      # Check to see if the program is GNU ld.  I'd rather use --version,
4063      # but apparently some variants of GNU ld only accept -v.
4064      # Break only if it was the GNU/non-GNU ld that we prefer.
4065      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
4066      *GNU* | *'with BFD'*)
4067	test "$with_gnu_ld" != no && break
4068	;;
4069      *)
4070	test "$with_gnu_ld" != yes && break
4071	;;
4072      esac
4073    fi
4074  done
4075  IFS="$lt_save_ifs"
4076else
4077  lt_cv_path_LD="$LD" # Let the user override the test with a path.
4078fi])
4079LD="$lt_cv_path_LD"
4080if test -n "$LD"; then
4081  AC_MSG_RESULT($LD)
4082else
4083  AC_MSG_RESULT(no)
4084fi
4085test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4086_LT_PATH_LD_GNU
4087AC_SUBST([LD])
4088
4089_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
4090])# LT_PATH_LD
4091
4092# Old names:
4093AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
4094AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
4095dnl aclocal-1.4 backwards compatibility:
4096dnl AC_DEFUN([AM_PROG_LD], [])
4097dnl AC_DEFUN([AC_PROG_LD], [])
4098
4099
4100# _LT_PATH_LD_GNU
4101#- --------------
4102m4_defun([_LT_PATH_LD_GNU],
4103[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
4104[# I'd rather use --version here, but apparently some GNU lds only accept -v.
4105case `$LD -v 2>&1 </dev/null` in
4106*GNU* | *'with BFD'*)
4107  lt_cv_prog_gnu_ld=yes
4108  ;;
4109*)
4110  lt_cv_prog_gnu_ld=no
4111  ;;
4112esac])
4113with_gnu_ld=$lt_cv_prog_gnu_ld
4114])# _LT_PATH_LD_GNU
4115
4116
4117# _LT_CMD_RELOAD
4118# --------------
4119# find reload flag for linker
4120#   -- PORTME Some linkers may need a different reload flag.
4121m4_defun([_LT_CMD_RELOAD],
4122[AC_CACHE_CHECK([for $LD option to reload object files],
4123  lt_cv_ld_reload_flag,
4124  [lt_cv_ld_reload_flag='-r'])
4125reload_flag=$lt_cv_ld_reload_flag
4126case $reload_flag in
4127"" | " "*) ;;
4128*) reload_flag=" $reload_flag" ;;
4129esac
4130reload_cmds='$LD$reload_flag -o $output$reload_objs'
4131case $host_os in
4132  cygwin* | mingw* | pw32* | cegcc*)
4133    if test "$GCC" != yes; then
4134      reload_cmds=false
4135    fi
4136    ;;
4137  darwin*)
4138    if test "$GCC" = yes; then
4139      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
4140    else
4141      reload_cmds='$LD$reload_flag -o $output$reload_objs'
4142    fi
4143    ;;
4144esac
4145_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
4146_LT_TAGDECL([], [reload_cmds], [2])dnl
4147])# _LT_CMD_RELOAD
4148
4149
4150# _LT_CHECK_MAGIC_METHOD
4151# ----------------------
4152# how to check for library dependencies
4153#  -- PORTME fill in with the dynamic library characteristics
4154m4_defun([_LT_CHECK_MAGIC_METHOD],
4155[m4_require([_LT_DECL_EGREP])
4156m4_require([_LT_DECL_OBJDUMP])
4157AC_CACHE_CHECK([how to recognize dependent libraries],
4158lt_cv_deplibs_check_method,
4159[lt_cv_file_magic_cmd='$MAGIC_CMD'
4160lt_cv_file_magic_test_file=
4161lt_cv_deplibs_check_method='unknown'
4162# Need to set the preceding variable on all platforms that support
4163# interlibrary dependencies.
4164# 'none' -- dependencies not supported.
4165# `unknown' -- same as none, but documents that we really don't know.
4166# 'pass_all' -- all dependencies passed with no checks.
4167# 'test_compile' -- check by making test program.
4168# 'file_magic [[regex]]' -- check by looking for files in library path
4169# which responds to the $file_magic_cmd with a given extended regex.
4170# If you have `file' or equivalent on your system and you're not sure
4171# whether `pass_all' will *always* work, you probably want this one.
4172
4173case $host_os in
4174aix[[4-9]]*)
4175  lt_cv_deplibs_check_method=pass_all
4176  ;;
4177
4178beos*)
4179  lt_cv_deplibs_check_method=pass_all
4180  ;;
4181
4182bsdi[[45]]*)
4183  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
4184  lt_cv_file_magic_cmd='/usr/bin/file -L'
4185  lt_cv_file_magic_test_file=/shlib/libc.so
4186  ;;
4187
4188cygwin*)
4189  # func_win32_libid is a shell function defined in ltmain.sh
4190  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4191  lt_cv_file_magic_cmd='func_win32_libid'
4192  ;;
4193
4194mingw* | pw32*)
4195  # Base MSYS/MinGW do not provide the 'file' command needed by
4196  # func_win32_libid shell function, so use a weaker test based on 'objdump',
4197  # unless we find 'file', for example because we are cross-compiling.
4198  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
4199  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
4200    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
4201    lt_cv_file_magic_cmd='func_win32_libid'
4202  else
4203    # Keep this pattern in sync with the one in func_win32_libid.
4204    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
4205    lt_cv_file_magic_cmd='$OBJDUMP -f'
4206  fi
4207  ;;
4208
4209cegcc*)
4210  # use the weaker test based on 'objdump'. See mingw*.
4211  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
4212  lt_cv_file_magic_cmd='$OBJDUMP -f'
4213  ;;
4214
4215darwin* | rhapsody*)
4216  lt_cv_deplibs_check_method=pass_all
4217  ;;
4218
4219freebsd* | dragonfly*)
4220  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
4221    case $host_cpu in
4222    i*86 )
4223      # Not sure whether the presence of OpenBSD here was a mistake.
4224      # Let's accept both of them until this is cleared up.
4225      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
4226      lt_cv_file_magic_cmd=/usr/bin/file
4227      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4228      ;;
4229    esac
4230  else
4231    lt_cv_deplibs_check_method=pass_all
4232  fi
4233  ;;
4234
4235gnu*)
4236  lt_cv_deplibs_check_method=pass_all
4237  ;;
4238
4239haiku*)
4240  lt_cv_deplibs_check_method=pass_all
4241  ;;
4242
4243hpux10.20* | hpux11*)
4244  lt_cv_file_magic_cmd=/usr/bin/file
4245  case $host_cpu in
4246  ia64*)
4247    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
4248    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
4249    ;;
4250  hppa*64*)
4251    [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]']
4252    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
4253    ;;
4254  *)
4255    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
4256    lt_cv_file_magic_test_file=/usr/lib/libc.sl
4257    ;;
4258  esac
4259  ;;
4260
4261interix[[3-9]]*)
4262  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
4263  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
4264  ;;
4265
4266irix5* | irix6* | nonstopux*)
4267  case $LD in
4268  *-32|*"-32 ") libmagic=32-bit;;
4269  *-n32|*"-n32 ") libmagic=N32;;
4270  *-64|*"-64 ") libmagic=64-bit;;
4271  *) libmagic=never-match;;
4272  esac
4273  lt_cv_deplibs_check_method=pass_all
4274  ;;
4275
4276# This must be glibc/ELF.
4277linux* | k*bsd*-gnu | kopensolaris*-gnu)
4278  lt_cv_deplibs_check_method=pass_all
4279  ;;
4280
4281netbsd*)
4282  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
4283    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4284  else
4285    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
4286  fi
4287  ;;
4288
4289newos6*)
4290  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
4291  lt_cv_file_magic_cmd=/usr/bin/file
4292  lt_cv_file_magic_test_file=/usr/lib/libnls.so
4293  ;;
4294
4295*nto* | *qnx*)
4296  lt_cv_deplibs_check_method=pass_all
4297  ;;
4298
4299openbsd*)
4300  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4301    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
4302  else
4303    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
4304  fi
4305  ;;
4306
4307osf3* | osf4* | osf5*)
4308  lt_cv_deplibs_check_method=pass_all
4309  ;;
4310
4311rdos*)
4312  lt_cv_deplibs_check_method=pass_all
4313  ;;
4314
4315solaris*)
4316  lt_cv_deplibs_check_method=pass_all
4317  ;;
4318
4319sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
4320  lt_cv_deplibs_check_method=pass_all
4321  ;;
4322
4323sysv4 | sysv4.3*)
4324  case $host_vendor in
4325  motorola)
4326    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]]'
4327    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
4328    ;;
4329  ncr)
4330    lt_cv_deplibs_check_method=pass_all
4331    ;;
4332  sequent)
4333    lt_cv_file_magic_cmd='/bin/file'
4334    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
4335    ;;
4336  sni)
4337    lt_cv_file_magic_cmd='/bin/file'
4338    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
4339    lt_cv_file_magic_test_file=/lib/libc.so
4340    ;;
4341  siemens)
4342    lt_cv_deplibs_check_method=pass_all
4343    ;;
4344  pc)
4345    lt_cv_deplibs_check_method=pass_all
4346    ;;
4347  esac
4348  ;;
4349
4350tpf*)
4351  lt_cv_deplibs_check_method=pass_all
4352  ;;
4353esac
4354])
4355
4356file_magic_glob=
4357want_nocaseglob=no
4358if test "$build" = "$host"; then
4359  case $host_os in
4360  mingw* | pw32*)
4361    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
4362      want_nocaseglob=yes
4363    else
4364      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
4365    fi
4366    ;;
4367  esac
4368fi
4369
4370file_magic_cmd=$lt_cv_file_magic_cmd
4371deplibs_check_method=$lt_cv_deplibs_check_method
4372test -z "$deplibs_check_method" && deplibs_check_method=unknown
4373
4374_LT_DECL([], [deplibs_check_method], [1],
4375    [Method to check whether dependent libraries are shared objects])
4376_LT_DECL([], [file_magic_cmd], [1],
4377    [Command to use when deplibs_check_method = "file_magic"])
4378_LT_DECL([], [file_magic_glob], [1],
4379    [How to find potential files when deplibs_check_method = "file_magic"])
4380_LT_DECL([], [want_nocaseglob], [1],
4381    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
4382])# _LT_CHECK_MAGIC_METHOD
4383
4384
4385# LT_PATH_NM
4386# ----------
4387# find the pathname to a BSD- or MS-compatible name lister
4388AC_DEFUN([LT_PATH_NM],
4389[AC_REQUIRE([AC_PROG_CC])dnl
4390AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
4391[if test -n "$NM"; then
4392  # Let the user override the test.
4393  lt_cv_path_NM="$NM"
4394else
4395  lt_nm_to_check="${ac_tool_prefix}nm"
4396  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
4397    lt_nm_to_check="$lt_nm_to_check nm"
4398  fi
4399  for lt_tmp_nm in $lt_nm_to_check; do
4400    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4401    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
4402      IFS="$lt_save_ifs"
4403      test -z "$ac_dir" && ac_dir=.
4404      tmp_nm="$ac_dir/$lt_tmp_nm"
4405      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
4406	# Check to see if the nm accepts a BSD-compat flag.
4407	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
4408	#   nm: unknown option "B" ignored
4409	# Tru64's nm complains that /dev/null is an invalid object file
4410	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
4411	*/dev/null* | *'Invalid file or object type'*)
4412	  lt_cv_path_NM="$tmp_nm -B"
4413	  break
4414	  ;;
4415	*)
4416	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
4417	  */dev/null*)
4418	    lt_cv_path_NM="$tmp_nm -p"
4419	    break
4420	    ;;
4421	  *)
4422	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4423	    continue # so that we can try to find one that supports BSD flags
4424	    ;;
4425	  esac
4426	  ;;
4427	esac
4428      fi
4429    done
4430    IFS="$lt_save_ifs"
4431  done
4432  : ${lt_cv_path_NM=no}
4433fi])
4434if test "$lt_cv_path_NM" != "no"; then
4435  NM="$lt_cv_path_NM"
4436else
4437  # Didn't find any BSD compatible name lister, look for dumpbin.
4438  if test -n "$DUMPBIN"; then :
4439    # Let the user override the test.
4440  else
4441    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
4442    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
4443    *COFF*)
4444      DUMPBIN="$DUMPBIN -symbols"
4445      ;;
4446    *)
4447      DUMPBIN=:
4448      ;;
4449    esac
4450  fi
4451  AC_SUBST([DUMPBIN])
4452  if test "$DUMPBIN" != ":"; then
4453    NM="$DUMPBIN"
4454  fi
4455fi
4456test -z "$NM" && NM=nm
4457AC_SUBST([NM])
4458_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
4459
4460AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
4461  [lt_cv_nm_interface="BSD nm"
4462  echo "int some_variable = 0;" > conftest.$ac_ext
4463  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
4464  (eval "$ac_compile" 2>conftest.err)
4465  cat conftest.err >&AS_MESSAGE_LOG_FD
4466  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
4467  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
4468  cat conftest.err >&AS_MESSAGE_LOG_FD
4469  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
4470  cat conftest.out >&AS_MESSAGE_LOG_FD
4471  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
4472    lt_cv_nm_interface="MS dumpbin"
4473  fi
4474  rm -f conftest*])
4475])# LT_PATH_NM
4476
4477# Old names:
4478AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
4479AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
4480dnl aclocal-1.4 backwards compatibility:
4481dnl AC_DEFUN([AM_PROG_NM], [])
4482dnl AC_DEFUN([AC_PROG_NM], [])
4483
4484# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4485# --------------------------------
4486# how to determine the name of the shared library
4487# associated with a specific link library.
4488#  -- PORTME fill in with the dynamic library characteristics
4489m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
4490[m4_require([_LT_DECL_EGREP])
4491m4_require([_LT_DECL_OBJDUMP])
4492m4_require([_LT_DECL_DLLTOOL])
4493AC_CACHE_CHECK([how to associate runtime and link libraries],
4494lt_cv_sharedlib_from_linklib_cmd,
4495[lt_cv_sharedlib_from_linklib_cmd='unknown'
4496
4497case $host_os in
4498cygwin* | mingw* | pw32* | cegcc*)
4499  # two different shell functions defined in ltmain.sh
4500  # decide which to use based on capabilities of $DLLTOOL
4501  case `$DLLTOOL --help 2>&1` in
4502  *--identify-strict*)
4503    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
4504    ;;
4505  *)
4506    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
4507    ;;
4508  esac
4509  ;;
4510*)
4511  # fallback: assume linklib IS sharedlib
4512  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
4513  ;;
4514esac
4515])
4516sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
4517test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
4518
4519_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
4520    [Command to associate shared and link libraries])
4521])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4522
4523
4524# _LT_PATH_MANIFEST_TOOL
4525# ----------------------
4526# locate the manifest tool
4527m4_defun([_LT_PATH_MANIFEST_TOOL],
4528[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
4529test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
4530AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
4531  [lt_cv_path_mainfest_tool=no
4532  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
4533  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
4534  cat conftest.err >&AS_MESSAGE_LOG_FD
4535  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
4536    lt_cv_path_mainfest_tool=yes
4537  fi
4538  rm -f conftest*])
4539if test "x$lt_cv_path_mainfest_tool" != xyes; then
4540  MANIFEST_TOOL=:
4541fi
4542_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
4543])# _LT_PATH_MANIFEST_TOOL
4544
4545
4546# LT_LIB_M
4547# --------
4548# check for math library
4549AC_DEFUN([LT_LIB_M],
4550[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4551LIBM=
4552case $host in
4553*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
4554  # These system don't have libm, or don't need it
4555  ;;
4556*-ncr-sysv4.3*)
4557  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
4558  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
4559  ;;
4560*)
4561  AC_CHECK_LIB(m, cos, LIBM="-lm")
4562  ;;
4563esac
4564AC_SUBST([LIBM])
4565])# LT_LIB_M
4566
4567# Old name:
4568AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
4569dnl aclocal-1.4 backwards compatibility:
4570dnl AC_DEFUN([AC_CHECK_LIBM], [])
4571
4572
4573# _LT_COMPILER_NO_RTTI([TAGNAME])
4574# -------------------------------
4575m4_defun([_LT_COMPILER_NO_RTTI],
4576[m4_require([_LT_TAG_COMPILER])dnl
4577
4578_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
4579
4580if test "$GCC" = yes; then
4581  case $cc_basename in
4582  nvcc*)
4583    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
4584  *)
4585    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
4586  esac
4587
4588  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
4589    lt_cv_prog_compiler_rtti_exceptions,
4590    [-fno-rtti -fno-exceptions], [],
4591    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
4592fi
4593_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
4594	[Compiler flag to turn off builtin functions])
4595])# _LT_COMPILER_NO_RTTI
4596
4597
4598# _LT_CMD_GLOBAL_SYMBOLS
4599# ----------------------
4600m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
4601[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4602AC_REQUIRE([AC_PROG_CC])dnl
4603AC_REQUIRE([AC_PROG_AWK])dnl
4604AC_REQUIRE([LT_PATH_NM])dnl
4605AC_REQUIRE([LT_PATH_LD])dnl
4606m4_require([_LT_DECL_SED])dnl
4607m4_require([_LT_DECL_EGREP])dnl
4608m4_require([_LT_TAG_COMPILER])dnl
4609
4610# Check for command to grab the raw symbol name followed by C symbol from nm.
4611AC_MSG_CHECKING([command to parse $NM output from $compiler object])
4612AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
4613[
4614# These are sane defaults that work on at least a few old systems.
4615# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4616
4617# Character class describing NM global symbol codes.
4618symcode='[[BCDEGRST]]'
4619
4620# Regexp to match symbols that can be accessed directly from C.
4621sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
4622
4623# Define system-specific variables.
4624case $host_os in
4625aix*)
4626  symcode='[[BCDT]]'
4627  ;;
4628cygwin* | mingw* | pw32* | cegcc*)
4629  symcode='[[ABCDGISTW]]'
4630  ;;
4631hpux*)
4632  if test "$host_cpu" = ia64; then
4633    symcode='[[ABCDEGRST]]'
4634  fi
4635  ;;
4636irix* | nonstopux*)
4637  symcode='[[BCDEGRST]]'
4638  ;;
4639osf*)
4640  symcode='[[BCDEGQRST]]'
4641  ;;
4642solaris*)
4643  symcode='[[BDRT]]'
4644  ;;
4645sco3.2v5*)
4646  symcode='[[DT]]'
4647  ;;
4648sysv4.2uw2*)
4649  symcode='[[DT]]'
4650  ;;
4651sysv5* | sco5v6* | unixware* | OpenUNIX*)
4652  symcode='[[ABDT]]'
4653  ;;
4654sysv4)
4655  symcode='[[DFNSTU]]'
4656  ;;
4657esac
4658
4659# If we're using GNU nm, then use its standard symbol codes.
4660case `$NM -V 2>&1` in
4661*GNU* | *'with BFD'*)
4662  symcode='[[ABCDGIRSTW]]' ;;
4663esac
4664
4665# Transform an extracted symbol line into a proper C declaration.
4666# Some systems (esp. on ia64) link data and code symbols differently,
4667# so use this general approach.
4668lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4669
4670# Transform an extracted symbol line into symbol name and symbol address
4671lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
4672lt_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'"
4673
4674# Handle CRLF in mingw tool chain
4675opt_cr=
4676case $build_os in
4677mingw*)
4678  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4679  ;;
4680esac
4681
4682# Try without a prefix underscore, then with it.
4683for ac_symprfx in "" "_"; do
4684
4685  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4686  symxfrm="\\1 $ac_symprfx\\2 \\2"
4687
4688  # Write the raw and C identifiers.
4689  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4690    # Fake it for dumpbin and say T for any non-static function
4691    # and D for any global variable.
4692    # Also find C++ and __fastcall symbols from MSVC++,
4693    # which start with @ or ?.
4694    lt_cv_sys_global_symbol_pipe="$AWK ['"\
4695"     {last_section=section; section=\$ 3};"\
4696"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
4697"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4698"     \$ 0!~/External *\|/{next};"\
4699"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
4700"     {if(hide[section]) next};"\
4701"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
4702"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
4703"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
4704"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
4705"     ' prfx=^$ac_symprfx]"
4706  else
4707    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4708  fi
4709  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4710
4711  # Check to see that the pipe works correctly.
4712  pipe_works=no
4713
4714  rm -f conftest*
4715  cat > conftest.$ac_ext <<_LT_EOF
4716#ifdef __cplusplus
4717extern "C" {
4718#endif
4719char nm_test_var;
4720void nm_test_func(void);
4721void nm_test_func(void){}
4722#ifdef __cplusplus
4723}
4724#endif
4725int main(){nm_test_var='a';nm_test_func();return(0);}
4726_LT_EOF
4727
4728  if AC_TRY_EVAL(ac_compile); then
4729    # Now try to grab the symbols.
4730    nlist=conftest.nm
4731    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
4732      # Try sorting and uniquifying the output.
4733      if sort "$nlist" | uniq > "$nlist"T; then
4734	mv -f "$nlist"T "$nlist"
4735      else
4736	rm -f "$nlist"T
4737      fi
4738
4739      # Make sure that we snagged all the symbols we need.
4740      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
4741	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
4742	  cat <<_LT_EOF > conftest.$ac_ext
4743/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
4744#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
4745/* DATA imports from DLLs on WIN32 con't be const, because runtime
4746   relocations are performed -- see ld's documentation on pseudo-relocs.  */
4747# define LT@&t@_DLSYM_CONST
4748#elif defined(__osf__)
4749/* This system does not cope well with relocations in const data.  */
4750# define LT@&t@_DLSYM_CONST
4751#else
4752# define LT@&t@_DLSYM_CONST const
4753#endif
4754
4755#ifdef __cplusplus
4756extern "C" {
4757#endif
4758
4759_LT_EOF
4760	  # Now generate the symbol file.
4761	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4762
4763	  cat <<_LT_EOF >> conftest.$ac_ext
4764
4765/* The mapping between symbol names and symbols.  */
4766LT@&t@_DLSYM_CONST struct {
4767  const char *name;
4768  void       *address;
4769}
4770lt__PROGRAM__LTX_preloaded_symbols[[]] =
4771{
4772  { "@PROGRAM@", (void *) 0 },
4773_LT_EOF
4774	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4775	  cat <<\_LT_EOF >> conftest.$ac_ext
4776  {0, (void *) 0}
4777};
4778
4779/* This works around a problem in FreeBSD linker */
4780#ifdef FREEBSD_WORKAROUND
4781static const void *lt_preloaded_setup() {
4782  return lt__PROGRAM__LTX_preloaded_symbols;
4783}
4784#endif
4785
4786#ifdef __cplusplus
4787}
4788#endif
4789_LT_EOF
4790	  # Now try linking the two files.
4791	  mv conftest.$ac_objext conftstm.$ac_objext
4792	  lt_globsym_save_LIBS=$LIBS
4793	  lt_globsym_save_CFLAGS=$CFLAGS
4794	  LIBS="conftstm.$ac_objext"
4795	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4796	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
4797	    pipe_works=yes
4798	  fi
4799	  LIBS=$lt_globsym_save_LIBS
4800	  CFLAGS=$lt_globsym_save_CFLAGS
4801	else
4802	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4803	fi
4804      else
4805	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4806      fi
4807    else
4808      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4809    fi
4810  else
4811    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4812    cat conftest.$ac_ext >&5
4813  fi
4814  rm -rf conftest* conftst*
4815
4816  # Do not use the global_symbol_pipe unless it works.
4817  if test "$pipe_works" = yes; then
4818    break
4819  else
4820    lt_cv_sys_global_symbol_pipe=
4821  fi
4822done
4823])
4824if test -z "$lt_cv_sys_global_symbol_pipe"; then
4825  lt_cv_sys_global_symbol_to_cdecl=
4826fi
4827if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4828  AC_MSG_RESULT(failed)
4829else
4830  AC_MSG_RESULT(ok)
4831fi
4832
4833# Response file support.
4834if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4835  nm_file_list_spec='@'
4836elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
4837  nm_file_list_spec='@'
4838fi
4839
4840_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4841    [Take the output of nm and produce a listing of raw symbols and C names])
4842_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4843    [Transform the output of nm in a proper C declaration])
4844_LT_DECL([global_symbol_to_c_name_address],
4845    [lt_cv_sys_global_symbol_to_c_name_address], [1],
4846    [Transform the output of nm in a C name address pair])
4847_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
4848    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
4849    [Transform the output of nm in a C name address pair when lib prefix is needed])
4850_LT_DECL([], [nm_file_list_spec], [1],
4851    [Specify filename containing input files for $NM])
4852]) # _LT_CMD_GLOBAL_SYMBOLS
4853
4854
4855# _LT_COMPILER_PIC([TAGNAME])
4856# ---------------------------
4857m4_defun([_LT_COMPILER_PIC],
4858[m4_require([_LT_TAG_COMPILER])dnl
4859_LT_TAGVAR(lt_prog_compiler_wl, $1)=
4860_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4861_LT_TAGVAR(lt_prog_compiler_static, $1)=
4862
4863m4_if([$1], [CXX], [
4864  # C++ specific cases for pic, static, wl, etc.
4865  if test "$GXX" = yes; then
4866    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4867    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4868
4869    case $host_os in
4870    aix*)
4871      # All AIX code is PIC.
4872      if test "$host_cpu" = ia64; then
4873	# AIX 5 now supports IA64 processor
4874	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4875      fi
4876      ;;
4877
4878    amigaos*)
4879      case $host_cpu in
4880      powerpc)
4881            # see comment about AmigaOS4 .so support
4882            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4883        ;;
4884      m68k)
4885            # FIXME: we need at least 68020 code to build shared libraries, but
4886            # adding the `-m68020' flag to GCC prevents building anything better,
4887            # like `-m68040'.
4888            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4889        ;;
4890      esac
4891      ;;
4892
4893    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4894      # PIC is the default for these OSes.
4895      ;;
4896    mingw* | cygwin* | os2* | pw32* | cegcc*)
4897      # This hack is so that the source file can tell whether it is being
4898      # built for inclusion in a dll (and should export symbols for example).
4899      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4900      # (--disable-auto-import) libraries
4901      m4_if([$1], [GCJ], [],
4902	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4903      ;;
4904    darwin* | rhapsody*)
4905      # PIC is the default on this platform
4906      # Common symbols not allowed in MH_DYLIB files
4907      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4908      ;;
4909    *djgpp*)
4910      # DJGPP does not support shared libraries at all
4911      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4912      ;;
4913    haiku*)
4914      # PIC is the default for Haiku.
4915      # The "-static" flag exists, but is broken.
4916      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4917      ;;
4918    interix[[3-9]]*)
4919      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4920      # Instead, we relocate shared libraries at runtime.
4921      ;;
4922    sysv4*MP*)
4923      if test -d /usr/nec; then
4924	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4925      fi
4926      ;;
4927    hpux*)
4928      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4929      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4930      # sets the default TLS model and affects inlining.
4931      case $host_cpu in
4932      hppa*64*)
4933	;;
4934      *)
4935	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4936	;;
4937      esac
4938      ;;
4939    *qnx* | *nto*)
4940      # QNX uses GNU C++, but need to define -shared option too, otherwise
4941      # it will coredump.
4942      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4943      ;;
4944    *)
4945      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4946      ;;
4947    esac
4948  else
4949    case $host_os in
4950      aix[[4-9]]*)
4951	# All AIX code is PIC.
4952	if test "$host_cpu" = ia64; then
4953	  # AIX 5 now supports IA64 processor
4954	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4955	else
4956	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4957	fi
4958	;;
4959      chorus*)
4960	case $cc_basename in
4961	cxch68*)
4962	  # Green Hills C++ Compiler
4963	  # _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"
4964	  ;;
4965	esac
4966	;;
4967      mingw* | cygwin* | os2* | pw32* | cegcc*)
4968	# This hack is so that the source file can tell whether it is being
4969	# built for inclusion in a dll (and should export symbols for example).
4970	m4_if([$1], [GCJ], [],
4971	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4972	;;
4973      dgux*)
4974	case $cc_basename in
4975	  ec++*)
4976	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4977	    ;;
4978	  ghcx*)
4979	    # Green Hills C++ Compiler
4980	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4981	    ;;
4982	  *)
4983	    ;;
4984	esac
4985	;;
4986      freebsd* | dragonfly*)
4987	# FreeBSD uses GNU C++
4988	;;
4989      hpux9* | hpux10* | hpux11*)
4990	case $cc_basename in
4991	  CC*)
4992	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4993	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4994	    if test "$host_cpu" != ia64; then
4995	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4996	    fi
4997	    ;;
4998	  aCC*)
4999	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5000	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5001	    case $host_cpu in
5002	    hppa*64*|ia64*)
5003	      # +Z the default
5004	      ;;
5005	    *)
5006	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5007	      ;;
5008	    esac
5009	    ;;
5010	  *)
5011	    ;;
5012	esac
5013	;;
5014      interix*)
5015	# This is c89, which is MS Visual C++ (no shared libs)
5016	# Anyone wants to do a port?
5017	;;
5018      irix5* | irix6* | nonstopux*)
5019	case $cc_basename in
5020	  CC*)
5021	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5022	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5023	    # CC pic flag -KPIC is the default.
5024	    ;;
5025	  *)
5026	    ;;
5027	esac
5028	;;
5029      linux* | k*bsd*-gnu | kopensolaris*-gnu)
5030	case $cc_basename in
5031	  KCC*)
5032	    # KAI C++ Compiler
5033	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5034	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5035	    ;;
5036	  ecpc* )
5037	    # old Intel C++ for x86_64 which still supported -KPIC.
5038	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5039	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5040	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5041	    ;;
5042	  icpc* )
5043	    # Intel C++, used to be incompatible with GCC.
5044	    # ICC 10 doesn't accept -KPIC any more.
5045	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5046	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5047	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5048	    ;;
5049	  pgCC* | pgcpp*)
5050	    # Portland Group C++ compiler
5051	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5052	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5053	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5054	    ;;
5055	  cxx*)
5056	    # Compaq C++
5057	    # Make sure the PIC flag is empty.  It appears that all Alpha
5058	    # Linux and Compaq Tru64 Unix objects are PIC.
5059	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5060	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5061	    ;;
5062	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
5063	    # IBM XL 8.0, 9.0 on PPC and BlueGene
5064	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5065	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5066	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
5067	    ;;
5068	  *)
5069	    case `$CC -V 2>&1 | sed 5q` in
5070	    *Sun\ C*)
5071	      # Sun C++ 5.9
5072	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5073	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5074	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5075	      ;;
5076	    esac
5077	    ;;
5078	esac
5079	;;
5080      lynxos*)
5081	;;
5082      m88k*)
5083	;;
5084      mvs*)
5085	case $cc_basename in
5086	  cxx*)
5087	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
5088	    ;;
5089	  *)
5090	    ;;
5091	esac
5092	;;
5093      netbsd*)
5094	;;
5095      *qnx* | *nto*)
5096        # QNX uses GNU C++, but need to define -shared option too, otherwise
5097        # it will coredump.
5098        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5099        ;;
5100      osf3* | osf4* | osf5*)
5101	case $cc_basename in
5102	  KCC*)
5103	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5104	    ;;
5105	  RCC*)
5106	    # Rational C++ 2.4.1
5107	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5108	    ;;
5109	  cxx*)
5110	    # Digital/Compaq C++
5111	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5112	    # Make sure the PIC flag is empty.  It appears that all Alpha
5113	    # Linux and Compaq Tru64 Unix objects are PIC.
5114	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5115	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5116	    ;;
5117	  *)
5118	    ;;
5119	esac
5120	;;
5121      psos*)
5122	;;
5123      solaris*)
5124	case $cc_basename in
5125	  CC* | sunCC*)
5126	    # Sun C++ 4.2, 5.x and Centerline C++
5127	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5128	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5129	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5130	    ;;
5131	  gcx*)
5132	    # Green Hills C++ Compiler
5133	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5134	    ;;
5135	  *)
5136	    ;;
5137	esac
5138	;;
5139      sunos4*)
5140	case $cc_basename in
5141	  CC*)
5142	    # Sun C++ 4.x
5143	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5144	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5145	    ;;
5146	  lcc*)
5147	    # Lucid
5148	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5149	    ;;
5150	  *)
5151	    ;;
5152	esac
5153	;;
5154      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5155	case $cc_basename in
5156	  CC*)
5157	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5158	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5159	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5160	    ;;
5161	esac
5162	;;
5163      tandem*)
5164	case $cc_basename in
5165	  NCC*)
5166	    # NonStop-UX NCC 3.20
5167	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5168	    ;;
5169	  *)
5170	    ;;
5171	esac
5172	;;
5173      vxworks*)
5174	;;
5175      *)
5176	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5177	;;
5178    esac
5179  fi
5180],
5181[
5182  if test "$GCC" = yes; then
5183    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5184    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5185
5186    case $host_os in
5187      aix*)
5188      # All AIX code is PIC.
5189      if test "$host_cpu" = ia64; then
5190	# AIX 5 now supports IA64 processor
5191	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5192      fi
5193      ;;
5194
5195    amigaos*)
5196      case $host_cpu in
5197      powerpc)
5198            # see comment about AmigaOS4 .so support
5199            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5200        ;;
5201      m68k)
5202            # FIXME: we need at least 68020 code to build shared libraries, but
5203            # adding the `-m68020' flag to GCC prevents building anything better,
5204            # like `-m68040'.
5205            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5206        ;;
5207      esac
5208      ;;
5209
5210    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5211      # PIC is the default for these OSes.
5212      ;;
5213
5214    mingw* | cygwin* | pw32* | os2* | cegcc*)
5215      # This hack is so that the source file can tell whether it is being
5216      # built for inclusion in a dll (and should export symbols for example).
5217      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5218      # (--disable-auto-import) libraries
5219      m4_if([$1], [GCJ], [],
5220	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5221      ;;
5222
5223    darwin* | rhapsody*)
5224      # PIC is the default on this platform
5225      # Common symbols not allowed in MH_DYLIB files
5226      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5227      ;;
5228
5229    haiku*)
5230      # PIC is the default for Haiku.
5231      # The "-static" flag exists, but is broken.
5232      _LT_TAGVAR(lt_prog_compiler_static, $1)=
5233      ;;
5234
5235    hpux*)
5236      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
5237      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
5238      # sets the default TLS model and affects inlining.
5239      case $host_cpu in
5240      hppa*64*)
5241	# +Z the default
5242	;;
5243      *)
5244	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5245	;;
5246      esac
5247      ;;
5248
5249    interix[[3-9]]*)
5250      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5251      # Instead, we relocate shared libraries at runtime.
5252      ;;
5253
5254    msdosdjgpp*)
5255      # Just because we use GCC doesn't mean we suddenly get shared libraries
5256      # on systems that don't support them.
5257      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5258      enable_shared=no
5259      ;;
5260
5261    *nto* | *qnx*)
5262      # QNX uses GNU C++, but need to define -shared option too, otherwise
5263      # it will coredump.
5264      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5265      ;;
5266
5267    sysv4*MP*)
5268      if test -d /usr/nec; then
5269	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5270      fi
5271      ;;
5272
5273    *)
5274      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5275      ;;
5276    esac
5277
5278    case $cc_basename in
5279    nvcc*) # Cuda Compiler Driver 2.2
5280      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
5281      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
5282        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
5283      fi
5284      ;;
5285    esac
5286  else
5287    # PORTME Check for flag to pass linker flags through the system compiler.
5288    case $host_os in
5289    aix*)
5290      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5291      if test "$host_cpu" = ia64; then
5292	# AIX 5 now supports IA64 processor
5293	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5294      else
5295	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5296      fi
5297      ;;
5298
5299    mingw* | cygwin* | pw32* | os2* | cegcc*)
5300      # This hack is so that the source file can tell whether it is being
5301      # built for inclusion in a dll (and should export symbols for example).
5302      m4_if([$1], [GCJ], [],
5303	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5304      ;;
5305
5306    hpux9* | hpux10* | hpux11*)
5307      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5308      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5309      # not for PA HP-UX.
5310      case $host_cpu in
5311      hppa*64*|ia64*)
5312	# +Z the default
5313	;;
5314      *)
5315	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5316	;;
5317      esac
5318      # Is there a better lt_prog_compiler_static that works with the bundled CC?
5319      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5320      ;;
5321
5322    irix5* | irix6* | nonstopux*)
5323      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5324      # PIC (with -KPIC) is the default.
5325      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5326      ;;
5327
5328    linux* | k*bsd*-gnu | kopensolaris*-gnu)
5329      case $cc_basename in
5330      # old Intel for x86_64 which still supported -KPIC.
5331      ecc*)
5332	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5333	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5334	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5335        ;;
5336      # icc used to be incompatible with GCC.
5337      # ICC 10 doesn't accept -KPIC any more.
5338      icc* | ifort*)
5339	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5340	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5341	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5342        ;;
5343      # Lahey Fortran 8.1.
5344      lf95*)
5345	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5346	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
5347	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
5348	;;
5349      nagfor*)
5350	# NAG Fortran compiler
5351	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
5352	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5353	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5354	;;
5355      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
5356        # Portland Group compilers (*not* the Pentium gcc compiler,
5357	# which looks to be a dead project)
5358	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5359	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5360	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5361        ;;
5362      ccc*)
5363        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5364        # All Alpha code is PIC.
5365        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5366        ;;
5367      xl* | bgxl* | bgf* | mpixl*)
5368	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
5369	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5370	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5371	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
5372	;;
5373      *)
5374	case `$CC -V 2>&1 | sed 5q` in
5375	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
5376	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
5377	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5378	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5379	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
5380	  ;;
5381	*Sun\ F* | *Sun*Fortran*)
5382	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5383	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5384	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5385	  ;;
5386	*Sun\ C*)
5387	  # Sun C 5.9
5388	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5389	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5390	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5391	  ;;
5392        *Intel*\ [[CF]]*Compiler*)
5393	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5394	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5395	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5396	  ;;
5397	*Portland\ Group*)
5398	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5399	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5400	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5401	  ;;
5402	esac
5403	;;
5404      esac
5405      ;;
5406
5407    newsos6)
5408      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5409      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5410      ;;
5411
5412    *nto* | *qnx*)
5413      # QNX uses GNU C++, but need to define -shared option too, otherwise
5414      # it will coredump.
5415      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5416      ;;
5417
5418    osf3* | osf4* | osf5*)
5419      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5420      # All OSF/1 code is PIC.
5421      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5422      ;;
5423
5424    rdos*)
5425      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5426      ;;
5427
5428    solaris*)
5429      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5430      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5431      case $cc_basename in
5432      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
5433	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
5434      *)
5435	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
5436      esac
5437      ;;
5438
5439    sunos4*)
5440      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5441      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5442      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5443      ;;
5444
5445    sysv4 | sysv4.2uw2* | sysv4.3*)
5446      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5447      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5448      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5449      ;;
5450
5451    sysv4*MP*)
5452      if test -d /usr/nec ;then
5453	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
5454	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5455      fi
5456      ;;
5457
5458    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5459      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5460      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5461      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5462      ;;
5463
5464    unicos*)
5465      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5466      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5467      ;;
5468
5469    uts4*)
5470      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5471      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5472      ;;
5473
5474    *)
5475      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5476      ;;
5477    esac
5478  fi
5479])
5480case $host_os in
5481  # For platforms which do not support PIC, -DPIC is meaningless:
5482  *djgpp*)
5483    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5484    ;;
5485  *)
5486    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
5487    ;;
5488esac
5489
5490AC_CACHE_CHECK([for $compiler option to produce PIC],
5491  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
5492  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
5493_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
5494
5495#
5496# Check to make sure the PIC flag actually works.
5497#
5498if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
5499  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
5500    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
5501    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
5502    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
5503     "" | " "*) ;;
5504     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
5505     esac],
5506    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
5507     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
5508fi
5509_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
5510	[Additional compiler flags for building library objects])
5511
5512_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
5513	[How to pass a linker flag through the compiler])
5514#
5515# Check to make sure the static flag actually works.
5516#
5517wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
5518_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
5519  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
5520  $lt_tmp_static_flag,
5521  [],
5522  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
5523_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
5524	[Compiler flag to prevent dynamic linking])
5525])# _LT_COMPILER_PIC
5526
5527
5528# _LT_LINKER_SHLIBS([TAGNAME])
5529# ----------------------------
5530# See if the linker supports building shared libraries.
5531m4_defun([_LT_LINKER_SHLIBS],
5532[AC_REQUIRE([LT_PATH_LD])dnl
5533AC_REQUIRE([LT_PATH_NM])dnl
5534m4_require([_LT_PATH_MANIFEST_TOOL])dnl
5535m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5536m4_require([_LT_DECL_EGREP])dnl
5537m4_require([_LT_DECL_SED])dnl
5538m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
5539m4_require([_LT_TAG_COMPILER])dnl
5540AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5541m4_if([$1], [CXX], [
5542  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5543  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5544  case $host_os in
5545  aix[[4-9]]*)
5546    # If we're using GNU nm, then we don't want the "-C" option.
5547    # -C means demangle to AIX nm, but means don't demangle with GNU nm
5548    # Also, AIX nm treats weak defined symbols like other global defined
5549    # symbols, whereas GNU nm marks them as "W".
5550    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5551      _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'
5552    else
5553      _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'
5554    fi
5555    ;;
5556  pw32*)
5557    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
5558    ;;
5559  cygwin* | mingw* | cegcc*)
5560    case $cc_basename in
5561    cl*)
5562      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5563      ;;
5564    *)
5565      _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'
5566      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5567      ;;
5568    esac
5569    ;;
5570  *)
5571    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5572    ;;
5573  esac
5574], [
5575  runpath_var=
5576  _LT_TAGVAR(allow_undefined_flag, $1)=
5577  _LT_TAGVAR(always_export_symbols, $1)=no
5578  _LT_TAGVAR(archive_cmds, $1)=
5579  _LT_TAGVAR(archive_expsym_cmds, $1)=
5580  _LT_TAGVAR(compiler_needs_object, $1)=no
5581  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5582  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5583  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5584  _LT_TAGVAR(hardcode_automatic, $1)=no
5585  _LT_TAGVAR(hardcode_direct, $1)=no
5586  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
5587  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5588  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5589  _LT_TAGVAR(hardcode_minus_L, $1)=no
5590  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5591  _LT_TAGVAR(inherit_rpath, $1)=no
5592  _LT_TAGVAR(link_all_deplibs, $1)=unknown
5593  _LT_TAGVAR(module_cmds, $1)=
5594  _LT_TAGVAR(module_expsym_cmds, $1)=
5595  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
5596  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
5597  _LT_TAGVAR(thread_safe_flag_spec, $1)=
5598  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5599  # include_expsyms should be a list of space-separated symbols to be *always*
5600  # included in the symbol list
5601  _LT_TAGVAR(include_expsyms, $1)=
5602  # exclude_expsyms can be an extended regexp of symbols to exclude
5603  # it will be wrapped by ` (' and `)$', so one must not match beginning or
5604  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5605  # as well as any symbol that contains `d'.
5606  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5607  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5608  # platforms (ab)use it in PIC code, but their linkers get confused if
5609  # the symbol is explicitly referenced.  Since portable code cannot
5610  # rely on this symbol name, it's probably fine to never include it in
5611  # preloaded symbol tables.
5612  # Exclude shared library initialization/finalization symbols.
5613dnl Note also adjust exclude_expsyms for C++ above.
5614  extract_expsyms_cmds=
5615
5616  case $host_os in
5617  cygwin* | mingw* | pw32* | cegcc*)
5618    # FIXME: the MSVC++ port hasn't been tested in a loooong time
5619    # When not using gcc, we currently assume that we are using
5620    # Microsoft Visual C++.
5621    if test "$GCC" != yes; then
5622      with_gnu_ld=no
5623    fi
5624    ;;
5625  interix*)
5626    # we just hope/assume this is gcc and not c89 (= MSVC++)
5627    with_gnu_ld=yes
5628    ;;
5629  openbsd*)
5630    with_gnu_ld=no
5631    ;;
5632  esac
5633
5634  _LT_TAGVAR(ld_shlibs, $1)=yes
5635
5636  # On some targets, GNU ld is compatible enough with the native linker
5637  # that we're better off using the native interface for both.
5638  lt_use_gnu_ld_interface=no
5639  if test "$with_gnu_ld" = yes; then
5640    case $host_os in
5641      aix*)
5642	# The AIX port of GNU ld has always aspired to compatibility
5643	# with the native linker.  However, as the warning in the GNU ld
5644	# block says, versions before 2.19.5* couldn't really create working
5645	# shared libraries, regardless of the interface used.
5646	case `$LD -v 2>&1` in
5647	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
5648	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
5649	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
5650	  *)
5651	    lt_use_gnu_ld_interface=yes
5652	    ;;
5653	esac
5654	;;
5655      *)
5656	lt_use_gnu_ld_interface=yes
5657	;;
5658    esac
5659  fi
5660
5661  if test "$lt_use_gnu_ld_interface" = yes; then
5662    # If archive_cmds runs LD, not CC, wlarc should be empty
5663    wlarc='${wl}'
5664
5665    # Set some defaults for GNU ld with shared library support. These
5666    # are reset later if shared libraries are not supported. Putting them
5667    # here allows them to be overridden if necessary.
5668    runpath_var=LD_RUN_PATH
5669    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5670    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5671    # ancient GNU ld didn't support --whole-archive et. al.
5672    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
5673      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5674    else
5675      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5676    fi
5677    supports_anon_versioning=no
5678    case `$LD -v 2>&1` in
5679      *GNU\ gold*) supports_anon_versioning=yes ;;
5680      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5681      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5682      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5683      *\ 2.11.*) ;; # other 2.11 versions
5684      *) supports_anon_versioning=yes ;;
5685    esac
5686
5687    # See if GNU ld supports shared libraries.
5688    case $host_os in
5689    aix[[3-9]]*)
5690      # On AIX/PPC, the GNU linker is very broken
5691      if test "$host_cpu" != ia64; then
5692	_LT_TAGVAR(ld_shlibs, $1)=no
5693	cat <<_LT_EOF 1>&2
5694
5695*** Warning: the GNU linker, at least up to release 2.19, is reported
5696*** to be unable to reliably create shared libraries on AIX.
5697*** Therefore, libtool is disabling shared libraries support.  If you
5698*** really care for shared libraries, you may want to install binutils
5699*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
5700*** You will then need to restart the configuration process.
5701
5702_LT_EOF
5703      fi
5704      ;;
5705
5706    amigaos*)
5707      case $host_cpu in
5708      powerpc)
5709            # see comment about AmigaOS4 .so support
5710            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5711            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5712        ;;
5713      m68k)
5714            _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)'
5715            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5716            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5717        ;;
5718      esac
5719      ;;
5720
5721    beos*)
5722      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5723	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5724	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5725	# support --undefined.  This deserves some investigation.  FIXME
5726	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5727      else
5728	_LT_TAGVAR(ld_shlibs, $1)=no
5729      fi
5730      ;;
5731
5732    cygwin* | mingw* | pw32* | cegcc*)
5733      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5734      # as there is no search path for DLLs.
5735      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5736      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
5737      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5738      _LT_TAGVAR(always_export_symbols, $1)=no
5739      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5740      _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'
5741      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5742
5743      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5744        _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'
5745	# If the export-symbols file already is a .def file (1st line
5746	# is EXPORTS), use it as is; otherwise, prepend...
5747	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5748	  cp $export_symbols $output_objdir/$soname.def;
5749	else
5750	  echo EXPORTS > $output_objdir/$soname.def;
5751	  cat $export_symbols >> $output_objdir/$soname.def;
5752	fi~
5753	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5754      else
5755	_LT_TAGVAR(ld_shlibs, $1)=no
5756      fi
5757      ;;
5758
5759    haiku*)
5760      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5761      _LT_TAGVAR(link_all_deplibs, $1)=yes
5762      ;;
5763
5764    interix[[3-9]]*)
5765      _LT_TAGVAR(hardcode_direct, $1)=no
5766      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5767      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5768      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5769      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5770      # Instead, shared libraries are loaded at an image base (0x10000000 by
5771      # default) and relocated if they conflict, which is a slow very memory
5772      # consuming and fragmenting process.  To avoid this, we pick a random,
5773      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5774      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5775      _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'
5776      _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'
5777      ;;
5778
5779    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
5780      tmp_diet=no
5781      if test "$host_os" = linux-dietlibc; then
5782	case $cc_basename in
5783	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
5784	esac
5785      fi
5786      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5787	 && test "$tmp_diet" = no
5788      then
5789	tmp_addflag=' $pic_flag'
5790	tmp_sharedflag='-shared'
5791	case $cc_basename,$host_cpu in
5792        pgcc*)				# Portland Group C compiler
5793	  _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'
5794	  tmp_addflag=' $pic_flag'
5795	  ;;
5796	pgf77* | pgf90* | pgf95* | pgfortran*)
5797					# Portland Group f77 and f90 compilers
5798	  _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'
5799	  tmp_addflag=' $pic_flag -Mnomain' ;;
5800	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
5801	  tmp_addflag=' -i_dynamic' ;;
5802	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5803	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5804	ifc* | ifort*)			# Intel Fortran compiler
5805	  tmp_addflag=' -nofor_main' ;;
5806	lf95*)				# Lahey Fortran 8.1
5807	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5808	  tmp_sharedflag='--shared' ;;
5809	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
5810	  tmp_sharedflag='-qmkshrobj'
5811	  tmp_addflag= ;;
5812	nvcc*)	# Cuda Compiler Driver 2.2
5813	  _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'
5814	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5815	  ;;
5816	esac
5817	case `$CC -V 2>&1 | sed 5q` in
5818	*Sun\ C*)			# Sun C 5.9
5819	  _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'
5820	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5821	  tmp_sharedflag='-G' ;;
5822	*Sun\ F*)			# Sun Fortran 8.3
5823	  tmp_sharedflag='-G' ;;
5824	esac
5825	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5826
5827        if test "x$supports_anon_versioning" = xyes; then
5828          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5829	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5830	    echo "local: *; };" >> $output_objdir/$libname.ver~
5831	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5832        fi
5833
5834	case $cc_basename in
5835	xlf* | bgf* | bgxlf* | mpixlf*)
5836	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
5837	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5838	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5839	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5840	  if test "x$supports_anon_versioning" = xyes; then
5841	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5842	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5843	      echo "local: *; };" >> $output_objdir/$libname.ver~
5844	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
5845	  fi
5846	  ;;
5847	esac
5848      else
5849        _LT_TAGVAR(ld_shlibs, $1)=no
5850      fi
5851      ;;
5852
5853    netbsd*)
5854      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5855	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5856	wlarc=
5857      else
5858	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5859	_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'
5860      fi
5861      ;;
5862
5863    solaris*)
5864      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
5865	_LT_TAGVAR(ld_shlibs, $1)=no
5866	cat <<_LT_EOF 1>&2
5867
5868*** Warning: The releases 2.8.* of the GNU linker cannot reliably
5869*** create shared libraries on Solaris systems.  Therefore, libtool
5870*** is disabling shared libraries support.  We urge you to upgrade GNU
5871*** binutils to release 2.9.1 or newer.  Another option is to modify
5872*** your PATH or compiler configuration so that the native linker is
5873*** used, and then restart.
5874
5875_LT_EOF
5876      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5877	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5878	_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'
5879      else
5880	_LT_TAGVAR(ld_shlibs, $1)=no
5881      fi
5882      ;;
5883
5884    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5885      case `$LD -v 2>&1` in
5886        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5887	_LT_TAGVAR(ld_shlibs, $1)=no
5888	cat <<_LT_EOF 1>&2
5889
5890*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
5891*** reliably create shared libraries on SCO systems.  Therefore, libtool
5892*** is disabling shared libraries support.  We urge you to upgrade GNU
5893*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
5894*** your PATH or compiler configuration so that the native linker is
5895*** used, and then restart.
5896
5897_LT_EOF
5898	;;
5899	*)
5900	  # For security reasons, it is highly recommended that you always
5901	  # use absolute paths for naming shared libraries, and exclude the
5902	  # DT_RUNPATH tag from executables and libraries.  But doing so
5903	  # requires that you compile everything twice, which is a pain.
5904	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5905	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5906	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5907	    _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'
5908	  else
5909	    _LT_TAGVAR(ld_shlibs, $1)=no
5910	  fi
5911	;;
5912      esac
5913      ;;
5914
5915    sunos4*)
5916      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5917      wlarc=
5918      _LT_TAGVAR(hardcode_direct, $1)=yes
5919      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5920      ;;
5921
5922    *)
5923      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5924	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5925	_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'
5926      else
5927	_LT_TAGVAR(ld_shlibs, $1)=no
5928      fi
5929      ;;
5930    esac
5931
5932    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
5933      runpath_var=
5934      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5935      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5936      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5937    fi
5938  else
5939    # PORTME fill in a description of your system's linker (not GNU ld)
5940    case $host_os in
5941    aix3*)
5942      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5943      _LT_TAGVAR(always_export_symbols, $1)=yes
5944      _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'
5945      # Note: this linker hardcodes the directories in LIBPATH if there
5946      # are no directories specified by -L.
5947      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5948      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
5949	# Neither direct hardcoding nor static linking is supported with a
5950	# broken collect2.
5951	_LT_TAGVAR(hardcode_direct, $1)=unsupported
5952      fi
5953      ;;
5954
5955    aix[[4-9]]*)
5956      if test "$host_cpu" = ia64; then
5957	# On IA64, the linker does run time linking by default, so we don't
5958	# have to do anything special.
5959	aix_use_runtimelinking=no
5960	exp_sym_flag='-Bexport'
5961	no_entry_flag=""
5962      else
5963	# If we're using GNU nm, then we don't want the "-C" option.
5964	# -C means demangle to AIX nm, but means don't demangle with GNU nm
5965	# Also, AIX nm treats weak defined symbols like other global
5966	# defined symbols, whereas GNU nm marks them as "W".
5967	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5968	  _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'
5969	else
5970	  _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'
5971	fi
5972	aix_use_runtimelinking=no
5973
5974	# Test if we are trying to use run time linking or normal
5975	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
5976	# need to do runtime linking.
5977	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5978	  for ld_flag in $LDFLAGS; do
5979	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
5980	    aix_use_runtimelinking=yes
5981	    break
5982	  fi
5983	  done
5984	  ;;
5985	esac
5986
5987	exp_sym_flag='-bexport'
5988	no_entry_flag='-bnoentry'
5989      fi
5990
5991      # When large executables or shared objects are built, AIX ld can
5992      # have problems creating the table of contents.  If linking a library
5993      # or program results in "error TOC overflow" add -mminimal-toc to
5994      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5995      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5996
5997      _LT_TAGVAR(archive_cmds, $1)=''
5998      _LT_TAGVAR(hardcode_direct, $1)=yes
5999      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6000      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6001      _LT_TAGVAR(link_all_deplibs, $1)=yes
6002      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6003
6004      if test "$GCC" = yes; then
6005	case $host_os in aix4.[[012]]|aix4.[[012]].*)
6006	# We only want to do this on AIX 4.2 and lower, the check
6007	# below for broken collect2 doesn't work under 4.3+
6008	  collect2name=`${CC} -print-prog-name=collect2`
6009	  if test -f "$collect2name" &&
6010	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6011	  then
6012	  # We have reworked collect2
6013	  :
6014	  else
6015	  # We have old collect2
6016	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
6017	  # It fails to find uninstalled libraries when the uninstalled
6018	  # path is not listed in the libpath.  Setting hardcode_minus_L
6019	  # to unsupported forces relinking
6020	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
6021	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6022	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
6023	  fi
6024	  ;;
6025	esac
6026	shared_flag='-shared'
6027	if test "$aix_use_runtimelinking" = yes; then
6028	  shared_flag="$shared_flag "'${wl}-G'
6029	fi
6030      else
6031	# not using gcc
6032	if test "$host_cpu" = ia64; then
6033	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6034	# chokes on -Wl,-G. The following line is correct:
6035	  shared_flag='-G'
6036	else
6037	  if test "$aix_use_runtimelinking" = yes; then
6038	    shared_flag='${wl}-G'
6039	  else
6040	    shared_flag='${wl}-bM:SRE'
6041	  fi
6042	fi
6043      fi
6044
6045      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
6046      # It seems that -bexpall does not export symbols beginning with
6047      # underscore (_), so it is better to generate a list of symbols to export.
6048      _LT_TAGVAR(always_export_symbols, $1)=yes
6049      if test "$aix_use_runtimelinking" = yes; then
6050	# Warning - without using the other runtime loading flags (-brtl),
6051	# -berok will link without error, but may produce a broken library.
6052	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
6053        # Determine the default libpath from the value encoded in an
6054        # empty executable.
6055        _LT_SYS_MODULE_PATH_AIX([$1])
6056        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6057        _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"
6058      else
6059	if test "$host_cpu" = ia64; then
6060	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6061	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6062	  _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"
6063	else
6064	 # Determine the default libpath from the value encoded in an
6065	 # empty executable.
6066	 _LT_SYS_MODULE_PATH_AIX([$1])
6067	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6068	  # Warning - without using the other run time loading flags,
6069	  # -berok will link without error, but may produce a broken library.
6070	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6071	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6072	  if test "$with_gnu_ld" = yes; then
6073	    # We only use this code for GNU lds that support --whole-archive.
6074	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6075	  else
6076	    # Exported symbols can be pulled into shared objects from archives
6077	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6078	  fi
6079	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6080	  # This is similar to how AIX traditionally builds its shared libraries.
6081	  _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'
6082	fi
6083      fi
6084      ;;
6085
6086    amigaos*)
6087      case $host_cpu in
6088      powerpc)
6089            # see comment about AmigaOS4 .so support
6090            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6091            _LT_TAGVAR(archive_expsym_cmds, $1)=''
6092        ;;
6093      m68k)
6094            _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)'
6095            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6096            _LT_TAGVAR(hardcode_minus_L, $1)=yes
6097        ;;
6098      esac
6099      ;;
6100
6101    bsdi[[45]]*)
6102      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
6103      ;;
6104
6105    cygwin* | mingw* | pw32* | cegcc*)
6106      # When not using gcc, we currently assume that we are using
6107      # Microsoft Visual C++.
6108      # hardcode_libdir_flag_spec is actually meaningless, as there is
6109      # no search path for DLLs.
6110      case $cc_basename in
6111      cl*)
6112	# Native MSVC
6113	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6114	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6115	_LT_TAGVAR(always_export_symbols, $1)=yes
6116	_LT_TAGVAR(file_list_spec, $1)='@'
6117	# Tell ltmain to make .lib files, not .a files.
6118	libext=lib
6119	# Tell ltmain to make .dll files, not .so files.
6120	shrext_cmds=".dll"
6121	# FIXME: Setting linknames here is a bad hack.
6122	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6123	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6124	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6125	  else
6126	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6127	  fi~
6128	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6129	  linknames='
6130	# The linker will not automatically build a static lib if we build a DLL.
6131	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6132	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6133	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
6134	_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'
6135	# Don't use ranlib
6136	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6137	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6138	  lt_tool_outputfile="@TOOL_OUTPUT@"~
6139	  case $lt_outputfile in
6140	    *.exe|*.EXE) ;;
6141	    *)
6142	      lt_outputfile="$lt_outputfile.exe"
6143	      lt_tool_outputfile="$lt_tool_outputfile.exe"
6144	      ;;
6145	  esac~
6146	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6147	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6148	    $RM "$lt_outputfile.manifest";
6149	  fi'
6150	;;
6151      *)
6152	# Assume MSVC wrapper
6153	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6154	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6155	# Tell ltmain to make .lib files, not .a files.
6156	libext=lib
6157	# Tell ltmain to make .dll files, not .so files.
6158	shrext_cmds=".dll"
6159	# FIXME: Setting linknames here is a bad hack.
6160	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
6161	# The linker will automatically build a .lib file if we build a DLL.
6162	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6163	# FIXME: Should let the user specify the lib program.
6164	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
6165	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6166	;;
6167      esac
6168      ;;
6169
6170    darwin* | rhapsody*)
6171      _LT_DARWIN_LINKER_FEATURES($1)
6172      ;;
6173
6174    dgux*)
6175      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6176      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6177      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6178      ;;
6179
6180    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
6181    # support.  Future versions do this automatically, but an explicit c++rt0.o
6182    # does not break anything, and helps significantly (at the cost of a little
6183    # extra space).
6184    freebsd2.2*)
6185      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
6186      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6187      _LT_TAGVAR(hardcode_direct, $1)=yes
6188      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6189      ;;
6190
6191    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
6192    freebsd2.*)
6193      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6194      _LT_TAGVAR(hardcode_direct, $1)=yes
6195      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6196      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6197      ;;
6198
6199    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
6200    freebsd* | dragonfly*)
6201      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6202      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6203      _LT_TAGVAR(hardcode_direct, $1)=yes
6204      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6205      ;;
6206
6207    hpux9*)
6208      if test "$GCC" = yes; then
6209	_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'
6210      else
6211	_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'
6212      fi
6213      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6214      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6215      _LT_TAGVAR(hardcode_direct, $1)=yes
6216
6217      # hardcode_minus_L: Not really in the search PATH,
6218      # but as the default location of the library.
6219      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6220      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6221      ;;
6222
6223    hpux10*)
6224      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
6225	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6226      else
6227	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
6228      fi
6229      if test "$with_gnu_ld" = no; then
6230	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6231	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
6232	_LT_TAGVAR(hardcode_direct, $1)=yes
6233	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6234	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6235	# hardcode_minus_L: Not really in the search PATH,
6236	# but as the default location of the library.
6237	_LT_TAGVAR(hardcode_minus_L, $1)=yes
6238      fi
6239      ;;
6240
6241    hpux11*)
6242      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
6243	case $host_cpu in
6244	hppa*64*)
6245	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6246	  ;;
6247	ia64*)
6248	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6249	  ;;
6250	*)
6251	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6252	  ;;
6253	esac
6254      else
6255	case $host_cpu in
6256	hppa*64*)
6257	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6258	  ;;
6259	ia64*)
6260	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6261	  ;;
6262	*)
6263	m4_if($1, [], [
6264	  # Older versions of the 11.00 compiler do not understand -b yet
6265	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
6266	  _LT_LINKER_OPTION([if $CC understands -b],
6267	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
6268	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
6269	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
6270	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
6271	  ;;
6272	esac
6273      fi
6274      if test "$with_gnu_ld" = no; then
6275	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6276	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
6277
6278	case $host_cpu in
6279	hppa*64*|ia64*)
6280	  _LT_TAGVAR(hardcode_direct, $1)=no
6281	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6282	  ;;
6283	*)
6284	  _LT_TAGVAR(hardcode_direct, $1)=yes
6285	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6286	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6287
6288	  # hardcode_minus_L: Not really in the search PATH,
6289	  # but as the default location of the library.
6290	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
6291	  ;;
6292	esac
6293      fi
6294      ;;
6295
6296    irix5* | irix6* | nonstopux*)
6297      if test "$GCC" = yes; then
6298	_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'
6299	# Try to use the -exported_symbol ld option, if it does not
6300	# work, assume that -exports_file does not work either and
6301	# implicitly export all symbols.
6302	# This should be the same for all languages, so no per-tag cache variable.
6303	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
6304	  [lt_cv_irix_exported_symbol],
6305	  [save_LDFLAGS="$LDFLAGS"
6306	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
6307	   AC_LINK_IFELSE(
6308	     [AC_LANG_SOURCE(
6309	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
6310			      [C++], [[int foo (void) { return 0; }]],
6311			      [Fortran 77], [[
6312      subroutine foo
6313      end]],
6314			      [Fortran], [[
6315      subroutine foo
6316      end]])])],
6317	      [lt_cv_irix_exported_symbol=yes],
6318	      [lt_cv_irix_exported_symbol=no])
6319           LDFLAGS="$save_LDFLAGS"])
6320	if test "$lt_cv_irix_exported_symbol" = yes; then
6321          _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'
6322	fi
6323      else
6324	_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'
6325	_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'
6326      fi
6327      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6328      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6329      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6330      _LT_TAGVAR(inherit_rpath, $1)=yes
6331      _LT_TAGVAR(link_all_deplibs, $1)=yes
6332      ;;
6333
6334    netbsd*)
6335      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6336	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
6337      else
6338	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
6339      fi
6340      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6341      _LT_TAGVAR(hardcode_direct, $1)=yes
6342      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6343      ;;
6344
6345    newsos6)
6346      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6347      _LT_TAGVAR(hardcode_direct, $1)=yes
6348      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6349      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6350      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6351      ;;
6352
6353    *nto* | *qnx*)
6354      ;;
6355
6356    openbsd*)
6357      if test -f /usr/libexec/ld.so; then
6358	_LT_TAGVAR(hardcode_direct, $1)=yes
6359	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6360	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6361	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6362	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6363	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
6364	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6365	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6366	else
6367	  case $host_os in
6368	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
6369	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6370	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6371	     ;;
6372	   *)
6373	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6374	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6375	     ;;
6376	  esac
6377	fi
6378      else
6379	_LT_TAGVAR(ld_shlibs, $1)=no
6380      fi
6381      ;;
6382
6383    os2*)
6384      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6385      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6386      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6387      _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'
6388      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
6389      ;;
6390
6391    osf3*)
6392      if test "$GCC" = yes; then
6393	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6394	_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'
6395      else
6396	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6397	_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'
6398      fi
6399      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6400      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6401      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6402      ;;
6403
6404    osf4* | osf5*)	# as osf3* with the addition of -msym flag
6405      if test "$GCC" = yes; then
6406	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6407	_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'
6408	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6409      else
6410	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6411	_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'
6412	_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~
6413	$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'
6414
6415	# Both c and cxx compiler support -rpath directly
6416	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6417      fi
6418      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6419      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6420      ;;
6421
6422    solaris*)
6423      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
6424      if test "$GCC" = yes; then
6425	wlarc='${wl}'
6426	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6427	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6428	  $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'
6429      else
6430	case `$CC -V 2>&1` in
6431	*"Compilers 5.0"*)
6432	  wlarc=''
6433	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6434	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6435	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
6436	  ;;
6437	*)
6438	  wlarc='${wl}'
6439	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
6440	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6441	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
6442	  ;;
6443	esac
6444      fi
6445      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6446      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6447      case $host_os in
6448      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6449      *)
6450	# The compiler driver will combine and reorder linker options,
6451	# but understands `-z linker_flag'.  GCC discards it without `$wl',
6452	# but is careful enough not to reorder.
6453	# Supported since Solaris 2.6 (maybe 2.5.1?)
6454	if test "$GCC" = yes; then
6455	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6456	else
6457	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6458	fi
6459	;;
6460      esac
6461      _LT_TAGVAR(link_all_deplibs, $1)=yes
6462      ;;
6463
6464    sunos4*)
6465      if test "x$host_vendor" = xsequent; then
6466	# Use $CC to link under sequent, because it throws in some extra .o
6467	# files that make .init and .fini sections work.
6468	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
6469      else
6470	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
6471      fi
6472      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6473      _LT_TAGVAR(hardcode_direct, $1)=yes
6474      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6475      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6476      ;;
6477
6478    sysv4)
6479      case $host_vendor in
6480	sni)
6481	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6482	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
6483	;;
6484	siemens)
6485	  ## LD is ld it makes a PLAMLIB
6486	  ## CC just makes a GrossModule.
6487	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6488	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
6489	  _LT_TAGVAR(hardcode_direct, $1)=no
6490        ;;
6491	motorola)
6492	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6493	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
6494	;;
6495      esac
6496      runpath_var='LD_RUN_PATH'
6497      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6498      ;;
6499
6500    sysv4.3*)
6501      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6502      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6503      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
6504      ;;
6505
6506    sysv4*MP*)
6507      if test -d /usr/nec; then
6508	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6509	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6510	runpath_var=LD_RUN_PATH
6511	hardcode_runpath_var=yes
6512	_LT_TAGVAR(ld_shlibs, $1)=yes
6513      fi
6514      ;;
6515
6516    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6517      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6518      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6519      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6520      runpath_var='LD_RUN_PATH'
6521
6522      if test "$GCC" = yes; then
6523	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6524	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6525      else
6526	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6527	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6528      fi
6529      ;;
6530
6531    sysv5* | sco3.2v5* | sco5v6*)
6532      # Note: We can NOT use -z defs as we might desire, because we do not
6533      # link with -lc, and that would cause any symbols used from libc to
6534      # always be unresolved, which means just about no library would
6535      # ever link correctly.  If we're not using GNU ld we use -z text
6536      # though, which does catch some bad symbols but isn't as heavy-handed
6537      # as -z defs.
6538      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6539      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6540      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6541      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6542      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6543      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6544      _LT_TAGVAR(link_all_deplibs, $1)=yes
6545      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6546      runpath_var='LD_RUN_PATH'
6547
6548      if test "$GCC" = yes; then
6549	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6550	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6551      else
6552	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6553	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6554      fi
6555      ;;
6556
6557    uts4*)
6558      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6559      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6560      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6561      ;;
6562
6563    *)
6564      _LT_TAGVAR(ld_shlibs, $1)=no
6565      ;;
6566    esac
6567
6568    if test x$host_vendor = xsni; then
6569      case $host in
6570      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6571	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
6572	;;
6573      esac
6574    fi
6575  fi
6576])
6577AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6578test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6579
6580_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
6581
6582_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
6583_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
6584_LT_DECL([], [extract_expsyms_cmds], [2],
6585    [The commands to extract the exported symbol list from a shared archive])
6586
6587#
6588# Do we need to explicitly link libc?
6589#
6590case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
6591x|xyes)
6592  # Assume -lc should be added
6593  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6594
6595  if test "$enable_shared" = yes && test "$GCC" = yes; then
6596    case $_LT_TAGVAR(archive_cmds, $1) in
6597    *'~'*)
6598      # FIXME: we may have to deal with multi-command sequences.
6599      ;;
6600    '$CC '*)
6601      # Test whether the compiler implicitly links with -lc since on some
6602      # systems, -lgcc has to come before -lc. If gcc already passes -lc
6603      # to ld, don't add -lc before -lgcc.
6604      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
6605	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
6606	[$RM conftest*
6607	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6608
6609	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6610	  soname=conftest
6611	  lib=conftest
6612	  libobjs=conftest.$ac_objext
6613	  deplibs=
6614	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
6615	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
6616	  compiler_flags=-v
6617	  linker_flags=-v
6618	  verstring=
6619	  output_objdir=.
6620	  libname=conftest
6621	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
6622	  _LT_TAGVAR(allow_undefined_flag, $1)=
6623	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
6624	  then
6625	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6626	  else
6627	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6628	  fi
6629	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6630	else
6631	  cat conftest.err 1>&5
6632	fi
6633	$RM conftest*
6634	])
6635      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
6636      ;;
6637    esac
6638  fi
6639  ;;
6640esac
6641
6642_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
6643    [Whether or not to add -lc for building shared libraries])
6644_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
6645    [enable_shared_with_static_runtimes], [0],
6646    [Whether or not to disallow shared libs when runtime libs are static])
6647_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
6648    [Compiler flag to allow reflexive dlopens])
6649_LT_TAGDECL([], [whole_archive_flag_spec], [1],
6650    [Compiler flag to generate shared objects directly from archives])
6651_LT_TAGDECL([], [compiler_needs_object], [1],
6652    [Whether the compiler copes with passing no objects directly])
6653_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
6654    [Create an old-style archive from a shared archive])
6655_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
6656    [Create a temporary old-style archive to link instead of a shared archive])
6657_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
6658_LT_TAGDECL([], [archive_expsym_cmds], [2])
6659_LT_TAGDECL([], [module_cmds], [2],
6660    [Commands used to build a loadable module if different from building
6661    a shared archive.])
6662_LT_TAGDECL([], [module_expsym_cmds], [2])
6663_LT_TAGDECL([], [with_gnu_ld], [1],
6664    [Whether we are building with GNU ld or not])
6665_LT_TAGDECL([], [allow_undefined_flag], [1],
6666    [Flag that allows shared libraries with undefined symbols to be built])
6667_LT_TAGDECL([], [no_undefined_flag], [1],
6668    [Flag that enforces no undefined symbols])
6669_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
6670    [Flag to hardcode $libdir into a binary during linking.
6671    This must work even if $libdir does not exist])
6672_LT_TAGDECL([], [hardcode_libdir_separator], [1],
6673    [Whether we need a single "-rpath" flag with a separated argument])
6674_LT_TAGDECL([], [hardcode_direct], [0],
6675    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
6676    DIR into the resulting binary])
6677_LT_TAGDECL([], [hardcode_direct_absolute], [0],
6678    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
6679    DIR into the resulting binary and the resulting library dependency is
6680    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
6681    library is relocated])
6682_LT_TAGDECL([], [hardcode_minus_L], [0],
6683    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
6684    into the resulting binary])
6685_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
6686    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
6687    into the resulting binary])
6688_LT_TAGDECL([], [hardcode_automatic], [0],
6689    [Set to "yes" if building a shared library automatically hardcodes DIR
6690    into the library and all subsequent libraries and executables linked
6691    against it])
6692_LT_TAGDECL([], [inherit_rpath], [0],
6693    [Set to yes if linker adds runtime paths of dependent libraries
6694    to runtime path list])
6695_LT_TAGDECL([], [link_all_deplibs], [0],
6696    [Whether libtool must link a program against all its dependency libraries])
6697_LT_TAGDECL([], [always_export_symbols], [0],
6698    [Set to "yes" if exported symbols are required])
6699_LT_TAGDECL([], [export_symbols_cmds], [2],
6700    [The commands to list exported symbols])
6701_LT_TAGDECL([], [exclude_expsyms], [1],
6702    [Symbols that should not be listed in the preloaded symbols])
6703_LT_TAGDECL([], [include_expsyms], [1],
6704    [Symbols that must always be exported])
6705_LT_TAGDECL([], [prelink_cmds], [2],
6706    [Commands necessary for linking programs (against libraries) with templates])
6707_LT_TAGDECL([], [postlink_cmds], [2],
6708    [Commands necessary for finishing linking programs])
6709_LT_TAGDECL([], [file_list_spec], [1],
6710    [Specify filename containing input files])
6711dnl FIXME: Not yet implemented
6712dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
6713dnl    [Compiler flag to generate thread safe objects])
6714])# _LT_LINKER_SHLIBS
6715
6716
6717# _LT_LANG_C_CONFIG([TAG])
6718# ------------------------
6719# Ensure that the configuration variables for a C compiler are suitably
6720# defined.  These variables are subsequently used by _LT_CONFIG to write
6721# the compiler configuration to `libtool'.
6722m4_defun([_LT_LANG_C_CONFIG],
6723[m4_require([_LT_DECL_EGREP])dnl
6724lt_save_CC="$CC"
6725AC_LANG_PUSH(C)
6726
6727# Source file extension for C test sources.
6728ac_ext=c
6729
6730# Object file extension for compiled C test sources.
6731objext=o
6732_LT_TAGVAR(objext, $1)=$objext
6733
6734# Code to be used in simple compile tests
6735lt_simple_compile_test_code="int some_variable = 0;"
6736
6737# Code to be used in simple link tests
6738lt_simple_link_test_code='int main(){return(0);}'
6739
6740_LT_TAG_COMPILER
6741# Save the default compiler, since it gets overwritten when the other
6742# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
6743compiler_DEFAULT=$CC
6744
6745# save warnings/boilerplate of simple test code
6746_LT_COMPILER_BOILERPLATE
6747_LT_LINKER_BOILERPLATE
6748
6749if test -n "$compiler"; then
6750  _LT_COMPILER_NO_RTTI($1)
6751  _LT_COMPILER_PIC($1)
6752  _LT_COMPILER_C_O($1)
6753  _LT_COMPILER_FILE_LOCKS($1)
6754  _LT_LINKER_SHLIBS($1)
6755  _LT_SYS_DYNAMIC_LINKER($1)
6756  _LT_LINKER_HARDCODE_LIBPATH($1)
6757  LT_SYS_DLOPEN_SELF
6758  _LT_CMD_STRIPLIB
6759
6760  # Report which library types will actually be built
6761  AC_MSG_CHECKING([if libtool supports shared libraries])
6762  AC_MSG_RESULT([$can_build_shared])
6763
6764  AC_MSG_CHECKING([whether to build shared libraries])
6765  test "$can_build_shared" = "no" && enable_shared=no
6766
6767  # On AIX, shared libraries and static libraries use the same namespace, and
6768  # are all built from PIC.
6769  case $host_os in
6770  aix3*)
6771    test "$enable_shared" = yes && enable_static=no
6772    if test -n "$RANLIB"; then
6773      archive_cmds="$archive_cmds~\$RANLIB \$lib"
6774      postinstall_cmds='$RANLIB $lib'
6775    fi
6776    ;;
6777
6778  aix[[4-9]]*)
6779    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6780      test "$enable_shared" = yes && enable_static=no
6781    fi
6782    ;;
6783  esac
6784  AC_MSG_RESULT([$enable_shared])
6785
6786  AC_MSG_CHECKING([whether to build static libraries])
6787  # Make sure either enable_shared or enable_static is yes.
6788  test "$enable_shared" = yes || enable_static=yes
6789  AC_MSG_RESULT([$enable_static])
6790
6791  _LT_CONFIG($1)
6792fi
6793AC_LANG_POP
6794CC="$lt_save_CC"
6795])# _LT_LANG_C_CONFIG
6796
6797
6798# _LT_LANG_CXX_CONFIG([TAG])
6799# --------------------------
6800# Ensure that the configuration variables for a C++ compiler are suitably
6801# defined.  These variables are subsequently used by _LT_CONFIG to write
6802# the compiler configuration to `libtool'.
6803m4_defun([_LT_LANG_CXX_CONFIG],
6804[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6805m4_require([_LT_DECL_EGREP])dnl
6806m4_require([_LT_PATH_MANIFEST_TOOL])dnl
6807if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
6808    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
6809    (test "X$CXX" != "Xg++"))) ; then
6810  AC_PROG_CXXCPP
6811else
6812  _lt_caught_CXX_error=yes
6813fi
6814
6815AC_LANG_PUSH(C++)
6816_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6817_LT_TAGVAR(allow_undefined_flag, $1)=
6818_LT_TAGVAR(always_export_symbols, $1)=no
6819_LT_TAGVAR(archive_expsym_cmds, $1)=
6820_LT_TAGVAR(compiler_needs_object, $1)=no
6821_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6822_LT_TAGVAR(hardcode_direct, $1)=no
6823_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6824_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6825_LT_TAGVAR(hardcode_libdir_separator, $1)=
6826_LT_TAGVAR(hardcode_minus_L, $1)=no
6827_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6828_LT_TAGVAR(hardcode_automatic, $1)=no
6829_LT_TAGVAR(inherit_rpath, $1)=no
6830_LT_TAGVAR(module_cmds, $1)=
6831_LT_TAGVAR(module_expsym_cmds, $1)=
6832_LT_TAGVAR(link_all_deplibs, $1)=unknown
6833_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6834_LT_TAGVAR(reload_flag, $1)=$reload_flag
6835_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6836_LT_TAGVAR(no_undefined_flag, $1)=
6837_LT_TAGVAR(whole_archive_flag_spec, $1)=
6838_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6839
6840# Source file extension for C++ test sources.
6841ac_ext=cpp
6842
6843# Object file extension for compiled C++ test sources.
6844objext=o
6845_LT_TAGVAR(objext, $1)=$objext
6846
6847# No sense in running all these tests if we already determined that
6848# the CXX compiler isn't working.  Some variables (like enable_shared)
6849# are currently assumed to apply to all compilers on this platform,
6850# and will be corrupted by setting them based on a non-working compiler.
6851if test "$_lt_caught_CXX_error" != yes; then
6852  # Code to be used in simple compile tests
6853  lt_simple_compile_test_code="int some_variable = 0;"
6854
6855  # Code to be used in simple link tests
6856  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
6857
6858  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6859  _LT_TAG_COMPILER
6860
6861  # save warnings/boilerplate of simple test code
6862  _LT_COMPILER_BOILERPLATE
6863  _LT_LINKER_BOILERPLATE
6864
6865  # Allow CC to be a program name with arguments.
6866  lt_save_CC=$CC
6867  lt_save_CFLAGS=$CFLAGS
6868  lt_save_LD=$LD
6869  lt_save_GCC=$GCC
6870  GCC=$GXX
6871  lt_save_with_gnu_ld=$with_gnu_ld
6872  lt_save_path_LD=$lt_cv_path_LD
6873  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
6874    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
6875  else
6876    $as_unset lt_cv_prog_gnu_ld
6877  fi
6878  if test -n "${lt_cv_path_LDCXX+set}"; then
6879    lt_cv_path_LD=$lt_cv_path_LDCXX
6880  else
6881    $as_unset lt_cv_path_LD
6882  fi
6883  test -z "${LDCXX+set}" || LD=$LDCXX
6884  CC=${CXX-"c++"}
6885  CFLAGS=$CXXFLAGS
6886  compiler=$CC
6887  _LT_TAGVAR(compiler, $1)=$CC
6888  _LT_CC_BASENAME([$compiler])
6889
6890  if test -n "$compiler"; then
6891    # We don't want -fno-exception when compiling C++ code, so set the
6892    # no_builtin_flag separately
6893    if test "$GXX" = yes; then
6894      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
6895    else
6896      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
6897    fi
6898
6899    if test "$GXX" = yes; then
6900      # Set up default GNU C++ configuration
6901
6902      LT_PATH_LD
6903
6904      # Check if GNU C++ uses GNU ld as the underlying linker, since the
6905      # archiving commands below assume that GNU ld is being used.
6906      if test "$with_gnu_ld" = yes; then
6907        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6908        _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'
6909
6910        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6911        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6912
6913        # If archive_cmds runs LD, not CC, wlarc should be empty
6914        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
6915        #     investigate it a little bit more. (MM)
6916        wlarc='${wl}'
6917
6918        # ancient GNU ld didn't support --whole-archive et. al.
6919        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
6920	  $GREP 'no-whole-archive' > /dev/null; then
6921          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6922        else
6923          _LT_TAGVAR(whole_archive_flag_spec, $1)=
6924        fi
6925      else
6926        with_gnu_ld=no
6927        wlarc=
6928
6929        # A generic and very simple default shared library creation
6930        # command for GNU C++ for the case where it uses the native
6931        # linker, instead of GNU ld.  If possible, this setting should
6932        # overridden to take advantage of the native linker features on
6933        # the platform it is being used on.
6934        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6935      fi
6936
6937      # Commands to make compiler produce verbose output that lists
6938      # what "hidden" libraries, object files and flags are used when
6939      # linking a shared library.
6940      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6941
6942    else
6943      GXX=no
6944      with_gnu_ld=no
6945      wlarc=
6946    fi
6947
6948    # PORTME: fill in a description of your system's C++ link characteristics
6949    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
6950    _LT_TAGVAR(ld_shlibs, $1)=yes
6951    case $host_os in
6952      aix3*)
6953        # FIXME: insert proper C++ library support
6954        _LT_TAGVAR(ld_shlibs, $1)=no
6955        ;;
6956      aix[[4-9]]*)
6957        if test "$host_cpu" = ia64; then
6958          # On IA64, the linker does run time linking by default, so we don't
6959          # have to do anything special.
6960          aix_use_runtimelinking=no
6961          exp_sym_flag='-Bexport'
6962          no_entry_flag=""
6963        else
6964          aix_use_runtimelinking=no
6965
6966          # Test if we are trying to use run time linking or normal
6967          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
6968          # need to do runtime linking.
6969          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6970	    for ld_flag in $LDFLAGS; do
6971	      case $ld_flag in
6972	      *-brtl*)
6973	        aix_use_runtimelinking=yes
6974	        break
6975	        ;;
6976	      esac
6977	    done
6978	    ;;
6979          esac
6980
6981          exp_sym_flag='-bexport'
6982          no_entry_flag='-bnoentry'
6983        fi
6984
6985        # When large executables or shared objects are built, AIX ld can
6986        # have problems creating the table of contents.  If linking a library
6987        # or program results in "error TOC overflow" add -mminimal-toc to
6988        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6989        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6990
6991        _LT_TAGVAR(archive_cmds, $1)=''
6992        _LT_TAGVAR(hardcode_direct, $1)=yes
6993        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6994        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6995        _LT_TAGVAR(link_all_deplibs, $1)=yes
6996        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6997
6998        if test "$GXX" = yes; then
6999          case $host_os in aix4.[[012]]|aix4.[[012]].*)
7000          # We only want to do this on AIX 4.2 and lower, the check
7001          # below for broken collect2 doesn't work under 4.3+
7002	  collect2name=`${CC} -print-prog-name=collect2`
7003	  if test -f "$collect2name" &&
7004	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
7005	  then
7006	    # We have reworked collect2
7007	    :
7008	  else
7009	    # We have old collect2
7010	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
7011	    # It fails to find uninstalled libraries when the uninstalled
7012	    # path is not listed in the libpath.  Setting hardcode_minus_L
7013	    # to unsupported forces relinking
7014	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
7015	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7016	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
7017	  fi
7018          esac
7019          shared_flag='-shared'
7020	  if test "$aix_use_runtimelinking" = yes; then
7021	    shared_flag="$shared_flag "'${wl}-G'
7022	  fi
7023        else
7024          # not using gcc
7025          if test "$host_cpu" = ia64; then
7026	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
7027	  # chokes on -Wl,-G. The following line is correct:
7028	  shared_flag='-G'
7029          else
7030	    if test "$aix_use_runtimelinking" = yes; then
7031	      shared_flag='${wl}-G'
7032	    else
7033	      shared_flag='${wl}-bM:SRE'
7034	    fi
7035          fi
7036        fi
7037
7038        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
7039        # It seems that -bexpall does not export symbols beginning with
7040        # underscore (_), so it is better to generate a list of symbols to
7041	# export.
7042        _LT_TAGVAR(always_export_symbols, $1)=yes
7043        if test "$aix_use_runtimelinking" = yes; then
7044          # Warning - without using the other runtime loading flags (-brtl),
7045          # -berok will link without error, but may produce a broken library.
7046          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
7047          # Determine the default libpath from the value encoded in an empty
7048          # executable.
7049          _LT_SYS_MODULE_PATH_AIX([$1])
7050          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7051
7052          _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"
7053        else
7054          if test "$host_cpu" = ia64; then
7055	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
7056	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
7057	    _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"
7058          else
7059	    # Determine the default libpath from the value encoded in an
7060	    # empty executable.
7061	    _LT_SYS_MODULE_PATH_AIX([$1])
7062	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7063	    # Warning - without using the other run time loading flags,
7064	    # -berok will link without error, but may produce a broken library.
7065	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
7066	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
7067	    if test "$with_gnu_ld" = yes; then
7068	      # We only use this code for GNU lds that support --whole-archive.
7069	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
7070	    else
7071	      # Exported symbols can be pulled into shared objects from archives
7072	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
7073	    fi
7074	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
7075	    # This is similar to how AIX traditionally builds its shared
7076	    # libraries.
7077	    _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'
7078          fi
7079        fi
7080        ;;
7081
7082      beos*)
7083	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
7084	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7085	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
7086	  # support --undefined.  This deserves some investigation.  FIXME
7087	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7088	else
7089	  _LT_TAGVAR(ld_shlibs, $1)=no
7090	fi
7091	;;
7092
7093      chorus*)
7094        case $cc_basename in
7095          *)
7096	  # FIXME: insert proper C++ library support
7097	  _LT_TAGVAR(ld_shlibs, $1)=no
7098	  ;;
7099        esac
7100        ;;
7101
7102      cygwin* | mingw* | pw32* | cegcc*)
7103	case $GXX,$cc_basename in
7104	,cl* | no,cl*)
7105	  # Native MSVC
7106	  # hardcode_libdir_flag_spec is actually meaningless, as there is
7107	  # no search path for DLLs.
7108	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
7109	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7110	  _LT_TAGVAR(always_export_symbols, $1)=yes
7111	  _LT_TAGVAR(file_list_spec, $1)='@'
7112	  # Tell ltmain to make .lib files, not .a files.
7113	  libext=lib
7114	  # Tell ltmain to make .dll files, not .so files.
7115	  shrext_cmds=".dll"
7116	  # FIXME: Setting linknames here is a bad hack.
7117	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
7118	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7119	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
7120	    else
7121	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
7122	    fi~
7123	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
7124	    linknames='
7125	  # The linker will not automatically build a static lib if we build a DLL.
7126	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
7127	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7128	  # Don't use ranlib
7129	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
7130	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
7131	    lt_tool_outputfile="@TOOL_OUTPUT@"~
7132	    case $lt_outputfile in
7133	      *.exe|*.EXE) ;;
7134	      *)
7135		lt_outputfile="$lt_outputfile.exe"
7136		lt_tool_outputfile="$lt_tool_outputfile.exe"
7137		;;
7138	    esac~
7139	    func_to_tool_file "$lt_outputfile"~
7140	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
7141	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
7142	      $RM "$lt_outputfile.manifest";
7143	    fi'
7144	  ;;
7145	*)
7146	  # g++
7147	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
7148	  # as there is no search path for DLLs.
7149	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7150	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
7151	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7152	  _LT_TAGVAR(always_export_symbols, $1)=no
7153	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7154
7155	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
7156	    _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'
7157	    # If the export-symbols file already is a .def file (1st line
7158	    # is EXPORTS), use it as is; otherwise, prepend...
7159	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
7160	      cp $export_symbols $output_objdir/$soname.def;
7161	    else
7162	      echo EXPORTS > $output_objdir/$soname.def;
7163	      cat $export_symbols >> $output_objdir/$soname.def;
7164	    fi~
7165	    $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'
7166	  else
7167	    _LT_TAGVAR(ld_shlibs, $1)=no
7168	  fi
7169	  ;;
7170	esac
7171	;;
7172      darwin* | rhapsody*)
7173        _LT_DARWIN_LINKER_FEATURES($1)
7174	;;
7175
7176      dgux*)
7177        case $cc_basename in
7178          ec++*)
7179	    # FIXME: insert proper C++ library support
7180	    _LT_TAGVAR(ld_shlibs, $1)=no
7181	    ;;
7182          ghcx*)
7183	    # Green Hills C++ Compiler
7184	    # FIXME: insert proper C++ library support
7185	    _LT_TAGVAR(ld_shlibs, $1)=no
7186	    ;;
7187          *)
7188	    # FIXME: insert proper C++ library support
7189	    _LT_TAGVAR(ld_shlibs, $1)=no
7190	    ;;
7191        esac
7192        ;;
7193
7194      freebsd2.*)
7195        # C++ shared libraries reported to be fairly broken before
7196	# switch to ELF
7197        _LT_TAGVAR(ld_shlibs, $1)=no
7198        ;;
7199
7200      freebsd-elf*)
7201        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7202        ;;
7203
7204      freebsd* | dragonfly*)
7205        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
7206        # conventions
7207        _LT_TAGVAR(ld_shlibs, $1)=yes
7208        ;;
7209
7210      gnu*)
7211        ;;
7212
7213      haiku*)
7214        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7215        _LT_TAGVAR(link_all_deplibs, $1)=yes
7216        ;;
7217
7218      hpux9*)
7219        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7220        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7221        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7222        _LT_TAGVAR(hardcode_direct, $1)=yes
7223        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
7224				             # but as the default
7225				             # location of the library.
7226
7227        case $cc_basename in
7228          CC*)
7229            # FIXME: insert proper C++ library support
7230            _LT_TAGVAR(ld_shlibs, $1)=no
7231            ;;
7232          aCC*)
7233            _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'
7234            # Commands to make compiler produce verbose output that lists
7235            # what "hidden" libraries, object files and flags are used when
7236            # linking a shared library.
7237            #
7238            # There doesn't appear to be a way to prevent this compiler from
7239            # explicitly linking system object files so we need to strip them
7240            # from the output so that they don't get included in the library
7241            # dependencies.
7242            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"'
7243            ;;
7244          *)
7245            if test "$GXX" = yes; then
7246              _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'
7247            else
7248              # FIXME: insert proper C++ library support
7249              _LT_TAGVAR(ld_shlibs, $1)=no
7250            fi
7251            ;;
7252        esac
7253        ;;
7254
7255      hpux10*|hpux11*)
7256        if test $with_gnu_ld = no; then
7257	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7258	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7259
7260          case $host_cpu in
7261            hppa*64*|ia64*)
7262              ;;
7263            *)
7264	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7265              ;;
7266          esac
7267        fi
7268        case $host_cpu in
7269          hppa*64*|ia64*)
7270            _LT_TAGVAR(hardcode_direct, $1)=no
7271            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7272            ;;
7273          *)
7274            _LT_TAGVAR(hardcode_direct, $1)=yes
7275            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7276            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
7277					         # but as the default
7278					         # location of the library.
7279            ;;
7280        esac
7281
7282        case $cc_basename in
7283          CC*)
7284	    # FIXME: insert proper C++ library support
7285	    _LT_TAGVAR(ld_shlibs, $1)=no
7286	    ;;
7287          aCC*)
7288	    case $host_cpu in
7289	      hppa*64*)
7290	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7291	        ;;
7292	      ia64*)
7293	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7294	        ;;
7295	      *)
7296	        _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'
7297	        ;;
7298	    esac
7299	    # Commands to make compiler produce verbose output that lists
7300	    # what "hidden" libraries, object files and flags are used when
7301	    # linking a shared library.
7302	    #
7303	    # There doesn't appear to be a way to prevent this compiler from
7304	    # explicitly linking system object files so we need to strip them
7305	    # from the output so that they don't get included in the library
7306	    # dependencies.
7307	    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"'
7308	    ;;
7309          *)
7310	    if test "$GXX" = yes; then
7311	      if test $with_gnu_ld = no; then
7312	        case $host_cpu in
7313	          hppa*64*)
7314	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7315	            ;;
7316	          ia64*)
7317	            _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'
7318	            ;;
7319	          *)
7320	            _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'
7321	            ;;
7322	        esac
7323	      fi
7324	    else
7325	      # FIXME: insert proper C++ library support
7326	      _LT_TAGVAR(ld_shlibs, $1)=no
7327	    fi
7328	    ;;
7329        esac
7330        ;;
7331
7332      interix[[3-9]]*)
7333	_LT_TAGVAR(hardcode_direct, $1)=no
7334	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7335	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7336	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7337	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
7338	# Instead, shared libraries are loaded at an image base (0x10000000 by
7339	# default) and relocated if they conflict, which is a slow very memory
7340	# consuming and fragmenting process.  To avoid this, we pick a random,
7341	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
7342	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
7343	_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'
7344	_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'
7345	;;
7346      irix5* | irix6*)
7347        case $cc_basename in
7348          CC*)
7349	    # SGI C++
7350	    _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'
7351
7352	    # Archives containing C++ object files must be created using
7353	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
7354	    # necessary to make sure instantiated templates are included
7355	    # in the archive.
7356	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
7357	    ;;
7358          *)
7359	    if test "$GXX" = yes; then
7360	      if test "$with_gnu_ld" = no; then
7361	        _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'
7362	      else
7363	        _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'
7364	      fi
7365	    fi
7366	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7367	    ;;
7368        esac
7369        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7370        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7371        _LT_TAGVAR(inherit_rpath, $1)=yes
7372        ;;
7373
7374      linux* | k*bsd*-gnu | kopensolaris*-gnu)
7375        case $cc_basename in
7376          KCC*)
7377	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7378
7379	    # KCC will only create a shared library if the output file
7380	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7381	    # to its proper name (with version) after linking.
7382	    _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'
7383	    _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'
7384	    # Commands to make compiler produce verbose output that lists
7385	    # what "hidden" libraries, object files and flags are used when
7386	    # linking a shared library.
7387	    #
7388	    # There doesn't appear to be a way to prevent this compiler from
7389	    # explicitly linking system object files so we need to strip them
7390	    # from the output so that they don't get included in the library
7391	    # dependencies.
7392	    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"'
7393
7394	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7395	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7396
7397	    # Archives containing C++ object files must be created using
7398	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
7399	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
7400	    ;;
7401	  icpc* | ecpc* )
7402	    # Intel C++
7403	    with_gnu_ld=yes
7404	    # version 8.0 and above of icpc choke on multiply defined symbols
7405	    # if we add $predep_objects and $postdep_objects, however 7.1 and
7406	    # earlier do not add the objects themselves.
7407	    case `$CC -V 2>&1` in
7408	      *"Version 7."*)
7409	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7410		_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'
7411		;;
7412	      *)  # Version 8.0 or newer
7413	        tmp_idyn=
7414	        case $host_cpu in
7415		  ia64*) tmp_idyn=' -i_dynamic';;
7416		esac
7417	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7418		_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'
7419		;;
7420	    esac
7421	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7422	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7423	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7424	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
7425	    ;;
7426          pgCC* | pgcpp*)
7427            # Portland Group C++ compiler
7428	    case `$CC -V` in
7429	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
7430	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
7431		rm -rf $tpldir~
7432		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
7433		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
7434	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
7435		rm -rf $tpldir~
7436		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
7437		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
7438		$RANLIB $oldlib'
7439	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
7440		rm -rf $tpldir~
7441		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7442		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
7443	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
7444		rm -rf $tpldir~
7445		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7446		$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'
7447	      ;;
7448	    *) # Version 6 and above use weak symbols
7449	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
7450	      _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'
7451	      ;;
7452	    esac
7453
7454	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
7455	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7456	    _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'
7457            ;;
7458	  cxx*)
7459	    # Compaq C++
7460	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7461	    _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'
7462
7463	    runpath_var=LD_RUN_PATH
7464	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7465	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7466
7467	    # Commands to make compiler produce verbose output that lists
7468	    # what "hidden" libraries, object files and flags are used when
7469	    # linking a shared library.
7470	    #
7471	    # There doesn't appear to be a way to prevent this compiler from
7472	    # explicitly linking system object files so we need to strip them
7473	    # from the output so that they don't get included in the library
7474	    # dependencies.
7475	    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'
7476	    ;;
7477	  xl* | mpixl* | bgxl*)
7478	    # IBM XL 8.0 on PPC, with GNU ld
7479	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7480	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7481	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7482	    if test "x$supports_anon_versioning" = xyes; then
7483	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7484		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7485		echo "local: *; };" >> $output_objdir/$libname.ver~
7486		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
7487	    fi
7488	    ;;
7489	  *)
7490	    case `$CC -V 2>&1 | sed 5q` in
7491	    *Sun\ C*)
7492	      # Sun C++ 5.9
7493	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7494	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7495	      _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'
7496	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7497	      _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'
7498	      _LT_TAGVAR(compiler_needs_object, $1)=yes
7499
7500	      # Not sure whether something based on
7501	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
7502	      # would be better.
7503	      output_verbose_link_cmd='func_echo_all'
7504
7505	      # Archives containing C++ object files must be created using
7506	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7507	      # necessary to make sure instantiated templates are included
7508	      # in the archive.
7509	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7510	      ;;
7511	    esac
7512	    ;;
7513	esac
7514	;;
7515
7516      lynxos*)
7517        # FIXME: insert proper C++ library support
7518	_LT_TAGVAR(ld_shlibs, $1)=no
7519	;;
7520
7521      m88k*)
7522        # FIXME: insert proper C++ library support
7523        _LT_TAGVAR(ld_shlibs, $1)=no
7524	;;
7525
7526      mvs*)
7527        case $cc_basename in
7528          cxx*)
7529	    # FIXME: insert proper C++ library support
7530	    _LT_TAGVAR(ld_shlibs, $1)=no
7531	    ;;
7532	  *)
7533	    # FIXME: insert proper C++ library support
7534	    _LT_TAGVAR(ld_shlibs, $1)=no
7535	    ;;
7536	esac
7537	;;
7538
7539      netbsd*)
7540        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7541	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
7542	  wlarc=
7543	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7544	  _LT_TAGVAR(hardcode_direct, $1)=yes
7545	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7546	fi
7547	# Workaround some broken pre-1.5 toolchains
7548	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
7549	;;
7550
7551      *nto* | *qnx*)
7552        _LT_TAGVAR(ld_shlibs, $1)=yes
7553	;;
7554
7555      openbsd2*)
7556        # C++ shared libraries are fairly broken
7557	_LT_TAGVAR(ld_shlibs, $1)=no
7558	;;
7559
7560      openbsd*)
7561	if test -f /usr/libexec/ld.so; then
7562	  _LT_TAGVAR(hardcode_direct, $1)=yes
7563	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7564	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7565	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7566	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7567	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
7568	    _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'
7569	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7570	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
7571	  fi
7572	  output_verbose_link_cmd=func_echo_all
7573	else
7574	  _LT_TAGVAR(ld_shlibs, $1)=no
7575	fi
7576	;;
7577
7578      osf3* | osf4* | osf5*)
7579        case $cc_basename in
7580          KCC*)
7581	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7582
7583	    # KCC will only create a shared library if the output file
7584	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7585	    # to its proper name (with version) after linking.
7586	    _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'
7587
7588	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7589	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7590
7591	    # Archives containing C++ object files must be created using
7592	    # the KAI C++ compiler.
7593	    case $host in
7594	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
7595	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
7596	    esac
7597	    ;;
7598          RCC*)
7599	    # Rational C++ 2.4.1
7600	    # FIXME: insert proper C++ library support
7601	    _LT_TAGVAR(ld_shlibs, $1)=no
7602	    ;;
7603          cxx*)
7604	    case $host in
7605	      osf3*)
7606	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7607	        _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'
7608	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7609		;;
7610	      *)
7611	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7612	        _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'
7613	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7614	          echo "-hidden">> $lib.exp~
7615	          $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~
7616	          $RM $lib.exp'
7617	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7618		;;
7619	    esac
7620
7621	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7622
7623	    # Commands to make compiler produce verbose output that lists
7624	    # what "hidden" libraries, object files and flags are used when
7625	    # linking a shared library.
7626	    #
7627	    # There doesn't appear to be a way to prevent this compiler from
7628	    # explicitly linking system object files so we need to strip them
7629	    # from the output so that they don't get included in the library
7630	    # dependencies.
7631	    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"'
7632	    ;;
7633	  *)
7634	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
7635	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7636	      case $host in
7637	        osf3*)
7638	          _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'
7639		  ;;
7640	        *)
7641	          _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'
7642		  ;;
7643	      esac
7644
7645	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7646	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7647
7648	      # Commands to make compiler produce verbose output that lists
7649	      # what "hidden" libraries, object files and flags are used when
7650	      # linking a shared library.
7651	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7652
7653	    else
7654	      # FIXME: insert proper C++ library support
7655	      _LT_TAGVAR(ld_shlibs, $1)=no
7656	    fi
7657	    ;;
7658        esac
7659        ;;
7660
7661      psos*)
7662        # FIXME: insert proper C++ library support
7663        _LT_TAGVAR(ld_shlibs, $1)=no
7664        ;;
7665
7666      sunos4*)
7667        case $cc_basename in
7668          CC*)
7669	    # Sun C++ 4.x
7670	    # FIXME: insert proper C++ library support
7671	    _LT_TAGVAR(ld_shlibs, $1)=no
7672	    ;;
7673          lcc*)
7674	    # Lucid
7675	    # FIXME: insert proper C++ library support
7676	    _LT_TAGVAR(ld_shlibs, $1)=no
7677	    ;;
7678          *)
7679	    # FIXME: insert proper C++ library support
7680	    _LT_TAGVAR(ld_shlibs, $1)=no
7681	    ;;
7682        esac
7683        ;;
7684
7685      solaris*)
7686        case $cc_basename in
7687          CC* | sunCC*)
7688	    # Sun C++ 4.2, 5.x and Centerline C++
7689            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
7690	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7691	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7692	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7693	      $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'
7694
7695	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7696	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7697	    case $host_os in
7698	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7699	      *)
7700		# The compiler driver will combine and reorder linker options,
7701		# but understands `-z linker_flag'.
7702	        # Supported since Solaris 2.6 (maybe 2.5.1?)
7703		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7704	        ;;
7705	    esac
7706	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7707
7708	    output_verbose_link_cmd='func_echo_all'
7709
7710	    # Archives containing C++ object files must be created using
7711	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7712	    # necessary to make sure instantiated templates are included
7713	    # in the archive.
7714	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7715	    ;;
7716          gcx*)
7717	    # Green Hills C++ Compiler
7718	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7719
7720	    # The C++ compiler must be used to create the archive.
7721	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
7722	    ;;
7723          *)
7724	    # GNU C++ compiler with Solaris linker
7725	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
7726	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
7727	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7728	        _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'
7729	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7730		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7731
7732	        # Commands to make compiler produce verbose output that lists
7733	        # what "hidden" libraries, object files and flags are used when
7734	        # linking a shared library.
7735	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7736	      else
7737	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
7738	        # platform.
7739	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7740	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7741		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7742
7743	        # Commands to make compiler produce verbose output that lists
7744	        # what "hidden" libraries, object files and flags are used when
7745	        # linking a shared library.
7746	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7747	      fi
7748
7749	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
7750	      case $host_os in
7751		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7752		*)
7753		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
7754		  ;;
7755	      esac
7756	    fi
7757	    ;;
7758        esac
7759        ;;
7760
7761    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7762      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7763      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7764      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7765      runpath_var='LD_RUN_PATH'
7766
7767      case $cc_basename in
7768        CC*)
7769	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7770	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7771	  ;;
7772	*)
7773	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7774	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7775	  ;;
7776      esac
7777      ;;
7778
7779      sysv5* | sco3.2v5* | sco5v6*)
7780	# Note: We can NOT use -z defs as we might desire, because we do not
7781	# link with -lc, and that would cause any symbols used from libc to
7782	# always be unresolved, which means just about no library would
7783	# ever link correctly.  If we're not using GNU ld we use -z text
7784	# though, which does catch some bad symbols but isn't as heavy-handed
7785	# as -z defs.
7786	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7787	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
7788	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7789	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7790	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
7791	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7792	_LT_TAGVAR(link_all_deplibs, $1)=yes
7793	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
7794	runpath_var='LD_RUN_PATH'
7795
7796	case $cc_basename in
7797          CC*)
7798	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7799	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7800	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7801	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
7802	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7803	      '"$_LT_TAGVAR(reload_cmds, $1)"
7804	    ;;
7805	  *)
7806	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7807	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7808	    ;;
7809	esac
7810      ;;
7811
7812      tandem*)
7813        case $cc_basename in
7814          NCC*)
7815	    # NonStop-UX NCC 3.20
7816	    # FIXME: insert proper C++ library support
7817	    _LT_TAGVAR(ld_shlibs, $1)=no
7818	    ;;
7819          *)
7820	    # FIXME: insert proper C++ library support
7821	    _LT_TAGVAR(ld_shlibs, $1)=no
7822	    ;;
7823        esac
7824        ;;
7825
7826      vxworks*)
7827        # FIXME: insert proper C++ library support
7828        _LT_TAGVAR(ld_shlibs, $1)=no
7829        ;;
7830
7831      *)
7832        # FIXME: insert proper C++ library support
7833        _LT_TAGVAR(ld_shlibs, $1)=no
7834        ;;
7835    esac
7836
7837    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7838    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
7839
7840    _LT_TAGVAR(GCC, $1)="$GXX"
7841    _LT_TAGVAR(LD, $1)="$LD"
7842
7843    ## CAVEAT EMPTOR:
7844    ## There is no encapsulation within the following macros, do not change
7845    ## the running order or otherwise move them around unless you know exactly
7846    ## what you are doing...
7847    _LT_SYS_HIDDEN_LIBDEPS($1)
7848    _LT_COMPILER_PIC($1)
7849    _LT_COMPILER_C_O($1)
7850    _LT_COMPILER_FILE_LOCKS($1)
7851    _LT_LINKER_SHLIBS($1)
7852    _LT_SYS_DYNAMIC_LINKER($1)
7853    _LT_LINKER_HARDCODE_LIBPATH($1)
7854
7855    _LT_CONFIG($1)
7856  fi # test -n "$compiler"
7857
7858  CC=$lt_save_CC
7859  CFLAGS=$lt_save_CFLAGS
7860  LDCXX=$LD
7861  LD=$lt_save_LD
7862  GCC=$lt_save_GCC
7863  with_gnu_ld=$lt_save_with_gnu_ld
7864  lt_cv_path_LDCXX=$lt_cv_path_LD
7865  lt_cv_path_LD=$lt_save_path_LD
7866  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
7867  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
7868fi # test "$_lt_caught_CXX_error" != yes
7869
7870AC_LANG_POP
7871])# _LT_LANG_CXX_CONFIG
7872
7873
7874# _LT_FUNC_STRIPNAME_CNF
7875# ----------------------
7876# func_stripname_cnf prefix suffix name
7877# strip PREFIX and SUFFIX off of NAME.
7878# PREFIX and SUFFIX must not contain globbing or regex special
7879# characters, hashes, percent signs, but SUFFIX may contain a leading
7880# dot (in which case that matches only a dot).
7881#
7882# This function is identical to the (non-XSI) version of func_stripname,
7883# except this one can be used by m4 code that may be executed by configure,
7884# rather than the libtool script.
7885m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
7886AC_REQUIRE([_LT_DECL_SED])
7887AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
7888func_stripname_cnf ()
7889{
7890  case ${2} in
7891  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
7892  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
7893  esac
7894} # func_stripname_cnf
7895])# _LT_FUNC_STRIPNAME_CNF
7896
7897# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
7898# ---------------------------------
7899# Figure out "hidden" library dependencies from verbose
7900# compiler output when linking a shared library.
7901# Parse the compiler output and extract the necessary
7902# objects, libraries and library flags.
7903m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
7904[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7905AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
7906# Dependencies to place before and after the object being linked:
7907_LT_TAGVAR(predep_objects, $1)=
7908_LT_TAGVAR(postdep_objects, $1)=
7909_LT_TAGVAR(predeps, $1)=
7910_LT_TAGVAR(postdeps, $1)=
7911_LT_TAGVAR(compiler_lib_search_path, $1)=
7912
7913dnl we can't use the lt_simple_compile_test_code here,
7914dnl because it contains code intended for an executable,
7915dnl not a library.  It's possible we should let each
7916dnl tag define a new lt_????_link_test_code variable,
7917dnl but it's only used here...
7918m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
7919int a;
7920void foo (void) { a = 0; }
7921_LT_EOF
7922], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
7923class Foo
7924{
7925public:
7926  Foo (void) { a = 0; }
7927private:
7928  int a;
7929};
7930_LT_EOF
7931], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
7932      subroutine foo
7933      implicit none
7934      integer*4 a
7935      a=0
7936      return
7937      end
7938_LT_EOF
7939], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
7940      subroutine foo
7941      implicit none
7942      integer a
7943      a=0
7944      return
7945      end
7946_LT_EOF
7947], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
7948public class foo {
7949  private int a;
7950  public void bar (void) {
7951    a = 0;
7952  }
7953};
7954_LT_EOF
7955], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
7956package foo
7957func foo() {
7958}
7959_LT_EOF
7960])
7961
7962_lt_libdeps_save_CFLAGS=$CFLAGS
7963case "$CC $CFLAGS " in #(
7964*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
7965*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
7966*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
7967esac
7968
7969dnl Parse the compiler output and extract the necessary
7970dnl objects, libraries and library flags.
7971if AC_TRY_EVAL(ac_compile); then
7972  # Parse the compiler output and extract the necessary
7973  # objects, libraries and library flags.
7974
7975  # Sentinel used to keep track of whether or not we are before
7976  # the conftest object file.
7977  pre_test_object_deps_done=no
7978
7979  for p in `eval "$output_verbose_link_cmd"`; do
7980    case ${prev}${p} in
7981
7982    -L* | -R* | -l*)
7983       # Some compilers place space between "-{L,R}" and the path.
7984       # Remove the space.
7985       if test $p = "-L" ||
7986          test $p = "-R"; then
7987	 prev=$p
7988	 continue
7989       fi
7990
7991       # Expand the sysroot to ease extracting the directories later.
7992       if test -z "$prev"; then
7993         case $p in
7994         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
7995         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
7996         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
7997         esac
7998       fi
7999       case $p in
8000       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
8001       esac
8002       if test "$pre_test_object_deps_done" = no; then
8003	 case ${prev} in
8004	 -L | -R)
8005	   # Internal compiler library paths should come after those
8006	   # provided the user.  The postdeps already come after the
8007	   # user supplied libs so there is no need to process them.
8008	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
8009	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
8010	   else
8011	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
8012	   fi
8013	   ;;
8014	 # The "-l" case would never come before the object being
8015	 # linked, so don't bother handling this case.
8016	 esac
8017       else
8018	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
8019	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
8020	 else
8021	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
8022	 fi
8023       fi
8024       prev=
8025       ;;
8026
8027    *.lto.$objext) ;; # Ignore GCC LTO objects
8028    *.$objext)
8029       # This assumes that the test object file only shows up
8030       # once in the compiler output.
8031       if test "$p" = "conftest.$objext"; then
8032	 pre_test_object_deps_done=yes
8033	 continue
8034       fi
8035
8036       if test "$pre_test_object_deps_done" = no; then
8037	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
8038	   _LT_TAGVAR(predep_objects, $1)="$p"
8039	 else
8040	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
8041	 fi
8042       else
8043	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
8044	   _LT_TAGVAR(postdep_objects, $1)="$p"
8045	 else
8046	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
8047	 fi
8048       fi
8049       ;;
8050
8051    *) ;; # Ignore the rest.
8052
8053    esac
8054  done
8055
8056  # Clean up.
8057  rm -f a.out a.exe
8058else
8059  echo "libtool.m4: error: problem compiling $1 test program"
8060fi
8061
8062$RM -f confest.$objext
8063CFLAGS=$_lt_libdeps_save_CFLAGS
8064
8065# PORTME: override above test on systems where it is broken
8066m4_if([$1], [CXX],
8067[case $host_os in
8068interix[[3-9]]*)
8069  # Interix 3.5 installs completely hosed .la files for C++, so rather than
8070  # hack all around it, let's just trust "g++" to DTRT.
8071  _LT_TAGVAR(predep_objects,$1)=
8072  _LT_TAGVAR(postdep_objects,$1)=
8073  _LT_TAGVAR(postdeps,$1)=
8074  ;;
8075
8076linux*)
8077  case `$CC -V 2>&1 | sed 5q` in
8078  *Sun\ C*)
8079    # Sun C++ 5.9
8080
8081    # The more standards-conforming stlport4 library is
8082    # incompatible with the Cstd library. Avoid specifying
8083    # it if it's in CXXFLAGS. Ignore libCrun as
8084    # -library=stlport4 depends on it.
8085    case " $CXX $CXXFLAGS " in
8086    *" -library=stlport4 "*)
8087      solaris_use_stlport4=yes
8088      ;;
8089    esac
8090
8091    if test "$solaris_use_stlport4" != yes; then
8092      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8093    fi
8094    ;;
8095  esac
8096  ;;
8097
8098solaris*)
8099  case $cc_basename in
8100  CC* | sunCC*)
8101    # The more standards-conforming stlport4 library is
8102    # incompatible with the Cstd library. Avoid specifying
8103    # it if it's in CXXFLAGS. Ignore libCrun as
8104    # -library=stlport4 depends on it.
8105    case " $CXX $CXXFLAGS " in
8106    *" -library=stlport4 "*)
8107      solaris_use_stlport4=yes
8108      ;;
8109    esac
8110
8111    # Adding this requires a known-good setup of shared libraries for
8112    # Sun compiler versions before 5.6, else PIC objects from an old
8113    # archive will be linked into the output, leading to subtle bugs.
8114    if test "$solaris_use_stlport4" != yes; then
8115      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8116    fi
8117    ;;
8118  esac
8119  ;;
8120esac
8121])
8122
8123case " $_LT_TAGVAR(postdeps, $1) " in
8124*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
8125esac
8126 _LT_TAGVAR(compiler_lib_search_dirs, $1)=
8127if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
8128 _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
8129fi
8130_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
8131    [The directories searched by this compiler when creating a shared library])
8132_LT_TAGDECL([], [predep_objects], [1],
8133    [Dependencies to place before and after the objects being linked to
8134    create a shared library])
8135_LT_TAGDECL([], [postdep_objects], [1])
8136_LT_TAGDECL([], [predeps], [1])
8137_LT_TAGDECL([], [postdeps], [1])
8138_LT_TAGDECL([], [compiler_lib_search_path], [1],
8139    [The library search path used internally by the compiler when linking
8140    a shared library])
8141])# _LT_SYS_HIDDEN_LIBDEPS
8142
8143
8144# _LT_LANG_F77_CONFIG([TAG])
8145# --------------------------
8146# Ensure that the configuration variables for a Fortran 77 compiler are
8147# suitably defined.  These variables are subsequently used by _LT_CONFIG
8148# to write the compiler configuration to `libtool'.
8149m4_defun([_LT_LANG_F77_CONFIG],
8150[AC_LANG_PUSH(Fortran 77)
8151if test -z "$F77" || test "X$F77" = "Xno"; then
8152  _lt_disable_F77=yes
8153fi
8154
8155_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8156_LT_TAGVAR(allow_undefined_flag, $1)=
8157_LT_TAGVAR(always_export_symbols, $1)=no
8158_LT_TAGVAR(archive_expsym_cmds, $1)=
8159_LT_TAGVAR(export_dynamic_flag_spec, $1)=
8160_LT_TAGVAR(hardcode_direct, $1)=no
8161_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8162_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8163_LT_TAGVAR(hardcode_libdir_separator, $1)=
8164_LT_TAGVAR(hardcode_minus_L, $1)=no
8165_LT_TAGVAR(hardcode_automatic, $1)=no
8166_LT_TAGVAR(inherit_rpath, $1)=no
8167_LT_TAGVAR(module_cmds, $1)=
8168_LT_TAGVAR(module_expsym_cmds, $1)=
8169_LT_TAGVAR(link_all_deplibs, $1)=unknown
8170_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8171_LT_TAGVAR(reload_flag, $1)=$reload_flag
8172_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8173_LT_TAGVAR(no_undefined_flag, $1)=
8174_LT_TAGVAR(whole_archive_flag_spec, $1)=
8175_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8176
8177# Source file extension for f77 test sources.
8178ac_ext=f
8179
8180# Object file extension for compiled f77 test sources.
8181objext=o
8182_LT_TAGVAR(objext, $1)=$objext
8183
8184# No sense in running all these tests if we already determined that
8185# the F77 compiler isn't working.  Some variables (like enable_shared)
8186# are currently assumed to apply to all compilers on this platform,
8187# and will be corrupted by setting them based on a non-working compiler.
8188if test "$_lt_disable_F77" != yes; then
8189  # Code to be used in simple compile tests
8190  lt_simple_compile_test_code="\
8191      subroutine t
8192      return
8193      end
8194"
8195
8196  # Code to be used in simple link tests
8197  lt_simple_link_test_code="\
8198      program t
8199      end
8200"
8201
8202  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8203  _LT_TAG_COMPILER
8204
8205  # save warnings/boilerplate of simple test code
8206  _LT_COMPILER_BOILERPLATE
8207  _LT_LINKER_BOILERPLATE
8208
8209  # Allow CC to be a program name with arguments.
8210  lt_save_CC="$CC"
8211  lt_save_GCC=$GCC
8212  lt_save_CFLAGS=$CFLAGS
8213  CC=${F77-"f77"}
8214  CFLAGS=$FFLAGS
8215  compiler=$CC
8216  _LT_TAGVAR(compiler, $1)=$CC
8217  _LT_CC_BASENAME([$compiler])
8218  GCC=$G77
8219  if test -n "$compiler"; then
8220    AC_MSG_CHECKING([if libtool supports shared libraries])
8221    AC_MSG_RESULT([$can_build_shared])
8222
8223    AC_MSG_CHECKING([whether to build shared libraries])
8224    test "$can_build_shared" = "no" && enable_shared=no
8225
8226    # On AIX, shared libraries and static libraries use the same namespace, and
8227    # are all built from PIC.
8228    case $host_os in
8229      aix3*)
8230        test "$enable_shared" = yes && enable_static=no
8231        if test -n "$RANLIB"; then
8232          archive_cmds="$archive_cmds~\$RANLIB \$lib"
8233          postinstall_cmds='$RANLIB $lib'
8234        fi
8235        ;;
8236      aix[[4-9]]*)
8237	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8238	  test "$enable_shared" = yes && enable_static=no
8239	fi
8240        ;;
8241    esac
8242    AC_MSG_RESULT([$enable_shared])
8243
8244    AC_MSG_CHECKING([whether to build static libraries])
8245    # Make sure either enable_shared or enable_static is yes.
8246    test "$enable_shared" = yes || enable_static=yes
8247    AC_MSG_RESULT([$enable_static])
8248
8249    _LT_TAGVAR(GCC, $1)="$G77"
8250    _LT_TAGVAR(LD, $1)="$LD"
8251
8252    ## CAVEAT EMPTOR:
8253    ## There is no encapsulation within the following macros, do not change
8254    ## the running order or otherwise move them around unless you know exactly
8255    ## what you are doing...
8256    _LT_COMPILER_PIC($1)
8257    _LT_COMPILER_C_O($1)
8258    _LT_COMPILER_FILE_LOCKS($1)
8259    _LT_LINKER_SHLIBS($1)
8260    _LT_SYS_DYNAMIC_LINKER($1)
8261    _LT_LINKER_HARDCODE_LIBPATH($1)
8262
8263    _LT_CONFIG($1)
8264  fi # test -n "$compiler"
8265
8266  GCC=$lt_save_GCC
8267  CC="$lt_save_CC"
8268  CFLAGS="$lt_save_CFLAGS"
8269fi # test "$_lt_disable_F77" != yes
8270
8271AC_LANG_POP
8272])# _LT_LANG_F77_CONFIG
8273
8274
8275# _LT_LANG_FC_CONFIG([TAG])
8276# -------------------------
8277# Ensure that the configuration variables for a Fortran compiler are
8278# suitably defined.  These variables are subsequently used by _LT_CONFIG
8279# to write the compiler configuration to `libtool'.
8280m4_defun([_LT_LANG_FC_CONFIG],
8281[AC_LANG_PUSH(Fortran)
8282
8283if test -z "$FC" || test "X$FC" = "Xno"; then
8284  _lt_disable_FC=yes
8285fi
8286
8287_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8288_LT_TAGVAR(allow_undefined_flag, $1)=
8289_LT_TAGVAR(always_export_symbols, $1)=no
8290_LT_TAGVAR(archive_expsym_cmds, $1)=
8291_LT_TAGVAR(export_dynamic_flag_spec, $1)=
8292_LT_TAGVAR(hardcode_direct, $1)=no
8293_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8294_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8295_LT_TAGVAR(hardcode_libdir_separator, $1)=
8296_LT_TAGVAR(hardcode_minus_L, $1)=no
8297_LT_TAGVAR(hardcode_automatic, $1)=no
8298_LT_TAGVAR(inherit_rpath, $1)=no
8299_LT_TAGVAR(module_cmds, $1)=
8300_LT_TAGVAR(module_expsym_cmds, $1)=
8301_LT_TAGVAR(link_all_deplibs, $1)=unknown
8302_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8303_LT_TAGVAR(reload_flag, $1)=$reload_flag
8304_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8305_LT_TAGVAR(no_undefined_flag, $1)=
8306_LT_TAGVAR(whole_archive_flag_spec, $1)=
8307_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8308
8309# Source file extension for fc test sources.
8310ac_ext=${ac_fc_srcext-f}
8311
8312# Object file extension for compiled fc test sources.
8313objext=o
8314_LT_TAGVAR(objext, $1)=$objext
8315
8316# No sense in running all these tests if we already determined that
8317# the FC compiler isn't working.  Some variables (like enable_shared)
8318# are currently assumed to apply to all compilers on this platform,
8319# and will be corrupted by setting them based on a non-working compiler.
8320if test "$_lt_disable_FC" != yes; then
8321  # Code to be used in simple compile tests
8322  lt_simple_compile_test_code="\
8323      subroutine t
8324      return
8325      end
8326"
8327
8328  # Code to be used in simple link tests
8329  lt_simple_link_test_code="\
8330      program t
8331      end
8332"
8333
8334  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8335  _LT_TAG_COMPILER
8336
8337  # save warnings/boilerplate of simple test code
8338  _LT_COMPILER_BOILERPLATE
8339  _LT_LINKER_BOILERPLATE
8340
8341  # Allow CC to be a program name with arguments.
8342  lt_save_CC="$CC"
8343  lt_save_GCC=$GCC
8344  lt_save_CFLAGS=$CFLAGS
8345  CC=${FC-"f95"}
8346  CFLAGS=$FCFLAGS
8347  compiler=$CC
8348  GCC=$ac_cv_fc_compiler_gnu
8349
8350  _LT_TAGVAR(compiler, $1)=$CC
8351  _LT_CC_BASENAME([$compiler])
8352
8353  if test -n "$compiler"; then
8354    AC_MSG_CHECKING([if libtool supports shared libraries])
8355    AC_MSG_RESULT([$can_build_shared])
8356
8357    AC_MSG_CHECKING([whether to build shared libraries])
8358    test "$can_build_shared" = "no" && enable_shared=no
8359
8360    # On AIX, shared libraries and static libraries use the same namespace, and
8361    # are all built from PIC.
8362    case $host_os in
8363      aix3*)
8364        test "$enable_shared" = yes && enable_static=no
8365        if test -n "$RANLIB"; then
8366          archive_cmds="$archive_cmds~\$RANLIB \$lib"
8367          postinstall_cmds='$RANLIB $lib'
8368        fi
8369        ;;
8370      aix[[4-9]]*)
8371	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8372	  test "$enable_shared" = yes && enable_static=no
8373	fi
8374        ;;
8375    esac
8376    AC_MSG_RESULT([$enable_shared])
8377
8378    AC_MSG_CHECKING([whether to build static libraries])
8379    # Make sure either enable_shared or enable_static is yes.
8380    test "$enable_shared" = yes || enable_static=yes
8381    AC_MSG_RESULT([$enable_static])
8382
8383    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
8384    _LT_TAGVAR(LD, $1)="$LD"
8385
8386    ## CAVEAT EMPTOR:
8387    ## There is no encapsulation within the following macros, do not change
8388    ## the running order or otherwise move them around unless you know exactly
8389    ## what you are doing...
8390    _LT_SYS_HIDDEN_LIBDEPS($1)
8391    _LT_COMPILER_PIC($1)
8392    _LT_COMPILER_C_O($1)
8393    _LT_COMPILER_FILE_LOCKS($1)
8394    _LT_LINKER_SHLIBS($1)
8395    _LT_SYS_DYNAMIC_LINKER($1)
8396    _LT_LINKER_HARDCODE_LIBPATH($1)
8397
8398    _LT_CONFIG($1)
8399  fi # test -n "$compiler"
8400
8401  GCC=$lt_save_GCC
8402  CC=$lt_save_CC
8403  CFLAGS=$lt_save_CFLAGS
8404fi # test "$_lt_disable_FC" != yes
8405
8406AC_LANG_POP
8407])# _LT_LANG_FC_CONFIG
8408
8409
8410# _LT_LANG_GCJ_CONFIG([TAG])
8411# --------------------------
8412# Ensure that the configuration variables for the GNU Java Compiler compiler
8413# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8414# to write the compiler configuration to `libtool'.
8415m4_defun([_LT_LANG_GCJ_CONFIG],
8416[AC_REQUIRE([LT_PROG_GCJ])dnl
8417AC_LANG_SAVE
8418
8419# Source file extension for Java test sources.
8420ac_ext=java
8421
8422# Object file extension for compiled Java test sources.
8423objext=o
8424_LT_TAGVAR(objext, $1)=$objext
8425
8426# Code to be used in simple compile tests
8427lt_simple_compile_test_code="class foo {}"
8428
8429# Code to be used in simple link tests
8430lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
8431
8432# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8433_LT_TAG_COMPILER
8434
8435# save warnings/boilerplate of simple test code
8436_LT_COMPILER_BOILERPLATE
8437_LT_LINKER_BOILERPLATE
8438
8439# Allow CC to be a program name with arguments.
8440lt_save_CC=$CC
8441lt_save_CFLAGS=$CFLAGS
8442lt_save_GCC=$GCC
8443GCC=yes
8444CC=${GCJ-"gcj"}
8445CFLAGS=$GCJFLAGS
8446compiler=$CC
8447_LT_TAGVAR(compiler, $1)=$CC
8448_LT_TAGVAR(LD, $1)="$LD"
8449_LT_CC_BASENAME([$compiler])
8450
8451# GCJ did not exist at the time GCC didn't implicitly link libc in.
8452_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8453
8454_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8455_LT_TAGVAR(reload_flag, $1)=$reload_flag
8456_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8457
8458if test -n "$compiler"; then
8459  _LT_COMPILER_NO_RTTI($1)
8460  _LT_COMPILER_PIC($1)
8461  _LT_COMPILER_C_O($1)
8462  _LT_COMPILER_FILE_LOCKS($1)
8463  _LT_LINKER_SHLIBS($1)
8464  _LT_LINKER_HARDCODE_LIBPATH($1)
8465
8466  _LT_CONFIG($1)
8467fi
8468
8469AC_LANG_RESTORE
8470
8471GCC=$lt_save_GCC
8472CC=$lt_save_CC
8473CFLAGS=$lt_save_CFLAGS
8474])# _LT_LANG_GCJ_CONFIG
8475
8476
8477# _LT_LANG_GO_CONFIG([TAG])
8478# --------------------------
8479# Ensure that the configuration variables for the GNU Go compiler
8480# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8481# to write the compiler configuration to `libtool'.
8482m4_defun([_LT_LANG_GO_CONFIG],
8483[AC_REQUIRE([LT_PROG_GO])dnl
8484AC_LANG_SAVE
8485
8486# Source file extension for Go test sources.
8487ac_ext=go
8488
8489# Object file extension for compiled Go test sources.
8490objext=o
8491_LT_TAGVAR(objext, $1)=$objext
8492
8493# Code to be used in simple compile tests
8494lt_simple_compile_test_code="package main; func main() { }"
8495
8496# Code to be used in simple link tests
8497lt_simple_link_test_code='package main; func main() { }'
8498
8499# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8500_LT_TAG_COMPILER
8501
8502# save warnings/boilerplate of simple test code
8503_LT_COMPILER_BOILERPLATE
8504_LT_LINKER_BOILERPLATE
8505
8506# Allow CC to be a program name with arguments.
8507lt_save_CC=$CC
8508lt_save_CFLAGS=$CFLAGS
8509lt_save_GCC=$GCC
8510GCC=yes
8511CC=${GOC-"gccgo"}
8512CFLAGS=$GOFLAGS
8513compiler=$CC
8514_LT_TAGVAR(compiler, $1)=$CC
8515_LT_TAGVAR(LD, $1)="$LD"
8516_LT_CC_BASENAME([$compiler])
8517
8518# Go did not exist at the time GCC didn't implicitly link libc in.
8519_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8520
8521_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8522_LT_TAGVAR(reload_flag, $1)=$reload_flag
8523_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8524
8525if test -n "$compiler"; then
8526  _LT_COMPILER_NO_RTTI($1)
8527  _LT_COMPILER_PIC($1)
8528  _LT_COMPILER_C_O($1)
8529  _LT_COMPILER_FILE_LOCKS($1)
8530  _LT_LINKER_SHLIBS($1)
8531  _LT_LINKER_HARDCODE_LIBPATH($1)
8532
8533  _LT_CONFIG($1)
8534fi
8535
8536AC_LANG_RESTORE
8537
8538GCC=$lt_save_GCC
8539CC=$lt_save_CC
8540CFLAGS=$lt_save_CFLAGS
8541])# _LT_LANG_GO_CONFIG
8542
8543
8544# _LT_LANG_RC_CONFIG([TAG])
8545# -------------------------
8546# Ensure that the configuration variables for the Windows resource compiler
8547# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8548# to write the compiler configuration to `libtool'.
8549m4_defun([_LT_LANG_RC_CONFIG],
8550[AC_REQUIRE([LT_PROG_RC])dnl
8551AC_LANG_SAVE
8552
8553# Source file extension for RC test sources.
8554ac_ext=rc
8555
8556# Object file extension for compiled RC test sources.
8557objext=o
8558_LT_TAGVAR(objext, $1)=$objext
8559
8560# Code to be used in simple compile tests
8561lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8562
8563# Code to be used in simple link tests
8564lt_simple_link_test_code="$lt_simple_compile_test_code"
8565
8566# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8567_LT_TAG_COMPILER
8568
8569# save warnings/boilerplate of simple test code
8570_LT_COMPILER_BOILERPLATE
8571_LT_LINKER_BOILERPLATE
8572
8573# Allow CC to be a program name with arguments.
8574lt_save_CC="$CC"
8575lt_save_CFLAGS=$CFLAGS
8576lt_save_GCC=$GCC
8577GCC=
8578CC=${RC-"windres"}
8579CFLAGS=
8580compiler=$CC
8581_LT_TAGVAR(compiler, $1)=$CC
8582_LT_CC_BASENAME([$compiler])
8583_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8584
8585if test -n "$compiler"; then
8586  :
8587  _LT_CONFIG($1)
8588fi
8589
8590GCC=$lt_save_GCC
8591AC_LANG_RESTORE
8592CC=$lt_save_CC
8593CFLAGS=$lt_save_CFLAGS
8594])# _LT_LANG_RC_CONFIG
8595
8596
8597# LT_PROG_GCJ
8598# -----------
8599AC_DEFUN([LT_PROG_GCJ],
8600[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8601  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8602    [AC_CHECK_TOOL(GCJ, gcj,)
8603      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
8604      AC_SUBST(GCJFLAGS)])])[]dnl
8605])
8606
8607# Old name:
8608AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
8609dnl aclocal-1.4 backwards compatibility:
8610dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8611
8612
8613# LT_PROG_GO
8614# ----------
8615AC_DEFUN([LT_PROG_GO],
8616[AC_CHECK_TOOL(GOC, gccgo,)
8617])
8618
8619
8620# LT_PROG_RC
8621# ----------
8622AC_DEFUN([LT_PROG_RC],
8623[AC_CHECK_TOOL(RC, windres,)
8624])
8625
8626# Old name:
8627AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
8628dnl aclocal-1.4 backwards compatibility:
8629dnl AC_DEFUN([LT_AC_PROG_RC], [])
8630
8631
8632# _LT_DECL_EGREP
8633# --------------
8634# If we don't have a new enough Autoconf to choose the best grep
8635# available, choose the one first in the user's PATH.
8636m4_defun([_LT_DECL_EGREP],
8637[AC_REQUIRE([AC_PROG_EGREP])dnl
8638AC_REQUIRE([AC_PROG_FGREP])dnl
8639test -z "$GREP" && GREP=grep
8640_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8641_LT_DECL([], [EGREP], [1], [An ERE matcher])
8642_LT_DECL([], [FGREP], [1], [A literal string matcher])
8643dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8644AC_SUBST([GREP])
8645])
8646
8647
8648# _LT_DECL_OBJDUMP
8649# --------------
8650# If we don't have a new enough Autoconf to choose the best objdump
8651# available, choose the one first in the user's PATH.
8652m4_defun([_LT_DECL_OBJDUMP],
8653[AC_CHECK_TOOL(OBJDUMP, objdump, false)
8654test -z "$OBJDUMP" && OBJDUMP=objdump
8655_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
8656AC_SUBST([OBJDUMP])
8657])
8658
8659# _LT_DECL_DLLTOOL
8660# ----------------
8661# Ensure DLLTOOL variable is set.
8662m4_defun([_LT_DECL_DLLTOOL],
8663[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8664test -z "$DLLTOOL" && DLLTOOL=dlltool
8665_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
8666AC_SUBST([DLLTOOL])
8667])
8668
8669# _LT_DECL_SED
8670# ------------
8671# Check for a fully-functional sed program, that truncates
8672# as few characters as possible.  Prefer GNU sed if found.
8673m4_defun([_LT_DECL_SED],
8674[AC_PROG_SED
8675test -z "$SED" && SED=sed
8676Xsed="$SED -e 1s/^X//"
8677_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8678_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8679    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8680])# _LT_DECL_SED
8681
8682m4_ifndef([AC_PROG_SED], [
8683# NOTE: This macro has been submitted for inclusion into   #
8684#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
8685#  a released version of Autoconf we should remove this    #
8686#  macro and use it instead.                               #
8687
8688m4_defun([AC_PROG_SED],
8689[AC_MSG_CHECKING([for a sed that does not truncate output])
8690AC_CACHE_VAL(lt_cv_path_SED,
8691[# Loop through the user's path and test for sed and gsed.
8692# Then use that list of sed's as ones to test for truncation.
8693as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8694for as_dir in $PATH
8695do
8696  IFS=$as_save_IFS
8697  test -z "$as_dir" && as_dir=.
8698  for lt_ac_prog in sed gsed; do
8699    for ac_exec_ext in '' $ac_executable_extensions; do
8700      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8701        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
8702      fi
8703    done
8704  done
8705done
8706IFS=$as_save_IFS
8707lt_ac_max=0
8708lt_ac_count=0
8709# Add /usr/xpg4/bin/sed as it is typically found on Solaris
8710# along with /bin/sed that truncates output.
8711for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8712  test ! -f $lt_ac_sed && continue
8713  cat /dev/null > conftest.in
8714  lt_ac_count=0
8715  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8716  # Check for GNU sed and select it if it is found.
8717  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8718    lt_cv_path_SED=$lt_ac_sed
8719    break
8720  fi
8721  while true; do
8722    cat conftest.in conftest.in >conftest.tmp
8723    mv conftest.tmp conftest.in
8724    cp conftest.in conftest.nl
8725    echo >>conftest.nl
8726    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8727    cmp -s conftest.out conftest.nl || break
8728    # 10000 chars as input seems more than enough
8729    test $lt_ac_count -gt 10 && break
8730    lt_ac_count=`expr $lt_ac_count + 1`
8731    if test $lt_ac_count -gt $lt_ac_max; then
8732      lt_ac_max=$lt_ac_count
8733      lt_cv_path_SED=$lt_ac_sed
8734    fi
8735  done
8736done
8737])
8738SED=$lt_cv_path_SED
8739AC_SUBST([SED])
8740AC_MSG_RESULT([$SED])
8741])#AC_PROG_SED
8742])#m4_ifndef
8743
8744# Old name:
8745AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
8746dnl aclocal-1.4 backwards compatibility:
8747dnl AC_DEFUN([LT_AC_PROG_SED], [])
8748
8749
8750# _LT_CHECK_SHELL_FEATURES
8751# ------------------------
8752# Find out whether the shell is Bourne or XSI compatible,
8753# or has some other useful features.
8754m4_defun([_LT_CHECK_SHELL_FEATURES],
8755[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
8756# Try some XSI features
8757xsi_shell=no
8758( _lt_dummy="a/b/c"
8759  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
8760      = c,a/b,b/c, \
8761    && eval 'test $(( 1 + 1 )) -eq 2 \
8762    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
8763  && xsi_shell=yes
8764AC_MSG_RESULT([$xsi_shell])
8765_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
8766
8767AC_MSG_CHECKING([whether the shell understands "+="])
8768lt_shell_append=no
8769( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
8770    >/dev/null 2>&1 \
8771  && lt_shell_append=yes
8772AC_MSG_RESULT([$lt_shell_append])
8773_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
8774
8775if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8776  lt_unset=unset
8777else
8778  lt_unset=false
8779fi
8780_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8781
8782# test EBCDIC or ASCII
8783case `echo X|tr X '\101'` in
8784 A) # ASCII based system
8785    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8786  lt_SP2NL='tr \040 \012'
8787  lt_NL2SP='tr \015\012 \040\040'
8788  ;;
8789 *) # EBCDIC based system
8790  lt_SP2NL='tr \100 \n'
8791  lt_NL2SP='tr \r\n \100\100'
8792  ;;
8793esac
8794_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8795_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8796])# _LT_CHECK_SHELL_FEATURES
8797
8798
8799# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
8800# ------------------------------------------------------
8801# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
8802# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
8803m4_defun([_LT_PROG_FUNCTION_REPLACE],
8804[dnl {
8805sed -e '/^$1 ()$/,/^} # $1 /c\
8806$1 ()\
8807{\
8808m4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
8809} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
8810  && mv -f "$cfgfile.tmp" "$cfgfile" \
8811    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8812test 0 -eq $? || _lt_function_replace_fail=:
8813])
8814
8815
8816# _LT_PROG_REPLACE_SHELLFNS
8817# -------------------------
8818# Replace existing portable implementations of several shell functions with
8819# equivalent extended shell implementations where those features are available..
8820m4_defun([_LT_PROG_REPLACE_SHELLFNS],
8821[if test x"$xsi_shell" = xyes; then
8822  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
8823    case ${1} in
8824      */*) func_dirname_result="${1%/*}${2}" ;;
8825      *  ) func_dirname_result="${3}" ;;
8826    esac])
8827
8828  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
8829    func_basename_result="${1##*/}"])
8830
8831  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
8832    case ${1} in
8833      */*) func_dirname_result="${1%/*}${2}" ;;
8834      *  ) func_dirname_result="${3}" ;;
8835    esac
8836    func_basename_result="${1##*/}"])
8837
8838  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
8839    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
8840    # positional parameters, so assign one to ordinary parameter first.
8841    func_stripname_result=${3}
8842    func_stripname_result=${func_stripname_result#"${1}"}
8843    func_stripname_result=${func_stripname_result%"${2}"}])
8844
8845  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
8846    func_split_long_opt_name=${1%%=*}
8847    func_split_long_opt_arg=${1#*=}])
8848
8849  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
8850    func_split_short_opt_arg=${1#??}
8851    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
8852
8853  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
8854    case ${1} in
8855      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
8856      *)    func_lo2o_result=${1} ;;
8857    esac])
8858
8859  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
8860
8861  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
8862
8863  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
8864fi
8865
8866if test x"$lt_shell_append" = xyes; then
8867  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
8868
8869  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
8870    func_quote_for_eval "${2}"
8871dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
8872    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
8873
8874  # Save a `func_append' function call where possible by direct use of '+='
8875  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
8876    && mv -f "$cfgfile.tmp" "$cfgfile" \
8877      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8878  test 0 -eq $? || _lt_function_replace_fail=:
8879else
8880  # Save a `func_append' function call even when '+=' is not available
8881  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
8882    && mv -f "$cfgfile.tmp" "$cfgfile" \
8883      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
8884  test 0 -eq $? || _lt_function_replace_fail=:
8885fi
8886
8887if test x"$_lt_function_replace_fail" = x":"; then
8888  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
8889fi
8890])
8891
8892# _LT_PATH_CONVERSION_FUNCTIONS
8893# -----------------------------
8894# Determine which file name conversion functions should be used by
8895# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
8896# for certain cross-compile configurations and native mingw.
8897m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
8898[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8899AC_REQUIRE([AC_CANONICAL_BUILD])dnl
8900AC_MSG_CHECKING([how to convert $build file names to $host format])
8901AC_CACHE_VAL(lt_cv_to_host_file_cmd,
8902[case $host in
8903  *-*-mingw* )
8904    case $build in
8905      *-*-mingw* ) # actually msys
8906        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
8907        ;;
8908      *-*-cygwin* )
8909        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
8910        ;;
8911      * ) # otherwise, assume *nix
8912        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
8913        ;;
8914    esac
8915    ;;
8916  *-*-cygwin* )
8917    case $build in
8918      *-*-mingw* ) # actually msys
8919        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
8920        ;;
8921      *-*-cygwin* )
8922        lt_cv_to_host_file_cmd=func_convert_file_noop
8923        ;;
8924      * ) # otherwise, assume *nix
8925        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
8926        ;;
8927    esac
8928    ;;
8929  * ) # unhandled hosts (and "normal" native builds)
8930    lt_cv_to_host_file_cmd=func_convert_file_noop
8931    ;;
8932esac
8933])
8934to_host_file_cmd=$lt_cv_to_host_file_cmd
8935AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
8936_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
8937         [0], [convert $build file names to $host format])dnl
8938
8939AC_MSG_CHECKING([how to convert $build file names to toolchain format])
8940AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
8941[#assume ordinary cross tools, or native build.
8942lt_cv_to_tool_file_cmd=func_convert_file_noop
8943case $host in
8944  *-*-mingw* )
8945    case $build in
8946      *-*-mingw* ) # actually msys
8947        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
8948        ;;
8949    esac
8950    ;;
8951esac
8952])
8953to_tool_file_cmd=$lt_cv_to_tool_file_cmd
8954AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
8955_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
8956         [0], [convert $build files to toolchain format])dnl
8957])# _LT_PATH_CONVERSION_FUNCTIONS
8958
8959# Helper functions for option handling.                    -*- Autoconf -*-
8960#
8961#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
8962#   Inc.
8963#   Written by Gary V. Vaughan, 2004
8964#
8965# This file is free software; the Free Software Foundation gives
8966# unlimited permission to copy and/or distribute it, with or without
8967# modifications, as long as this notice is preserved.
8968
8969# serial 7 ltoptions.m4
8970
8971# This is to help aclocal find these macros, as it can't see m4_define.
8972AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
8973
8974
8975# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
8976# ------------------------------------------
8977m4_define([_LT_MANGLE_OPTION],
8978[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
8979
8980
8981# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
8982# ---------------------------------------
8983# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
8984# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
8985# saved as a flag.
8986m4_define([_LT_SET_OPTION],
8987[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
8988m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
8989        _LT_MANGLE_DEFUN([$1], [$2]),
8990    [m4_warning([Unknown $1 option `$2'])])[]dnl
8991])
8992
8993
8994# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
8995# ------------------------------------------------------------
8996# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
8997m4_define([_LT_IF_OPTION],
8998[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
8999
9000
9001# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
9002# -------------------------------------------------------
9003# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
9004# are set.
9005m4_define([_LT_UNLESS_OPTIONS],
9006[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9007	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
9008		      [m4_define([$0_found])])])[]dnl
9009m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
9010])[]dnl
9011])
9012
9013
9014# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
9015# ----------------------------------------
9016# OPTION-LIST is a space-separated list of Libtool options associated
9017# with MACRO-NAME.  If any OPTION has a matching handler declared with
9018# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
9019# the unknown option and exit.
9020m4_defun([_LT_SET_OPTIONS],
9021[# Set options
9022m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9023    [_LT_SET_OPTION([$1], _LT_Option)])
9024
9025m4_if([$1],[LT_INIT],[
9026  dnl
9027  dnl Simply set some default values (i.e off) if boolean options were not
9028  dnl specified:
9029  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
9030  ])
9031  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
9032  ])
9033  dnl
9034  dnl If no reference was made to various pairs of opposing options, then
9035  dnl we run the default mode handler for the pair.  For example, if neither
9036  dnl `shared' nor `disable-shared' was passed, we enable building of shared
9037  dnl archives by default:
9038  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
9039  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
9040  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
9041  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
9042  		   [_LT_ENABLE_FAST_INSTALL])
9043  ])
9044])# _LT_SET_OPTIONS
9045
9046
9047
9048# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
9049# -----------------------------------------
9050m4_define([_LT_MANGLE_DEFUN],
9051[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
9052
9053
9054# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
9055# -----------------------------------------------
9056m4_define([LT_OPTION_DEFINE],
9057[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
9058])# LT_OPTION_DEFINE
9059
9060
9061# dlopen
9062# ------
9063LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
9064])
9065
9066AU_DEFUN([AC_LIBTOOL_DLOPEN],
9067[_LT_SET_OPTION([LT_INIT], [dlopen])
9068AC_DIAGNOSE([obsolete],
9069[$0: Remove this warning and the call to _LT_SET_OPTION when you
9070put the `dlopen' option into LT_INIT's first parameter.])
9071])
9072
9073dnl aclocal-1.4 backwards compatibility:
9074dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
9075
9076
9077# win32-dll
9078# ---------
9079# Declare package support for building win32 dll's.
9080LT_OPTION_DEFINE([LT_INIT], [win32-dll],
9081[enable_win32_dll=yes
9082
9083case $host in
9084*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
9085  AC_CHECK_TOOL(AS, as, false)
9086  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
9087  AC_CHECK_TOOL(OBJDUMP, objdump, false)
9088  ;;
9089esac
9090
9091test -z "$AS" && AS=as
9092_LT_DECL([], [AS],      [1], [Assembler program])dnl
9093
9094test -z "$DLLTOOL" && DLLTOOL=dlltool
9095_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
9096
9097test -z "$OBJDUMP" && OBJDUMP=objdump
9098_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
9099])# win32-dll
9100
9101AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
9102[AC_REQUIRE([AC_CANONICAL_HOST])dnl
9103_LT_SET_OPTION([LT_INIT], [win32-dll])
9104AC_DIAGNOSE([obsolete],
9105[$0: Remove this warning and the call to _LT_SET_OPTION when you
9106put the `win32-dll' option into LT_INIT's first parameter.])
9107])
9108
9109dnl aclocal-1.4 backwards compatibility:
9110dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
9111
9112
9113# _LT_ENABLE_SHARED([DEFAULT])
9114# ----------------------------
9115# implement the --enable-shared flag, and supports the `shared' and
9116# `disable-shared' LT_INIT options.
9117# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9118m4_define([_LT_ENABLE_SHARED],
9119[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
9120AC_ARG_ENABLE([shared],
9121    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
9122	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
9123    [p=${PACKAGE-default}
9124    case $enableval in
9125    yes) enable_shared=yes ;;
9126    no) enable_shared=no ;;
9127    *)
9128      enable_shared=no
9129      # Look at the argument we got.  We use all the common list separators.
9130      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9131      for pkg in $enableval; do
9132	IFS="$lt_save_ifs"
9133	if test "X$pkg" = "X$p"; then
9134	  enable_shared=yes
9135	fi
9136      done
9137      IFS="$lt_save_ifs"
9138      ;;
9139    esac],
9140    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
9141
9142    _LT_DECL([build_libtool_libs], [enable_shared], [0],
9143	[Whether or not to build shared libraries])
9144])# _LT_ENABLE_SHARED
9145
9146LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
9147LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
9148
9149# Old names:
9150AC_DEFUN([AC_ENABLE_SHARED],
9151[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
9152])
9153
9154AC_DEFUN([AC_DISABLE_SHARED],
9155[_LT_SET_OPTION([LT_INIT], [disable-shared])
9156])
9157
9158AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
9159AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
9160
9161dnl aclocal-1.4 backwards compatibility:
9162dnl AC_DEFUN([AM_ENABLE_SHARED], [])
9163dnl AC_DEFUN([AM_DISABLE_SHARED], [])
9164
9165
9166
9167# _LT_ENABLE_STATIC([DEFAULT])
9168# ----------------------------
9169# implement the --enable-static flag, and support the `static' and
9170# `disable-static' LT_INIT options.
9171# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9172m4_define([_LT_ENABLE_STATIC],
9173[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
9174AC_ARG_ENABLE([static],
9175    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
9176	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
9177    [p=${PACKAGE-default}
9178    case $enableval in
9179    yes) enable_static=yes ;;
9180    no) enable_static=no ;;
9181    *)
9182     enable_static=no
9183      # Look at the argument we got.  We use all the common list separators.
9184      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9185      for pkg in $enableval; do
9186	IFS="$lt_save_ifs"
9187	if test "X$pkg" = "X$p"; then
9188	  enable_static=yes
9189	fi
9190      done
9191      IFS="$lt_save_ifs"
9192      ;;
9193    esac],
9194    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
9195
9196    _LT_DECL([build_old_libs], [enable_static], [0],
9197	[Whether or not to build static libraries])
9198])# _LT_ENABLE_STATIC
9199
9200LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
9201LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
9202
9203# Old names:
9204AC_DEFUN([AC_ENABLE_STATIC],
9205[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
9206])
9207
9208AC_DEFUN([AC_DISABLE_STATIC],
9209[_LT_SET_OPTION([LT_INIT], [disable-static])
9210])
9211
9212AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
9213AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
9214
9215dnl aclocal-1.4 backwards compatibility:
9216dnl AC_DEFUN([AM_ENABLE_STATIC], [])
9217dnl AC_DEFUN([AM_DISABLE_STATIC], [])
9218
9219
9220
9221# _LT_ENABLE_FAST_INSTALL([DEFAULT])
9222# ----------------------------------
9223# implement the --enable-fast-install flag, and support the `fast-install'
9224# and `disable-fast-install' LT_INIT options.
9225# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9226m4_define([_LT_ENABLE_FAST_INSTALL],
9227[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
9228AC_ARG_ENABLE([fast-install],
9229    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
9230    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
9231    [p=${PACKAGE-default}
9232    case $enableval in
9233    yes) enable_fast_install=yes ;;
9234    no) enable_fast_install=no ;;
9235    *)
9236      enable_fast_install=no
9237      # Look at the argument we got.  We use all the common list separators.
9238      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9239      for pkg in $enableval; do
9240	IFS="$lt_save_ifs"
9241	if test "X$pkg" = "X$p"; then
9242	  enable_fast_install=yes
9243	fi
9244      done
9245      IFS="$lt_save_ifs"
9246      ;;
9247    esac],
9248    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
9249
9250_LT_DECL([fast_install], [enable_fast_install], [0],
9251	 [Whether or not to optimize for fast installation])dnl
9252])# _LT_ENABLE_FAST_INSTALL
9253
9254LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
9255LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
9256
9257# Old names:
9258AU_DEFUN([AC_ENABLE_FAST_INSTALL],
9259[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
9260AC_DIAGNOSE([obsolete],
9261[$0: Remove this warning and the call to _LT_SET_OPTION when you put
9262the `fast-install' option into LT_INIT's first parameter.])
9263])
9264
9265AU_DEFUN([AC_DISABLE_FAST_INSTALL],
9266[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
9267AC_DIAGNOSE([obsolete],
9268[$0: Remove this warning and the call to _LT_SET_OPTION when you put
9269the `disable-fast-install' option into LT_INIT's first parameter.])
9270])
9271
9272dnl aclocal-1.4 backwards compatibility:
9273dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
9274dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
9275
9276
9277# _LT_WITH_PIC([MODE])
9278# --------------------
9279# implement the --with-pic flag, and support the `pic-only' and `no-pic'
9280# LT_INIT options.
9281# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
9282m4_define([_LT_WITH_PIC],
9283[AC_ARG_WITH([pic],
9284    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
9285	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
9286    [lt_p=${PACKAGE-default}
9287    case $withval in
9288    yes|no) pic_mode=$withval ;;
9289    *)
9290      pic_mode=default
9291      # Look at the argument we got.  We use all the common list separators.
9292      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9293      for lt_pkg in $withval; do
9294	IFS="$lt_save_ifs"
9295	if test "X$lt_pkg" = "X$lt_p"; then
9296	  pic_mode=yes
9297	fi
9298      done
9299      IFS="$lt_save_ifs"
9300      ;;
9301    esac],
9302    [pic_mode=default])
9303
9304test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
9305
9306_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
9307])# _LT_WITH_PIC
9308
9309LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
9310LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
9311
9312# Old name:
9313AU_DEFUN([AC_LIBTOOL_PICMODE],
9314[_LT_SET_OPTION([LT_INIT], [pic-only])
9315AC_DIAGNOSE([obsolete],
9316[$0: Remove this warning and the call to _LT_SET_OPTION when you
9317put the `pic-only' option into LT_INIT's first parameter.])
9318])
9319
9320dnl aclocal-1.4 backwards compatibility:
9321dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
9322
9323
9324m4_define([_LTDL_MODE], [])
9325LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
9326		 [m4_define([_LTDL_MODE], [nonrecursive])])
9327LT_OPTION_DEFINE([LTDL_INIT], [recursive],
9328		 [m4_define([_LTDL_MODE], [recursive])])
9329LT_OPTION_DEFINE([LTDL_INIT], [subproject],
9330		 [m4_define([_LTDL_MODE], [subproject])])
9331
9332m4_define([_LTDL_TYPE], [])
9333LT_OPTION_DEFINE([LTDL_INIT], [installable],
9334		 [m4_define([_LTDL_TYPE], [installable])])
9335LT_OPTION_DEFINE([LTDL_INIT], [convenience],
9336		 [m4_define([_LTDL_TYPE], [convenience])])
9337
9338# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
9339#
9340# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
9341# Written by Gary V. Vaughan, 2004
9342#
9343# This file is free software; the Free Software Foundation gives
9344# unlimited permission to copy and/or distribute it, with or without
9345# modifications, as long as this notice is preserved.
9346
9347# serial 6 ltsugar.m4
9348
9349# This is to help aclocal find these macros, as it can't see m4_define.
9350AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
9351
9352
9353# lt_join(SEP, ARG1, [ARG2...])
9354# -----------------------------
9355# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
9356# associated separator.
9357# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
9358# versions in m4sugar had bugs.
9359m4_define([lt_join],
9360[m4_if([$#], [1], [],
9361       [$#], [2], [[$2]],
9362       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
9363m4_define([_lt_join],
9364[m4_if([$#$2], [2], [],
9365       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
9366
9367
9368# lt_car(LIST)
9369# lt_cdr(LIST)
9370# ------------
9371# Manipulate m4 lists.
9372# These macros are necessary as long as will still need to support
9373# Autoconf-2.59 which quotes differently.
9374m4_define([lt_car], [[$1]])
9375m4_define([lt_cdr],
9376[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
9377       [$#], 1, [],
9378       [m4_dquote(m4_shift($@))])])
9379m4_define([lt_unquote], $1)
9380
9381
9382# lt_append(MACRO-NAME, STRING, [SEPARATOR])
9383# ------------------------------------------
9384# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
9385# Note that neither SEPARATOR nor STRING are expanded; they are appended
9386# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
9387# No SEPARATOR is output if MACRO-NAME was previously undefined (different
9388# than defined and empty).
9389#
9390# This macro is needed until we can rely on Autoconf 2.62, since earlier
9391# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
9392m4_define([lt_append],
9393[m4_define([$1],
9394	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
9395
9396
9397
9398# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
9399# ----------------------------------------------------------
9400# Produce a SEP delimited list of all paired combinations of elements of
9401# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
9402# has the form PREFIXmINFIXSUFFIXn.
9403# Needed until we can rely on m4_combine added in Autoconf 2.62.
9404m4_define([lt_combine],
9405[m4_if(m4_eval([$# > 3]), [1],
9406       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
9407[[m4_foreach([_Lt_prefix], [$2],
9408	     [m4_foreach([_Lt_suffix],
9409		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
9410	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
9411
9412
9413# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
9414# -----------------------------------------------------------------------
9415# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
9416# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
9417m4_define([lt_if_append_uniq],
9418[m4_ifdef([$1],
9419	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
9420		 [lt_append([$1], [$2], [$3])$4],
9421		 [$5])],
9422	  [lt_append([$1], [$2], [$3])$4])])
9423
9424
9425# lt_dict_add(DICT, KEY, VALUE)
9426# -----------------------------
9427m4_define([lt_dict_add],
9428[m4_define([$1($2)], [$3])])
9429
9430
9431# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
9432# --------------------------------------------
9433m4_define([lt_dict_add_subkey],
9434[m4_define([$1($2:$3)], [$4])])
9435
9436
9437# lt_dict_fetch(DICT, KEY, [SUBKEY])
9438# ----------------------------------
9439m4_define([lt_dict_fetch],
9440[m4_ifval([$3],
9441	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
9442    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
9443
9444
9445# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
9446# -----------------------------------------------------------------
9447m4_define([lt_if_dict_fetch],
9448[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
9449	[$5],
9450    [$6])])
9451
9452
9453# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
9454# --------------------------------------------------------------
9455m4_define([lt_dict_filter],
9456[m4_if([$5], [], [],
9457  [lt_join(m4_quote(m4_default([$4], [[, ]])),
9458           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
9459		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
9460])
9461
9462# ltversion.m4 -- version numbers			-*- Autoconf -*-
9463#
9464#   Copyright (C) 2004 Free Software Foundation, Inc.
9465#   Written by Scott James Remnant, 2004
9466#
9467# This file is free software; the Free Software Foundation gives
9468# unlimited permission to copy and/or distribute it, with or without
9469# modifications, as long as this notice is preserved.
9470
9471# @configure_input@
9472
9473# serial 3337 ltversion.m4
9474# This file is part of GNU Libtool
9475
9476m4_define([LT_PACKAGE_VERSION], [2.4.2])
9477m4_define([LT_PACKAGE_REVISION], [1.3337])
9478
9479AC_DEFUN([LTVERSION_VERSION],
9480[macro_version='2.4.2'
9481macro_revision='1.3337'
9482_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
9483_LT_DECL(, macro_revision, 0)
9484])
9485
9486# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
9487#
9488#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
9489#   Written by Scott James Remnant, 2004.
9490#
9491# This file is free software; the Free Software Foundation gives
9492# unlimited permission to copy and/or distribute it, with or without
9493# modifications, as long as this notice is preserved.
9494
9495# serial 5 lt~obsolete.m4
9496
9497# These exist entirely to fool aclocal when bootstrapping libtool.
9498#
9499# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
9500# which have later been changed to m4_define as they aren't part of the
9501# exported API, or moved to Autoconf or Automake where they belong.
9502#
9503# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
9504# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
9505# using a macro with the same name in our local m4/libtool.m4 it'll
9506# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
9507# and doesn't know about Autoconf macros at all.)
9508#
9509# So we provide this file, which has a silly filename so it's always
9510# included after everything else.  This provides aclocal with the
9511# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
9512# because those macros already exist, or will be overwritten later.
9513# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
9514#
9515# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
9516# Yes, that means every name once taken will need to remain here until
9517# we give up compatibility with versions before 1.7, at which point
9518# we need to keep only those names which we still refer to.
9519
9520# This is to help aclocal find these macros, as it can't see m4_define.
9521AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
9522
9523m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
9524m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
9525m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
9526m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
9527m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
9528m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
9529m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
9530m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
9531m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
9532m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
9533m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
9534m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
9535m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
9536m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
9537m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
9538m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
9539m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
9540m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
9541m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
9542m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
9543m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
9544m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
9545m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
9546m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
9547m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
9548m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
9549m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
9550m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
9551m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
9552m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
9553m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
9554m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
9555m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
9556m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
9557m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
9558m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
9559m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
9560m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
9561m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
9562m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
9563m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
9564m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
9565m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
9566m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
9567m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
9568m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
9569m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
9570m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
9571m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
9572m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
9573m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
9574m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
9575m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
9576m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
9577m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
9578m4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
9579m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
9580m4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
9581m4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
9582m4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
9583m4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
9584
9585# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
9586# 
9587# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
9588#
9589# This program is free software; you can redistribute it and/or modify
9590# it under the terms of the GNU General Public License as published by
9591# the Free Software Foundation; either version 2 of the License, or
9592# (at your option) any later version.
9593#
9594# This program is distributed in the hope that it will be useful, but
9595# WITHOUT ANY WARRANTY; without even the implied warranty of
9596# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9597# General Public License for more details.
9598#
9599# You should have received a copy of the GNU General Public License
9600# along with this program; if not, write to the Free Software
9601# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
9602#
9603# As a special exception to the GNU General Public License, if you
9604# distribute this file as part of a program that contains a
9605# configuration script generated by Autoconf, you may include it under
9606# the same distribution terms that you use for the rest of that program.
9607
9608# PKG_PROG_PKG_CONFIG([MIN-VERSION])
9609# ----------------------------------
9610AC_DEFUN([PKG_PROG_PKG_CONFIG],
9611[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
9612m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
9613AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
9614if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
9615	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
9616fi
9617if test -n "$PKG_CONFIG"; then
9618	_pkg_min_version=m4_default([$1], [0.9.0])
9619	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
9620	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
9621		AC_MSG_RESULT([yes])
9622	else
9623		AC_MSG_RESULT([no])
9624		PKG_CONFIG=""
9625	fi
9626		
9627fi[]dnl
9628])# PKG_PROG_PKG_CONFIG
9629
9630# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9631#
9632# Check to see whether a particular set of modules exists.  Similar
9633# to PKG_CHECK_MODULES(), but does not set variables or print errors.
9634#
9635#
9636# Similar to PKG_CHECK_MODULES, make sure that the first instance of
9637# this or PKG_CHECK_MODULES is called, or make sure to call
9638# PKG_CHECK_EXISTS manually
9639# --------------------------------------------------------------
9640AC_DEFUN([PKG_CHECK_EXISTS],
9641[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9642if test -n "$PKG_CONFIG" && \
9643    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
9644  m4_ifval([$2], [$2], [:])
9645m4_ifvaln([$3], [else
9646  $3])dnl
9647fi])
9648
9649
9650# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
9651# ---------------------------------------------
9652m4_define([_PKG_CONFIG],
9653[if test -n "$$1"; then
9654    pkg_cv_[]$1="$$1"
9655 elif test -n "$PKG_CONFIG"; then
9656    PKG_CHECK_EXISTS([$3],
9657                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
9658		     [pkg_failed=yes])
9659 else
9660    pkg_failed=untried
9661fi[]dnl
9662])# _PKG_CONFIG
9663
9664# _PKG_SHORT_ERRORS_SUPPORTED
9665# -----------------------------
9666AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
9667[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9668if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
9669        _pkg_short_errors_supported=yes
9670else
9671        _pkg_short_errors_supported=no
9672fi[]dnl
9673])# _PKG_SHORT_ERRORS_SUPPORTED
9674
9675
9676# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
9677# [ACTION-IF-NOT-FOUND])
9678#
9679#
9680# Note that if there is a possibility the first call to
9681# PKG_CHECK_MODULES might not happen, you should be sure to include an
9682# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
9683#
9684#
9685# --------------------------------------------------------------
9686AC_DEFUN([PKG_CHECK_MODULES],
9687[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9688AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
9689AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
9690
9691pkg_failed=no
9692AC_MSG_CHECKING([for $1])
9693
9694_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
9695_PKG_CONFIG([$1][_LIBS], [libs], [$2])
9696
9697m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
9698and $1[]_LIBS to avoid the need to call pkg-config.
9699See the pkg-config man page for more details.])
9700
9701if test $pkg_failed = yes; then
9702        _PKG_SHORT_ERRORS_SUPPORTED
9703        if test $_pkg_short_errors_supported = yes; then
9704	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
9705        else 
9706	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
9707        fi
9708	# Put the nasty error message in config.log where it belongs
9709	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
9710
9711	ifelse([$4], , [AC_MSG_ERROR(dnl
9712[Package requirements ($2) were not met:
9713
9714$$1_PKG_ERRORS
9715
9716Consider adjusting the PKG_CONFIG_PATH environment variable if you
9717installed software in a non-standard prefix.
9718
9719_PKG_TEXT
9720])],
9721		[AC_MSG_RESULT([no])
9722                $4])
9723elif test $pkg_failed = untried; then
9724	ifelse([$4], , [AC_MSG_FAILURE(dnl
9725[The pkg-config script could not be found or is too old.  Make sure it
9726is in your PATH or set the PKG_CONFIG environment variable to the full
9727path to pkg-config.
9728
9729_PKG_TEXT
9730
9731To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
9732		[$4])
9733else
9734	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
9735	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
9736        AC_MSG_RESULT([yes])
9737	ifelse([$3], , :, [$3])
9738fi[]dnl
9739])# PKG_CHECK_MODULES
9740
9741dnl fontutil.m4.  Generated from fontutil.m4.in by configure.
9742dnl
9743dnl This file comes from X.Org's font-util 1.3.0
9744dnl
9745dnl Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
9746dnl
9747dnl Permission is hereby granted, free of charge, to any person obtaining a
9748dnl copy of this software and associated documentation files (the "Software"),
9749dnl to deal in the Software without restriction, including without limitation
9750dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
9751dnl and/or sell copies of the Software, and to permit persons to whom the
9752dnl Software is furnished to do so, subject to the following conditions:
9753dnl
9754dnl The above copyright notice and this permission notice (including the next
9755dnl paragraph) shall be included in all copies or substantial portions of the
9756dnl Software.
9757dnl
9758dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9759dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9760dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
9761dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9762dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9763dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
9764dnl DEALINGS IN THE SOFTWARE.
9765dnl
9766dnl --------------------------------------------------------------------
9767dnl
9768dnl Copyright 2005 Red Hat, Inc
9769dnl
9770dnl Permission to use, copy, modify, distribute, and sell this software and its
9771dnl documentation for any purpose is hereby granted without fee, provided that
9772dnl the above copyright notice appear in all copies and that both that
9773dnl copyright notice and this permission notice appear in supporting
9774dnl documentation.
9775dnl
9776dnl The above copyright notice and this permission notice shall be included
9777dnl in all copies or substantial portions of the Software.
9778dnl
9779dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
9780dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9781dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
9782dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
9783dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
9784dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
9785dnl OTHER DEALINGS IN THE SOFTWARE.
9786dnl
9787dnl Except as contained in this notice, the name of the copyright holders shall
9788dnl not be used in advertising or otherwise to promote the sale, use or
9789dnl other dealings in this Software without prior written authorization
9790dnl from the copyright holders.
9791
9792# XORG_FONT_MACROS_VERSION(required-version)
9793# ------------------------------------------
9794# Minimum version: 1.1.0
9795#
9796# If you're using a macro added in Version 1.1 or newer, include this in
9797# your configure.ac with the minimum required version, such as:
9798# XORG_FONT_MACROS_VERSION(1.1)
9799#
9800# To ensure that this macro is defined, also add:
9801# m4_ifndef([XORG_FONT_MACROS_VERSION],
9802#     [m4_fatal([must install X.Org font-util 1.1 or later before running autoconf/autogen])])
9803#
9804#
9805# See the "minimum version" comment for each macro you use to see what
9806# version you require.
9807m4_defun([XORG_FONT_MACROS_VERSION],[
9808m4_define([vers_have], [1.3.0])
9809m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9810m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9811m4_if(m4_cmp(maj_have, maj_needed), 0,,
9812    [m4_fatal([font-util major version ]maj_needed[ is required but ]vers_have[ found])])
9813m4_if(m4_version_compare(vers_have, [$1]), -1,
9814    [m4_fatal([font-util version $1 or higher is required but ]vers_have[ found])])
9815m4_undefine([vers_have])
9816m4_undefine([maj_have])
9817m4_undefine([maj_needed])
9818]) # XORG_FONT_MACROS_VERSION
9819
9820# XORG_FONT_CHECK_{maps}()
9821# ------------------------
9822# Minimum version: 1.0.0
9823# These macros add --enable/disable-{maps} where {maps} are ISO8859-*,
9824# JISX0201 or KOI8_R.  By default, they are all enabled.
9825
9826AC_DEFUN([XORG_FONT_CHECK_ISO8859_1], [XORG_FONT_CHECK_ENCODING(ISO8859-1)])
9827AC_DEFUN([XORG_FONT_CHECK_ISO8859_2], [XORG_FONT_CHECK_ENCODING(ISO8859-2)])
9828AC_DEFUN([XORG_FONT_CHECK_ISO8859_3], [XORG_FONT_CHECK_ENCODING(ISO8859-3)])
9829AC_DEFUN([XORG_FONT_CHECK_ISO8859_4], [XORG_FONT_CHECK_ENCODING(ISO8859-4)])
9830AC_DEFUN([XORG_FONT_CHECK_ISO8859_5], [XORG_FONT_CHECK_ENCODING(ISO8859-5)])
9831AC_DEFUN([XORG_FONT_CHECK_ISO8859_6], [XORG_FONT_CHECK_ENCODING(ISO8859-6)])
9832AC_DEFUN([XORG_FONT_CHECK_ISO8859_7], [XORG_FONT_CHECK_ENCODING(ISO8859-7)])
9833AC_DEFUN([XORG_FONT_CHECK_ISO8859_8], [XORG_FONT_CHECK_ENCODING(ISO8859-8)])
9834AC_DEFUN([XORG_FONT_CHECK_ISO8859_9], [XORG_FONT_CHECK_ENCODING(ISO8859-9)])
9835AC_DEFUN([XORG_FONT_CHECK_ISO8859_10],[XORG_FONT_CHECK_ENCODING(ISO8859-10)])
9836AC_DEFUN([XORG_FONT_CHECK_ISO8859_11],[XORG_FONT_CHECK_ENCODING(ISO8859-11)])
9837AC_DEFUN([XORG_FONT_CHECK_ISO8859_12],[XORG_FONT_CHECK_ENCODING(ISO8859-12)])
9838AC_DEFUN([XORG_FONT_CHECK_ISO8859_13],[XORG_FONT_CHECK_ENCODING(ISO8859-13)])
9839AC_DEFUN([XORG_FONT_CHECK_ISO8859_14],[XORG_FONT_CHECK_ENCODING(ISO8859-14)])
9840AC_DEFUN([XORG_FONT_CHECK_ISO8859_15],[XORG_FONT_CHECK_ENCODING(ISO8859-15)])
9841AC_DEFUN([XORG_FONT_CHECK_ISO8859_16],[XORG_FONT_CHECK_ENCODING(ISO8859-16)])
9842AC_DEFUN([XORG_FONT_CHECK_JISX0201],  [XORG_FONT_CHECK_ENCODING(JISX0201)])
9843AC_DEFUN([XORG_FONT_CHECK_KOI8_R],    [XORG_FONT_CHECK_ENCODING(KOI8-R)])
9844
9845# XORG_FONT_CHECK_ENCODING(encoding)
9846# ----------------------------------
9847# Minimum version: 1.1.0
9848# This macro adds --enable/disable-<encoding>, enabled by default.
9849# It replaced individual copies of this code in the above macros in 1.1.
9850# Currently assumes encoding names will be all upper-case - add m4_toupper
9851# calls if this is not true in the future.
9852
9853AC_DEFUN([XORG_FONT_CHECK_ENCODING],[
9854	AC_ARG_ENABLE(m4_tolower($1),
9855		AS_HELP_STRING(m4_join([-], [--disable], m4_tolower($1)),
9856				[Build $1 fonts (default: yes)]),
9857		[AS_TR_SH($1)=$enableval])
9858	AC_MSG_CHECKING([whether to build $1 fonts])
9859	AC_MSG_RESULT($[AS_TR_SH($1)])
9860	AM_CONDITIONAL(AS_TR_SH($1), [test "x$AS_TR_SH($1)" = xyes])
9861]) # XORG_FONT_CHECK_ENCODING
9862
9863# XORG_FONT_CHECK_ENCODING_LIST(encoding1 encoding2....)
9864# -----------------------------------------------------
9865# Minimum version: 1.1.0
9866# Call XORG_FONT_CHECK_ENCODING for multiple encodings at once.
9867# Add a shorthand --enable/disable-all-encodings option.
9868
9869AC_DEFUN([XORG_FONT_CHECK_ENCODING_LIST],[
9870	AC_ARG_ENABLE([all-encodings],
9871		AS_HELP_STRING([--disable-all-encodings],
9872				[Disable building of all font encodings]),
9873		[m4_foreach_w([enc], [$1], [
9874			AS_TR_SH(enc)=$enableval
9875		])],
9876		[m4_foreach_w([enc], [$1], [
9877			AS_TR_SH(enc)=yes
9878		])])
9879	m4_foreach_w([enc], [$1], [XORG_FONT_CHECK_ENCODING(enc)])
9880]) # XORG_FONT_CHECK_ENCODING_LIST
9881
9882# XORG_FONT_REQUIRED_PROG(VARNAME, progname)
9883# ------------------------------------------
9884# Minimum version: 1.1.0
9885#
9886# Simple wrapper around AC_PATH_PROG that errors if not found
9887#
9888
9889AC_DEFUN([XORG_FONT_REQUIRED_PROG],[
9890	AC_PATH_PROG($1, $2)
9891	if test x"$$1" = x; then
9892		AC_MSG_ERROR([$2 is required to build $PACKAGE_NAME.])
9893	fi
9894])
9895
9896
9897# XORG_FONT_FCCACHE()
9898# -------------------
9899# Minimum version: 1.1.0
9900#
9901# Set FCCACHE to path to fc-cache (fontconfig cache builder) if found
9902# Set RUN_FCCACHE to a rule suitable for substituting into a makefile
9903# to run fc-cache if found and not installing to $DESTDIR and not
9904# cross-compiling
9905#
9906# fc-cache is optional, not required, and should be skipped when making
9907# packages (installing to $DESTDIR) or cross-compiling
9908#
9909AC_DEFUN([XORG_FONT_FCCACHE],[
9910	AC_PATH_PROG(FCCACHE, fc-cache)
9911	FCCACHE_WARN='echo "** Warning: fonts.cache not built" ; echo "** Generate this file manually on host system using fc-cache"'
9912	if test x"$FCCACHE" = x || test x"$cross_compiling" != x"no" ; then
9913		RUN_FCCACHE="${FCCACHE_WARN}"
9914	else
9915		RUN_FCCACHE='@(if test -z "$(DESTDIR)"; then echo $(FCCACHE) $(fontdir); $(FCCACHE) $(fontdir); else'
9916		RUN_FCCACHE="${RUN_FCCACHE} ${FCCACHE_WARN} ; fi)"
9917	fi
9918	AC_SUBST([RUN_FCCACHE])
9919])
9920
9921# XORG_FONT_MKFONTDIR()
9922# -------------------
9923# Minimum version: 1.3.0
9924#
9925# Set MKFONTDIR to path to mkfontdir.
9926#
9927# If cross-compiling, and if mkdir is not found, use a shell command
9928# which warns mkfontdir needs to be run on the target
9929#
9930# If not cross-compiling, mkfontdir must be found
9931#
9932AC_DEFUN([XORG_FONT_MKFONTDIR],[
9933	if test x"$cross_compiling" != x"no" ; then
9934		AC_PATH_PROG(MKFONTDIR, mkfontdir, "")
9935		MKFONTDIR_WARN='echo "** Warning: mkfontdir not run" ; echo "** Run mkfontdir manually on host system"'
9936
9937		if test x"$MKFONTDIR" = x; then
9938			MKFONTDIR="${MKFONTDIR_WARN} ; echo '** mkfontdir'"
9939		fi
9940	else
9941		XORG_FONT_REQUIRED_PROG(MKFONTDIR, mkfontdir)
9942	fi
9943
9944	AC_SUBST([MKFONTDIR])
9945])
9946
9947# XORG_FONT_COMMON_UTILS()
9948# ------------------------
9949# Minimum version: 1.1.0
9950#
9951# Call XORG_FONT_REQUIRED_PROG for programs needed for all font types
9952
9953AC_DEFUN([XORG_FONT_COMMON_UTILS],[
9954	XORG_FONT_FCCACHE
9955	XORG_FONT_MKFONTDIR
9956])
9957
9958# XORG_FONT_SCALED_UTILS()
9959# ------------------------
9960# Minimum version: 1.1.0
9961#
9962# Call XORG_FONT_REQUIRED_PROG for programs needed for scalable fonts
9963# (TrueType, OpenType, Type1)
9964
9965AC_DEFUN([XORG_FONT_SCALED_UTILS],[
9966	XORG_FONT_COMMON_UTILS
9967	XORG_FONT_REQUIRED_PROG(MKFONTSCALE, mkfontscale)
9968])
9969
9970# XORG_FONT_BDF_UTILS()
9971# ---------------------
9972# Minimum version: 1.1.0
9973#
9974# Call XORG_FONT_REQUIRED_PROG for programs needed for BDF format bitmap fonts
9975# Also call XORG_FONT_CHECK_COMPRESSION to determine how to compress the
9976# PCF output files created by bdftopcf
9977
9978AC_DEFUN([XORG_FONT_BDF_UTILS],[
9979	XORG_FONT_COMMON_UTILS
9980	XORG_FONT_REQUIRED_PROG(BDFTOPCF, bdftopcf)
9981	XORG_FONT_CHECK_COMPRESSION
9982])
9983
9984# XORG_FONT_CHECK_COMPRESSION()
9985# -----------------------------
9986# Minimum version: 1.1.0
9987#
9988# Offer a --with-compression flag to control what compression method is
9989# used for pcf font files.   Offers all the methods currently supported
9990# by libXfont, including no compression.
9991
9992AC_DEFUN([XORG_FONT_CHECK_COMPRESSION],[
9993	AC_MSG_CHECKING([font compression method])
9994	AC_ARG_WITH(compression,
9995	 [AS_HELP_STRING([--with-compression=<no|compress|gzip|bzip2>],
9996			 [compression method to use on pcf fonts])],
9997         [compression="$withval"], [compression="yes"])
9998	if test x"$compression" = "xyes" ; then
9999		compression="gzip"
10000	fi
10001	AC_MSG_RESULT([${compression}])
10002	case ${compression} in
10003	 *compress)	COMPRESS_SUFFIX=".Z" ;;
10004	 *gzip)		COMPRESS_SUFFIX=".gz" ;;
10005	 *bzip2)	COMPRESS_SUFFIX=".bz2" ;;
10006	 no|none)	COMPRESS_SUFFIX="" ; COMPRESS="cat" ;;
10007	 *) AC_MSG_ERROR([${compression} is not a supported compression method]) ;;
10008	esac
10009	if test x"$COMPRESS_SUFFIX" != "x" ; then
10010	   XORG_FONT_REQUIRED_PROG(COMPRESS, ${compression})
10011	fi
10012	AC_SUBST([COMPRESS_SUFFIX])
10013])
10014
10015# XORG_FONT_UCS2ANY()
10016# -------------------
10017# Minimum version: 1.1.0
10018#
10019# Call XORG_FONT_REQUIRED_PROG for ucs2any program needed for splitting
10020# Unicode-encoded BDF format bitmap fonts into subsets for older encodings.
10021# Also call pkg-config to find the directory with the encoding files needed
10022# by ucs2any, and export it as MAPFILES_PATH to the Makefiles
10023
10024AC_DEFUN([XORG_FONT_UCS2ANY],[
10025	XORG_FONT_REQUIRED_PROG(UCS2ANY, ucs2any)
10026	PKG_CHECK_MODULES(MAPS, [fontutil])
10027	AC_MSG_CHECKING([for ucs2any encoding data files])
10028	MAPFILES_PATH=`pkg-config --variable=mapdir fontutil`
10029	AC_SUBST(MAPFILES_PATH)
10030	AC_MSG_RESULT([${MAPFILES_PATH}])
10031])
10032
10033
10034
10035# XORG_FONT_FC_CONFDIR()
10036# --------------------
10037# Minimum version: 1.2.0
10038#
10039# Sets FC_CONFDIR to the fontconfig config directory
10040# (which should be --with-confdir=... when building fontconfig)
10041# found from:
10042#	--with-fc-confdir=...
10043#	pkg-config --variable=confdir fontconfig
10044#	${sysconfdir}/fonts
10045
10046AC_DEFUN([XORG_FONT_FC_CONFDIR],[
10047	dnl Ensure $PKG_CONFIG is set first
10048	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
10049
10050	AC_MSG_CHECKING([for fontconfig's configuration directory])
10051	AC_ARG_WITH(fc-confdir,
10052		    AS_HELP_STRING([--with-fc-confdir=DIR],
10053			   [Path to fontconfig's configuration directory]),
10054		    [FC_CONFDIR="$withval"])
10055	# if --with-fc-confdir was not specified
10056	if test "x${FC_CONFDIR}" = "x"; then
10057		FC_CONFDIR=`$PKG_CONFIG --variable=confdir fontconfig`
10058	fi
10059	# ...and if pkg-config didn't find confdir in fontconfig.pc...
10060	if test "x${FC_CONFDIR}" = "x"; then
10061		FC_CONFDIR="${sysconfdir}/fonts"
10062	fi
10063	AC_SUBST(FC_CONFDIR)
10064	AC_MSG_RESULT([${FC_CONFDIR}])
10065])
10066
10067
10068
10069# XORG_FONTROOTDIR()
10070# --------------------
10071# Minimum version: 1.1.0
10072#
10073# Sets FONTROOTDIR to the root directory for font files.  Uses the first
10074# found from:
10075#	--with-fontrootdir
10076#	pkg-config --variable=fontrootdir fontutil
10077#	${datadir}/fonts/X11
10078
10079AC_DEFUN([XORG_FONTROOTDIR],[
10080	dnl Ensure $PKG_CONFIG is set first
10081	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
10082
10083	AC_MSG_CHECKING([for root directory for font files])
10084	AC_ARG_WITH(fontrootdir,
10085		    AS_HELP_STRING([--with-fontrootdir=DIR],
10086			   [Path to root directory for font files]),
10087		    [FONTROOTDIR="$withval"])
10088	# if --with-fontrootdir not specified...
10089	if test "x${FONTROOTDIR}" = "x"; then
10090		FONTROOTDIR=`$PKG_CONFIG --variable=fontrootdir fontutil`
10091	fi
10092	# ...and if pkg-config didn't find fontdir in fontutil.pc...
10093	if test "x${FONTROOTDIR}" = "x"; then
10094		FONTROOTDIR="${datadir}/fonts/X11"
10095	fi
10096	AC_SUBST(FONTROOTDIR)
10097	AC_MSG_RESULT([${FONTROOTDIR}])
10098])
10099
10100# XORG_FONTSUBDIR(variable, flag, subdir)
10101# ---------------------------------------
10102# Minimum version: 1.1.0
10103#
10104# Offer a --with-<flag> flag to control directory for font installation
10105# Default is the specified <subdir> of the font root directory.
10106# Sets <variable> to the selected directory
10107
10108AC_DEFUN([XORG_FONTSUBDIR],[
10109	AC_REQUIRE([XORG_FONTROOTDIR])
10110
10111	AC_MSG_CHECKING([for directory for $3 files])
10112	AC_ARG_WITH($2,
10113		    [AS_HELP_STRING([--with-$2=DIR],
10114				    [Path to $3 files [FONTROOTDIR/$3]])],
10115		    [$1="${withval}"], [$1='${FONTROOTDIR}/$3'])
10116	AC_SUBST($1)
10117	AC_MSG_RESULT([${$1}])
10118]) # XORG_FONTSUBDIR
10119
10120# XORG_FONTDIR(subdir)
10121# --------------------
10122# Minimum version: 1.1.0
10123#
10124# Offer a --with-fontdir flag to control directory for font installation
10125# Default is the specified subdir of the font root directory.
10126# Sets FONTDIR to the selected directory
10127
10128AC_DEFUN([XORG_FONTDIR],[XORG_FONTSUBDIR([FONTDIR], [fontdir], [$1])])
10129
10130dnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
10131dnl
10132dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
10133dnl 
10134dnl Permission is hereby granted, free of charge, to any person obtaining a
10135dnl copy of this software and associated documentation files (the "Software"),
10136dnl to deal in the Software without restriction, including without limitation
10137dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
10138dnl and/or sell copies of the Software, and to permit persons to whom the
10139dnl Software is furnished to do so, subject to the following conditions:
10140dnl
10141dnl The above copyright notice and this permission notice (including the next
10142dnl paragraph) shall be included in all copies or substantial portions of the
10143dnl Software.
10144dnl
10145dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10146dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
10147dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
10148dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10149dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
10150dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
10151dnl DEALINGS IN THE SOFTWARE.
10152
10153# XORG_MACROS_VERSION(required-version)
10154# -------------------------------------
10155# Minimum version: 1.1.0
10156#
10157# If you're using a macro added in Version 1.1 or newer, include this in
10158# your configure.ac with the minimum required version, such as:
10159# XORG_MACROS_VERSION(1.1)
10160#
10161# To ensure that this macro is defined, also add:
10162# m4_ifndef([XORG_MACROS_VERSION],
10163#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
10164#
10165#
10166# See the "minimum version" comment for each macro you use to see what 
10167# version you require.
10168m4_defun([XORG_MACROS_VERSION],[
10169m4_define([vers_have], [1.17])
10170m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
10171m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
10172m4_if(m4_cmp(maj_have, maj_needed), 0,,
10173    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
10174m4_if(m4_version_compare(vers_have, [$1]), -1,
10175    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
10176m4_undefine([vers_have])
10177m4_undefine([maj_have])
10178m4_undefine([maj_needed])
10179]) # XORG_MACROS_VERSION
10180
10181# XORG_PROG_RAWCPP()
10182# ------------------
10183# Minimum version: 1.0.0
10184#
10185# Find cpp program and necessary flags for use in pre-processing text files
10186# such as man pages and config files
10187AC_DEFUN([XORG_PROG_RAWCPP],[
10188AC_REQUIRE([AC_PROG_CPP])
10189AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
10190   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
10191
10192# Check for flag to avoid builtin definitions - assumes unix is predefined,
10193# which is not the best choice for supporting other OS'es, but covers most
10194# of the ones we need for now.
10195AC_MSG_CHECKING([if $RAWCPP requires -undef])
10196AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
10197if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
10198	AC_MSG_RESULT([no])
10199else
10200	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
10201		RAWCPPFLAGS=-undef
10202		AC_MSG_RESULT([yes])
10203	# under Cygwin unix is still defined even with -undef
10204	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
10205		RAWCPPFLAGS="-undef -ansi"
10206		AC_MSG_RESULT([yes, with -ansi])
10207	else
10208		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
10209	fi
10210fi
10211rm -f conftest.$ac_ext
10212
10213AC_MSG_CHECKING([if $RAWCPP requires -traditional])
10214AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
10215if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
10216	AC_MSG_RESULT([no])
10217else
10218	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
10219		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
10220		AC_MSG_RESULT([yes])
10221	else
10222		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
10223	fi
10224fi
10225rm -f conftest.$ac_ext
10226AC_SUBST(RAWCPPFLAGS)
10227]) # XORG_PROG_RAWCPP
10228
10229# XORG_MANPAGE_SECTIONS()
10230# -----------------------
10231# Minimum version: 1.0.0
10232#
10233# Determine which sections man pages go in for the different man page types
10234# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
10235# Not sure if there's any better way than just hardcoding by OS name.
10236# Override default settings by setting environment variables
10237# Added MAN_SUBSTS in version 1.8
10238# Added AC_PROG_SED in version 1.8
10239
10240AC_DEFUN([XORG_MANPAGE_SECTIONS],[
10241AC_REQUIRE([AC_CANONICAL_HOST])
10242AC_REQUIRE([AC_PROG_SED])
10243
10244if test x$APP_MAN_SUFFIX = x    ; then
10245    APP_MAN_SUFFIX=1
10246fi
10247if test x$APP_MAN_DIR = x    ; then
10248    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
10249fi
10250
10251if test x$LIB_MAN_SUFFIX = x    ; then
10252    LIB_MAN_SUFFIX=3
10253fi
10254if test x$LIB_MAN_DIR = x    ; then
10255    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
10256fi
10257
10258if test x$FILE_MAN_SUFFIX = x    ; then
10259    case $host_os in
10260	solaris*)	FILE_MAN_SUFFIX=4  ;;
10261	*)		FILE_MAN_SUFFIX=5  ;;
10262    esac
10263fi
10264if test x$FILE_MAN_DIR = x    ; then
10265    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
10266fi
10267
10268if test x$MISC_MAN_SUFFIX = x    ; then
10269    case $host_os in
10270	solaris*)	MISC_MAN_SUFFIX=5  ;;
10271	*)		MISC_MAN_SUFFIX=7  ;;
10272    esac
10273fi
10274if test x$MISC_MAN_DIR = x    ; then
10275    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
10276fi
10277
10278if test x$DRIVER_MAN_SUFFIX = x    ; then
10279    case $host_os in
10280	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
10281	*)		DRIVER_MAN_SUFFIX=4  ;;
10282    esac
10283fi
10284if test x$DRIVER_MAN_DIR = x    ; then
10285    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
10286fi
10287
10288if test x$ADMIN_MAN_SUFFIX = x    ; then
10289    case $host_os in
10290	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
10291	*)		ADMIN_MAN_SUFFIX=8  ;;
10292    esac
10293fi
10294if test x$ADMIN_MAN_DIR = x    ; then
10295    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
10296fi
10297
10298
10299AC_SUBST([APP_MAN_SUFFIX])
10300AC_SUBST([LIB_MAN_SUFFIX])
10301AC_SUBST([FILE_MAN_SUFFIX])
10302AC_SUBST([MISC_MAN_SUFFIX])
10303AC_SUBST([DRIVER_MAN_SUFFIX])
10304AC_SUBST([ADMIN_MAN_SUFFIX])
10305AC_SUBST([APP_MAN_DIR])
10306AC_SUBST([LIB_MAN_DIR])
10307AC_SUBST([FILE_MAN_DIR])
10308AC_SUBST([MISC_MAN_DIR])
10309AC_SUBST([DRIVER_MAN_DIR])
10310AC_SUBST([ADMIN_MAN_DIR])
10311
10312XORG_MAN_PAGE="X Version 11"
10313AC_SUBST([XORG_MAN_PAGE])
10314MAN_SUBSTS="\
10315	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
10316	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
10317	-e 's|__xservername__|Xorg|g' \
10318	-e 's|__xconfigfile__|xorg.conf|g' \
10319	-e 's|__projectroot__|\$(prefix)|g' \
10320	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
10321	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
10322	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
10323	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
10324	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
10325	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
10326	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
10327AC_SUBST([MAN_SUBSTS])
10328
10329]) # XORG_MANPAGE_SECTIONS
10330
10331# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
10332# ------------------------
10333# Minimum version: 1.7.0
10334#
10335# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
10336# provided by xorg-sgml-doctools, if installed.
10337AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
10338AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
10339XORG_SGML_PATH=
10340PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
10341    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
10342    [m4_ifval([$1],[:],
10343        [if test x"$cross_compiling" != x"yes" ; then
10344            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
10345                          [XORG_SGML_PATH=$prefix/share/sgml])
10346         fi])
10347    ])
10348
10349# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
10350# the path and the name of the doc stylesheet
10351if test "x$XORG_SGML_PATH" != "x" ; then
10352   AC_MSG_RESULT([$XORG_SGML_PATH])
10353   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
10354   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
10355else
10356   AC_MSG_RESULT([no])
10357fi
10358
10359AC_SUBST(XORG_SGML_PATH)
10360AC_SUBST(STYLESHEET_SRCDIR)
10361AC_SUBST(XSL_STYLESHEET)
10362AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
10363]) # XORG_CHECK_SGML_DOCTOOLS
10364
10365# XORG_CHECK_LINUXDOC
10366# -------------------
10367# Minimum version: 1.0.0
10368#
10369# Defines the variable MAKE_TEXT if the necessary tools and
10370# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
10371# Whether or not the necessary tools and files are found can be checked
10372# with the AM_CONDITIONAL "BUILD_LINUXDOC"
10373AC_DEFUN([XORG_CHECK_LINUXDOC],[
10374AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10375AC_REQUIRE([XORG_WITH_PS2PDF])
10376
10377AC_PATH_PROG(LINUXDOC, linuxdoc)
10378
10379AC_MSG_CHECKING([whether to build documentation])
10380
10381if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
10382   BUILDDOC=yes
10383else
10384   BUILDDOC=no
10385fi
10386
10387AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
10388
10389AC_MSG_RESULT([$BUILDDOC])
10390
10391AC_MSG_CHECKING([whether to build pdf documentation])
10392
10393if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
10394   BUILDPDFDOC=yes
10395else
10396   BUILDPDFDOC=no
10397fi
10398
10399AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10400
10401AC_MSG_RESULT([$BUILDPDFDOC])
10402
10403MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
10404MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
10405MAKE_PDF="$PS2PDF"
10406MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
10407
10408AC_SUBST(MAKE_TEXT)
10409AC_SUBST(MAKE_PS)
10410AC_SUBST(MAKE_PDF)
10411AC_SUBST(MAKE_HTML)
10412]) # XORG_CHECK_LINUXDOC
10413
10414# XORG_CHECK_DOCBOOK
10415# -------------------
10416# Minimum version: 1.0.0
10417#
10418# Checks for the ability to build output formats from SGML DocBook source.
10419# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
10420# indicates whether the necessary tools and files are found and, if set,
10421# $(MAKE_XXX) blah.sgml will produce blah.xxx.
10422AC_DEFUN([XORG_CHECK_DOCBOOK],[
10423AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10424
10425BUILDTXTDOC=no
10426BUILDPDFDOC=no
10427BUILDPSDOC=no
10428BUILDHTMLDOC=no
10429
10430AC_PATH_PROG(DOCBOOKPS, docbook2ps)
10431AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
10432AC_PATH_PROG(DOCBOOKHTML, docbook2html)
10433AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
10434
10435AC_MSG_CHECKING([whether to build text documentation])
10436if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
10437   test x$BUILD_TXTDOC != xno; then
10438	BUILDTXTDOC=yes
10439fi
10440AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
10441AC_MSG_RESULT([$BUILDTXTDOC])
10442
10443AC_MSG_CHECKING([whether to build PDF documentation])
10444if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
10445   test x$BUILD_PDFDOC != xno; then
10446	BUILDPDFDOC=yes
10447fi
10448AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10449AC_MSG_RESULT([$BUILDPDFDOC])
10450
10451AC_MSG_CHECKING([whether to build PostScript documentation])
10452if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
10453   test x$BUILD_PSDOC != xno; then
10454	BUILDPSDOC=yes
10455fi
10456AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
10457AC_MSG_RESULT([$BUILDPSDOC])
10458
10459AC_MSG_CHECKING([whether to build HTML documentation])
10460if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
10461   test x$BUILD_HTMLDOC != xno; then
10462	BUILDHTMLDOC=yes
10463fi
10464AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
10465AC_MSG_RESULT([$BUILDHTMLDOC])
10466
10467MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
10468MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
10469MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
10470MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
10471
10472AC_SUBST(MAKE_TEXT)
10473AC_SUBST(MAKE_PS)
10474AC_SUBST(MAKE_PDF)
10475AC_SUBST(MAKE_HTML)
10476]) # XORG_CHECK_DOCBOOK
10477
10478# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
10479# ----------------
10480# Minimum version: 1.5.0
10481# Minimum version for optional DEFAULT argument: 1.11.0
10482#
10483# Documentation tools are not always available on all platforms and sometimes
10484# not at the appropriate level. This macro enables a module to test for the
10485# presence of the tool and obtain it's path in separate variables. Coupled with
10486# the --with-xmlto option, it allows maximum flexibilty in making decisions
10487# as whether or not to use the xmlto package. When DEFAULT is not specified,
10488# --with-xmlto assumes 'auto'.
10489#
10490# Interface to module:
10491# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
10492# XMLTO:	returns the path of the xmlto program found
10493#		returns the path set by the user in the environment
10494# --with-xmlto:	'yes' user instructs the module to use xmlto
10495#		'no' user instructs the module not to use xmlto
10496#
10497# Added in version 1.10.0
10498# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
10499#                  xmlto for text output requires either lynx, links, or w3m browsers
10500#
10501# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
10502#
10503AC_DEFUN([XORG_WITH_XMLTO],[
10504AC_ARG_VAR([XMLTO], [Path to xmlto command])
10505m4_define([_defopt], m4_default([$2], [auto]))
10506AC_ARG_WITH(xmlto,
10507	AS_HELP_STRING([--with-xmlto],
10508	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
10509	   [use_xmlto=$withval], [use_xmlto=]_defopt)
10510m4_undefine([_defopt])
10511
10512if test "x$use_xmlto" = x"auto"; then
10513   AC_PATH_PROG([XMLTO], [xmlto])
10514   if test "x$XMLTO" = "x"; then
10515        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
10516	have_xmlto=no
10517   else
10518        have_xmlto=yes
10519   fi
10520elif test "x$use_xmlto" = x"yes" ; then
10521   AC_PATH_PROG([XMLTO], [xmlto])
10522   if test "x$XMLTO" = "x"; then
10523        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
10524   fi
10525   have_xmlto=yes
10526elif test "x$use_xmlto" = x"no" ; then
10527   if test "x$XMLTO" != "x"; then
10528      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
10529   fi
10530   have_xmlto=no
10531else
10532   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
10533fi
10534
10535# Test for a minimum version of xmlto, if provided.
10536m4_ifval([$1],
10537[if test "$have_xmlto" = yes; then
10538    # scrape the xmlto version
10539    AC_MSG_CHECKING([the xmlto version])
10540    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
10541    AC_MSG_RESULT([$xmlto_version])
10542    AS_VERSION_COMPARE([$xmlto_version], [$1],
10543        [if test "x$use_xmlto" = xauto; then
10544            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
10545            have_xmlto=no
10546        else
10547            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
10548        fi])
10549fi])
10550
10551# Test for the ability of xmlto to generate a text target
10552have_xmlto_text=no
10553cat > conftest.xml << "EOF"
10554EOF
10555AS_IF([test "$have_xmlto" = yes],
10556      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
10557             [have_xmlto_text=yes],
10558             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
10559rm -f conftest.xml
10560AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
10561AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
10562]) # XORG_WITH_XMLTO
10563
10564# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
10565# --------------------------------------------
10566# Minimum version: 1.12.0
10567# Minimum version for optional DEFAULT argument: 1.12.0
10568#
10569# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
10570# XML-based language used for the transformation of XML documents.
10571# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
10572# It is used under the cover by xmlto to generate html files from DocBook/XML.
10573# The XSLT processor is often used as a standalone tool for transformations.
10574# It should not be assumed that this tool is used only to work with documnetation.
10575# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
10576#
10577# Interface to module:
10578# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
10579# XSLTPROC:	 returns the path of the xsltproc program found
10580#		 returns the path set by the user in the environment
10581# --with-xsltproc: 'yes' user instructs the module to use xsltproc
10582#		  'no' user instructs the module not to use xsltproc
10583# have_xsltproc: returns yes if xsltproc found in PATH or no
10584#
10585# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
10586#
10587AC_DEFUN([XORG_WITH_XSLTPROC],[
10588AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
10589# Preserves the interface, should it be implemented later
10590m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
10591m4_define([_defopt], m4_default([$2], [auto]))
10592AC_ARG_WITH(xsltproc,
10593	AS_HELP_STRING([--with-xsltproc],
10594	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
10595	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
10596m4_undefine([_defopt])
10597
10598if test "x$use_xsltproc" = x"auto"; then
10599   AC_PATH_PROG([XSLTPROC], [xsltproc])
10600   if test "x$XSLTPROC" = "x"; then
10601        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
10602	have_xsltproc=no
10603   else
10604        have_xsltproc=yes
10605   fi
10606elif test "x$use_xsltproc" = x"yes" ; then
10607   AC_PATH_PROG([XSLTPROC], [xsltproc])
10608   if test "x$XSLTPROC" = "x"; then
10609        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
10610   fi
10611   have_xsltproc=yes
10612elif test "x$use_xsltproc" = x"no" ; then
10613   if test "x$XSLTPROC" != "x"; then
10614      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
10615   fi
10616   have_xsltproc=no
10617else
10618   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
10619fi
10620
10621AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
10622]) # XORG_WITH_XSLTPROC
10623
10624# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
10625# ----------------------------------------
10626# Minimum version: 1.15.0
10627#
10628# PERL (Practical Extraction and Report Language) is a language optimized for
10629# scanning arbitrary text files, extracting information from those text files,
10630# and printing reports based on that information.
10631#
10632# When DEFAULT is not specified, --with-perl assumes 'auto'.
10633#
10634# Interface to module:
10635# HAVE_PERL: used in makefiles to conditionally scan text files
10636# PERL:	     returns the path of the perl program found
10637#	     returns the path set by the user in the environment
10638# --with-perl: 'yes' user instructs the module to use perl
10639#	       'no' user instructs the module not to use perl
10640# have_perl: returns yes if perl found in PATH or no
10641#
10642# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
10643#
10644AC_DEFUN([XORG_WITH_PERL],[
10645AC_ARG_VAR([PERL], [Path to perl command])
10646# Preserves the interface, should it be implemented later
10647m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
10648m4_define([_defopt], m4_default([$2], [auto]))
10649AC_ARG_WITH(perl,
10650	AS_HELP_STRING([--with-perl],
10651	   [Use perl for extracting information from files (default: ]_defopt[)]),
10652	   [use_perl=$withval], [use_perl=]_defopt)
10653m4_undefine([_defopt])
10654
10655if test "x$use_perl" = x"auto"; then
10656   AC_PATH_PROG([PERL], [perl])
10657   if test "x$PERL" = "x"; then
10658        AC_MSG_WARN([perl not found - cannot extract information and report])
10659	have_perl=no
10660   else
10661        have_perl=yes
10662   fi
10663elif test "x$use_perl" = x"yes" ; then
10664   AC_PATH_PROG([PERL], [perl])
10665   if test "x$PERL" = "x"; then
10666        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
10667   fi
10668   have_perl=yes
10669elif test "x$use_perl" = x"no" ; then
10670   if test "x$PERL" != "x"; then
10671      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
10672   fi
10673   have_perl=no
10674else
10675   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
10676fi
10677
10678AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
10679]) # XORG_WITH_PERL
10680
10681# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
10682# ----------------
10683# Minimum version: 1.5.0
10684# Minimum version for optional DEFAULT argument: 1.11.0
10685#
10686# Documentation tools are not always available on all platforms and sometimes
10687# not at the appropriate level. This macro enables a module to test for the
10688# presence of the tool and obtain it's path in separate variables. Coupled with
10689# the --with-asciidoc option, it allows maximum flexibilty in making decisions
10690# as whether or not to use the asciidoc package. When DEFAULT is not specified,
10691# --with-asciidoc assumes 'auto'.
10692#
10693# Interface to module:
10694# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
10695# ASCIIDOC:	 returns the path of the asciidoc program found
10696#		 returns the path set by the user in the environment
10697# --with-asciidoc: 'yes' user instructs the module to use asciidoc
10698#		  'no' user instructs the module not to use asciidoc
10699#
10700# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
10701#
10702AC_DEFUN([XORG_WITH_ASCIIDOC],[
10703AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
10704m4_define([_defopt], m4_default([$2], [auto]))
10705AC_ARG_WITH(asciidoc,
10706	AS_HELP_STRING([--with-asciidoc],
10707	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
10708	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
10709m4_undefine([_defopt])
10710
10711if test "x$use_asciidoc" = x"auto"; then
10712   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10713   if test "x$ASCIIDOC" = "x"; then
10714        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
10715	have_asciidoc=no
10716   else
10717        have_asciidoc=yes
10718   fi
10719elif test "x$use_asciidoc" = x"yes" ; then
10720   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10721   if test "x$ASCIIDOC" = "x"; then
10722        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
10723   fi
10724   have_asciidoc=yes
10725elif test "x$use_asciidoc" = x"no" ; then
10726   if test "x$ASCIIDOC" != "x"; then
10727      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
10728   fi
10729   have_asciidoc=no
10730else
10731   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
10732fi
10733m4_ifval([$1],
10734[if test "$have_asciidoc" = yes; then
10735    # scrape the asciidoc version
10736    AC_MSG_CHECKING([the asciidoc version])
10737    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
10738    AC_MSG_RESULT([$asciidoc_version])
10739    AS_VERSION_COMPARE([$asciidoc_version], [$1],
10740        [if test "x$use_asciidoc" = xauto; then
10741            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
10742            have_asciidoc=no
10743        else
10744            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
10745        fi])
10746fi])
10747AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
10748]) # XORG_WITH_ASCIIDOC
10749
10750# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
10751# --------------------------------
10752# Minimum version: 1.5.0
10753# Minimum version for optional DEFAULT argument: 1.11.0
10754#
10755# Documentation tools are not always available on all platforms and sometimes
10756# not at the appropriate level. This macro enables a module to test for the
10757# presence of the tool and obtain it's path in separate variables. Coupled with
10758# the --with-doxygen option, it allows maximum flexibilty in making decisions
10759# as whether or not to use the doxygen package. When DEFAULT is not specified,
10760# --with-doxygen assumes 'auto'.
10761#
10762# Interface to module:
10763# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
10764# DOXYGEN:	 returns the path of the doxygen program found
10765#		 returns the path set by the user in the environment
10766# --with-doxygen: 'yes' user instructs the module to use doxygen
10767#		  'no' user instructs the module not to use doxygen
10768#
10769# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
10770#
10771AC_DEFUN([XORG_WITH_DOXYGEN],[
10772AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
10773m4_define([_defopt], m4_default([$2], [auto]))
10774AC_ARG_WITH(doxygen,
10775	AS_HELP_STRING([--with-doxygen],
10776	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
10777	   [use_doxygen=$withval], [use_doxygen=]_defopt)
10778m4_undefine([_defopt])
10779
10780if test "x$use_doxygen" = x"auto"; then
10781   AC_PATH_PROG([DOXYGEN], [doxygen])
10782   if test "x$DOXYGEN" = "x"; then
10783        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
10784	have_doxygen=no
10785   else
10786        have_doxygen=yes
10787   fi
10788elif test "x$use_doxygen" = x"yes" ; then
10789   AC_PATH_PROG([DOXYGEN], [doxygen])
10790   if test "x$DOXYGEN" = "x"; then
10791        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
10792   fi
10793   have_doxygen=yes
10794elif test "x$use_doxygen" = x"no" ; then
10795   if test "x$DOXYGEN" != "x"; then
10796      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
10797   fi
10798   have_doxygen=no
10799else
10800   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
10801fi
10802m4_ifval([$1],
10803[if test "$have_doxygen" = yes; then
10804    # scrape the doxygen version
10805    AC_MSG_CHECKING([the doxygen version])
10806    doxygen_version=`$DOXYGEN --version 2>/dev/null`
10807    AC_MSG_RESULT([$doxygen_version])
10808    AS_VERSION_COMPARE([$doxygen_version], [$1],
10809        [if test "x$use_doxygen" = xauto; then
10810            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
10811            have_doxygen=no
10812        else
10813            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
10814        fi])
10815fi])
10816AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
10817]) # XORG_WITH_DOXYGEN
10818
10819# XORG_WITH_GROFF([DEFAULT])
10820# ----------------
10821# Minimum version: 1.6.0
10822# Minimum version for optional DEFAULT argument: 1.11.0
10823#
10824# Documentation tools are not always available on all platforms and sometimes
10825# not at the appropriate level. This macro enables a module to test for the
10826# presence of the tool and obtain it's path in separate variables. Coupled with
10827# the --with-groff option, it allows maximum flexibilty in making decisions
10828# as whether or not to use the groff package. When DEFAULT is not specified,
10829# --with-groff assumes 'auto'.
10830#
10831# Interface to module:
10832# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
10833# HAVE_GROFF_MM: the memorandum macros (-mm) package
10834# HAVE_GROFF_MS: the -ms macros package
10835# GROFF:	 returns the path of the groff program found
10836#		 returns the path set by the user in the environment
10837# --with-groff:	 'yes' user instructs the module to use groff
10838#		 'no' user instructs the module not to use groff
10839#
10840# Added in version 1.9.0:
10841# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
10842#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
10843#		   psselect from the psutils package.
10844#		   the ghostcript package. Refer to the grohtml man pages
10845#
10846# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
10847#
10848# OS and distros often splits groff in a basic and full package, the former
10849# having the groff program and the later having devices, fonts and macros
10850# Checking for the groff executable is not enough.
10851#
10852# If macros are missing, we cannot assume that groff is useless, so we don't
10853# unset HAVE_GROFF or GROFF env variables.
10854# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
10855#
10856AC_DEFUN([XORG_WITH_GROFF],[
10857AC_ARG_VAR([GROFF], [Path to groff command])
10858m4_define([_defopt], m4_default([$1], [auto]))
10859AC_ARG_WITH(groff,
10860	AS_HELP_STRING([--with-groff],
10861	   [Use groff to regenerate documentation (default: ]_defopt[)]),
10862	   [use_groff=$withval], [use_groff=]_defopt)
10863m4_undefine([_defopt])
10864
10865if test "x$use_groff" = x"auto"; then
10866   AC_PATH_PROG([GROFF], [groff])
10867   if test "x$GROFF" = "x"; then
10868        AC_MSG_WARN([groff not found - documentation targets will be skipped])
10869	have_groff=no
10870   else
10871        have_groff=yes
10872   fi
10873elif test "x$use_groff" = x"yes" ; then
10874   AC_PATH_PROG([GROFF], [groff])
10875   if test "x$GROFF" = "x"; then
10876        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
10877   fi
10878   have_groff=yes
10879elif test "x$use_groff" = x"no" ; then
10880   if test "x$GROFF" != "x"; then
10881      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
10882   fi
10883   have_groff=no
10884else
10885   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
10886fi
10887
10888# We have groff, test for the presence of the macro packages
10889if test "x$have_groff" = x"yes"; then
10890    AC_MSG_CHECKING([for ${GROFF} -ms macros])
10891    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
10892        groff_ms_works=yes
10893    else
10894        groff_ms_works=no
10895    fi
10896    AC_MSG_RESULT([$groff_ms_works])
10897    AC_MSG_CHECKING([for ${GROFF} -mm macros])
10898    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
10899        groff_mm_works=yes
10900    else
10901        groff_mm_works=no
10902    fi
10903    AC_MSG_RESULT([$groff_mm_works])
10904fi
10905
10906# We have groff, test for HTML dependencies, one command per package
10907if test "x$have_groff" = x"yes"; then
10908   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
10909   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
10910   AC_PATH_PROG(PSSELECT_PATH, [psselect])
10911   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
10912      have_groff_html=yes
10913   else
10914      have_groff_html=no
10915      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
10916   fi
10917fi
10918
10919# Set Automake conditionals for Makefiles
10920AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
10921AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
10922AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
10923AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
10924]) # XORG_WITH_GROFF
10925
10926# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
10927# ---------------------------------------
10928# Minimum version: 1.6.0
10929# Minimum version for optional DEFAULT argument: 1.11.0
10930# Minimum version for optional MIN-VERSION argument: 1.15.0
10931#
10932# Documentation tools are not always available on all platforms and sometimes
10933# not at the appropriate level. This macro enables a module to test for the
10934# presence of the tool and obtain it's path in separate variables. Coupled with
10935# the --with-fop option, it allows maximum flexibilty in making decisions
10936# as whether or not to use the fop package. When DEFAULT is not specified,
10937# --with-fop assumes 'auto'.
10938#
10939# Interface to module:
10940# HAVE_FOP: 	used in makefiles to conditionally generate documentation
10941# FOP:	 	returns the path of the fop program found
10942#		returns the path set by the user in the environment
10943# --with-fop: 	'yes' user instructs the module to use fop
10944#		'no' user instructs the module not to use fop
10945#
10946# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
10947#
10948AC_DEFUN([XORG_WITH_FOP],[
10949AC_ARG_VAR([FOP], [Path to fop command])
10950m4_define([_defopt], m4_default([$2], [auto]))
10951AC_ARG_WITH(fop,
10952	AS_HELP_STRING([--with-fop],
10953	   [Use fop to regenerate documentation (default: ]_defopt[)]),
10954	   [use_fop=$withval], [use_fop=]_defopt)
10955m4_undefine([_defopt])
10956
10957if test "x$use_fop" = x"auto"; then
10958   AC_PATH_PROG([FOP], [fop])
10959   if test "x$FOP" = "x"; then
10960        AC_MSG_WARN([fop not found - documentation targets will be skipped])
10961	have_fop=no
10962   else
10963        have_fop=yes
10964   fi
10965elif test "x$use_fop" = x"yes" ; then
10966   AC_PATH_PROG([FOP], [fop])
10967   if test "x$FOP" = "x"; then
10968        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
10969   fi
10970   have_fop=yes
10971elif test "x$use_fop" = x"no" ; then
10972   if test "x$FOP" != "x"; then
10973      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
10974   fi
10975   have_fop=no
10976else
10977   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
10978fi
10979
10980# Test for a minimum version of fop, if provided.
10981m4_ifval([$1],
10982[if test "$have_fop" = yes; then
10983    # scrape the fop version
10984    AC_MSG_CHECKING([for fop minimum version])
10985    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
10986    AC_MSG_RESULT([$fop_version])
10987    AS_VERSION_COMPARE([$fop_version], [$1],
10988        [if test "x$use_fop" = xauto; then
10989            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
10990            have_fop=no
10991        else
10992            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
10993        fi])
10994fi])
10995AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
10996]) # XORG_WITH_FOP
10997
10998# XORG_WITH_PS2PDF([DEFAULT])
10999# ----------------
11000# Minimum version: 1.6.0
11001# Minimum version for optional DEFAULT argument: 1.11.0
11002#
11003# Documentation tools are not always available on all platforms and sometimes
11004# not at the appropriate level. This macro enables a module to test for the
11005# presence of the tool and obtain it's path in separate variables. Coupled with
11006# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
11007# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
11008# --with-ps2pdf assumes 'auto'.
11009#
11010# Interface to module:
11011# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
11012# PS2PDF:	returns the path of the ps2pdf program found
11013#		returns the path set by the user in the environment
11014# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
11015#		 'no' user instructs the module not to use ps2pdf
11016#
11017# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
11018#
11019AC_DEFUN([XORG_WITH_PS2PDF],[
11020AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
11021m4_define([_defopt], m4_default([$1], [auto]))
11022AC_ARG_WITH(ps2pdf,
11023	AS_HELP_STRING([--with-ps2pdf],
11024	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
11025	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
11026m4_undefine([_defopt])
11027
11028if test "x$use_ps2pdf" = x"auto"; then
11029   AC_PATH_PROG([PS2PDF], [ps2pdf])
11030   if test "x$PS2PDF" = "x"; then
11031        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
11032	have_ps2pdf=no
11033   else
11034        have_ps2pdf=yes
11035   fi
11036elif test "x$use_ps2pdf" = x"yes" ; then
11037   AC_PATH_PROG([PS2PDF], [ps2pdf])
11038   if test "x$PS2PDF" = "x"; then
11039        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
11040   fi
11041   have_ps2pdf=yes
11042elif test "x$use_ps2pdf" = x"no" ; then
11043   if test "x$PS2PDF" != "x"; then
11044      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
11045   fi
11046   have_ps2pdf=no
11047else
11048   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
11049fi
11050AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
11051]) # XORG_WITH_PS2PDF
11052
11053# XORG_ENABLE_DOCS (enable_docs=yes)
11054# ----------------
11055# Minimum version: 1.6.0
11056#
11057# Documentation tools are not always available on all platforms and sometimes
11058# not at the appropriate level. This macro enables a builder to skip all
11059# documentation targets except traditional man pages.
11060# Combined with the specific tool checking macros XORG_WITH_*, it provides
11061# maximum flexibilty in controlling documentation building.
11062# Refer to:
11063# XORG_WITH_XMLTO         --with-xmlto
11064# XORG_WITH_ASCIIDOC      --with-asciidoc
11065# XORG_WITH_DOXYGEN       --with-doxygen
11066# XORG_WITH_FOP           --with-fop
11067# XORG_WITH_GROFF         --with-groff
11068# XORG_WITH_PS2PDF        --with-ps2pdf
11069#
11070# Interface to module:
11071# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
11072# --enable-docs: 'yes' user instructs the module to generate docs
11073#		 'no' user instructs the module not to generate docs
11074# parm1:	specify the default value, yes or no.
11075#
11076AC_DEFUN([XORG_ENABLE_DOCS],[
11077m4_define([docs_default], m4_default([$1], [yes]))
11078AC_ARG_ENABLE(docs,
11079	AS_HELP_STRING([--enable-docs],
11080	   [Enable building the documentation (default: ]docs_default[)]),
11081	   [build_docs=$enableval], [build_docs=]docs_default)
11082m4_undefine([docs_default])
11083AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
11084AC_MSG_CHECKING([whether to build documentation])
11085AC_MSG_RESULT([$build_docs])
11086]) # XORG_ENABLE_DOCS
11087
11088# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
11089# ----------------
11090# Minimum version: 1.6.0
11091#
11092# This macro enables a builder to skip all developer documentation.
11093# Combined with the specific tool checking macros XORG_WITH_*, it provides
11094# maximum flexibilty in controlling documentation building.
11095# Refer to:
11096# XORG_WITH_XMLTO         --with-xmlto
11097# XORG_WITH_ASCIIDOC      --with-asciidoc
11098# XORG_WITH_DOXYGEN       --with-doxygen
11099# XORG_WITH_FOP           --with-fop
11100# XORG_WITH_GROFF         --with-groff
11101# XORG_WITH_PS2PDF        --with-ps2pdf
11102#
11103# Interface to module:
11104# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
11105# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
11106#			'no' user instructs the module not to generate developer docs
11107# parm1:		specify the default value, yes or no.
11108#
11109AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
11110m4_define([devel_default], m4_default([$1], [yes]))
11111AC_ARG_ENABLE(devel-docs,
11112	AS_HELP_STRING([--enable-devel-docs],
11113	   [Enable building the developer documentation (default: ]devel_default[)]),
11114	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
11115m4_undefine([devel_default])
11116AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
11117AC_MSG_CHECKING([whether to build developer documentation])
11118AC_MSG_RESULT([$build_devel_docs])
11119]) # XORG_ENABLE_DEVEL_DOCS
11120
11121# XORG_ENABLE_SPECS (enable_specs=yes)
11122# ----------------
11123# Minimum version: 1.6.0
11124#
11125# This macro enables a builder to skip all functional specification targets.
11126# Combined with the specific tool checking macros XORG_WITH_*, it provides
11127# maximum flexibilty in controlling documentation building.
11128# Refer to:
11129# XORG_WITH_XMLTO         --with-xmlto
11130# XORG_WITH_ASCIIDOC      --with-asciidoc
11131# XORG_WITH_DOXYGEN       --with-doxygen
11132# XORG_WITH_FOP           --with-fop
11133# XORG_WITH_GROFF         --with-groff
11134# XORG_WITH_PS2PDF        --with-ps2pdf
11135#
11136# Interface to module:
11137# ENABLE_SPECS:		used in makefiles to conditionally generate specs
11138# --enable-specs:	'yes' user instructs the module to generate specs
11139#			'no' user instructs the module not to generate specs
11140# parm1:		specify the default value, yes or no.
11141#
11142AC_DEFUN([XORG_ENABLE_SPECS],[
11143m4_define([spec_default], m4_default([$1], [yes]))
11144AC_ARG_ENABLE(specs,
11145	AS_HELP_STRING([--enable-specs],
11146	   [Enable building the specs (default: ]spec_default[)]),
11147	   [build_specs=$enableval], [build_specs=]spec_default)
11148m4_undefine([spec_default])
11149AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
11150AC_MSG_CHECKING([whether to build functional specifications])
11151AC_MSG_RESULT([$build_specs])
11152]) # XORG_ENABLE_SPECS
11153
11154# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
11155# ----------------------------------------------
11156# Minimum version: 1.13.0
11157#
11158# This macro enables a builder to enable/disable unit testing
11159# It makes no assumption about the test cases implementation
11160# Test cases may or may not use Automake "Support for test suites"
11161# They may or may not use the software utility library GLib
11162#
11163# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
11164# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
11165# The variable enable_unit_tests is used by other macros in this file.
11166#
11167# Interface to module:
11168# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
11169# enable_unit_tests:    used in configure.ac for additional configuration
11170# --enable-unit-tests:	'yes' user instructs the module to build tests
11171#			'no' user instructs the module not to build tests
11172# parm1:		specify the default value, yes or no.
11173#
11174AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
11175AC_BEFORE([$0], [XORG_WITH_GLIB])
11176AC_BEFORE([$0], [XORG_LD_WRAP])
11177AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
11178m4_define([_defopt], m4_default([$1], [auto]))
11179AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
11180	[Enable building unit test cases (default: ]_defopt[)]),
11181	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
11182m4_undefine([_defopt])
11183AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
11184AC_MSG_CHECKING([whether to build unit test cases])
11185AC_MSG_RESULT([$enable_unit_tests])
11186]) # XORG_ENABLE_UNIT_TESTS
11187
11188# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
11189# ------------------------------------------------------
11190# Minimum version: 1.17.0
11191#
11192# This macro enables a builder to enable/disable integration testing
11193# It makes no assumption about the test cases' implementation
11194# Test cases may or may not use Automake "Support for test suites"
11195#
11196# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
11197# usually requires less dependencies and may be built and run under less
11198# stringent environments than integration tests.
11199#
11200# Interface to module:
11201# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
11202# enable_integration_tests:   used in configure.ac for additional configuration
11203# --enable-integration-tests: 'yes' user instructs the module to build tests
11204#                             'no' user instructs the module not to build tests
11205# parm1:                      specify the default value, yes or no.
11206#
11207AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
11208AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
11209m4_define([_defopt], m4_default([$1], [auto]))
11210AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
11211	[Enable building integration test cases (default: ]_defopt[)]),
11212	[enable_integration_tests=$enableval],
11213	[enable_integration_tests=]_defopt)
11214m4_undefine([_defopt])
11215AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
11216	[test "x$enable_integration_tests" != xno])
11217AC_MSG_CHECKING([whether to build unit test cases])
11218AC_MSG_RESULT([$enable_integration_tests])
11219]) # XORG_ENABLE_INTEGRATION_TESTS
11220
11221# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
11222# ----------------------------------------
11223# Minimum version: 1.13.0
11224#
11225# GLib is a library which provides advanced data structures and functions.
11226# This macro enables a module to test for the presence of Glib.
11227#
11228# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
11229# Otherwise the value of $enable_unit_tests is blank.
11230#
11231# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
11232# test support usually requires less dependencies and may be built and run under
11233# less stringent environments than integration tests.
11234#
11235# Interface to module:
11236# HAVE_GLIB: used in makefiles to conditionally build targets
11237# with_glib: used in configure.ac to know if GLib has been found
11238# --with-glib:	'yes' user instructs the module to use glib
11239#		'no' user instructs the module not to use glib
11240#
11241AC_DEFUN([XORG_WITH_GLIB],[
11242AC_REQUIRE([PKG_PROG_PKG_CONFIG])
11243m4_define([_defopt], m4_default([$2], [auto]))
11244AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
11245	[Use GLib library for unit testing (default: ]_defopt[)]),
11246	[with_glib=$withval], [with_glib=]_defopt)
11247m4_undefine([_defopt])
11248
11249have_glib=no
11250# Do not probe GLib if user explicitly disabled unit testing
11251if test "x$enable_unit_tests" != x"no"; then
11252  # Do not probe GLib if user explicitly disabled it
11253  if test "x$with_glib" != x"no"; then
11254    m4_ifval(
11255      [$1],
11256      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
11257      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
11258    )
11259  fi
11260fi
11261
11262# Not having GLib when unit testing has been explicitly requested is an error
11263if test "x$enable_unit_tests" = x"yes"; then
11264  if test "x$have_glib" = x"no"; then
11265    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
11266  fi
11267fi
11268
11269# Having unit testing disabled when GLib has been explicitly requested is an error
11270if test "x$enable_unit_tests" = x"no"; then
11271  if test "x$with_glib" = x"yes"; then
11272    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
11273  fi
11274fi
11275
11276# Not having GLib when it has been explicitly requested is an error
11277if test "x$with_glib" = x"yes"; then
11278  if test "x$have_glib" = x"no"; then
11279    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
11280  fi
11281fi
11282
11283AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
11284]) # XORG_WITH_GLIB
11285
11286# XORG_LD_WRAP([required|optional])
11287# ---------------------------------
11288# Minimum version: 1.13.0
11289#
11290# Check if linker supports -wrap, passed via compiler flags
11291#
11292# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
11293# Otherwise the value of $enable_unit_tests is blank.
11294#
11295# Argument added in 1.16.0 - default is "required", to match existing behavior
11296# of returning an error if enable_unit_tests is yes, and ld -wrap is not
11297# available, an argument of "optional" allows use when some unit tests require
11298# ld -wrap and others do not.
11299#
11300AC_DEFUN([XORG_LD_WRAP],[
11301XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
11302    [AC_LANG_PROGRAM([#include <stdlib.h>
11303                      void __wrap_exit(int status) { return; }],
11304                     [exit(0);])])
11305# Not having ld wrap when unit testing has been explicitly requested is an error
11306if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
11307  if test "x$have_ld_wrap" = x"no"; then
11308    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
11309  fi
11310fi
11311AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
11312#
11313]) # XORG_LD_WRAP
11314
11315# XORG_CHECK_LINKER_FLAGS
11316# -----------------------
11317# SYNOPSIS
11318#
11319#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
11320#
11321# DESCRIPTION
11322#
11323#   Check whether the given linker FLAGS work with the current language's
11324#   linker, or whether they give an error.
11325#
11326#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
11327#   success/failure.
11328#
11329#   PROGRAM-SOURCE is the program source to link with, if needed
11330#
11331#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
11332#
11333# LICENSE
11334#
11335#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
11336#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
11337#   Copyright (c) 2009 Matteo Frigo
11338#
11339#   This program is free software: you can redistribute it and/or modify it
11340#   under the terms of the GNU General Public License as published by the
11341#   Free Software Foundation, either version 3 of the License, or (at your
11342#   option) any later version.
11343#
11344#   This program is distributed in the hope that it will be useful, but
11345#   WITHOUT ANY WARRANTY; without even the implied warranty of
11346#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11347#   Public License for more details.
11348#
11349#   You should have received a copy of the GNU General Public License along
11350#   with this program. If not, see <http://www.gnu.org/licenses/>.
11351#
11352#   As a special exception, the respective Autoconf Macro's copyright owner
11353#   gives unlimited permission to copy, distribute and modify the configure
11354#   scripts that are the output of Autoconf when processing the Macro. You
11355#   need not follow the terms of the GNU General Public License when using
11356#   or distributing such scripts, even though portions of the text of the
11357#   Macro appear in them. The GNU General Public License (GPL) does govern
11358#   all other use of the material that constitutes the Autoconf Macro.
11359#
11360#   This special exception to the GPL applies to versions of the Autoconf
11361#   Macro released by the Autoconf Archive. When you make and distribute a
11362#   modified version of the Autoconf Macro, you may extend this special
11363#   exception to the GPL to apply to your modified version as well.#
11364AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
11365[AC_MSG_CHECKING([whether the linker accepts $1])
11366dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
11367AS_LITERAL_IF([$1],
11368  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
11369      ax_save_FLAGS=$LDFLAGS
11370      LDFLAGS="$1"
11371      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
11372        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
11373        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
11374      LDFLAGS=$ax_save_FLAGS])],
11375  [ax_save_FLAGS=$LDFLAGS
11376   LDFLAGS="$1"
11377   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
11378     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
11379     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
11380   LDFLAGS=$ax_save_FLAGS])
11381eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
11382AC_MSG_RESULT($xorg_check_linker_flags)
11383if test "x$xorg_check_linker_flags" = xyes; then
11384	m4_default([$2], :)
11385else
11386	m4_default([$3], :)
11387fi
11388]) # XORG_CHECK_LINKER_FLAGS
11389
11390# XORG_MEMORY_CHECK_FLAGS
11391# -----------------------
11392# Minimum version: 1.16.0
11393#
11394# This macro attempts to find appropriate memory checking functionality
11395# for various platforms which unit testing code may use to catch various
11396# forms of memory allocation and access errors in testing.
11397#
11398# Interface to module:
11399# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
11400#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
11401#
11402# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
11403#
11404AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
11405
11406AC_REQUIRE([AC_CANONICAL_HOST])
11407AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
11408           [Environment variables to enable memory checking in tests])
11409
11410# Check for different types of support on different platforms
11411case $host_os in
11412    solaris*)
11413        AC_CHECK_LIB([umem], [umem_alloc],
11414            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
11415        ;;
11416    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
11417        # both directly and inverted, so should not be 0 or 255.
11418        malloc_debug_env='MALLOC_PERTURB_=15'
11419        ;;
11420    darwin*)
11421        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
11422        ;;
11423    *bsd*)
11424        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
11425        ;;
11426esac
11427
11428# User supplied flags override default flags
11429if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
11430    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
11431fi
11432
11433AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
11434]) # XORG_WITH_LINT
11435
11436# XORG_CHECK_MALLOC_ZERO
11437# ----------------------
11438# Minimum version: 1.0.0
11439#
11440# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
11441# malloc(0) returns NULL.  Packages should add one of these cflags to
11442# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
11443AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
11444AC_ARG_ENABLE(malloc0returnsnull,
11445	AS_HELP_STRING([--enable-malloc0returnsnull],
11446		       [malloc(0) returns NULL (default: auto)]),
11447	[MALLOC_ZERO_RETURNS_NULL=$enableval],
11448	[MALLOC_ZERO_RETURNS_NULL=auto])
11449
11450AC_MSG_CHECKING([whether malloc(0) returns NULL])
11451if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
11452	AC_RUN_IFELSE([AC_LANG_PROGRAM([
11453#include <stdlib.h>
11454],[
11455    char *m0, *r0, *c0, *p;
11456    m0 = malloc(0);
11457    p = malloc(10);
11458    r0 = realloc(p,0);
11459    c0 = calloc(0,10);
11460    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
11461])],
11462		[MALLOC_ZERO_RETURNS_NULL=yes],
11463		[MALLOC_ZERO_RETURNS_NULL=no],
11464		[MALLOC_ZERO_RETURNS_NULL=yes])
11465fi
11466AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
11467
11468if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
11469	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
11470	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
11471	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
11472else
11473	MALLOC_ZERO_CFLAGS=""
11474	XMALLOC_ZERO_CFLAGS=""
11475	XTMALLOC_ZERO_CFLAGS=""
11476fi
11477
11478AC_SUBST([MALLOC_ZERO_CFLAGS])
11479AC_SUBST([XMALLOC_ZERO_CFLAGS])
11480AC_SUBST([XTMALLOC_ZERO_CFLAGS])
11481]) # XORG_CHECK_MALLOC_ZERO
11482
11483# XORG_WITH_LINT()
11484# ----------------
11485# Minimum version: 1.1.0
11486#
11487# This macro enables the use of a tool that flags some suspicious and
11488# non-portable constructs (likely to be bugs) in C language source code.
11489# It will attempt to locate the tool and use appropriate options.
11490# There are various lint type tools on different platforms.
11491#
11492# Interface to module:
11493# LINT:		returns the path to the tool found on the platform
11494#		or the value set to LINT on the configure cmd line
11495#		also an Automake conditional
11496# LINT_FLAGS:	an Automake variable with appropriate flags
11497#
11498# --with-lint:	'yes' user instructs the module to use lint
11499#		'no' user instructs the module not to use lint (default)
11500#
11501# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
11502# If the user sets the value of LINT_FLAGS, they are used verbatim.
11503#
11504AC_DEFUN([XORG_WITH_LINT],[
11505
11506AC_ARG_VAR([LINT], [Path to a lint-style command])
11507AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
11508AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
11509		[Use a lint-style source code checker (default: disabled)])],
11510		[use_lint=$withval], [use_lint=no])
11511
11512# Obtain platform specific info like program name and options
11513# The lint program on FreeBSD and NetBSD is different from the one on Solaris
11514case $host_os in
11515  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
11516	lint_name=splint
11517	lint_options="-badflag"
11518	;;
11519  *freebsd* | *netbsd*)
11520	lint_name=lint
11521	lint_options="-u -b"
11522	;;
11523  *solaris*)
11524	lint_name=lint
11525	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
11526	;;
11527esac
11528
11529# Test for the presence of the program (either guessed by the code or spelled out by the user)
11530if test "x$use_lint" = x"yes" ; then
11531   AC_PATH_PROG([LINT], [$lint_name])
11532   if test "x$LINT" = "x"; then
11533        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
11534   fi
11535elif test "x$use_lint" = x"no" ; then
11536   if test "x$LINT" != "x"; then
11537      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
11538   fi
11539else
11540   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
11541fi
11542
11543# User supplied flags override default flags
11544if test "x$LINT_FLAGS" != "x"; then
11545   lint_options=$LINT_FLAGS
11546fi
11547
11548AC_SUBST([LINT_FLAGS],[$lint_options])
11549AM_CONDITIONAL(LINT, [test "x$LINT" != x])
11550
11551]) # XORG_WITH_LINT
11552
11553# XORG_LINT_LIBRARY(LIBNAME)
11554# --------------------------
11555# Minimum version: 1.1.0
11556#
11557# Sets up flags for building lint libraries for checking programs that call
11558# functions in the library.
11559#
11560# Interface to module:
11561# LINTLIB		- Automake variable with the name of lint library file to make
11562# MAKE_LINT_LIB		- Automake conditional
11563#
11564# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
11565#			  - 'no' user instructs the module not to create a lint library (default)
11566
11567AC_DEFUN([XORG_LINT_LIBRARY],[
11568AC_REQUIRE([XORG_WITH_LINT])
11569AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
11570	[Create lint library (default: disabled)])],
11571	[make_lint_lib=$enableval], [make_lint_lib=no])
11572
11573if test "x$make_lint_lib" = x"yes" ; then
11574   LINTLIB=llib-l$1.ln
11575   if test "x$LINT" = "x"; then
11576        AC_MSG_ERROR([Cannot make lint library without --with-lint])
11577   fi
11578elif test "x$make_lint_lib" != x"no" ; then
11579   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
11580fi
11581
11582AC_SUBST(LINTLIB)
11583AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
11584
11585]) # XORG_LINT_LIBRARY
11586
11587# XORG_COMPILER_BRAND
11588# -------------------
11589# Minimum version: 1.14.0
11590#
11591# Checks for various brands of compilers and sets flags as appropriate:
11592#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
11593#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
11594#   clang compiler - sets CLANGCC to "yes"
11595#   Intel compiler - sets INTELCC to "yes"
11596#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
11597#
11598AC_DEFUN([XORG_COMPILER_BRAND], [
11599AC_LANG_CASE(
11600	[C], [
11601		AC_REQUIRE([AC_PROG_CC_C99])
11602	],
11603	[C++], [
11604		AC_REQUIRE([AC_PROG_CXX])
11605	]
11606)
11607AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
11608AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
11609AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
11610]) # XORG_COMPILER_BRAND
11611
11612# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
11613# ---------------
11614# Minimum version: 1.16.0
11615#
11616# Test if the compiler works when passed the given flag as a command line argument.
11617# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
11618# next flag in the list until there are no more options.
11619#
11620# Note that this does not guarantee that the compiler supports the flag as some
11621# compilers will simply ignore arguments that they do not understand, but we do
11622# attempt to weed out false positives by using -Werror=unknown-warning-option and
11623# -Werror=unused-command-line-argument
11624#
11625AC_DEFUN([XORG_TESTSET_CFLAG], [
11626m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11627m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11628
11629AC_LANG_COMPILER_REQUIRE
11630
11631AC_LANG_CASE(
11632	[C], [
11633		AC_REQUIRE([AC_PROG_CC_C99])
11634		define([PREFIX], [C])
11635		define([CACHE_PREFIX], [cc])
11636		define([COMPILER], [$CC])
11637	],
11638	[C++], [
11639		define([PREFIX], [CXX])
11640		define([CACHE_PREFIX], [cxx])
11641		define([COMPILER], [$CXX])
11642	]
11643)
11644
11645[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
11646
11647if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
11648	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11649	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
11650			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
11651			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11652					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
11653					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
11654	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
11655	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11656fi
11657
11658if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
11659	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
11660		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11661	fi
11662	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11663	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
11664			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
11665			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11666					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
11667					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
11668	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
11669	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11670fi
11671
11672found="no"
11673m4_foreach([flag], m4_cdr($@), [
11674	if test $found = "no" ; then
11675		if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
11676			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11677		fi
11678
11679		if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
11680			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11681		fi
11682
11683		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
11684
11685dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
11686		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
11687		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
11688		AC_CACHE_VAL($cacheid,
11689			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
11690					     [eval $cacheid=yes],
11691					     [eval $cacheid=no])])
11692
11693		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11694
11695		eval supported=\$$cacheid
11696		AC_MSG_RESULT([$supported])
11697		if test "$supported" = "yes" ; then
11698			$1="$$1 ]flag["
11699			found="yes"
11700		fi
11701	fi
11702])
11703]) # XORG_TESTSET_CFLAG
11704
11705# XORG_COMPILER_FLAGS
11706# ---------------
11707# Minimum version: 1.16.0
11708#
11709# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
11710# arguments supported by the selected compiler which do NOT alter the generated
11711# code.  These arguments will cause the compiler to print various warnings
11712# during compilation AND turn a conservative set of warnings into errors.
11713#
11714# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
11715# future versions of util-macros as options are added to new compilers.
11716#
11717AC_DEFUN([XORG_COMPILER_FLAGS], [
11718AC_REQUIRE([XORG_COMPILER_BRAND])
11719
11720AC_ARG_ENABLE(selective-werror,
11721              AS_HELP_STRING([--disable-selective-werror],
11722                             [Turn off selective compiler errors. (default: enabled)]),
11723              [SELECTIVE_WERROR=$enableval],
11724              [SELECTIVE_WERROR=yes])
11725
11726AC_LANG_CASE(
11727        [C], [
11728                define([PREFIX], [C])
11729        ],
11730        [C++], [
11731                define([PREFIX], [CXX])
11732        ]
11733)
11734# -v is too short to test reliably with XORG_TESTSET_CFLAG
11735if test "x$SUNCC" = "xyes"; then
11736    [BASE_]PREFIX[FLAGS]="-v"
11737else
11738    [BASE_]PREFIX[FLAGS]=""
11739fi
11740
11741# This chunk of warnings were those that existed in the legacy CWARNFLAGS
11742XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
11743XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
11744XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
11745XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
11746
11747AC_LANG_CASE(
11748	[C], [
11749		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
11750		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
11751		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
11752		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
11753		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
11754		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
11755	]
11756)
11757
11758# This chunk adds additional warnings that could catch undesired effects.
11759XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
11760XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
11761XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
11762XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
11763XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
11764XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
11765XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
11766
11767# These are currently disabled because they are noisy.  They will be enabled
11768# in the future once the codebase is sufficiently modernized to silence
11769# them.  For now, I don't want them to drown out the other warnings.
11770# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
11771# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
11772# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
11773
11774# Turn some warnings into errors, so we don't accidently get successful builds
11775# when there are problems that should be fixed.
11776
11777if test "x$SELECTIVE_WERROR" = "xyes" ; then
11778XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
11779XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
11780XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
11781XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
11782XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
11783XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
11784XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
11785XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
11786XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
11787XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
11788XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
11789XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
11790XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
11791else
11792AC_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])
11793XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
11794XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
11795XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
11796XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
11797XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
11798XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
11799XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
11800XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
11801XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
11802XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
11803XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
11804XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
11805XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
11806fi
11807
11808AC_SUBST([BASE_]PREFIX[FLAGS])
11809]) # XORG_COMPILER_FLAGS
11810
11811# XORG_CWARNFLAGS
11812# ---------------
11813# Minimum version: 1.2.0
11814# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
11815#
11816# Defines CWARNFLAGS to enable C compiler warnings.
11817#
11818# This function is deprecated because it defines -fno-strict-aliasing
11819# which alters the code generated by the compiler.  If -fno-strict-aliasing
11820# is needed, then it should be added explicitly in the module when
11821# it is updated to use BASE_CFLAGS.
11822#
11823AC_DEFUN([XORG_CWARNFLAGS], [
11824AC_REQUIRE([XORG_COMPILER_FLAGS])
11825AC_REQUIRE([XORG_COMPILER_BRAND])
11826AC_LANG_CASE(
11827	[C], [
11828		CWARNFLAGS="$BASE_CFLAGS"
11829		if  test "x$GCC" = xyes ; then
11830		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
11831		fi
11832		AC_SUBST(CWARNFLAGS)
11833	]
11834)
11835]) # XORG_CWARNFLAGS
11836
11837# XORG_STRICT_OPTION
11838# -----------------------
11839# Minimum version: 1.3.0
11840#
11841# Add configure option to enable strict compilation flags, such as treating
11842# warnings as fatal errors.
11843# If --enable-strict-compilation is passed to configure, adds strict flags to
11844# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
11845#
11846# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
11847# when strict compilation is unconditionally desired.
11848AC_DEFUN([XORG_STRICT_OPTION], [
11849AC_REQUIRE([XORG_CWARNFLAGS])
11850AC_REQUIRE([XORG_COMPILER_FLAGS])
11851
11852AC_ARG_ENABLE(strict-compilation,
11853			  AS_HELP_STRING([--enable-strict-compilation],
11854			  [Enable all warnings from compiler and make them errors (default: disabled)]),
11855			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
11856
11857AC_LANG_CASE(
11858        [C], [
11859                define([PREFIX], [C])
11860        ],
11861        [C++], [
11862                define([PREFIX], [CXX])
11863        ]
11864)
11865
11866[STRICT_]PREFIX[FLAGS]=""
11867XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
11868XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
11869
11870# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
11871# activate it with -Werror, so we add it here explicitly.
11872XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
11873
11874if test "x$STRICT_COMPILE" = "xyes"; then
11875    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
11876    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
11877fi
11878AC_SUBST([STRICT_]PREFIX[FLAGS])
11879AC_SUBST([BASE_]PREFIX[FLAGS])
11880AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
11881]) # XORG_STRICT_OPTION
11882
11883# XORG_DEFAULT_OPTIONS
11884# --------------------
11885# Minimum version: 1.3.0
11886#
11887# Defines default options for X.Org modules.
11888#
11889AC_DEFUN([XORG_DEFAULT_OPTIONS], [
11890AC_REQUIRE([AC_PROG_INSTALL])
11891XORG_COMPILER_FLAGS
11892XORG_CWARNFLAGS
11893XORG_STRICT_OPTION
11894XORG_RELEASE_VERSION
11895XORG_CHANGELOG
11896XORG_INSTALL
11897XORG_MANPAGE_SECTIONS
11898m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
11899    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
11900]) # XORG_DEFAULT_OPTIONS
11901
11902# XORG_INSTALL()
11903# ----------------
11904# Minimum version: 1.4.0
11905#
11906# Defines the variable INSTALL_CMD as the command to copy
11907# INSTALL from $prefix/share/util-macros.
11908#
11909AC_DEFUN([XORG_INSTALL], [
11910AC_REQUIRE([PKG_PROG_PKG_CONFIG])
11911macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
11912INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
11913mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
11914|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
11915echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
11916AC_SUBST([INSTALL_CMD])
11917]) # XORG_INSTALL
11918dnl Copyright 2005 Red Hat, Inc
11919dnl
11920dnl Permission to use, copy, modify, distribute, and sell this software and its
11921dnl documentation for any purpose is hereby granted without fee, provided that
11922dnl the above copyright notice appear in all copies and that both that
11923dnl copyright notice and this permission notice appear in supporting
11924dnl documentation.
11925dnl
11926dnl The above copyright notice and this permission notice shall be included
11927dnl in all copies or substantial portions of the Software.
11928dnl
11929dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11930dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11931dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11932dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11933dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11934dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11935dnl OTHER DEALINGS IN THE SOFTWARE.
11936dnl
11937dnl Except as contained in this notice, the name of the copyright holders shall
11938dnl not be used in advertising or otherwise to promote the sale, use or
11939dnl other dealings in this Software without prior written authorization
11940dnl from the copyright holders.
11941dnl
11942
11943# XORG_RELEASE_VERSION
11944# --------------------
11945# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
11946 
11947AC_DEFUN([XORG_RELEASE_VERSION],[
11948	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
11949		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
11950		[Major version of this package])
11951	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
11952	if test "x$PVM" = "x"; then
11953		PVM="0"
11954	fi
11955	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
11956		[$PVM],
11957		[Minor version of this package])
11958	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
11959	if test "x$PVP" = "x"; then
11960		PVP="0"
11961	fi
11962	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
11963		[$PVP],
11964		[Patch version of this package])
11965])
11966
11967# XORG_CHANGELOG()
11968# ----------------
11969# Minimum version: 1.2.0
11970#
11971# Defines the variable CHANGELOG_CMD as the command to generate
11972# ChangeLog from git.
11973#
11974#
11975AC_DEFUN([XORG_CHANGELOG], [
11976CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
11977mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
11978|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
11979echo 'git directory not found: installing possibly empty changelog.' >&2)"
11980AC_SUBST([CHANGELOG_CMD])
11981]) # XORG_CHANGELOG
11982
11983