aclocal.m4 revision 17caa701
117caa701Smrg# generated automatically by aclocal 1.13.2 -*- Autoconf -*-
217caa701Smrg
317caa701Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
46f03b1f6Smrg
56f03b1f6Smrg# This file is free software; the Free Software Foundation
66f03b1f6Smrg# gives unlimited permission to copy and/or distribute it,
76f03b1f6Smrg# with or without modifications, as long as this notice is preserved.
86f03b1f6Smrg
96f03b1f6Smrg# This program is distributed in the hope that it will be useful,
106f03b1f6Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
116f03b1f6Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
126f03b1f6Smrg# PARTICULAR PURPOSE.
136f03b1f6Smrg
1417caa701Smrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
1598af18c5Smrgm4_ifndef([AC_AUTOCONF_VERSION],
1698af18c5Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1742941e3bSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
1842941e3bSmrg[m4_warning([this file was generated for autoconf 2.68.
1998af18c5SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
2098af18c5SmrgIf you have problems, you may need to regenerate the build system entirely.
2117caa701SmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
226f03b1f6Smrg
2317caa701Smrg# Copyright (C) 2002-2013 Free Software Foundation, Inc.
2498af18c5Smrg#
2598af18c5Smrg# This file is free software; the Free Software Foundation
2698af18c5Smrg# gives unlimited permission to copy and/or distribute it,
2798af18c5Smrg# with or without modifications, as long as this notice is preserved.
286f03b1f6Smrg
2998af18c5Smrg# AM_AUTOMAKE_VERSION(VERSION)
3098af18c5Smrg# ----------------------------
3198af18c5Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
3298af18c5Smrg# generated from the m4 files accompanying Automake X.Y.
3398af18c5Smrg# (This private macro should not be called outside this file.)
3498af18c5SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
3517caa701Smrg[am__api_version='1.13'
3698af18c5Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
3798af18c5Smrgdnl require some minimum version.  Point them to the right macro.
3817caa701Smrgm4_if([$1], [1.13.2], [],
3998af18c5Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
4098af18c5Smrg])
416f03b1f6Smrg
4298af18c5Smrg# _AM_AUTOCONF_VERSION(VERSION)
4398af18c5Smrg# -----------------------------
4498af18c5Smrg# aclocal traces this macro to find the Autoconf version.
4598af18c5Smrg# This is a private macro too.  Using m4_define simplifies
4698af18c5Smrg# the logic in aclocal, which can simply ignore this definition.
4798af18c5Smrgm4_define([_AM_AUTOCONF_VERSION], [])
486f03b1f6Smrg
4998af18c5Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
5098af18c5Smrg# -------------------------------
5198af18c5Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
5298af18c5Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
5398af18c5SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
5417caa701Smrg[AM_AUTOMAKE_VERSION([1.13.2])dnl
5598af18c5Smrgm4_ifndef([AC_AUTOCONF_VERSION],
5698af18c5Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
5798af18c5Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
586f03b1f6Smrg
5998af18c5Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
606f03b1f6Smrg
6117caa701Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
6298af18c5Smrg#
6398af18c5Smrg# This file is free software; the Free Software Foundation
6498af18c5Smrg# gives unlimited permission to copy and/or distribute it,
6598af18c5Smrg# with or without modifications, as long as this notice is preserved.
666f03b1f6Smrg
6798af18c5Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
6817caa701Smrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
6917caa701Smrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
7098af18c5Smrg#
7198af18c5Smrg# Of course, Automake must honor this variable whenever it calls a
7298af18c5Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
7398af18c5Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
7498af18c5Smrg# depending on how configure is run.  This is pretty annoying, since
7598af18c5Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
7698af18c5Smrg# source directory, any form will work fine, but in subdirectories a
7798af18c5Smrg# relative path needs to be adjusted first.
7898af18c5Smrg#
7998af18c5Smrg# $ac_aux_dir/missing
8098af18c5Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
8198af18c5Smrg# $top_srcdir/$ac_aux_dir/missing
8298af18c5Smrg#    fails if $ac_aux_dir is absolute,
8398af18c5Smrg#    fails when called from a subdirectory in a VPATH build with
8498af18c5Smrg#          a relative $ac_aux_dir
8598af18c5Smrg#
8698af18c5Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
8798af18c5Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
8817caa701Smrg# harmless because $srcdir is '.', but things will broke when you
8998af18c5Smrg# start a VPATH build or use an absolute $srcdir.
9098af18c5Smrg#
9198af18c5Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
9298af18c5Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
9398af18c5Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
9498af18c5Smrg# and then we would define $MISSING as
9598af18c5Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
9698af18c5Smrg# This will work as long as MISSING is not called from configure, because
9798af18c5Smrg# unfortunately $(top_srcdir) has no meaning in configure.
9898af18c5Smrg# However there are other variables, like CC, which are often used in
9998af18c5Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
10098af18c5Smrg#
10198af18c5Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
10298af18c5Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
10398af18c5Smrg# configured tree to be moved without reconfiguration.
1046f03b1f6Smrg
10598af18c5SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
10698af18c5Smrg[dnl Rely on autoconf to set up CDPATH properly.
10798af18c5SmrgAC_PREREQ([2.50])dnl
10898af18c5Smrg# expand $ac_aux_dir to an absolute path
10998af18c5Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
11098af18c5Smrg])
1116f03b1f6Smrg
11298af18c5Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1136f03b1f6Smrg
11417caa701Smrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
11598af18c5Smrg#
11698af18c5Smrg# This file is free software; the Free Software Foundation
11798af18c5Smrg# gives unlimited permission to copy and/or distribute it,
11898af18c5Smrg# with or without modifications, as long as this notice is preserved.
1196f03b1f6Smrg
12098af18c5Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
12198af18c5Smrg# -------------------------------------
12298af18c5Smrg# Define a conditional.
12398af18c5SmrgAC_DEFUN([AM_CONDITIONAL],
12417caa701Smrg[AC_PREREQ([2.52])dnl
12517caa701Smrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
12617caa701Smrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
12798af18c5SmrgAC_SUBST([$1_TRUE])dnl
12898af18c5SmrgAC_SUBST([$1_FALSE])dnl
12998af18c5Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
13098af18c5Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
13198af18c5Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
13298af18c5Smrgif $2; then
13398af18c5Smrg  $1_TRUE=
13498af18c5Smrg  $1_FALSE='#'
13598af18c5Smrgelse
13698af18c5Smrg  $1_TRUE='#'
13798af18c5Smrg  $1_FALSE=
13898af18c5Smrgfi
13998af18c5SmrgAC_CONFIG_COMMANDS_PRE(
14098af18c5Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
14198af18c5Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
14298af18c5SmrgUsually this means the macro was only invoked conditionally.]])
14398af18c5Smrgfi])])
1446f03b1f6Smrg
14517caa701Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
14698af18c5Smrg#
14798af18c5Smrg# This file is free software; the Free Software Foundation
14898af18c5Smrg# gives unlimited permission to copy and/or distribute it,
14998af18c5Smrg# with or without modifications, as long as this notice is preserved.
1506f03b1f6Smrg
1516f03b1f6Smrg
15217caa701Smrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
15398af18c5Smrg# written in clear, in which case automake, when reading aclocal.m4,
15498af18c5Smrg# will think it sees a *use*, and therefore will trigger all it's
15598af18c5Smrg# C support machinery.  Also note that it means that autoscan, seeing
15698af18c5Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1576f03b1f6Smrg
1586f03b1f6Smrg
15998af18c5Smrg# _AM_DEPENDENCIES(NAME)
16098af18c5Smrg# ----------------------
16198af18c5Smrg# See how the compiler implements dependency checking.
16217caa701Smrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
16398af18c5Smrg# We try a few techniques and use that to set a single cache variable.
16498af18c5Smrg#
16598af18c5Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
16698af18c5Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
16798af18c5Smrg# dependency, and given that the user is not expected to run this macro,
16898af18c5Smrg# just rely on AC_PROG_CC.
16998af18c5SmrgAC_DEFUN([_AM_DEPENDENCIES],
17098af18c5Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
17198af18c5SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
17298af18c5SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
17398af18c5SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1746f03b1f6Smrg
17517caa701Smrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
17617caa701Smrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
17717caa701Smrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
17817caa701Smrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
17917caa701Smrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
18017caa701Smrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
18117caa701Smrg                    [depcc="$$1"   am_compiler_list=])
1826f03b1f6Smrg
18398af18c5SmrgAC_CACHE_CHECK([dependency style of $depcc],
18498af18c5Smrg               [am_cv_$1_dependencies_compiler_type],
18598af18c5Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
18698af18c5Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
18798af18c5Smrg  # making bogus files that we don't know about and never remove.  For
18898af18c5Smrg  # instance it was reported that on HP-UX the gcc test will end up
18917caa701Smrg  # making a dummy file named 'D' -- because '-MD' means "put the output
19017caa701Smrg  # in D".
19117caa701Smrg  rm -rf conftest.dir
19298af18c5Smrg  mkdir conftest.dir
19398af18c5Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
19498af18c5Smrg  # using a relative directory.
19598af18c5Smrg  cp "$am_depcomp" conftest.dir
19698af18c5Smrg  cd conftest.dir
19798af18c5Smrg  # We will build objects and dependencies in a subdirectory because
19898af18c5Smrg  # it helps to detect inapplicable dependency modes.  For instance
19998af18c5Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
20098af18c5Smrg  # side effect of compilation, but ICC will put the dependencies in
20198af18c5Smrg  # the current directory while Tru64 will put them in the object
20298af18c5Smrg  # directory.
20398af18c5Smrg  mkdir sub
2046f03b1f6Smrg
20598af18c5Smrg  am_cv_$1_dependencies_compiler_type=none
20698af18c5Smrg  if test "$am_compiler_list" = ""; then
20798af18c5Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
20898af18c5Smrg  fi
20998af18c5Smrg  am__universal=false
21098af18c5Smrg  m4_case([$1], [CC],
21198af18c5Smrg    [case " $depcc " in #(
21298af18c5Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
21398af18c5Smrg     esac],
21498af18c5Smrg    [CXX],
21598af18c5Smrg    [case " $depcc " in #(
21698af18c5Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
21798af18c5Smrg     esac])
2186f03b1f6Smrg
21998af18c5Smrg  for depmode in $am_compiler_list; do
22098af18c5Smrg    # Setup a source with many dependencies, because some compilers
22198af18c5Smrg    # like to wrap large dependency lists on column 80 (with \), and
22298af18c5Smrg    # we should not choose a depcomp mode which is confused by this.
22398af18c5Smrg    #
22498af18c5Smrg    # We need to recreate these files for each test, as the compiler may
22598af18c5Smrg    # overwrite some of them when testing with obscure command lines.
22698af18c5Smrg    # This happens at least with the AIX C compiler.
22798af18c5Smrg    : > sub/conftest.c
22898af18c5Smrg    for i in 1 2 3 4 5 6; do
22998af18c5Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
23017caa701Smrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
23117caa701Smrg      # Solaris 10 /bin/sh.
23217caa701Smrg      echo '/* dummy */' > sub/conftst$i.h
23398af18c5Smrg    done
23498af18c5Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2356f03b1f6Smrg
23617caa701Smrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
23798af18c5Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
23817caa701Smrg    # handle '-M -o', and we need to detect this.  Also, some Intel
23917caa701Smrg    # versions had trouble with output in subdirs.
24098af18c5Smrg    am__obj=sub/conftest.${OBJEXT-o}
24198af18c5Smrg    am__minus_obj="-o $am__obj"
24298af18c5Smrg    case $depmode in
24398af18c5Smrg    gcc)
24498af18c5Smrg      # This depmode causes a compiler race in universal mode.
24598af18c5Smrg      test "$am__universal" = false || continue
24698af18c5Smrg      ;;
24798af18c5Smrg    nosideeffect)
24817caa701Smrg      # After this tag, mechanisms are not by side-effect, so they'll
24917caa701Smrg      # only be used when explicitly requested.
25098af18c5Smrg      if test "x$enable_dependency_tracking" = xyes; then
25198af18c5Smrg	continue
25298af18c5Smrg      else
25398af18c5Smrg	break
25498af18c5Smrg      fi
25598af18c5Smrg      ;;
25617caa701Smrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
25717caa701Smrg      # This compiler won't grok '-c -o', but also, the minuso test has
25898af18c5Smrg      # not run yet.  These depmodes are late enough in the game, and
25998af18c5Smrg      # so weak that their functioning should not be impacted.
26098af18c5Smrg      am__obj=conftest.${OBJEXT-o}
26198af18c5Smrg      am__minus_obj=
26298af18c5Smrg      ;;
26398af18c5Smrg    none) break ;;
26498af18c5Smrg    esac
26598af18c5Smrg    if depmode=$depmode \
26698af18c5Smrg       source=sub/conftest.c object=$am__obj \
26798af18c5Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
26898af18c5Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
26998af18c5Smrg         >/dev/null 2>conftest.err &&
27098af18c5Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
27198af18c5Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
27298af18c5Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
27398af18c5Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
27498af18c5Smrg      # icc doesn't choke on unknown options, it will just issue warnings
27598af18c5Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
27698af18c5Smrg      # that says an option was ignored or not supported.
27798af18c5Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
27898af18c5Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
27998af18c5Smrg      # The diagnosis changed in icc 8.0:
28098af18c5Smrg      #   icc: Command line remark: option '-MP' not supported
28198af18c5Smrg      if (grep 'ignoring option' conftest.err ||
28298af18c5Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
28398af18c5Smrg        am_cv_$1_dependencies_compiler_type=$depmode
28498af18c5Smrg        break
28598af18c5Smrg      fi
28698af18c5Smrg    fi
28798af18c5Smrg  done
2886f03b1f6Smrg
28998af18c5Smrg  cd ..
29098af18c5Smrg  rm -rf conftest.dir
29198af18c5Smrgelse
29298af18c5Smrg  am_cv_$1_dependencies_compiler_type=none
2936f03b1f6Smrgfi
29498af18c5Smrg])
29598af18c5SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
29698af18c5SmrgAM_CONDITIONAL([am__fastdep$1], [
29798af18c5Smrg  test "x$enable_dependency_tracking" != xno \
29898af18c5Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
29998af18c5Smrg])
3006f03b1f6Smrg
3016f03b1f6Smrg
30298af18c5Smrg# AM_SET_DEPDIR
30398af18c5Smrg# -------------
30498af18c5Smrg# Choose a directory name for dependency files.
30517caa701Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
30698af18c5SmrgAC_DEFUN([AM_SET_DEPDIR],
30798af18c5Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
30898af18c5SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
30998af18c5Smrg])
3106f03b1f6Smrg
3116f03b1f6Smrg
31298af18c5Smrg# AM_DEP_TRACK
31398af18c5Smrg# ------------
31498af18c5SmrgAC_DEFUN([AM_DEP_TRACK],
31517caa701Smrg[AC_ARG_ENABLE([dependency-tracking], [dnl
31617caa701SmrgAS_HELP_STRING(
31717caa701Smrg  [--enable-dependency-tracking],
31817caa701Smrg  [do not reject slow dependency extractors])
31917caa701SmrgAS_HELP_STRING(
32017caa701Smrg  [--disable-dependency-tracking],
32117caa701Smrg  [speeds up one-time build])])
32298af18c5Smrgif test "x$enable_dependency_tracking" != xno; then
32398af18c5Smrg  am_depcomp="$ac_aux_dir/depcomp"
32498af18c5Smrg  AMDEPBACKSLASH='\'
32517caa701Smrg  am__nodep='_no'
32698af18c5Smrgfi
32798af18c5SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
32898af18c5SmrgAC_SUBST([AMDEPBACKSLASH])dnl
32998af18c5Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
33017caa701SmrgAC_SUBST([am__nodep])dnl
33117caa701Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl
33298af18c5Smrg])
3336f03b1f6Smrg
33498af18c5Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
3356f03b1f6Smrg
33617caa701Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
33798af18c5Smrg#
33898af18c5Smrg# This file is free software; the Free Software Foundation
33998af18c5Smrg# gives unlimited permission to copy and/or distribute it,
34098af18c5Smrg# with or without modifications, as long as this notice is preserved.
3416f03b1f6Smrg
3426f03b1f6Smrg
34398af18c5Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
34498af18c5Smrg# ------------------------------
34598af18c5SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
34698af18c5Smrg[{
34717caa701Smrg  # Older Autoconf quotes --file arguments for eval, but not when files
34898af18c5Smrg  # are listed without --file.  Let's play safe and only enable the eval
34998af18c5Smrg  # if we detect the quoting.
35098af18c5Smrg  case $CONFIG_FILES in
35198af18c5Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
35298af18c5Smrg  *)   set x $CONFIG_FILES ;;
35398af18c5Smrg  esac
35498af18c5Smrg  shift
35598af18c5Smrg  for mf
35698af18c5Smrg  do
35798af18c5Smrg    # Strip MF so we end up with the name of the file.
35898af18c5Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
35998af18c5Smrg    # Check whether this is an Automake generated Makefile or not.
36017caa701Smrg    # We used to match only the files named 'Makefile.in', but
36198af18c5Smrg    # some people rename them; so instead we look at the file content.
36298af18c5Smrg    # Grep'ing the first line is not enough: some people post-process
36398af18c5Smrg    # each Makefile.in and add a new line on top of each file to say so.
36498af18c5Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
36598af18c5Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
36698af18c5Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
36798af18c5Smrg      dirpart=`AS_DIRNAME("$mf")`
36898af18c5Smrg    else
36998af18c5Smrg      continue
37098af18c5Smrg    fi
37198af18c5Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
37217caa701Smrg    # from the Makefile without running 'make'.
37398af18c5Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
37498af18c5Smrg    test -z "$DEPDIR" && continue
37598af18c5Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
37617caa701Smrg    test -z "$am__include" && continue
37798af18c5Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
37898af18c5Smrg    # Find all dependency output files, they are included files with
37998af18c5Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
38098af18c5Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
38198af18c5Smrg    # expansion.
38298af18c5Smrg    for file in `sed -n "
38398af18c5Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
38417caa701Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
38598af18c5Smrg      # Make sure the directory exists.
38698af18c5Smrg      test -f "$dirpart/$file" && continue
38798af18c5Smrg      fdir=`AS_DIRNAME(["$file"])`
38898af18c5Smrg      AS_MKDIR_P([$dirpart/$fdir])
38998af18c5Smrg      # echo "creating $dirpart/$file"
39098af18c5Smrg      echo '# dummy' > "$dirpart/$file"
39198af18c5Smrg    done
39298af18c5Smrg  done
39398af18c5Smrg}
39498af18c5Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3956f03b1f6Smrg
3966f03b1f6Smrg
39798af18c5Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
39898af18c5Smrg# -----------------------------
39998af18c5Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
40098af18c5Smrg#
40198af18c5Smrg# This code is only required when automatic dependency tracking
40217caa701Smrg# is enabled.  FIXME.  This creates each '.P' file that we will
40398af18c5Smrg# need in order to bootstrap the dependency handling code.
40498af18c5SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
40598af18c5Smrg[AC_CONFIG_COMMANDS([depfiles],
40698af18c5Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
40798af18c5Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
4086f03b1f6Smrg])
4096f03b1f6Smrg
41098af18c5Smrg# Do all the work for Automake.                             -*- Autoconf -*-
4116f03b1f6Smrg
41217caa701Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
41398af18c5Smrg#
41498af18c5Smrg# This file is free software; the Free Software Foundation
41598af18c5Smrg# gives unlimited permission to copy and/or distribute it,
41698af18c5Smrg# with or without modifications, as long as this notice is preserved.
4176f03b1f6Smrg
41898af18c5Smrg# This macro actually does too much.  Some checks are only needed if
41998af18c5Smrg# your package does certain things.  But this isn't really a big deal.
4206f03b1f6Smrg
42198af18c5Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
42298af18c5Smrg# AM_INIT_AUTOMAKE([OPTIONS])
42398af18c5Smrg# -----------------------------------------------
42498af18c5Smrg# The call with PACKAGE and VERSION arguments is the old style
42598af18c5Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
42698af18c5Smrg# and VERSION should now be passed to AC_INIT and removed from
42798af18c5Smrg# the call to AM_INIT_AUTOMAKE.
42898af18c5Smrg# We support both call styles for the transition.  After
42998af18c5Smrg# the next Automake release, Autoconf can make the AC_INIT
43098af18c5Smrg# arguments mandatory, and then we can depend on a new Autoconf
43198af18c5Smrg# release and drop the old call support.
43298af18c5SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
43317caa701Smrg[AC_PREREQ([2.65])dnl
43498af18c5Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
43598af18c5Smrgdnl the ones we care about.
43698af18c5Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
43798af18c5SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
43898af18c5SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
43998af18c5Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
44098af18c5Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
44198af18c5Smrg  # is not polluted with repeated "-I."
44298af18c5Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
44398af18c5Smrg  # test to see if srcdir already configured
44498af18c5Smrg  if test -f $srcdir/config.status; then
44598af18c5Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
44698af18c5Smrg  fi
44798af18c5Smrgfi
4486f03b1f6Smrg
44998af18c5Smrg# test whether we have cygpath
45098af18c5Smrgif test -z "$CYGPATH_W"; then
45198af18c5Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
45298af18c5Smrg    CYGPATH_W='cygpath -w'
45398af18c5Smrg  else
45498af18c5Smrg    CYGPATH_W=echo
45598af18c5Smrg  fi
45698af18c5Smrgfi
45798af18c5SmrgAC_SUBST([CYGPATH_W])
4586f03b1f6Smrg
45998af18c5Smrg# Define the identity of the package.
46098af18c5Smrgdnl Distinguish between old-style and new-style calls.
46198af18c5Smrgm4_ifval([$2],
46217caa701Smrg[AC_DIAGNOSE([obsolete],
46317caa701Smrg             [$0: two- and three-arguments forms are deprecated.])
46417caa701Smrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
46598af18c5Smrg AC_SUBST([PACKAGE], [$1])dnl
46698af18c5Smrg AC_SUBST([VERSION], [$2])],
46798af18c5Smrg[_AM_SET_OPTIONS([$1])dnl
46898af18c5Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
46917caa701Smrgm4_if(
47017caa701Smrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
47117caa701Smrg  [ok:ok],,
47298af18c5Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
47398af18c5Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
47498af18c5Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
4756f03b1f6Smrg
47698af18c5Smrg_AM_IF_OPTION([no-define],,
47717caa701Smrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
47817caa701Smrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
4796f03b1f6Smrg
48098af18c5Smrg# Some tools Automake needs.
48198af18c5SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
48298af18c5SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
48317caa701SmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
48417caa701SmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
48517caa701SmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
48617caa701SmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
48717caa701SmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
48898af18c5SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
48998af18c5SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
49017caa701SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
49117caa701Smrg# For better backward compatibility.  To be removed once Automake 1.9.x
49217caa701Smrg# dies out for good.  For more background, see:
49317caa701Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
49417caa701Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
49517caa701SmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
49698af18c5Smrg# We need awk for the "check" target.  The system "awk" is bad on
49798af18c5Smrg# some platforms.
49898af18c5SmrgAC_REQUIRE([AC_PROG_AWK])dnl
49998af18c5SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
50098af18c5SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
50198af18c5Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
50298af18c5Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
50398af18c5Smrg			     [_AM_PROG_TAR([v7])])])
50498af18c5Smrg_AM_IF_OPTION([no-dependencies],,
50598af18c5Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
50617caa701Smrg		  [_AM_DEPENDENCIES([CC])],
50717caa701Smrg		  [m4_define([AC_PROG_CC],
50817caa701Smrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
50998af18c5SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
51017caa701Smrg		  [_AM_DEPENDENCIES([CXX])],
51117caa701Smrg		  [m4_define([AC_PROG_CXX],
51217caa701Smrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
51398af18c5SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
51417caa701Smrg		  [_AM_DEPENDENCIES([OBJC])],
51517caa701Smrg		  [m4_define([AC_PROG_OBJC],
51617caa701Smrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
51717caa701SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
51817caa701Smrg		  [_AM_DEPENDENCIES([OBJCXX])],
51917caa701Smrg		  [m4_define([AC_PROG_OBJCXX],
52017caa701Smrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
52198af18c5Smrg])
52217caa701SmrgAC_REQUIRE([AM_SILENT_RULES])dnl
52317caa701Smrgdnl The testsuite driver may need to know about EXEEXT, so add the
52417caa701Smrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
52517caa701Smrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
52698af18c5SmrgAC_CONFIG_COMMANDS_PRE(dnl
52798af18c5Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
52898af18c5Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
52998af18c5Smrg])
5306f03b1f6Smrg
53117caa701Smrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
53298af18c5Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
53398af18c5Smrgdnl mangled by Autoconf and run in a shell conditional statement.
53498af18c5Smrgm4_define([_AC_COMPILER_EXEEXT],
53598af18c5Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
5366f03b1f6Smrg
5376f03b1f6Smrg
53898af18c5Smrg# When config.status generates a header, we must update the stamp-h file.
53998af18c5Smrg# This file resides in the same directory as the config header
54098af18c5Smrg# that is generated.  The stamp files are numbered to have different names.
5416f03b1f6Smrg
54298af18c5Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
54398af18c5Smrg# loop where config.status creates the headers, so we can generate
54498af18c5Smrg# our stamp files there.
54598af18c5SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
54698af18c5Smrg[# Compute $1's index in $config_headers.
54798af18c5Smrg_am_arg=$1
54898af18c5Smrg_am_stamp_count=1
54998af18c5Smrgfor _am_header in $config_headers :; do
55098af18c5Smrg  case $_am_header in
55198af18c5Smrg    $_am_arg | $_am_arg:* )
55298af18c5Smrg      break ;;
55398af18c5Smrg    * )
55498af18c5Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
55598af18c5Smrg  esac
55698af18c5Smrgdone
55798af18c5Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
5586f03b1f6Smrg
55917caa701Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
56098af18c5Smrg#
56198af18c5Smrg# This file is free software; the Free Software Foundation
56298af18c5Smrg# gives unlimited permission to copy and/or distribute it,
56398af18c5Smrg# with or without modifications, as long as this notice is preserved.
5646f03b1f6Smrg
56598af18c5Smrg# AM_PROG_INSTALL_SH
56698af18c5Smrg# ------------------
56798af18c5Smrg# Define $install_sh.
56898af18c5SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
56998af18c5Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
57098af18c5Smrgif test x"${install_sh}" != xset; then
57198af18c5Smrg  case $am_aux_dir in
57298af18c5Smrg  *\ * | *\	*)
57398af18c5Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
57498af18c5Smrg  *)
57598af18c5Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
57698af18c5Smrg  esac
57798af18c5Smrgfi
57817caa701SmrgAC_SUBST([install_sh])])
5796f03b1f6Smrg
58017caa701Smrg# Copyright (C) 2003-2013 Free Software Foundation, Inc.
58198af18c5Smrg#
58298af18c5Smrg# This file is free software; the Free Software Foundation
58398af18c5Smrg# gives unlimited permission to copy and/or distribute it,
58498af18c5Smrg# with or without modifications, as long as this notice is preserved.
5856f03b1f6Smrg
58698af18c5Smrg# Check whether the underlying file-system supports filenames
58798af18c5Smrg# with a leading dot.  For instance MS-DOS doesn't.
58898af18c5SmrgAC_DEFUN([AM_SET_LEADING_DOT],
58998af18c5Smrg[rm -rf .tst 2>/dev/null
59098af18c5Smrgmkdir .tst 2>/dev/null
59198af18c5Smrgif test -d .tst; then
59298af18c5Smrg  am__leading_dot=.
59398af18c5Smrgelse
59498af18c5Smrg  am__leading_dot=_
5956f03b1f6Smrgfi
59698af18c5Smrgrmdir .tst 2>/dev/null
59798af18c5SmrgAC_SUBST([am__leading_dot])])
5986f03b1f6Smrg
59998af18c5Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
60098af18c5Smrg
60117caa701Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
60298af18c5Smrg#
60398af18c5Smrg# This file is free software; the Free Software Foundation
60498af18c5Smrg# gives unlimited permission to copy and/or distribute it,
60598af18c5Smrg# with or without modifications, as long as this notice is preserved.
60698af18c5Smrg
60798af18c5Smrg# AM_MAKE_INCLUDE()
60898af18c5Smrg# -----------------
60998af18c5Smrg# Check to see how make treats includes.
61098af18c5SmrgAC_DEFUN([AM_MAKE_INCLUDE],
61198af18c5Smrg[am_make=${MAKE-make}
61298af18c5Smrgcat > confinc << 'END'
61398af18c5Smrgam__doit:
61498af18c5Smrg	@echo this is the am__doit target
61598af18c5Smrg.PHONY: am__doit
61698af18c5SmrgEND
61798af18c5Smrg# If we don't find an include directive, just comment out the code.
61898af18c5SmrgAC_MSG_CHECKING([for style of include used by $am_make])
61998af18c5Smrgam__include="#"
62098af18c5Smrgam__quote=
62198af18c5Smrg_am_result=none
62298af18c5Smrg# First try GNU make style include.
62398af18c5Smrgecho "include confinc" > confmf
62417caa701Smrg# Ignore all kinds of additional output from 'make'.
62598af18c5Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
62698af18c5Smrg*the\ am__doit\ target*)
62798af18c5Smrg  am__include=include
62898af18c5Smrg  am__quote=
62998af18c5Smrg  _am_result=GNU
6306f03b1f6Smrg  ;;
6316f03b1f6Smrgesac
63298af18c5Smrg# Now try BSD make style include.
63398af18c5Smrgif test "$am__include" = "#"; then
63498af18c5Smrg   echo '.include "confinc"' > confmf
63598af18c5Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
63698af18c5Smrg   *the\ am__doit\ target*)
63798af18c5Smrg     am__include=.include
63898af18c5Smrg     am__quote="\""
63998af18c5Smrg     _am_result=BSD
64098af18c5Smrg     ;;
64198af18c5Smrg   esac
64298af18c5Smrgfi
64398af18c5SmrgAC_SUBST([am__include])
64498af18c5SmrgAC_SUBST([am__quote])
64598af18c5SmrgAC_MSG_RESULT([$_am_result])
64698af18c5Smrgrm -f confinc confmf
64798af18c5Smrg])
6486f03b1f6Smrg
64998af18c5Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
6506f03b1f6Smrg
65117caa701Smrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
65298af18c5Smrg#
65398af18c5Smrg# This file is free software; the Free Software Foundation
65498af18c5Smrg# gives unlimited permission to copy and/or distribute it,
65598af18c5Smrg# with or without modifications, as long as this notice is preserved.
6566f03b1f6Smrg
65798af18c5Smrg# AM_MISSING_PROG(NAME, PROGRAM)
65898af18c5Smrg# ------------------------------
65998af18c5SmrgAC_DEFUN([AM_MISSING_PROG],
66098af18c5Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
66198af18c5Smrg$1=${$1-"${am_missing_run}$2"}
66298af18c5SmrgAC_SUBST($1)])
6636f03b1f6Smrg
66498af18c5Smrg# AM_MISSING_HAS_RUN
66598af18c5Smrg# ------------------
66617caa701Smrg# Define MISSING if not defined so far and test if it is modern enough.
66717caa701Smrg# If it is, set am_missing_run to use it, otherwise, to nothing.
66898af18c5SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
66998af18c5Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
67098af18c5SmrgAC_REQUIRE_AUX_FILE([missing])dnl
67198af18c5Smrgif test x"${MISSING+set}" != xset; then
67298af18c5Smrg  case $am_aux_dir in
67398af18c5Smrg  *\ * | *\	*)
67498af18c5Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
67598af18c5Smrg  *)
67698af18c5Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
67798af18c5Smrg  esac
67898af18c5Smrgfi
67998af18c5Smrg# Use eval to expand $SHELL
68017caa701Smrgif eval "$MISSING --is-lightweight"; then
68117caa701Smrg  am_missing_run="$MISSING "
6826f03b1f6Smrgelse
68398af18c5Smrg  am_missing_run=
68417caa701Smrg  AC_MSG_WARN(['missing' script is too old or missing])
6856f03b1f6Smrgfi
68698af18c5Smrg])
6876f03b1f6Smrg
68898af18c5Smrg# Helper functions for option handling.                     -*- Autoconf -*-
6896f03b1f6Smrg
69017caa701Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
69198af18c5Smrg#
69298af18c5Smrg# This file is free software; the Free Software Foundation
69398af18c5Smrg# gives unlimited permission to copy and/or distribute it,
69498af18c5Smrg# with or without modifications, as long as this notice is preserved.
6956f03b1f6Smrg
69698af18c5Smrg# _AM_MANGLE_OPTION(NAME)
69798af18c5Smrg# -----------------------
69898af18c5SmrgAC_DEFUN([_AM_MANGLE_OPTION],
69998af18c5Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
7006f03b1f6Smrg
70198af18c5Smrg# _AM_SET_OPTION(NAME)
70217caa701Smrg# --------------------
70398af18c5Smrg# Set option NAME.  Presently that only means defining a flag for this option.
70498af18c5SmrgAC_DEFUN([_AM_SET_OPTION],
70517caa701Smrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
7066f03b1f6Smrg
70798af18c5Smrg# _AM_SET_OPTIONS(OPTIONS)
70817caa701Smrg# ------------------------
70998af18c5Smrg# OPTIONS is a space-separated list of Automake options.
71098af18c5SmrgAC_DEFUN([_AM_SET_OPTIONS],
71198af18c5Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
7126f03b1f6Smrg
71398af18c5Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
71498af18c5Smrg# -------------------------------------------
71598af18c5Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
71698af18c5SmrgAC_DEFUN([_AM_IF_OPTION],
71798af18c5Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
7186f03b1f6Smrg
71998af18c5Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
7206f03b1f6Smrg
72117caa701Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
72298af18c5Smrg#
72398af18c5Smrg# This file is free software; the Free Software Foundation
72498af18c5Smrg# gives unlimited permission to copy and/or distribute it,
72598af18c5Smrg# with or without modifications, as long as this notice is preserved.
7266f03b1f6Smrg
72798af18c5Smrg# AM_SANITY_CHECK
72898af18c5Smrg# ---------------
72998af18c5SmrgAC_DEFUN([AM_SANITY_CHECK],
73098af18c5Smrg[AC_MSG_CHECKING([whether build environment is sane])
73198af18c5Smrg# Reject unsafe characters in $srcdir or the absolute working directory
73298af18c5Smrg# name.  Accept space and tab only in the latter.
73398af18c5Smrgam_lf='
73498af18c5Smrg'
73598af18c5Smrgcase `pwd` in
73698af18c5Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
73798af18c5Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
73898af18c5Smrgesac
73998af18c5Smrgcase $srcdir in
74098af18c5Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
74117caa701Smrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
74298af18c5Smrgesac
7436f03b1f6Smrg
74417caa701Smrg# Do 'set' in a subshell so we don't clobber the current shell's
74598af18c5Smrg# arguments.  Must try -L first in case configure is actually a
74698af18c5Smrg# symlink; some systems play weird games with the mod time of symlinks
74798af18c5Smrg# (eg FreeBSD returns the mod time of the symlink's containing
74898af18c5Smrg# directory).
74998af18c5Smrgif (
75017caa701Smrg   am_has_slept=no
75117caa701Smrg   for am_try in 1 2; do
75217caa701Smrg     echo "timestamp, slept: $am_has_slept" > conftest.file
75317caa701Smrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
75417caa701Smrg     if test "$[*]" = "X"; then
75517caa701Smrg	# -L didn't work.
75617caa701Smrg	set X `ls -t "$srcdir/configure" conftest.file`
75717caa701Smrg     fi
75817caa701Smrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
75917caa701Smrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
76017caa701Smrg
76117caa701Smrg	# If neither matched, then we have a broken ls.  This can happen
76217caa701Smrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
76317caa701Smrg	# broken ls alias from the environment.  This has actually
76417caa701Smrg	# happened.  Such a system could not be considered "sane".
76517caa701Smrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
76617caa701Smrg  alias in your environment])
76717caa701Smrg     fi
76817caa701Smrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
76917caa701Smrg       break
77017caa701Smrg     fi
77117caa701Smrg     # Just in case.
77217caa701Smrg     sleep 1
77317caa701Smrg     am_has_slept=yes
77417caa701Smrg   done
77598af18c5Smrg   test "$[2]" = conftest.file
77698af18c5Smrg   )
77798af18c5Smrgthen
77898af18c5Smrg   # Ok.
77998af18c5Smrg   :
7806f03b1f6Smrgelse
78198af18c5Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
78298af18c5SmrgCheck your system clock])
78398af18c5Smrgfi
78417caa701SmrgAC_MSG_RESULT([yes])
78517caa701Smrg# If we didn't sleep, we still need to ensure time stamps of config.status and
78617caa701Smrg# generated files are strictly newer.
78717caa701Smrgam_sleep_pid=
78817caa701Smrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
78917caa701Smrg  ( sleep 1 ) &
79017caa701Smrg  am_sleep_pid=$!
79117caa701Smrgfi
79217caa701SmrgAC_CONFIG_COMMANDS_PRE(
79317caa701Smrg  [AC_MSG_CHECKING([that generated files are newer than configure])
79417caa701Smrg   if test -n "$am_sleep_pid"; then
79517caa701Smrg     # Hide warnings about reused PIDs.
79617caa701Smrg     wait $am_sleep_pid 2>/dev/null
79717caa701Smrg   fi
79817caa701Smrg   AC_MSG_RESULT([done])])
79917caa701Smrgrm -f conftest.file
80017caa701Smrg])
8016f03b1f6Smrg
80217caa701Smrg# Copyright (C) 2009-2013 Free Software Foundation, Inc.
80398af18c5Smrg#
80498af18c5Smrg# This file is free software; the Free Software Foundation
80598af18c5Smrg# gives unlimited permission to copy and/or distribute it,
80698af18c5Smrg# with or without modifications, as long as this notice is preserved.
8076f03b1f6Smrg
80898af18c5Smrg# AM_SILENT_RULES([DEFAULT])
80998af18c5Smrg# --------------------------
81098af18c5Smrg# Enable less verbose build rules; with the default set to DEFAULT
81117caa701Smrg# ("yes" being less verbose, "no" or empty being verbose).
81298af18c5SmrgAC_DEFUN([AM_SILENT_RULES],
81317caa701Smrg[AC_ARG_ENABLE([silent-rules], [dnl
81417caa701SmrgAS_HELP_STRING(
81517caa701Smrg  [--enable-silent-rules],
81617caa701Smrg  [less verbose build output (undo: "make V=1")])
81717caa701SmrgAS_HELP_STRING(
81817caa701Smrg  [--disable-silent-rules],
81917caa701Smrg  [verbose build output (undo: "make V=0")])dnl
82017caa701Smrg])
82117caa701Smrgcase $enable_silent_rules in @%:@ (((
82217caa701Smrg  yes) AM_DEFAULT_VERBOSITY=0;;
82317caa701Smrg   no) AM_DEFAULT_VERBOSITY=1;;
82417caa701Smrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
82598af18c5Smrgesac
82617caa701Smrgdnl
82717caa701Smrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
82817caa701Smrgdnl do not support nested variable expansions.
82917caa701Smrgdnl See automake bug#9928 and bug#10237.
83017caa701Smrgam_make=${MAKE-make}
83117caa701SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
83217caa701Smrg   [am_cv_make_support_nested_variables],
83317caa701Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
83417caa701SmrgBAR0=false
83517caa701SmrgBAR1=true
83617caa701SmrgV=1
83717caa701Smrgam__doit:
83817caa701Smrg	@$(TRUE)
83917caa701Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
84017caa701Smrg  am_cv_make_support_nested_variables=yes
84117caa701Smrgelse
84217caa701Smrg  am_cv_make_support_nested_variables=no
84317caa701Smrgfi])
84417caa701Smrgif test $am_cv_make_support_nested_variables = yes; then
84517caa701Smrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
84617caa701Smrg  AM_V='$(V)'
84717caa701Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
84817caa701Smrgelse
84917caa701Smrg  AM_V=$AM_DEFAULT_VERBOSITY
85017caa701Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
85117caa701Smrgfi
85217caa701SmrgAC_SUBST([AM_V])dnl
85317caa701SmrgAM_SUBST_NOTMAKE([AM_V])dnl
85417caa701SmrgAC_SUBST([AM_DEFAULT_V])dnl
85517caa701SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
85698af18c5SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
85798af18c5SmrgAM_BACKSLASH='\'
85898af18c5SmrgAC_SUBST([AM_BACKSLASH])dnl
85998af18c5Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
86098af18c5Smrg])
8616f03b1f6Smrg
86217caa701Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
86398af18c5Smrg#
86498af18c5Smrg# This file is free software; the Free Software Foundation
86598af18c5Smrg# gives unlimited permission to copy and/or distribute it,
86698af18c5Smrg# with or without modifications, as long as this notice is preserved.
8676f03b1f6Smrg
86898af18c5Smrg# AM_PROG_INSTALL_STRIP
86998af18c5Smrg# ---------------------
87017caa701Smrg# One issue with vendor 'install' (even GNU) is that you can't
87198af18c5Smrg# specify the program used to strip binaries.  This is especially
87298af18c5Smrg# annoying in cross-compiling environments, where the build's strip
87398af18c5Smrg# is unlikely to handle the host's binaries.
87498af18c5Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
87517caa701Smrg# always use install-sh in "make install-strip", and initialize
87698af18c5Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
87798af18c5SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
87898af18c5Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
87917caa701Smrg# Installed binaries are usually stripped using 'strip' when the user
88017caa701Smrg# run "make install-strip".  However 'strip' might not be the right
88198af18c5Smrg# tool to use in cross-compilation environments, therefore Automake
88217caa701Smrg# will honor the 'STRIP' environment variable to overrule this program.
88317caa701Smrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
88498af18c5Smrgif test "$cross_compiling" != no; then
88598af18c5Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
8866f03b1f6Smrgfi
88798af18c5SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
88898af18c5SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
8896f03b1f6Smrg
89017caa701Smrg# Copyright (C) 2006-2013 Free Software Foundation, Inc.
89198af18c5Smrg#
89298af18c5Smrg# This file is free software; the Free Software Foundation
89398af18c5Smrg# gives unlimited permission to copy and/or distribute it,
89498af18c5Smrg# with or without modifications, as long as this notice is preserved.
8956f03b1f6Smrg
89698af18c5Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
89798af18c5Smrg# ---------------------------
89898af18c5Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
89998af18c5Smrg# This macro is traced by Automake.
90098af18c5SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
9016f03b1f6Smrg
90298af18c5Smrg# AM_SUBST_NOTMAKE(VARIABLE)
90317caa701Smrg# --------------------------
90498af18c5Smrg# Public sister of _AM_SUBST_NOTMAKE.
90598af18c5SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
9066f03b1f6Smrg
90798af18c5Smrg# Check how to create a tarball.                            -*- Autoconf -*-
9086f03b1f6Smrg
90917caa701Smrg# Copyright (C) 2004-2013 Free Software Foundation, Inc.
91098af18c5Smrg#
91198af18c5Smrg# This file is free software; the Free Software Foundation
91298af18c5Smrg# gives unlimited permission to copy and/or distribute it,
91398af18c5Smrg# with or without modifications, as long as this notice is preserved.
9146f03b1f6Smrg
91598af18c5Smrg# _AM_PROG_TAR(FORMAT)
91698af18c5Smrg# --------------------
91798af18c5Smrg# Check how to create a tarball in format FORMAT.
91817caa701Smrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
91998af18c5Smrg#
92098af18c5Smrg# Substitute a variable $(am__tar) that is a command
92198af18c5Smrg# writing to stdout a FORMAT-tarball containing the directory
92298af18c5Smrg# $tardir.
92398af18c5Smrg#     tardir=directory && $(am__tar) > result.tar
92498af18c5Smrg#
92598af18c5Smrg# Substitute a variable $(am__untar) that extract such
92698af18c5Smrg# a tarball read from stdin.
92798af18c5Smrg#     $(am__untar) < result.tar
92842941e3bSmrg#
92917caa701SmrgAC_DEFUN([_AM_PROG_TAR],
93017caa701Smrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
93117caa701Smrg# in the wild :-(  We should find a proper way to deprecate it ...
93217caa701SmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
9336f03b1f6Smrg
93417caa701Smrg# We'll loop over all known methods to create a tar archive until one works.
93517caa701Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
9366f03b1f6Smrg
93717caa701Smrgm4_if([$1], [v7],
93817caa701Smrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
93917caa701Smrg
94017caa701Smrg  [m4_case([$1],
94117caa701Smrg    [ustar],
94217caa701Smrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
94317caa701Smrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
94417caa701Smrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
94517caa701Smrg      # and bug#13588).
94617caa701Smrg      am_max_uid=2097151 # 2^21 - 1
94717caa701Smrg      am_max_gid=$am_max_uid
94817caa701Smrg      # The $UID and $GID variables are not portable, so we need to resort
94917caa701Smrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
95017caa701Smrg      # below are definitely unexpected, so allow the users to see them
95117caa701Smrg      # (that is, avoid stderr redirection).
95217caa701Smrg      am_uid=`id -u || echo unknown`
95317caa701Smrg      am_gid=`id -g || echo unknown`
95417caa701Smrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
95517caa701Smrg      if test $am_uid -le $am_max_uid; then
95617caa701Smrg         AC_MSG_RESULT([yes])
95717caa701Smrg      else
95817caa701Smrg         AC_MSG_RESULT([no])
95917caa701Smrg         _am_tools=none
96017caa701Smrg      fi
96117caa701Smrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
96217caa701Smrg      if test $am_gid -le $am_max_gid; then
96317caa701Smrg         AC_MSG_RESULT([yes])
96417caa701Smrg      else
96517caa701Smrg        AC_MSG_RESULT([no])
96617caa701Smrg        _am_tools=none
96717caa701Smrg      fi],
9686f03b1f6Smrg
96917caa701Smrg  [pax],
97017caa701Smrg    [],
9716f03b1f6Smrg
97217caa701Smrg  [m4_fatal([Unknown tar format])])
973356f6debSmrg
97417caa701Smrg  AC_MSG_CHECKING([how to create a $1 tar archive])
975356f6debSmrg
97617caa701Smrg  # Go ahead even if we have the value already cached.  We do so because we
97717caa701Smrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
97817caa701Smrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
9796f03b1f6Smrg
98017caa701Smrg  for _am_tool in $_am_tools; do
98117caa701Smrg    case $_am_tool in
98217caa701Smrg    gnutar)
98317caa701Smrg      for _am_tar in tar gnutar gtar; do
98417caa701Smrg        AM_RUN_LOG([$_am_tar --version]) && break
98517caa701Smrg      done
98617caa701Smrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
98717caa701Smrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
98817caa701Smrg      am__untar="$_am_tar -xf -"
98917caa701Smrg      ;;
99017caa701Smrg    plaintar)
99117caa701Smrg      # Must skip GNU tar: if it does not support --format= it doesn't create
99217caa701Smrg      # ustar tarball either.
99317caa701Smrg      (tar --version) >/dev/null 2>&1 && continue
99417caa701Smrg      am__tar='tar chf - "$$tardir"'
99517caa701Smrg      am__tar_='tar chf - "$tardir"'
99617caa701Smrg      am__untar='tar xf -'
99717caa701Smrg      ;;
99817caa701Smrg    pax)
99917caa701Smrg      am__tar='pax -L -x $1 -w "$$tardir"'
100017caa701Smrg      am__tar_='pax -L -x $1 -w "$tardir"'
100117caa701Smrg      am__untar='pax -r'
100217caa701Smrg      ;;
100317caa701Smrg    cpio)
100417caa701Smrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
100517caa701Smrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
100617caa701Smrg      am__untar='cpio -i -H $1 -d'
100717caa701Smrg      ;;
100817caa701Smrg    none)
100917caa701Smrg      am__tar=false
101017caa701Smrg      am__tar_=false
101117caa701Smrg      am__untar=false
101217caa701Smrg      ;;
101317caa701Smrg    esac
1014356f6debSmrg
101517caa701Smrg    # If the value was cached, stop now.  We just wanted to have am__tar
101617caa701Smrg    # and am__untar set.
101717caa701Smrg    test -n "${am_cv_prog_tar_$1}" && break
101817caa701Smrg
101917caa701Smrg    # tar/untar a dummy directory, and stop if the command works.
102017caa701Smrg    rm -rf conftest.dir
102117caa701Smrg    mkdir conftest.dir
102217caa701Smrg    echo GrepMe > conftest.dir/file
102317caa701Smrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
102417caa701Smrg    rm -rf conftest.dir
102517caa701Smrg    if test -s conftest.tar; then
102617caa701Smrg      AM_RUN_LOG([$am__untar <conftest.tar])
102717caa701Smrg      AM_RUN_LOG([cat conftest.dir/file])
102817caa701Smrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
102917caa701Smrg    fi
103017caa701Smrg  done
103117caa701Smrg  rm -rf conftest.dir
1032356f6debSmrg
103317caa701Smrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
103417caa701Smrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1035356f6debSmrg
103617caa701SmrgAC_SUBST([am__tar])
103717caa701SmrgAC_SUBST([am__untar])
103817caa701Smrg]) # _AM_PROG_TAR
10396f03b1f6Smrg
104042941e3bSmrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
104142941e3bSmrg#
104242941e3bSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
104317caa701Smrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
104417caa701Smrg#                 Foundation, Inc.
104542941e3bSmrg#   Written by Gordon Matzigkeit, 1996
104642941e3bSmrg#
104742941e3bSmrg# This file is free software; the Free Software Foundation gives
104842941e3bSmrg# unlimited permission to copy and/or distribute it, with or without
104942941e3bSmrg# modifications, as long as this notice is preserved.
10506f03b1f6Smrg
105142941e3bSmrgm4_define([_LT_COPYING], [dnl
105242941e3bSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
105317caa701Smrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
105417caa701Smrg#                 Foundation, Inc.
105542941e3bSmrg#   Written by Gordon Matzigkeit, 1996
105642941e3bSmrg#
105742941e3bSmrg#   This file is part of GNU Libtool.
105842941e3bSmrg#
105942941e3bSmrg# GNU Libtool is free software; you can redistribute it and/or
106042941e3bSmrg# modify it under the terms of the GNU General Public License as
106142941e3bSmrg# published by the Free Software Foundation; either version 2 of
106242941e3bSmrg# the License, or (at your option) any later version.
106342941e3bSmrg#
106442941e3bSmrg# As a special exception to the GNU General Public License,
106542941e3bSmrg# if you distribute this file as part of a program or library that
106642941e3bSmrg# is built using GNU Libtool, you may include this file under the
106742941e3bSmrg# same distribution terms that you use for the rest of that program.
106842941e3bSmrg#
106942941e3bSmrg# GNU Libtool is distributed in the hope that it will be useful,
107042941e3bSmrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
107142941e3bSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
107242941e3bSmrg# GNU General Public License for more details.
107342941e3bSmrg#
107442941e3bSmrg# You should have received a copy of the GNU General Public License
107542941e3bSmrg# along with GNU Libtool; see the file COPYING.  If not, a copy
107642941e3bSmrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
107742941e3bSmrg# obtained by writing to the Free Software Foundation, Inc.,
107842941e3bSmrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
107942941e3bSmrg])
10806f03b1f6Smrg
108142941e3bSmrg# serial 57 LT_INIT
10826f03b1f6Smrg
10836f03b1f6Smrg
108442941e3bSmrg# LT_PREREQ(VERSION)
108542941e3bSmrg# ------------------
108642941e3bSmrg# Complain and exit if this libtool version is less that VERSION.
108742941e3bSmrgm4_defun([LT_PREREQ],
108842941e3bSmrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
108942941e3bSmrg       [m4_default([$3],
109042941e3bSmrg		   [m4_fatal([Libtool version $1 or higher is required],
109142941e3bSmrg		             63)])],
109242941e3bSmrg       [$2])])
109398af18c5Smrg
109498af18c5Smrg
109542941e3bSmrg# _LT_CHECK_BUILDDIR
109642941e3bSmrg# ------------------
109742941e3bSmrg# Complain if the absolute build directory name contains unusual characters
109842941e3bSmrgm4_defun([_LT_CHECK_BUILDDIR],
109942941e3bSmrg[case `pwd` in
110042941e3bSmrg  *\ * | *\	*)
110142941e3bSmrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
110242941e3bSmrgesac
110342941e3bSmrg])
11046f03b1f6Smrg
11056f03b1f6Smrg
110642941e3bSmrg# LT_INIT([OPTIONS])
110742941e3bSmrg# ------------------
110842941e3bSmrgAC_DEFUN([LT_INIT],
110942941e3bSmrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
111042941e3bSmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
111142941e3bSmrgAC_BEFORE([$0], [LT_LANG])dnl
111242941e3bSmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
111342941e3bSmrgAC_BEFORE([$0], [LTDL_INIT])dnl
111442941e3bSmrgm4_require([_LT_CHECK_BUILDDIR])dnl
11156f03b1f6Smrg
111642941e3bSmrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
111742941e3bSmrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
111842941e3bSmrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
111942941e3bSmrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
112042941e3bSmrgdnl unless we require an AC_DEFUNed macro:
112142941e3bSmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
112242941e3bSmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
112342941e3bSmrgAC_REQUIRE([LTVERSION_VERSION])dnl
112442941e3bSmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
112542941e3bSmrgm4_require([_LT_PROG_LTMAIN])dnl
11266f03b1f6Smrg
112742941e3bSmrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
11286f03b1f6Smrg
112942941e3bSmrgdnl Parse OPTIONS
113042941e3bSmrg_LT_SET_OPTIONS([$0], [$1])
1131356f6debSmrg
113242941e3bSmrg# This can be used to rebuild libtool when needed
113342941e3bSmrgLIBTOOL_DEPS="$ltmain"
11346f03b1f6Smrg
113542941e3bSmrg# Always use our own libtool.
113642941e3bSmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
113742941e3bSmrgAC_SUBST(LIBTOOL)dnl
11386f03b1f6Smrg
113942941e3bSmrg_LT_SETUP
11406f03b1f6Smrg
114142941e3bSmrg# Only expand once:
114242941e3bSmrgm4_define([LT_INIT])
114342941e3bSmrg])# LT_INIT
11446f03b1f6Smrg
114542941e3bSmrg# Old names:
114642941e3bSmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
114742941e3bSmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
114842941e3bSmrgdnl aclocal-1.4 backwards compatibility:
114942941e3bSmrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
115042941e3bSmrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
11516f03b1f6Smrg
11526f03b1f6Smrg
115342941e3bSmrg# _LT_CC_BASENAME(CC)
115442941e3bSmrg# -------------------
115542941e3bSmrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
115642941e3bSmrgm4_defun([_LT_CC_BASENAME],
115742941e3bSmrg[for cc_temp in $1""; do
115842941e3bSmrg  case $cc_temp in
115942941e3bSmrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
116042941e3bSmrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
116142941e3bSmrg    \-*) ;;
116242941e3bSmrg    *) break;;
116342941e3bSmrg  esac
116442941e3bSmrgdone
116542941e3bSmrgcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
116642941e3bSmrg])
11676f03b1f6Smrg
11686f03b1f6Smrg
116942941e3bSmrg# _LT_FILEUTILS_DEFAULTS
117042941e3bSmrg# ----------------------
117142941e3bSmrg# It is okay to use these file commands and assume they have been set
117242941e3bSmrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
117342941e3bSmrgm4_defun([_LT_FILEUTILS_DEFAULTS],
117442941e3bSmrg[: ${CP="cp -f"}
117542941e3bSmrg: ${MV="mv -f"}
117642941e3bSmrg: ${RM="rm -f"}
117742941e3bSmrg])# _LT_FILEUTILS_DEFAULTS
1178356f6debSmrg
117942941e3bSmrg
118042941e3bSmrg# _LT_SETUP
118142941e3bSmrg# ---------
118242941e3bSmrgm4_defun([_LT_SETUP],
118342941e3bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
118442941e3bSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
118542941e3bSmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
118642941e3bSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
118742941e3bSmrg
118817caa701Smrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
118917caa701Smrgdnl
119042941e3bSmrg_LT_DECL([], [host_alias], [0], [The host system])dnl
119142941e3bSmrg_LT_DECL([], [host], [0])dnl
119242941e3bSmrg_LT_DECL([], [host_os], [0])dnl
119342941e3bSmrgdnl
119442941e3bSmrg_LT_DECL([], [build_alias], [0], [The build system])dnl
119542941e3bSmrg_LT_DECL([], [build], [0])dnl
119642941e3bSmrg_LT_DECL([], [build_os], [0])dnl
119742941e3bSmrgdnl
119842941e3bSmrgAC_REQUIRE([AC_PROG_CC])dnl
119942941e3bSmrgAC_REQUIRE([LT_PATH_LD])dnl
120042941e3bSmrgAC_REQUIRE([LT_PATH_NM])dnl
120142941e3bSmrgdnl
120242941e3bSmrgAC_REQUIRE([AC_PROG_LN_S])dnl
120342941e3bSmrgtest -z "$LN_S" && LN_S="ln -s"
120442941e3bSmrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
120542941e3bSmrgdnl
120642941e3bSmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
120742941e3bSmrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
120842941e3bSmrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
120942941e3bSmrgdnl
121042941e3bSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
121142941e3bSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
121242941e3bSmrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
121342941e3bSmrgm4_require([_LT_CMD_RELOAD])dnl
121442941e3bSmrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
121542941e3bSmrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
121642941e3bSmrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
121742941e3bSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
121842941e3bSmrgm4_require([_LT_WITH_SYSROOT])dnl
121942941e3bSmrg
122042941e3bSmrg_LT_CONFIG_LIBTOOL_INIT([
122142941e3bSmrg# See if we are running on zsh, and set the options which allow our
122242941e3bSmrg# commands through without removal of \ escapes INIT.
122342941e3bSmrgif test -n "\${ZSH_VERSION+set}" ; then
122442941e3bSmrg   setopt NO_GLOB_SUBST
122542941e3bSmrgfi
122642941e3bSmrg])
122742941e3bSmrgif test -n "${ZSH_VERSION+set}" ; then
122842941e3bSmrg   setopt NO_GLOB_SUBST
1229356f6debSmrgfi
1230356f6debSmrg
123142941e3bSmrg_LT_CHECK_OBJDIR
1232356f6debSmrg
123342941e3bSmrgm4_require([_LT_TAG_COMPILER])dnl
1234356f6debSmrg
123542941e3bSmrgcase $host_os in
123642941e3bSmrgaix3*)
123742941e3bSmrg  # AIX sometimes has problems with the GCC collect2 program.  For some
123842941e3bSmrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
123942941e3bSmrg  # vanish in a puff of smoke.
124042941e3bSmrg  if test "X${COLLECT_NAMES+set}" != Xset; then
124142941e3bSmrg    COLLECT_NAMES=
124242941e3bSmrg    export COLLECT_NAMES
124342941e3bSmrg  fi
124442941e3bSmrg  ;;
124542941e3bSmrgesac
1246356f6debSmrg
124742941e3bSmrg# Global variables:
124842941e3bSmrgofile=libtool
124942941e3bSmrgcan_build_shared=yes
1250356f6debSmrg
125142941e3bSmrg# All known linkers require a `.a' archive for static linking (except MSVC,
125242941e3bSmrg# which needs '.lib').
125342941e3bSmrglibext=a
1254356f6debSmrg
125542941e3bSmrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
1256356f6debSmrg
125742941e3bSmrgold_CC="$CC"
125842941e3bSmrgold_CFLAGS="$CFLAGS"
1259356f6debSmrg
126042941e3bSmrg# Set sane defaults for various variables
126142941e3bSmrgtest -z "$CC" && CC=cc
126242941e3bSmrgtest -z "$LTCC" && LTCC=$CC
126342941e3bSmrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
126442941e3bSmrgtest -z "$LD" && LD=ld
126542941e3bSmrgtest -z "$ac_objext" && ac_objext=o
1266356f6debSmrg
126742941e3bSmrg_LT_CC_BASENAME([$compiler])
1268356f6debSmrg
126942941e3bSmrg# Only perform the check for file, if the check method requires it
127042941e3bSmrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
127142941e3bSmrgcase $deplibs_check_method in
127242941e3bSmrgfile_magic*)
127342941e3bSmrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
127442941e3bSmrg    _LT_PATH_MAGIC
127542941e3bSmrg  fi
127642941e3bSmrg  ;;
127742941e3bSmrgesac
1278356f6debSmrg
127942941e3bSmrg# Use C for the default configuration in the libtool script
128042941e3bSmrgLT_SUPPORTED_TAG([CC])
128142941e3bSmrg_LT_LANG_C_CONFIG
128242941e3bSmrg_LT_LANG_DEFAULT_CONFIG
128342941e3bSmrg_LT_CONFIG_COMMANDS
128442941e3bSmrg])# _LT_SETUP
1285356f6debSmrg
1286356f6debSmrg
128742941e3bSmrg# _LT_PREPARE_SED_QUOTE_VARS
128842941e3bSmrg# --------------------------
128942941e3bSmrg# Define a few sed substitution that help us do robust quoting.
129042941e3bSmrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
129142941e3bSmrg[# Backslashify metacharacters that are still active within
129242941e3bSmrg# double-quoted strings.
129342941e3bSmrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
1294356f6debSmrg
129542941e3bSmrg# Same as above, but do not quote variable references.
129642941e3bSmrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
1297356f6debSmrg
129842941e3bSmrg# Sed substitution to delay expansion of an escaped shell variable in a
129942941e3bSmrg# double_quote_subst'ed string.
130042941e3bSmrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1301356f6debSmrg
130242941e3bSmrg# Sed substitution to delay expansion of an escaped single quote.
130342941e3bSmrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
1304356f6debSmrg
130542941e3bSmrg# Sed substitution to avoid accidental globbing in evaled expressions
130642941e3bSmrgno_glob_subst='s/\*/\\\*/g'
130742941e3bSmrg])
1308356f6debSmrg
130942941e3bSmrg# _LT_PROG_LTMAIN
131042941e3bSmrg# ---------------
131142941e3bSmrg# Note that this code is called both from `configure', and `config.status'
131242941e3bSmrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
131342941e3bSmrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
131442941e3bSmrg# so we pass a copy along to make sure it has a sensible value anyway.
131542941e3bSmrgm4_defun([_LT_PROG_LTMAIN],
131642941e3bSmrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
131742941e3bSmrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
131842941e3bSmrgltmain="$ac_aux_dir/ltmain.sh"
131942941e3bSmrg])# _LT_PROG_LTMAIN
1320356f6debSmrg
13216f03b1f6Smrg
13226f03b1f6Smrg
132342941e3bSmrg# So that we can recreate a full libtool script including additional
132442941e3bSmrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
132542941e3bSmrg# in macros and then make a single call at the end using the `libtool'
132642941e3bSmrg# label.
13276f03b1f6Smrg
13286f03b1f6Smrg
132942941e3bSmrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
133042941e3bSmrg# ----------------------------------------
133142941e3bSmrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
133242941e3bSmrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
133342941e3bSmrg[m4_ifval([$1],
133442941e3bSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
133542941e3bSmrg                     [$1
133642941e3bSmrg])])])
133798af18c5Smrg
133842941e3bSmrg# Initialize.
133942941e3bSmrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
1340356f6debSmrg
1341356f6debSmrg
134242941e3bSmrg# _LT_CONFIG_LIBTOOL([COMMANDS])
134342941e3bSmrg# ------------------------------
134442941e3bSmrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
134542941e3bSmrgm4_define([_LT_CONFIG_LIBTOOL],
134642941e3bSmrg[m4_ifval([$1],
134742941e3bSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
134842941e3bSmrg                     [$1
134942941e3bSmrg])])])
1350356f6debSmrg
135142941e3bSmrg# Initialize.
135242941e3bSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
13536f03b1f6Smrg
13546f03b1f6Smrg
135542941e3bSmrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
135642941e3bSmrg# -----------------------------------------------------
135742941e3bSmrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
135842941e3bSmrg[_LT_CONFIG_LIBTOOL([$1])
135942941e3bSmrg_LT_CONFIG_LIBTOOL_INIT([$2])
136042941e3bSmrg])
13616f03b1f6Smrg
13626f03b1f6Smrg
136342941e3bSmrg# _LT_FORMAT_COMMENT([COMMENT])
136442941e3bSmrg# -----------------------------
136542941e3bSmrg# Add leading comment marks to the start of each line, and a trailing
136642941e3bSmrg# full-stop to the whole comment if one is not present already.
136742941e3bSmrgm4_define([_LT_FORMAT_COMMENT],
136842941e3bSmrg[m4_ifval([$1], [
136942941e3bSmrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
137042941e3bSmrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
137142941e3bSmrg)])
1372356f6debSmrg
13736f03b1f6Smrg
13746f03b1f6Smrg
13756f03b1f6Smrg
137698af18c5Smrg
137742941e3bSmrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
137842941e3bSmrg# -------------------------------------------------------------------
137942941e3bSmrg# CONFIGNAME is the name given to the value in the libtool script.
138042941e3bSmrg# VARNAME is the (base) name used in the configure script.
138142941e3bSmrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
138242941e3bSmrg# VARNAME.  Any other value will be used directly.
138342941e3bSmrgm4_define([_LT_DECL],
138442941e3bSmrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
138542941e3bSmrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
138642941e3bSmrg	[m4_ifval([$1], [$1], [$2])])
138742941e3bSmrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
138842941e3bSmrg    m4_ifval([$4],
138942941e3bSmrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
139042941e3bSmrg    lt_dict_add_subkey([lt_decl_dict], [$2],
139142941e3bSmrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
139242941e3bSmrg])
13936f03b1f6Smrg
1394356f6debSmrg
139542941e3bSmrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
139642941e3bSmrg# --------------------------------------------------------
139742941e3bSmrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
13986f03b1f6Smrg
13996f03b1f6Smrg
140042941e3bSmrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
140142941e3bSmrg# ------------------------------------------------
140242941e3bSmrgm4_define([lt_decl_tag_varnames],
140342941e3bSmrg[_lt_decl_filter([tagged?], [yes], $@)])
14046f03b1f6Smrg
14056f03b1f6Smrg
140642941e3bSmrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
140742941e3bSmrg# ---------------------------------------------------------
140842941e3bSmrgm4_define([_lt_decl_filter],
140942941e3bSmrg[m4_case([$#],
141042941e3bSmrg  [0], [m4_fatal([$0: too few arguments: $#])],
141142941e3bSmrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
141242941e3bSmrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
141342941e3bSmrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
141442941e3bSmrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
141542941e3bSmrg])
14166f03b1f6Smrg
14176f03b1f6Smrg
141842941e3bSmrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
141942941e3bSmrg# --------------------------------------------------
142042941e3bSmrgm4_define([lt_decl_quote_varnames],
142142941e3bSmrg[_lt_decl_filter([value], [1], $@)])
14226f03b1f6Smrg
14236f03b1f6Smrg
142442941e3bSmrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
142542941e3bSmrg# ---------------------------------------------------
142642941e3bSmrgm4_define([lt_decl_dquote_varnames],
142742941e3bSmrg[_lt_decl_filter([value], [2], $@)])
14286f03b1f6Smrg
14296f03b1f6Smrg
143042941e3bSmrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
143142941e3bSmrg# ---------------------------------------------------
143242941e3bSmrgm4_define([lt_decl_varnames_tagged],
143342941e3bSmrg[m4_assert([$# <= 2])dnl
143442941e3bSmrg_$0(m4_quote(m4_default([$1], [[, ]])),
143542941e3bSmrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
143642941e3bSmrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
143742941e3bSmrgm4_define([_lt_decl_varnames_tagged],
143842941e3bSmrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
1439356f6debSmrg
1440356f6debSmrg
144142941e3bSmrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
144242941e3bSmrg# ------------------------------------------------
144342941e3bSmrgm4_define([lt_decl_all_varnames],
144442941e3bSmrg[_$0(m4_quote(m4_default([$1], [[, ]])),
144542941e3bSmrg     m4_if([$2], [],
144642941e3bSmrg	   m4_quote(lt_decl_varnames),
144742941e3bSmrg	m4_quote(m4_shift($@))))[]dnl
144842941e3bSmrg])
144942941e3bSmrgm4_define([_lt_decl_all_varnames],
145042941e3bSmrg[lt_join($@, lt_decl_varnames_tagged([$1],
145142941e3bSmrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
145242941e3bSmrg])
1453356f6debSmrg
1454356f6debSmrg
145542941e3bSmrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
145642941e3bSmrg# ------------------------------------
145742941e3bSmrg# Quote a variable value, and forward it to `config.status' so that its
145842941e3bSmrg# declaration there will have the same value as in `configure'.  VARNAME
145942941e3bSmrg# must have a single quote delimited value for this to work.
146042941e3bSmrgm4_define([_LT_CONFIG_STATUS_DECLARE],
146142941e3bSmrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
1462356f6debSmrg
1463356f6debSmrg
146442941e3bSmrg# _LT_CONFIG_STATUS_DECLARATIONS
146542941e3bSmrg# ------------------------------
146642941e3bSmrg# We delimit libtool config variables with single quotes, so when
146742941e3bSmrg# we write them to config.status, we have to be sure to quote all
146842941e3bSmrg# embedded single quotes properly.  In configure, this macro expands
146942941e3bSmrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
147042941e3bSmrg#
147142941e3bSmrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
147242941e3bSmrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
147342941e3bSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
147442941e3bSmrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
1475356f6debSmrg
1476356f6debSmrg
147742941e3bSmrg# _LT_LIBTOOL_TAGS
147842941e3bSmrg# ----------------
147942941e3bSmrg# Output comment and list of tags supported by the script
148042941e3bSmrgm4_defun([_LT_LIBTOOL_TAGS],
148142941e3bSmrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
148242941e3bSmrgavailable_tags="_LT_TAGS"dnl
148342941e3bSmrg])
1484356f6debSmrg
1485356f6debSmrg
148642941e3bSmrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
148742941e3bSmrg# -----------------------------------
148842941e3bSmrg# Extract the dictionary values for VARNAME (optionally with TAG) and
148942941e3bSmrg# expand to a commented shell variable setting:
1490356f6debSmrg#
149142941e3bSmrg#    # Some comment about what VAR is for.
149242941e3bSmrg#    visible_name=$lt_internal_name
149342941e3bSmrgm4_define([_LT_LIBTOOL_DECLARE],
149442941e3bSmrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
149542941e3bSmrg					   [description])))[]dnl
149642941e3bSmrgm4_pushdef([_libtool_name],
149742941e3bSmrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
149842941e3bSmrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
149942941e3bSmrg    [0], [_libtool_name=[$]$1],
150042941e3bSmrg    [1], [_libtool_name=$lt_[]$1],
150142941e3bSmrg    [2], [_libtool_name=$lt_[]$1],
150242941e3bSmrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
150342941e3bSmrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
1504356f6debSmrg])
1505356f6debSmrg
1506356f6debSmrg
150742941e3bSmrg# _LT_LIBTOOL_CONFIG_VARS
150842941e3bSmrg# -----------------------
150942941e3bSmrg# Produce commented declarations of non-tagged libtool config variables
151042941e3bSmrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
151142941e3bSmrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
151242941e3bSmrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
151342941e3bSmrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
151442941e3bSmrg[m4_foreach([_lt_var],
151542941e3bSmrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
151642941e3bSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
1517356f6debSmrg
1518356f6debSmrg
151942941e3bSmrg# _LT_LIBTOOL_TAG_VARS(TAG)
152042941e3bSmrg# -------------------------
152142941e3bSmrgm4_define([_LT_LIBTOOL_TAG_VARS],
152242941e3bSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
152342941e3bSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
1524356f6debSmrg
1525356f6debSmrg
152642941e3bSmrg# _LT_TAGVAR(VARNAME, [TAGNAME])
152742941e3bSmrg# ------------------------------
152842941e3bSmrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
1529356f6debSmrg
1530356f6debSmrg
153142941e3bSmrg# _LT_CONFIG_COMMANDS
153242941e3bSmrg# -------------------
153342941e3bSmrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
153442941e3bSmrg# variables for single and double quote escaping we saved from calls
153542941e3bSmrg# to _LT_DECL, we can put quote escaped variables declarations
153642941e3bSmrg# into `config.status', and then the shell code to quote escape them in
153742941e3bSmrg# for loops in `config.status'.  Finally, any additional code accumulated
153842941e3bSmrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
153942941e3bSmrgm4_defun([_LT_CONFIG_COMMANDS],
154042941e3bSmrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
154142941e3bSmrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
154242941e3bSmrg	dnl instead of duplicating it all over again into config.status,
154342941e3bSmrg	dnl then we will have config.status run $CONFIG_LT later, so it
154442941e3bSmrg	dnl needs to know what name is stored there:
154542941e3bSmrg        [AC_CONFIG_COMMANDS([libtool],
154642941e3bSmrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
154742941e3bSmrg    dnl If the libtool generation code is destined for config.status,
154842941e3bSmrg    dnl expand the accumulated commands and init code now:
154942941e3bSmrg    [AC_CONFIG_COMMANDS([libtool],
155042941e3bSmrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
155142941e3bSmrg])#_LT_CONFIG_COMMANDS
1552356f6debSmrg
1553356f6debSmrg
155442941e3bSmrg# Initialize.
155542941e3bSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
155642941e3bSmrg[
15576f03b1f6Smrg
155842941e3bSmrg# The HP-UX ksh and POSIX shell print the target directory to stdout
155942941e3bSmrg# if CDPATH is set.
156042941e3bSmrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1561356f6debSmrg
156242941e3bSmrgsed_quote_subst='$sed_quote_subst'
156342941e3bSmrgdouble_quote_subst='$double_quote_subst'
156442941e3bSmrgdelay_variable_subst='$delay_variable_subst'
156542941e3bSmrg_LT_CONFIG_STATUS_DECLARATIONS
156642941e3bSmrgLTCC='$LTCC'
156742941e3bSmrgLTCFLAGS='$LTCFLAGS'
156842941e3bSmrgcompiler='$compiler_DEFAULT'
1569356f6debSmrg
157042941e3bSmrg# A function that is used when there is no print builtin or printf.
157142941e3bSmrgfunc_fallback_echo ()
157242941e3bSmrg{
157342941e3bSmrg  eval 'cat <<_LTECHO_EOF
157442941e3bSmrg\$[]1
157542941e3bSmrg_LTECHO_EOF'
157642941e3bSmrg}
1577356f6debSmrg
157842941e3bSmrg# Quote evaled strings.
157942941e3bSmrgfor var in lt_decl_all_varnames([[ \
158042941e3bSmrg]], lt_decl_quote_varnames); do
158142941e3bSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
158242941e3bSmrg    *[[\\\\\\\`\\"\\\$]]*)
158342941e3bSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
158442941e3bSmrg      ;;
158542941e3bSmrg    *)
158642941e3bSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
158742941e3bSmrg      ;;
158842941e3bSmrg    esac
1589356f6debSmrgdone
1590356f6debSmrg
159142941e3bSmrg# Double-quote double-evaled strings.
159242941e3bSmrgfor var in lt_decl_all_varnames([[ \
159342941e3bSmrg]], lt_decl_dquote_varnames); do
159442941e3bSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
159542941e3bSmrg    *[[\\\\\\\`\\"\\\$]]*)
159642941e3bSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
159742941e3bSmrg      ;;
159842941e3bSmrg    *)
159942941e3bSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
160042941e3bSmrg      ;;
160142941e3bSmrg    esac
160242941e3bSmrgdone
1603356f6debSmrg
160442941e3bSmrg_LT_OUTPUT_LIBTOOL_INIT
160542941e3bSmrg])
1606356f6debSmrg
160742941e3bSmrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
160842941e3bSmrg# ------------------------------------
160942941e3bSmrg# Generate a child script FILE with all initialization necessary to
161042941e3bSmrg# reuse the environment learned by the parent script, and make the
161142941e3bSmrg# file executable.  If COMMENT is supplied, it is inserted after the
161242941e3bSmrg# `#!' sequence but before initialization text begins.  After this
161342941e3bSmrg# macro, additional text can be appended to FILE to form the body of
161442941e3bSmrg# the child script.  The macro ends with non-zero status if the
161542941e3bSmrg# file could not be fully written (such as if the disk is full).
161642941e3bSmrgm4_ifdef([AS_INIT_GENERATED],
161742941e3bSmrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
161842941e3bSmrg[m4_defun([_LT_GENERATED_FILE_INIT],
161942941e3bSmrg[m4_require([AS_PREPARE])]dnl
162042941e3bSmrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
162142941e3bSmrg[lt_write_fail=0
162242941e3bSmrgcat >$1 <<_ASEOF || lt_write_fail=1
162342941e3bSmrg#! $SHELL
162442941e3bSmrg# Generated by $as_me.
162542941e3bSmrg$2
162642941e3bSmrgSHELL=\${CONFIG_SHELL-$SHELL}
162742941e3bSmrgexport SHELL
162842941e3bSmrg_ASEOF
162942941e3bSmrgcat >>$1 <<\_ASEOF || lt_write_fail=1
163042941e3bSmrgAS_SHELL_SANITIZE
163142941e3bSmrg_AS_PREPARE
163242941e3bSmrgexec AS_MESSAGE_FD>&1
163342941e3bSmrg_ASEOF
163442941e3bSmrgtest $lt_write_fail = 0 && chmod +x $1[]dnl
163542941e3bSmrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
1636356f6debSmrg
163742941e3bSmrg# LT_OUTPUT
1638356f6debSmrg# ---------
163942941e3bSmrg# This macro allows early generation of the libtool script (before
164042941e3bSmrg# AC_OUTPUT is called), incase it is used in configure for compilation
164142941e3bSmrg# tests.
164242941e3bSmrgAC_DEFUN([LT_OUTPUT],
164342941e3bSmrg[: ${CONFIG_LT=./config.lt}
164442941e3bSmrgAC_MSG_NOTICE([creating $CONFIG_LT])
164542941e3bSmrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
164642941e3bSmrg[# Run this file to recreate a libtool stub with the current configuration.])
1647356f6debSmrg
164842941e3bSmrgcat >>"$CONFIG_LT" <<\_LTEOF
164942941e3bSmrglt_cl_silent=false
165042941e3bSmrgexec AS_MESSAGE_LOG_FD>>config.log
165142941e3bSmrg{
165242941e3bSmrg  echo
165342941e3bSmrg  AS_BOX([Running $as_me.])
165442941e3bSmrg} >&AS_MESSAGE_LOG_FD
1655356f6debSmrg
165642941e3bSmrglt_cl_help="\
165742941e3bSmrg\`$as_me' creates a local libtool stub from the current configuration,
165842941e3bSmrgfor use in further configure time tests before the real libtool is
165942941e3bSmrggenerated.
16606f03b1f6Smrg
166142941e3bSmrgUsage: $[0] [[OPTIONS]]
16626f03b1f6Smrg
166342941e3bSmrg  -h, --help      print this help, then exit
166442941e3bSmrg  -V, --version   print version number, then exit
166542941e3bSmrg  -q, --quiet     do not print progress messages
166642941e3bSmrg  -d, --debug     don't remove temporary files
16676f03b1f6Smrg
166842941e3bSmrgReport bugs to <bug-libtool@gnu.org>."
16696f03b1f6Smrg
167042941e3bSmrglt_cl_version="\
167142941e3bSmrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
167242941e3bSmrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
167342941e3bSmrgconfigured by $[0], generated by m4_PACKAGE_STRING.
16746f03b1f6Smrg
167517caa701SmrgCopyright (C) 2011 Free Software Foundation, Inc.
167642941e3bSmrgThis config.lt script is free software; the Free Software Foundation
167742941e3bSmrggives unlimited permision to copy, distribute and modify it."
16786f03b1f6Smrg
167942941e3bSmrgwhile test $[#] != 0
168042941e3bSmrgdo
168142941e3bSmrg  case $[1] in
168242941e3bSmrg    --version | --v* | -V )
168342941e3bSmrg      echo "$lt_cl_version"; exit 0 ;;
168442941e3bSmrg    --help | --h* | -h )
168542941e3bSmrg      echo "$lt_cl_help"; exit 0 ;;
168642941e3bSmrg    --debug | --d* | -d )
168742941e3bSmrg      debug=: ;;
168842941e3bSmrg    --quiet | --q* | --silent | --s* | -q )
168942941e3bSmrg      lt_cl_silent=: ;;
1690356f6debSmrg
169142941e3bSmrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
169242941e3bSmrgTry \`$[0] --help' for more information.]) ;;
16936f03b1f6Smrg
169442941e3bSmrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
169542941e3bSmrgTry \`$[0] --help' for more information.]) ;;
169642941e3bSmrg  esac
169742941e3bSmrg  shift
169842941e3bSmrgdone
16996f03b1f6Smrg
170042941e3bSmrgif $lt_cl_silent; then
170142941e3bSmrg  exec AS_MESSAGE_FD>/dev/null
170242941e3bSmrgfi
170342941e3bSmrg_LTEOF
17046f03b1f6Smrg
170542941e3bSmrgcat >>"$CONFIG_LT" <<_LTEOF
170642941e3bSmrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
170742941e3bSmrg_LTEOF
17086f03b1f6Smrg
170942941e3bSmrgcat >>"$CONFIG_LT" <<\_LTEOF
171042941e3bSmrgAC_MSG_NOTICE([creating $ofile])
171142941e3bSmrg_LT_OUTPUT_LIBTOOL_COMMANDS
171242941e3bSmrgAS_EXIT(0)
171342941e3bSmrg_LTEOF
171442941e3bSmrgchmod +x "$CONFIG_LT"
17156f03b1f6Smrg
171642941e3bSmrg# configure is writing to config.log, but config.lt does its own redirection,
171742941e3bSmrg# appending to config.log, which fails on DOS, as config.log is still kept
171842941e3bSmrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
171942941e3bSmrg# config.log, so it can be properly (re)opened and appended to by config.lt.
172042941e3bSmrglt_cl_success=:
172142941e3bSmrgtest "$silent" = yes &&
172242941e3bSmrg  lt_config_lt_args="$lt_config_lt_args --quiet"
172342941e3bSmrgexec AS_MESSAGE_LOG_FD>/dev/null
172442941e3bSmrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
172542941e3bSmrgexec AS_MESSAGE_LOG_FD>>config.log
172642941e3bSmrg$lt_cl_success || AS_EXIT(1)
172742941e3bSmrg])# LT_OUTPUT
17286f03b1f6Smrg
17296f03b1f6Smrg
173042941e3bSmrg# _LT_CONFIG(TAG)
173142941e3bSmrg# ---------------
173242941e3bSmrg# If TAG is the built-in tag, create an initial libtool script with a
173342941e3bSmrg# default configuration from the untagged config vars.  Otherwise add code
173442941e3bSmrg# to config.status for appending the configuration named by TAG from the
173542941e3bSmrg# matching tagged config vars.
173642941e3bSmrgm4_defun([_LT_CONFIG],
173742941e3bSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
173842941e3bSmrg_LT_CONFIG_SAVE_COMMANDS([
173942941e3bSmrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
174042941e3bSmrg  m4_if(_LT_TAG, [C], [
174142941e3bSmrg    # See if we are running on zsh, and set the options which allow our
174242941e3bSmrg    # commands through without removal of \ escapes.
174342941e3bSmrg    if test -n "${ZSH_VERSION+set}" ; then
174442941e3bSmrg      setopt NO_GLOB_SUBST
174542941e3bSmrg    fi
17466f03b1f6Smrg
174742941e3bSmrg    cfgfile="${ofile}T"
174842941e3bSmrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
174942941e3bSmrg    $RM "$cfgfile"
17506f03b1f6Smrg
175142941e3bSmrg    cat <<_LT_EOF >> "$cfgfile"
175242941e3bSmrg#! $SHELL
17536f03b1f6Smrg
175442941e3bSmrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
175542941e3bSmrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
175642941e3bSmrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
175742941e3bSmrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
175842941e3bSmrg#
175942941e3bSmrg_LT_COPYING
176042941e3bSmrg_LT_LIBTOOL_TAGS
17616f03b1f6Smrg
176242941e3bSmrg# ### BEGIN LIBTOOL CONFIG
176342941e3bSmrg_LT_LIBTOOL_CONFIG_VARS
176442941e3bSmrg_LT_LIBTOOL_TAG_VARS
176542941e3bSmrg# ### END LIBTOOL CONFIG
17666f03b1f6Smrg
176742941e3bSmrg_LT_EOF
17686f03b1f6Smrg
176942941e3bSmrg  case $host_os in
177042941e3bSmrg  aix3*)
177142941e3bSmrg    cat <<\_LT_EOF >> "$cfgfile"
177242941e3bSmrg# AIX sometimes has problems with the GCC collect2 program.  For some
177342941e3bSmrg# reason, if we set the COLLECT_NAMES environment variable, the problems
177442941e3bSmrg# vanish in a puff of smoke.
177542941e3bSmrgif test "X${COLLECT_NAMES+set}" != Xset; then
177642941e3bSmrg  COLLECT_NAMES=
177742941e3bSmrg  export COLLECT_NAMES
177842941e3bSmrgfi
177942941e3bSmrg_LT_EOF
178042941e3bSmrg    ;;
178142941e3bSmrg  esac
17826f03b1f6Smrg
178342941e3bSmrg  _LT_PROG_LTMAIN
17846f03b1f6Smrg
178542941e3bSmrg  # We use sed instead of cat because bash on DJGPP gets confused if
178642941e3bSmrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
178742941e3bSmrg  # text mode, it properly converts lines to CR/LF.  This bash problem
178842941e3bSmrg  # is reportedly fixed, but why not run on old versions too?
178942941e3bSmrg  sed '$q' "$ltmain" >> "$cfgfile" \
179042941e3bSmrg     || (rm -f "$cfgfile"; exit 1)
17916f03b1f6Smrg
179242941e3bSmrg  _LT_PROG_REPLACE_SHELLFNS
17936f03b1f6Smrg
179442941e3bSmrg   mv -f "$cfgfile" "$ofile" ||
179542941e3bSmrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
179642941e3bSmrg  chmod +x "$ofile"
179742941e3bSmrg],
179842941e3bSmrg[cat <<_LT_EOF >> "$ofile"
17996f03b1f6Smrg
180042941e3bSmrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
180142941e3bSmrgdnl in a comment (ie after a #).
180242941e3bSmrg# ### BEGIN LIBTOOL TAG CONFIG: $1
180342941e3bSmrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
180442941e3bSmrg# ### END LIBTOOL TAG CONFIG: $1
180542941e3bSmrg_LT_EOF
180642941e3bSmrg])dnl /m4_if
180742941e3bSmrg],
180842941e3bSmrg[m4_if([$1], [], [
180942941e3bSmrg    PACKAGE='$PACKAGE'
181042941e3bSmrg    VERSION='$VERSION'
181142941e3bSmrg    TIMESTAMP='$TIMESTAMP'
181242941e3bSmrg    RM='$RM'
181342941e3bSmrg    ofile='$ofile'], [])
181442941e3bSmrg])dnl /_LT_CONFIG_SAVE_COMMANDS
181542941e3bSmrg])# _LT_CONFIG
1816356f6debSmrg
1817356f6debSmrg
181842941e3bSmrg# LT_SUPPORTED_TAG(TAG)
181942941e3bSmrg# ---------------------
182042941e3bSmrg# Trace this macro to discover what tags are supported by the libtool
182142941e3bSmrg# --tag option, using:
182242941e3bSmrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
182342941e3bSmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
1824356f6debSmrg
18256f03b1f6Smrg
182642941e3bSmrg# C support is built-in for now
182742941e3bSmrgm4_define([_LT_LANG_C_enabled], [])
182842941e3bSmrgm4_define([_LT_TAGS], [])
1829356f6debSmrg
1830356f6debSmrg
183142941e3bSmrg# LT_LANG(LANG)
183242941e3bSmrg# -------------
183342941e3bSmrg# Enable libtool support for the given language if not already enabled.
183442941e3bSmrgAC_DEFUN([LT_LANG],
183542941e3bSmrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
183642941e3bSmrgm4_case([$1],
183742941e3bSmrg  [C],			[_LT_LANG(C)],
183842941e3bSmrg  [C++],		[_LT_LANG(CXX)],
183917caa701Smrg  [Go],			[_LT_LANG(GO)],
184042941e3bSmrg  [Java],		[_LT_LANG(GCJ)],
184142941e3bSmrg  [Fortran 77],		[_LT_LANG(F77)],
184242941e3bSmrg  [Fortran],		[_LT_LANG(FC)],
184342941e3bSmrg  [Windows Resource],	[_LT_LANG(RC)],
184442941e3bSmrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
184542941e3bSmrg    [_LT_LANG($1)],
184642941e3bSmrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
184742941e3bSmrg])# LT_LANG
1848356f6debSmrg
1849356f6debSmrg
185042941e3bSmrg# _LT_LANG(LANGNAME)
185142941e3bSmrg# ------------------
185242941e3bSmrgm4_defun([_LT_LANG],
185342941e3bSmrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
185442941e3bSmrg  [LT_SUPPORTED_TAG([$1])dnl
185542941e3bSmrg  m4_append([_LT_TAGS], [$1 ])dnl
185642941e3bSmrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
185742941e3bSmrg  _LT_LANG_$1_CONFIG($1)])dnl
185842941e3bSmrg])# _LT_LANG
1859356f6debSmrg
1860356f6debSmrg
186117caa701Smrgm4_ifndef([AC_PROG_GO], [
186217caa701Smrg# NOTE: This macro has been submitted for inclusion into   #
186317caa701Smrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
186417caa701Smrg#  a released version of Autoconf we should remove this    #
186517caa701Smrg#  macro and use it instead.                               #
186617caa701Smrgm4_defun([AC_PROG_GO],
186717caa701Smrg[AC_LANG_PUSH(Go)dnl
186817caa701SmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
186917caa701SmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
187017caa701Smrg_AC_ARG_VAR_LDFLAGS()dnl
187117caa701SmrgAC_CHECK_TOOL(GOC, gccgo)
187217caa701Smrgif test -z "$GOC"; then
187317caa701Smrg  if test -n "$ac_tool_prefix"; then
187417caa701Smrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
187517caa701Smrg  fi
187617caa701Smrgfi
187717caa701Smrgif test -z "$GOC"; then
187817caa701Smrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
187917caa701Smrgfi
188017caa701Smrg])#m4_defun
188117caa701Smrg])#m4_ifndef
188217caa701Smrg
188317caa701Smrg
188442941e3bSmrg# _LT_LANG_DEFAULT_CONFIG
188542941e3bSmrg# -----------------------
188642941e3bSmrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
188742941e3bSmrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
188842941e3bSmrg  [LT_LANG(CXX)],
188942941e3bSmrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
18906f03b1f6Smrg
189142941e3bSmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
189242941e3bSmrg  [LT_LANG(F77)],
189342941e3bSmrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
18946f03b1f6Smrg
189542941e3bSmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
189642941e3bSmrg  [LT_LANG(FC)],
189742941e3bSmrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
18986f03b1f6Smrg
189942941e3bSmrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
190042941e3bSmrgdnl pulling things in needlessly.
190142941e3bSmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
190242941e3bSmrg  [LT_LANG(GCJ)],
190342941e3bSmrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
190442941e3bSmrg    [LT_LANG(GCJ)],
190542941e3bSmrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
190642941e3bSmrg      [LT_LANG(GCJ)],
190742941e3bSmrg      [m4_ifdef([AC_PROG_GCJ],
190842941e3bSmrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
190942941e3bSmrg       m4_ifdef([A][M_PROG_GCJ],
191042941e3bSmrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
191142941e3bSmrg       m4_ifdef([LT_PROG_GCJ],
191242941e3bSmrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
19136f03b1f6Smrg
191417caa701SmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
191517caa701Smrg  [LT_LANG(GO)],
191617caa701Smrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
191717caa701Smrg
191842941e3bSmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
191942941e3bSmrg  [LT_LANG(RC)],
192042941e3bSmrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
192142941e3bSmrg])# _LT_LANG_DEFAULT_CONFIG
19226f03b1f6Smrg
192342941e3bSmrg# Obsolete macros:
192442941e3bSmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
192542941e3bSmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
192642941e3bSmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
192742941e3bSmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
192842941e3bSmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
192942941e3bSmrgdnl aclocal-1.4 backwards compatibility:
193042941e3bSmrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
193142941e3bSmrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
193242941e3bSmrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
193342941e3bSmrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
193442941e3bSmrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
193598af18c5Smrg
19366f03b1f6Smrg
193742941e3bSmrg# _LT_TAG_COMPILER
193842941e3bSmrg# ----------------
193942941e3bSmrgm4_defun([_LT_TAG_COMPILER],
194042941e3bSmrg[AC_REQUIRE([AC_PROG_CC])dnl
1941356f6debSmrg
194242941e3bSmrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
194342941e3bSmrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
194442941e3bSmrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
194542941e3bSmrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
1946356f6debSmrg
194742941e3bSmrg# If no C compiler was specified, use CC.
194842941e3bSmrgLTCC=${LTCC-"$CC"}
1949356f6debSmrg
195042941e3bSmrg# If no C compiler flags were specified, use CFLAGS.
195142941e3bSmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
1952356f6debSmrg
195342941e3bSmrg# Allow CC to be a program name with arguments.
195442941e3bSmrgcompiler=$CC
195542941e3bSmrg])# _LT_TAG_COMPILER
1956356f6debSmrg
1957356f6debSmrg
195842941e3bSmrg# _LT_COMPILER_BOILERPLATE
195942941e3bSmrg# ------------------------
196042941e3bSmrg# Check for compiler boilerplate output or warnings with
196142941e3bSmrg# the simple compiler test code.
196242941e3bSmrgm4_defun([_LT_COMPILER_BOILERPLATE],
196342941e3bSmrg[m4_require([_LT_DECL_SED])dnl
196442941e3bSmrgac_outfile=conftest.$ac_objext
196542941e3bSmrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
196642941e3bSmrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
196742941e3bSmrg_lt_compiler_boilerplate=`cat conftest.err`
196842941e3bSmrg$RM conftest*
196942941e3bSmrg])# _LT_COMPILER_BOILERPLATE
1970356f6debSmrg
1971356f6debSmrg
197242941e3bSmrg# _LT_LINKER_BOILERPLATE
197342941e3bSmrg# ----------------------
197442941e3bSmrg# Check for linker boilerplate output or warnings with
197542941e3bSmrg# the simple link test code.
197642941e3bSmrgm4_defun([_LT_LINKER_BOILERPLATE],
197742941e3bSmrg[m4_require([_LT_DECL_SED])dnl
197842941e3bSmrgac_outfile=conftest.$ac_objext
197942941e3bSmrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
198042941e3bSmrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
198142941e3bSmrg_lt_linker_boilerplate=`cat conftest.err`
198242941e3bSmrg$RM -r conftest*
198342941e3bSmrg])# _LT_LINKER_BOILERPLATE
1984356f6debSmrg
198542941e3bSmrg# _LT_REQUIRED_DARWIN_CHECKS
198642941e3bSmrg# -------------------------
198742941e3bSmrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
198842941e3bSmrg  case $host_os in
198942941e3bSmrg    rhapsody* | darwin*)
199042941e3bSmrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
199142941e3bSmrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
199242941e3bSmrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
199342941e3bSmrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
199442941e3bSmrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
199542941e3bSmrg    _LT_DECL([], [DSYMUTIL], [1],
199642941e3bSmrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
199742941e3bSmrg    _LT_DECL([], [NMEDIT], [1],
199842941e3bSmrg      [Tool to change global to local symbols on Mac OS X])
199942941e3bSmrg    _LT_DECL([], [LIPO], [1],
200042941e3bSmrg      [Tool to manipulate fat objects and archives on Mac OS X])
200142941e3bSmrg    _LT_DECL([], [OTOOL], [1],
200242941e3bSmrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
200342941e3bSmrg    _LT_DECL([], [OTOOL64], [1],
200442941e3bSmrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
2005356f6debSmrg
200642941e3bSmrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
200742941e3bSmrg      [lt_cv_apple_cc_single_mod=no
200842941e3bSmrg      if test -z "${LT_MULTI_MODULE}"; then
200942941e3bSmrg	# By default we will add the -single_module flag. You can override
201042941e3bSmrg	# by either setting the environment variable LT_MULTI_MODULE
201142941e3bSmrg	# non-empty at configure time, or by adding -multi_module to the
201242941e3bSmrg	# link flags.
201342941e3bSmrg	rm -rf libconftest.dylib*
201442941e3bSmrg	echo "int foo(void){return 1;}" > conftest.c
201542941e3bSmrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
201642941e3bSmrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
201742941e3bSmrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
201842941e3bSmrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
201942941e3bSmrg        _lt_result=$?
202017caa701Smrg	# If there is a non-empty error log, and "single_module"
202117caa701Smrg	# appears in it, assume the flag caused a linker warning
202217caa701Smrg        if test -s conftest.err && $GREP single_module conftest.err; then
202317caa701Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
202417caa701Smrg	# Otherwise, if the output was created with a 0 exit code from
202517caa701Smrg	# the compiler, it worked.
202617caa701Smrg	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
202742941e3bSmrg	  lt_cv_apple_cc_single_mod=yes
202842941e3bSmrg	else
202942941e3bSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
203042941e3bSmrg	fi
203142941e3bSmrg	rm -rf libconftest.dylib*
203242941e3bSmrg	rm -f conftest.*
203342941e3bSmrg      fi])
203417caa701Smrg
203542941e3bSmrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
203642941e3bSmrg      [lt_cv_ld_exported_symbols_list],
203742941e3bSmrg      [lt_cv_ld_exported_symbols_list=no
203842941e3bSmrg      save_LDFLAGS=$LDFLAGS
203942941e3bSmrg      echo "_main" > conftest.sym
204042941e3bSmrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
204142941e3bSmrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
204242941e3bSmrg	[lt_cv_ld_exported_symbols_list=yes],
204342941e3bSmrg	[lt_cv_ld_exported_symbols_list=no])
204442941e3bSmrg	LDFLAGS="$save_LDFLAGS"
204542941e3bSmrg    ])
204617caa701Smrg
204742941e3bSmrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
204842941e3bSmrg      [lt_cv_ld_force_load=no
204942941e3bSmrg      cat > conftest.c << _LT_EOF
205042941e3bSmrgint forced_loaded() { return 2;}
205142941e3bSmrg_LT_EOF
205242941e3bSmrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
205342941e3bSmrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
205442941e3bSmrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
205542941e3bSmrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
205642941e3bSmrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
205742941e3bSmrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
205842941e3bSmrg      cat > conftest.c << _LT_EOF
205942941e3bSmrgint main() { return 0;}
206042941e3bSmrg_LT_EOF
206142941e3bSmrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
206242941e3bSmrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
206342941e3bSmrg      _lt_result=$?
206417caa701Smrg      if test -s conftest.err && $GREP force_load conftest.err; then
206517caa701Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
206617caa701Smrg      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
206742941e3bSmrg	lt_cv_ld_force_load=yes
206842941e3bSmrg      else
206942941e3bSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
207042941e3bSmrg      fi
207142941e3bSmrg        rm -f conftest.err libconftest.a conftest conftest.c
207242941e3bSmrg        rm -rf conftest.dSYM
207342941e3bSmrg    ])
207442941e3bSmrg    case $host_os in
207542941e3bSmrg    rhapsody* | darwin1.[[012]])
207642941e3bSmrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
207742941e3bSmrg    darwin1.*)
207842941e3bSmrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
207942941e3bSmrg    darwin*) # darwin 5.x on
208042941e3bSmrg      # if running on 10.5 or later, the deployment target defaults
208142941e3bSmrg      # to the OS version, if on x86, and 10.4, the deployment
208242941e3bSmrg      # target defaults to 10.4. Don't you love it?
208342941e3bSmrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
208442941e3bSmrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
208542941e3bSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
208642941e3bSmrg	10.[[012]]*)
208742941e3bSmrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
208842941e3bSmrg	10.*)
208942941e3bSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
209042941e3bSmrg      esac
209142941e3bSmrg    ;;
209242941e3bSmrg  esac
209342941e3bSmrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
209442941e3bSmrg      _lt_dar_single_mod='$single_module'
209542941e3bSmrg    fi
209642941e3bSmrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
209742941e3bSmrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
209842941e3bSmrg    else
209942941e3bSmrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
210042941e3bSmrg    fi
210142941e3bSmrg    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
210242941e3bSmrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
210342941e3bSmrg    else
210442941e3bSmrg      _lt_dsymutil=
210542941e3bSmrg    fi
210642941e3bSmrg    ;;
210742941e3bSmrg  esac
2108356f6debSmrg])
2109356f6debSmrg
2110356f6debSmrg
211117caa701Smrg# _LT_DARWIN_LINKER_FEATURES([TAG])
211217caa701Smrg# ---------------------------------
211342941e3bSmrg# Checks for linker and compiler features on darwin
211442941e3bSmrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
211542941e3bSmrg[
211642941e3bSmrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
211742941e3bSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
211842941e3bSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
211942941e3bSmrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
212042941e3bSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
212142941e3bSmrg  if test "$lt_cv_ld_force_load" = "yes"; then
212242941e3bSmrg    _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\"`'
212317caa701Smrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
212417caa701Smrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
212542941e3bSmrg  else
212642941e3bSmrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
212742941e3bSmrg  fi
212842941e3bSmrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
212942941e3bSmrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
213042941e3bSmrg  case $cc_basename in
213142941e3bSmrg     ifort*) _lt_dar_can_shared=yes ;;
213242941e3bSmrg     *) _lt_dar_can_shared=$GCC ;;
213342941e3bSmrg  esac
213442941e3bSmrg  if test "$_lt_dar_can_shared" = "yes"; then
213542941e3bSmrg    output_verbose_link_cmd=func_echo_all
213642941e3bSmrg    _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}"
213742941e3bSmrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
213842941e3bSmrg    _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}"
213942941e3bSmrg    _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}"
214042941e3bSmrg    m4_if([$1], [CXX],
214142941e3bSmrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
214242941e3bSmrg      _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}"
214342941e3bSmrg      _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}"
214442941e3bSmrg    fi
214542941e3bSmrg],[])
214642941e3bSmrg  else
214742941e3bSmrg  _LT_TAGVAR(ld_shlibs, $1)=no
214842941e3bSmrg  fi
2149356f6debSmrg])
2150356f6debSmrg
215142941e3bSmrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
215242941e3bSmrg# ----------------------------------
215342941e3bSmrg# Links a minimal program and checks the executable
215442941e3bSmrg# for the system default hardcoded library path. In most cases,
215542941e3bSmrg# this is /usr/lib:/lib, but when the MPI compilers are used
215642941e3bSmrg# the location of the communication and MPI libs are included too.
215742941e3bSmrg# If we don't find anything, use the default library path according
215842941e3bSmrg# to the aix ld manual.
215942941e3bSmrg# Store the results from the different compilers for each TAGNAME.
216042941e3bSmrg# Allow to override them for all tags through lt_cv_aix_libpath.
216142941e3bSmrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
216242941e3bSmrg[m4_require([_LT_DECL_SED])dnl
216342941e3bSmrgif test "${lt_cv_aix_libpath+set}" = set; then
216442941e3bSmrg  aix_libpath=$lt_cv_aix_libpath
216542941e3bSmrgelse
216642941e3bSmrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
216742941e3bSmrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
216842941e3bSmrg  lt_aix_libpath_sed='[
216942941e3bSmrg      /Import File Strings/,/^$/ {
217042941e3bSmrg	  /^0/ {
217142941e3bSmrg	      s/^0  *\([^ ]*\) *$/\1/
217242941e3bSmrg	      p
217342941e3bSmrg	  }
217442941e3bSmrg      }]'
217542941e3bSmrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
217642941e3bSmrg  # Check for a 64-bit object if we didn't find anything.
217742941e3bSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
217842941e3bSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
217942941e3bSmrg  fi],[])
218042941e3bSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
218142941e3bSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
218242941e3bSmrg  fi
218342941e3bSmrg  ])
218442941e3bSmrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
218542941e3bSmrgfi
218642941e3bSmrg])# _LT_SYS_MODULE_PATH_AIX
2187356f6debSmrg
2188356f6debSmrg
218942941e3bSmrg# _LT_SHELL_INIT(ARG)
219042941e3bSmrg# -------------------
219142941e3bSmrgm4_define([_LT_SHELL_INIT],
219242941e3bSmrg[m4_divert_text([M4SH-INIT], [$1
219342941e3bSmrg])])# _LT_SHELL_INIT
2194356f6debSmrg
2195356f6debSmrg
2196356f6debSmrg
219742941e3bSmrg# _LT_PROG_ECHO_BACKSLASH
219842941e3bSmrg# -----------------------
219942941e3bSmrg# Find how we can fake an echo command that does not interpret backslash.
220042941e3bSmrg# In particular, with Autoconf 2.60 or later we add some code to the start
220142941e3bSmrg# of the generated configure script which will find a shell with a builtin
220242941e3bSmrg# printf (which we can use as an echo command).
220342941e3bSmrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
220442941e3bSmrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
220542941e3bSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
220642941e3bSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
220742941e3bSmrg
220842941e3bSmrgAC_MSG_CHECKING([how to print strings])
220942941e3bSmrg# Test print first, because it will be a builtin if present.
221042941e3bSmrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
221142941e3bSmrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
221242941e3bSmrg  ECHO='print -r --'
221342941e3bSmrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
221442941e3bSmrg  ECHO='printf %s\n'
221542941e3bSmrgelse
221642941e3bSmrg  # Use this function as a fallback that always works.
221742941e3bSmrg  func_fallback_echo ()
221842941e3bSmrg  {
221942941e3bSmrg    eval 'cat <<_LTECHO_EOF
222042941e3bSmrg$[]1
222142941e3bSmrg_LTECHO_EOF'
222242941e3bSmrg  }
222342941e3bSmrg  ECHO='func_fallback_echo'
222442941e3bSmrgfi
2225356f6debSmrg
222642941e3bSmrg# func_echo_all arg...
222742941e3bSmrg# Invoke $ECHO with all args, space-separated.
222842941e3bSmrgfunc_echo_all ()
222942941e3bSmrg{
223042941e3bSmrg    $ECHO "$*" 
223142941e3bSmrg}
2232356f6debSmrg
223342941e3bSmrgcase "$ECHO" in
223442941e3bSmrg  printf*) AC_MSG_RESULT([printf]) ;;
223542941e3bSmrg  print*) AC_MSG_RESULT([print -r]) ;;
223642941e3bSmrg  *) AC_MSG_RESULT([cat]) ;;
223742941e3bSmrgesac
2238356f6debSmrg
223942941e3bSmrgm4_ifdef([_AS_DETECT_SUGGESTED],
224042941e3bSmrg[_AS_DETECT_SUGGESTED([
224142941e3bSmrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
224242941e3bSmrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
224342941e3bSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
224442941e3bSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
224542941e3bSmrg    PATH=/empty FPATH=/empty; export PATH FPATH
224642941e3bSmrg    test "X`printf %s $ECHO`" = "X$ECHO" \
224742941e3bSmrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
2248356f6debSmrg
224942941e3bSmrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
225042941e3bSmrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
225142941e3bSmrg])# _LT_PROG_ECHO_BACKSLASH
2252356f6debSmrg
2253356f6debSmrg
225442941e3bSmrg# _LT_WITH_SYSROOT
225542941e3bSmrg# ----------------
225642941e3bSmrgAC_DEFUN([_LT_WITH_SYSROOT],
225742941e3bSmrg[AC_MSG_CHECKING([for sysroot])
225842941e3bSmrgAC_ARG_WITH([sysroot],
225942941e3bSmrg[  --with-sysroot[=DIR] Search for dependent libraries within DIR
226042941e3bSmrg                        (or the compiler's sysroot if not specified).],
226142941e3bSmrg[], [with_sysroot=no])
226242941e3bSmrg
226342941e3bSmrgdnl lt_sysroot will always be passed unquoted.  We quote it here
226442941e3bSmrgdnl in case the user passed a directory name.
226542941e3bSmrglt_sysroot=
226642941e3bSmrgcase ${with_sysroot} in #(
226742941e3bSmrg yes)
226842941e3bSmrg   if test "$GCC" = yes; then
226942941e3bSmrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
227042941e3bSmrg   fi
227142941e3bSmrg   ;; #(
227242941e3bSmrg /*)
227342941e3bSmrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
227442941e3bSmrg   ;; #(
227542941e3bSmrg no|'')
227642941e3bSmrg   ;; #(
227742941e3bSmrg *)
227842941e3bSmrg   AC_MSG_RESULT([${with_sysroot}])
227942941e3bSmrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
228042941e3bSmrg   ;;
228142941e3bSmrgesac
2282356f6debSmrg
228342941e3bSmrg AC_MSG_RESULT([${lt_sysroot:-no}])
228442941e3bSmrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
228542941e3bSmrg[dependent libraries, and in which our libraries should be installed.])])
2286356f6debSmrg
228742941e3bSmrg# _LT_ENABLE_LOCK
228842941e3bSmrg# ---------------
228942941e3bSmrgm4_defun([_LT_ENABLE_LOCK],
229042941e3bSmrg[AC_ARG_ENABLE([libtool-lock],
229142941e3bSmrg  [AS_HELP_STRING([--disable-libtool-lock],
229242941e3bSmrg    [avoid locking (might break parallel builds)])])
229342941e3bSmrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
2294356f6debSmrg
229542941e3bSmrg# Some flags need to be propagated to the compiler or linker for good
229642941e3bSmrg# libtool support.
229742941e3bSmrgcase $host in
229842941e3bSmrgia64-*-hpux*)
229942941e3bSmrg  # Find out which ABI we are using.
230042941e3bSmrg  echo 'int i;' > conftest.$ac_ext
230142941e3bSmrg  if AC_TRY_EVAL(ac_compile); then
230242941e3bSmrg    case `/usr/bin/file conftest.$ac_objext` in
230342941e3bSmrg      *ELF-32*)
230442941e3bSmrg	HPUX_IA64_MODE="32"
230542941e3bSmrg	;;
230642941e3bSmrg      *ELF-64*)
230742941e3bSmrg	HPUX_IA64_MODE="64"
230842941e3bSmrg	;;
230942941e3bSmrg    esac
231042941e3bSmrg  fi
231142941e3bSmrg  rm -rf conftest*
231242941e3bSmrg  ;;
231342941e3bSmrg*-*-irix6*)
231442941e3bSmrg  # Find out which ABI we are using.
231542941e3bSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
231642941e3bSmrg  if AC_TRY_EVAL(ac_compile); then
231742941e3bSmrg    if test "$lt_cv_prog_gnu_ld" = yes; then
231842941e3bSmrg      case `/usr/bin/file conftest.$ac_objext` in
231942941e3bSmrg	*32-bit*)
232042941e3bSmrg	  LD="${LD-ld} -melf32bsmip"
232142941e3bSmrg	  ;;
232242941e3bSmrg	*N32*)
232342941e3bSmrg	  LD="${LD-ld} -melf32bmipn32"
232442941e3bSmrg	  ;;
232542941e3bSmrg	*64-bit*)
232642941e3bSmrg	  LD="${LD-ld} -melf64bmip"
232742941e3bSmrg	;;
232842941e3bSmrg      esac
232942941e3bSmrg    else
233042941e3bSmrg      case `/usr/bin/file conftest.$ac_objext` in
233142941e3bSmrg	*32-bit*)
233242941e3bSmrg	  LD="${LD-ld} -32"
233342941e3bSmrg	  ;;
233442941e3bSmrg	*N32*)
233542941e3bSmrg	  LD="${LD-ld} -n32"
233642941e3bSmrg	  ;;
233742941e3bSmrg	*64-bit*)
233842941e3bSmrg	  LD="${LD-ld} -64"
233942941e3bSmrg	  ;;
234042941e3bSmrg      esac
234142941e3bSmrg    fi
234242941e3bSmrg  fi
234342941e3bSmrg  rm -rf conftest*
2344356f6debSmrg  ;;
2345356f6debSmrg
234642941e3bSmrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
234742941e3bSmrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
234842941e3bSmrg  # Find out which ABI we are using.
234942941e3bSmrg  echo 'int i;' > conftest.$ac_ext
235042941e3bSmrg  if AC_TRY_EVAL(ac_compile); then
235142941e3bSmrg    case `/usr/bin/file conftest.o` in
235242941e3bSmrg      *32-bit*)
235342941e3bSmrg	case $host in
235442941e3bSmrg	  x86_64-*kfreebsd*-gnu)
235542941e3bSmrg	    LD="${LD-ld} -m elf_i386_fbsd"
235642941e3bSmrg	    ;;
235742941e3bSmrg	  x86_64-*linux*)
235842941e3bSmrg	    LD="${LD-ld} -m elf_i386"
235942941e3bSmrg	    ;;
236042941e3bSmrg	  ppc64-*linux*|powerpc64-*linux*)
236142941e3bSmrg	    LD="${LD-ld} -m elf32ppclinux"
236242941e3bSmrg	    ;;
236342941e3bSmrg	  s390x-*linux*)
236442941e3bSmrg	    LD="${LD-ld} -m elf_s390"
236542941e3bSmrg	    ;;
236642941e3bSmrg	  sparc64-*linux*)
236742941e3bSmrg	    LD="${LD-ld} -m elf32_sparc"
236842941e3bSmrg	    ;;
236942941e3bSmrg	esac
237042941e3bSmrg	;;
237142941e3bSmrg      *64-bit*)
237242941e3bSmrg	case $host in
237342941e3bSmrg	  x86_64-*kfreebsd*-gnu)
237442941e3bSmrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
237542941e3bSmrg	    ;;
237642941e3bSmrg	  x86_64-*linux*)
237742941e3bSmrg	    LD="${LD-ld} -m elf_x86_64"
237842941e3bSmrg	    ;;
237942941e3bSmrg	  ppc*-*linux*|powerpc*-*linux*)
238042941e3bSmrg	    LD="${LD-ld} -m elf64ppc"
238142941e3bSmrg	    ;;
238242941e3bSmrg	  s390*-*linux*|s390*-*tpf*)
238342941e3bSmrg	    LD="${LD-ld} -m elf64_s390"
238442941e3bSmrg	    ;;
238542941e3bSmrg	  sparc*-*linux*)
238642941e3bSmrg	    LD="${LD-ld} -m elf64_sparc"
238742941e3bSmrg	    ;;
238842941e3bSmrg	esac
238942941e3bSmrg	;;
239042941e3bSmrg    esac
239142941e3bSmrg  fi
239242941e3bSmrg  rm -rf conftest*
239342941e3bSmrg  ;;
2394356f6debSmrg
239542941e3bSmrg*-*-sco3.2v5*)
239642941e3bSmrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
239742941e3bSmrg  SAVE_CFLAGS="$CFLAGS"
239842941e3bSmrg  CFLAGS="$CFLAGS -belf"
239942941e3bSmrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
240042941e3bSmrg    [AC_LANG_PUSH(C)
240142941e3bSmrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
240242941e3bSmrg     AC_LANG_POP])
240342941e3bSmrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
240442941e3bSmrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
240542941e3bSmrg    CFLAGS="$SAVE_CFLAGS"
240642941e3bSmrg  fi
240742941e3bSmrg  ;;
240817caa701Smrg*-*solaris*)
240942941e3bSmrg  # Find out which ABI we are using.
241042941e3bSmrg  echo 'int i;' > conftest.$ac_ext
241142941e3bSmrg  if AC_TRY_EVAL(ac_compile); then
241242941e3bSmrg    case `/usr/bin/file conftest.o` in
241342941e3bSmrg    *64-bit*)
241442941e3bSmrg      case $lt_cv_prog_gnu_ld in
241517caa701Smrg      yes*)
241617caa701Smrg        case $host in
241717caa701Smrg        i?86-*-solaris*)
241817caa701Smrg          LD="${LD-ld} -m elf_x86_64"
241917caa701Smrg          ;;
242017caa701Smrg        sparc*-*-solaris*)
242117caa701Smrg          LD="${LD-ld} -m elf64_sparc"
242217caa701Smrg          ;;
242317caa701Smrg        esac
242417caa701Smrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
242517caa701Smrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
242617caa701Smrg          LD="${LD-ld}_sol2"
242717caa701Smrg        fi
242817caa701Smrg        ;;
242942941e3bSmrg      *)
243042941e3bSmrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
243142941e3bSmrg	  LD="${LD-ld} -64"
243242941e3bSmrg	fi
243342941e3bSmrg	;;
243442941e3bSmrg      esac
243542941e3bSmrg      ;;
243642941e3bSmrg    esac
243742941e3bSmrg  fi
243842941e3bSmrg  rm -rf conftest*
243942941e3bSmrg  ;;
244042941e3bSmrgesac
2441356f6debSmrg
244242941e3bSmrgneed_locks="$enable_libtool_lock"
244342941e3bSmrg])# _LT_ENABLE_LOCK
2444356f6debSmrg
2445356f6debSmrg
244642941e3bSmrg# _LT_PROG_AR
244742941e3bSmrg# -----------
244842941e3bSmrgm4_defun([_LT_PROG_AR],
244942941e3bSmrg[AC_CHECK_TOOLS(AR, [ar], false)
245042941e3bSmrg: ${AR=ar}
245142941e3bSmrg: ${AR_FLAGS=cru}
245242941e3bSmrg_LT_DECL([], [AR], [1], [The archiver])
245342941e3bSmrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
245442941e3bSmrg
245542941e3bSmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
245642941e3bSmrg  [lt_cv_ar_at_file=no
245742941e3bSmrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
245842941e3bSmrg     [echo conftest.$ac_objext > conftest.lst
245942941e3bSmrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
246042941e3bSmrg      AC_TRY_EVAL([lt_ar_try])
246142941e3bSmrg      if test "$ac_status" -eq 0; then
246242941e3bSmrg	# Ensure the archiver fails upon bogus file names.
246342941e3bSmrg	rm -f conftest.$ac_objext libconftest.a
246442941e3bSmrg	AC_TRY_EVAL([lt_ar_try])
246542941e3bSmrg	if test "$ac_status" -ne 0; then
246642941e3bSmrg          lt_cv_ar_at_file=@
246742941e3bSmrg        fi
246842941e3bSmrg      fi
246942941e3bSmrg      rm -f conftest.* libconftest.a
247042941e3bSmrg     ])
247142941e3bSmrg  ])
2472356f6debSmrg
247342941e3bSmrgif test "x$lt_cv_ar_at_file" = xno; then
247442941e3bSmrg  archiver_list_spec=
247542941e3bSmrgelse
247642941e3bSmrg  archiver_list_spec=$lt_cv_ar_at_file
247742941e3bSmrgfi
247842941e3bSmrg_LT_DECL([], [archiver_list_spec], [1],
247942941e3bSmrg  [How to feed a file listing to the archiver])
248042941e3bSmrg])# _LT_PROG_AR
2481356f6debSmrg
2482356f6debSmrg
248342941e3bSmrg# _LT_CMD_OLD_ARCHIVE
248442941e3bSmrg# -------------------
248542941e3bSmrgm4_defun([_LT_CMD_OLD_ARCHIVE],
248642941e3bSmrg[_LT_PROG_AR
2487356f6debSmrg
248842941e3bSmrgAC_CHECK_TOOL(STRIP, strip, :)
248942941e3bSmrgtest -z "$STRIP" && STRIP=:
249042941e3bSmrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
2491356f6debSmrg
249242941e3bSmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
249342941e3bSmrgtest -z "$RANLIB" && RANLIB=:
249442941e3bSmrg_LT_DECL([], [RANLIB], [1],
249542941e3bSmrg    [Commands used to install an old-style archive])
2496356f6debSmrg
249742941e3bSmrg# Determine commands to create old-style static archives.
249842941e3bSmrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
249942941e3bSmrgold_postinstall_cmds='chmod 644 $oldlib'
250042941e3bSmrgold_postuninstall_cmds=
2501356f6debSmrg
250242941e3bSmrgif test -n "$RANLIB"; then
250342941e3bSmrg  case $host_os in
250442941e3bSmrg  openbsd*)
250517caa701Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
250642941e3bSmrg    ;;
250742941e3bSmrg  *)
250817caa701Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
250942941e3bSmrg    ;;
2510356f6debSmrg  esac
251117caa701Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
2512356f6debSmrgfi
2513356f6debSmrg
251442941e3bSmrgcase $host_os in
251542941e3bSmrg  darwin*)
251642941e3bSmrg    lock_old_archive_extraction=yes ;;
251742941e3bSmrg  *)
251842941e3bSmrg    lock_old_archive_extraction=no ;;
251942941e3bSmrgesac
252042941e3bSmrg_LT_DECL([], [old_postinstall_cmds], [2])
252142941e3bSmrg_LT_DECL([], [old_postuninstall_cmds], [2])
252242941e3bSmrg_LT_TAGDECL([], [old_archive_cmds], [2],
252342941e3bSmrg    [Commands used to build an old-style archive])
252442941e3bSmrg_LT_DECL([], [lock_old_archive_extraction], [0],
252542941e3bSmrg    [Whether to use a lock for old archive extraction])
252642941e3bSmrg])# _LT_CMD_OLD_ARCHIVE
2527356f6debSmrg
2528356f6debSmrg
252942941e3bSmrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
253042941e3bSmrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
253142941e3bSmrg# ----------------------------------------------------------------
253242941e3bSmrg# Check whether the given compiler option works
253342941e3bSmrgAC_DEFUN([_LT_COMPILER_OPTION],
2534356f6debSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
253542941e3bSmrgm4_require([_LT_DECL_SED])dnl
253642941e3bSmrgAC_CACHE_CHECK([$1], [$2],
253742941e3bSmrg  [$2=no
253842941e3bSmrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
253942941e3bSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
254042941e3bSmrg   lt_compiler_flag="$3"
254142941e3bSmrg   # Insert the option either (1) after the last *FLAGS variable, or
254242941e3bSmrg   # (2) before a word containing "conftest.", or (3) at the end.
254342941e3bSmrg   # Note that $ac_compile itself does not contain backslashes and begins
254442941e3bSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
254542941e3bSmrg   # The option is referenced via a variable to avoid confusing sed.
254642941e3bSmrg   lt_compile=`echo "$ac_compile" | $SED \
254742941e3bSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
254842941e3bSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
254942941e3bSmrg   -e 's:$: $lt_compiler_flag:'`
255042941e3bSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
255142941e3bSmrg   (eval "$lt_compile" 2>conftest.err)
255242941e3bSmrg   ac_status=$?
255342941e3bSmrg   cat conftest.err >&AS_MESSAGE_LOG_FD
255442941e3bSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
255542941e3bSmrg   if (exit $ac_status) && test -s "$ac_outfile"; then
255642941e3bSmrg     # The compiler can only warn and ignore the option if not recognized
255742941e3bSmrg     # So say no if there are warnings other than the usual output.
255842941e3bSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
255942941e3bSmrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
256042941e3bSmrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
256142941e3bSmrg       $2=yes
256242941e3bSmrg     fi
256342941e3bSmrg   fi
256442941e3bSmrg   $RM conftest*
256542941e3bSmrg])
2566356f6debSmrg
256742941e3bSmrgif test x"[$]$2" = xyes; then
256842941e3bSmrg    m4_if([$5], , :, [$5])
256942941e3bSmrgelse
257042941e3bSmrg    m4_if([$6], , :, [$6])
2571356f6debSmrgfi
257242941e3bSmrg])# _LT_COMPILER_OPTION
2573356f6debSmrg
257442941e3bSmrg# Old name:
257542941e3bSmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
257642941e3bSmrgdnl aclocal-1.4 backwards compatibility:
257742941e3bSmrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
2578356f6debSmrg
2579356f6debSmrg
258042941e3bSmrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
258142941e3bSmrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
258242941e3bSmrg# ----------------------------------------------------
258342941e3bSmrg# Check whether the given linker option works
258442941e3bSmrgAC_DEFUN([_LT_LINKER_OPTION],
258542941e3bSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
258642941e3bSmrgm4_require([_LT_DECL_SED])dnl
258742941e3bSmrgAC_CACHE_CHECK([$1], [$2],
258842941e3bSmrg  [$2=no
258942941e3bSmrg   save_LDFLAGS="$LDFLAGS"
259042941e3bSmrg   LDFLAGS="$LDFLAGS $3"
259142941e3bSmrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
259242941e3bSmrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
259342941e3bSmrg     # The linker can only warn and ignore the option if not recognized
259442941e3bSmrg     # So say no if there are warnings
259542941e3bSmrg     if test -s conftest.err; then
259642941e3bSmrg       # Append any errors to the config.log.
259742941e3bSmrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
259842941e3bSmrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
259942941e3bSmrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
260042941e3bSmrg       if diff conftest.exp conftest.er2 >/dev/null; then
260142941e3bSmrg         $2=yes
260242941e3bSmrg       fi
260342941e3bSmrg     else
260442941e3bSmrg       $2=yes
260542941e3bSmrg     fi
260642941e3bSmrg   fi
260742941e3bSmrg   $RM -r conftest*
260842941e3bSmrg   LDFLAGS="$save_LDFLAGS"
260942941e3bSmrg])
2610356f6debSmrg
261142941e3bSmrgif test x"[$]$2" = xyes; then
261242941e3bSmrg    m4_if([$4], , :, [$4])
261342941e3bSmrgelse
261442941e3bSmrg    m4_if([$5], , :, [$5])
261542941e3bSmrgfi
261642941e3bSmrg])# _LT_LINKER_OPTION
2617356f6debSmrg
261842941e3bSmrg# Old name:
261942941e3bSmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
262042941e3bSmrgdnl aclocal-1.4 backwards compatibility:
262142941e3bSmrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
2622356f6debSmrg
2623356f6debSmrg
262442941e3bSmrg# LT_CMD_MAX_LEN
262542941e3bSmrg#---------------
262642941e3bSmrgAC_DEFUN([LT_CMD_MAX_LEN],
262742941e3bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
262842941e3bSmrg# find the maximum length of command line arguments
262942941e3bSmrgAC_MSG_CHECKING([the maximum length of command line arguments])
263042941e3bSmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
263142941e3bSmrg  i=0
263242941e3bSmrg  teststring="ABCD"
2633356f6debSmrg
263442941e3bSmrg  case $build_os in
263542941e3bSmrg  msdosdjgpp*)
263642941e3bSmrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
263742941e3bSmrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
263842941e3bSmrg    # during glob expansion).  Even if it were fixed, the result of this
263942941e3bSmrg    # check would be larger than it should be.
264042941e3bSmrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
264142941e3bSmrg    ;;
2642356f6debSmrg
264342941e3bSmrg  gnu*)
264442941e3bSmrg    # Under GNU Hurd, this test is not required because there is
264542941e3bSmrg    # no limit to the length of command line arguments.
264642941e3bSmrg    # Libtool will interpret -1 as no limit whatsoever
264742941e3bSmrg    lt_cv_sys_max_cmd_len=-1;
264842941e3bSmrg    ;;
2649356f6debSmrg
265042941e3bSmrg  cygwin* | mingw* | cegcc*)
265142941e3bSmrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
265242941e3bSmrg    # about 5 minutes as the teststring grows exponentially.
265342941e3bSmrg    # Worse, since 9x/ME are not pre-emptively multitasking,
265442941e3bSmrg    # you end up with a "frozen" computer, even though with patience
265542941e3bSmrg    # the test eventually succeeds (with a max line length of 256k).
265642941e3bSmrg    # Instead, let's just punt: use the minimum linelength reported by
265742941e3bSmrg    # all of the supported platforms: 8192 (on NT/2K/XP).
265842941e3bSmrg    lt_cv_sys_max_cmd_len=8192;
265942941e3bSmrg    ;;
2660356f6debSmrg
266142941e3bSmrg  mint*)
266242941e3bSmrg    # On MiNT this can take a long time and run out of memory.
266342941e3bSmrg    lt_cv_sys_max_cmd_len=8192;
266442941e3bSmrg    ;;
2665356f6debSmrg
266642941e3bSmrg  amigaos*)
266742941e3bSmrg    # On AmigaOS with pdksh, this test takes hours, literally.
266842941e3bSmrg    # So we just punt and use a minimum line length of 8192.
266942941e3bSmrg    lt_cv_sys_max_cmd_len=8192;
267042941e3bSmrg    ;;
2671356f6debSmrg
267242941e3bSmrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
267342941e3bSmrg    # This has been around since 386BSD, at least.  Likely further.
267442941e3bSmrg    if test -x /sbin/sysctl; then
267542941e3bSmrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
267642941e3bSmrg    elif test -x /usr/sbin/sysctl; then
267742941e3bSmrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
267842941e3bSmrg    else
267942941e3bSmrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
268042941e3bSmrg    fi
268142941e3bSmrg    # And add a safety zone
268242941e3bSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
268342941e3bSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
268442941e3bSmrg    ;;
2685356f6debSmrg
268642941e3bSmrg  interix*)
268742941e3bSmrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
268842941e3bSmrg    lt_cv_sys_max_cmd_len=196608
268942941e3bSmrg    ;;
2690356f6debSmrg
269117caa701Smrg  os2*)
269217caa701Smrg    # The test takes a long time on OS/2.
269317caa701Smrg    lt_cv_sys_max_cmd_len=8192
269417caa701Smrg    ;;
269517caa701Smrg
269642941e3bSmrg  osf*)
269742941e3bSmrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
269842941e3bSmrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
269942941e3bSmrg    # nice to cause kernel panics so lets avoid the loop below.
270042941e3bSmrg    # First set a reasonable default.
270142941e3bSmrg    lt_cv_sys_max_cmd_len=16384
270242941e3bSmrg    #
270342941e3bSmrg    if test -x /sbin/sysconfig; then
270442941e3bSmrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
270542941e3bSmrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
270642941e3bSmrg      esac
270742941e3bSmrg    fi
270842941e3bSmrg    ;;
270942941e3bSmrg  sco3.2v5*)
271042941e3bSmrg    lt_cv_sys_max_cmd_len=102400
271142941e3bSmrg    ;;
271242941e3bSmrg  sysv5* | sco5v6* | sysv4.2uw2*)
271342941e3bSmrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
271442941e3bSmrg    if test -n "$kargmax"; then
271542941e3bSmrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
271642941e3bSmrg    else
271742941e3bSmrg      lt_cv_sys_max_cmd_len=32768
271842941e3bSmrg    fi
271942941e3bSmrg    ;;
272042941e3bSmrg  *)
272142941e3bSmrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
272242941e3bSmrg    if test -n "$lt_cv_sys_max_cmd_len"; then
272342941e3bSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
272442941e3bSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
272542941e3bSmrg    else
272642941e3bSmrg      # Make teststring a little bigger before we do anything with it.
272742941e3bSmrg      # a 1K string should be a reasonable start.
272842941e3bSmrg      for i in 1 2 3 4 5 6 7 8 ; do
272942941e3bSmrg        teststring=$teststring$teststring
273042941e3bSmrg      done
273142941e3bSmrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
273242941e3bSmrg      # If test is not a shell built-in, we'll probably end up computing a
273342941e3bSmrg      # maximum length that is only half of the actual maximum length, but
273442941e3bSmrg      # we can't tell.
273517caa701Smrg      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
273642941e3bSmrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
273742941e3bSmrg	      test $i != 17 # 1/2 MB should be enough
273842941e3bSmrg      do
273942941e3bSmrg        i=`expr $i + 1`
274042941e3bSmrg        teststring=$teststring$teststring
274142941e3bSmrg      done
274242941e3bSmrg      # Only check the string length outside the loop.
274342941e3bSmrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
274442941e3bSmrg      teststring=
274542941e3bSmrg      # Add a significant safety factor because C++ compilers can tack on
274642941e3bSmrg      # massive amounts of additional arguments before passing them to the
274742941e3bSmrg      # linker.  It appears as though 1/2 is a usable value.
274842941e3bSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
274942941e3bSmrg    fi
275042941e3bSmrg    ;;
275142941e3bSmrg  esac
275242941e3bSmrg])
275342941e3bSmrgif test -n $lt_cv_sys_max_cmd_len ; then
275442941e3bSmrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
275542941e3bSmrgelse
275642941e3bSmrg  AC_MSG_RESULT(none)
275742941e3bSmrgfi
275842941e3bSmrgmax_cmd_len=$lt_cv_sys_max_cmd_len
275942941e3bSmrg_LT_DECL([], [max_cmd_len], [0],
276042941e3bSmrg    [What is the maximum length of a command?])
276142941e3bSmrg])# LT_CMD_MAX_LEN
2762356f6debSmrg
276342941e3bSmrg# Old name:
276442941e3bSmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
276542941e3bSmrgdnl aclocal-1.4 backwards compatibility:
276642941e3bSmrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
2767356f6debSmrg
2768356f6debSmrg
276942941e3bSmrg# _LT_HEADER_DLFCN
277042941e3bSmrg# ----------------
277142941e3bSmrgm4_defun([_LT_HEADER_DLFCN],
277242941e3bSmrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
277342941e3bSmrg])# _LT_HEADER_DLFCN
2774356f6debSmrg
2775356f6debSmrg
277642941e3bSmrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
277742941e3bSmrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
277842941e3bSmrg# ----------------------------------------------------------------
277942941e3bSmrgm4_defun([_LT_TRY_DLOPEN_SELF],
278042941e3bSmrg[m4_require([_LT_HEADER_DLFCN])dnl
278142941e3bSmrgif test "$cross_compiling" = yes; then :
278242941e3bSmrg  [$4]
278342941e3bSmrgelse
278442941e3bSmrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
278542941e3bSmrg  lt_status=$lt_dlunknown
278642941e3bSmrg  cat > conftest.$ac_ext <<_LT_EOF
278742941e3bSmrg[#line $LINENO "configure"
278842941e3bSmrg#include "confdefs.h"
2789356f6debSmrg
279042941e3bSmrg#if HAVE_DLFCN_H
279142941e3bSmrg#include <dlfcn.h>
279242941e3bSmrg#endif
2793356f6debSmrg
279442941e3bSmrg#include <stdio.h>
2795356f6debSmrg
279642941e3bSmrg#ifdef RTLD_GLOBAL
279742941e3bSmrg#  define LT_DLGLOBAL		RTLD_GLOBAL
279842941e3bSmrg#else
279942941e3bSmrg#  ifdef DL_GLOBAL
280042941e3bSmrg#    define LT_DLGLOBAL		DL_GLOBAL
280142941e3bSmrg#  else
280242941e3bSmrg#    define LT_DLGLOBAL		0
280342941e3bSmrg#  endif
280442941e3bSmrg#endif
2805356f6debSmrg
280642941e3bSmrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
280742941e3bSmrg   find out it does not work in some platform. */
280842941e3bSmrg#ifndef LT_DLLAZY_OR_NOW
280942941e3bSmrg#  ifdef RTLD_LAZY
281042941e3bSmrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
281142941e3bSmrg#  else
281242941e3bSmrg#    ifdef DL_LAZY
281342941e3bSmrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
281442941e3bSmrg#    else
281542941e3bSmrg#      ifdef RTLD_NOW
281642941e3bSmrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
281742941e3bSmrg#      else
281842941e3bSmrg#        ifdef DL_NOW
281942941e3bSmrg#          define LT_DLLAZY_OR_NOW	DL_NOW
282042941e3bSmrg#        else
282142941e3bSmrg#          define LT_DLLAZY_OR_NOW	0
282242941e3bSmrg#        endif
282342941e3bSmrg#      endif
282442941e3bSmrg#    endif
282542941e3bSmrg#  endif
282642941e3bSmrg#endif
2827356f6debSmrg
282842941e3bSmrg/* When -fvisbility=hidden is used, assume the code has been annotated
282942941e3bSmrg   correspondingly for the symbols needed.  */
283042941e3bSmrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
283142941e3bSmrgint fnord () __attribute__((visibility("default")));
283242941e3bSmrg#endif
2833356f6debSmrg
283442941e3bSmrgint fnord () { return 42; }
283542941e3bSmrgint main ()
283642941e3bSmrg{
283742941e3bSmrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
283842941e3bSmrg  int status = $lt_dlunknown;
2839356f6debSmrg
284042941e3bSmrg  if (self)
284142941e3bSmrg    {
284242941e3bSmrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
284342941e3bSmrg      else
284442941e3bSmrg        {
284542941e3bSmrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
284642941e3bSmrg          else puts (dlerror ());
284742941e3bSmrg	}
284842941e3bSmrg      /* dlclose (self); */
284942941e3bSmrg    }
285042941e3bSmrg  else
285142941e3bSmrg    puts (dlerror ());
2852356f6debSmrg
285342941e3bSmrg  return status;
285442941e3bSmrg}]
285542941e3bSmrg_LT_EOF
285642941e3bSmrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
285742941e3bSmrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
285842941e3bSmrg    lt_status=$?
285942941e3bSmrg    case x$lt_status in
286042941e3bSmrg      x$lt_dlno_uscore) $1 ;;
286142941e3bSmrg      x$lt_dlneed_uscore) $2 ;;
286242941e3bSmrg      x$lt_dlunknown|x*) $3 ;;
286342941e3bSmrg    esac
286442941e3bSmrg  else :
286542941e3bSmrg    # compilation failed
286642941e3bSmrg    $3
286742941e3bSmrg  fi
286842941e3bSmrgfi
286942941e3bSmrgrm -fr conftest*
287042941e3bSmrg])# _LT_TRY_DLOPEN_SELF
2871356f6debSmrg
2872356f6debSmrg
287342941e3bSmrg# LT_SYS_DLOPEN_SELF
287442941e3bSmrg# ------------------
287542941e3bSmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
287642941e3bSmrg[m4_require([_LT_HEADER_DLFCN])dnl
287742941e3bSmrgif test "x$enable_dlopen" != xyes; then
287842941e3bSmrg  enable_dlopen=unknown
287942941e3bSmrg  enable_dlopen_self=unknown
288042941e3bSmrg  enable_dlopen_self_static=unknown
288142941e3bSmrgelse
288242941e3bSmrg  lt_cv_dlopen=no
288342941e3bSmrg  lt_cv_dlopen_libs=
2884356f6debSmrg
2885356f6debSmrg  case $host_os in
288642941e3bSmrg  beos*)
288742941e3bSmrg    lt_cv_dlopen="load_add_on"
288842941e3bSmrg    lt_cv_dlopen_libs=
288942941e3bSmrg    lt_cv_dlopen_self=yes
289042941e3bSmrg    ;;
2891356f6debSmrg
289242941e3bSmrg  mingw* | pw32* | cegcc*)
289342941e3bSmrg    lt_cv_dlopen="LoadLibrary"
289442941e3bSmrg    lt_cv_dlopen_libs=
2895356f6debSmrg    ;;
289642941e3bSmrg
289742941e3bSmrg  cygwin*)
289842941e3bSmrg    lt_cv_dlopen="dlopen"
289942941e3bSmrg    lt_cv_dlopen_libs=
2900356f6debSmrg    ;;
2901356f6debSmrg
290242941e3bSmrg  darwin*)
290342941e3bSmrg  # if libdl is installed we need to link against it
290442941e3bSmrg    AC_CHECK_LIB([dl], [dlopen],
290542941e3bSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
290642941e3bSmrg    lt_cv_dlopen="dyld"
290742941e3bSmrg    lt_cv_dlopen_libs=
290842941e3bSmrg    lt_cv_dlopen_self=yes
290942941e3bSmrg    ])
291042941e3bSmrg    ;;
2911356f6debSmrg
291242941e3bSmrg  *)
291342941e3bSmrg    AC_CHECK_FUNC([shl_load],
291442941e3bSmrg	  [lt_cv_dlopen="shl_load"],
291542941e3bSmrg      [AC_CHECK_LIB([dld], [shl_load],
291642941e3bSmrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
291742941e3bSmrg	[AC_CHECK_FUNC([dlopen],
291842941e3bSmrg	      [lt_cv_dlopen="dlopen"],
291942941e3bSmrg	  [AC_CHECK_LIB([dl], [dlopen],
292042941e3bSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
292142941e3bSmrg	    [AC_CHECK_LIB([svld], [dlopen],
292242941e3bSmrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
292342941e3bSmrg	      [AC_CHECK_LIB([dld], [dld_link],
292442941e3bSmrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
292542941e3bSmrg	      ])
292642941e3bSmrg	    ])
292742941e3bSmrg	  ])
292842941e3bSmrg	])
292942941e3bSmrg      ])
293042941e3bSmrg    ;;
2931356f6debSmrg  esac
293242941e3bSmrg
293342941e3bSmrg  if test "x$lt_cv_dlopen" != xno; then
293442941e3bSmrg    enable_dlopen=yes
2935356f6debSmrg  else
293642941e3bSmrg    enable_dlopen=no
2937356f6debSmrg  fi
29386f03b1f6Smrg
293942941e3bSmrg  case $lt_cv_dlopen in
294042941e3bSmrg  dlopen)
294142941e3bSmrg    save_CPPFLAGS="$CPPFLAGS"
294242941e3bSmrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
29436f03b1f6Smrg
294442941e3bSmrg    save_LDFLAGS="$LDFLAGS"
294542941e3bSmrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
29466f03b1f6Smrg
294742941e3bSmrg    save_LIBS="$LIBS"
294842941e3bSmrg    LIBS="$lt_cv_dlopen_libs $LIBS"
29496f03b1f6Smrg
295042941e3bSmrg    AC_CACHE_CHECK([whether a program can dlopen itself],
295142941e3bSmrg	  lt_cv_dlopen_self, [dnl
295242941e3bSmrg	  _LT_TRY_DLOPEN_SELF(
295342941e3bSmrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
295442941e3bSmrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
295542941e3bSmrg    ])
29566f03b1f6Smrg
295742941e3bSmrg    if test "x$lt_cv_dlopen_self" = xyes; then
295842941e3bSmrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
295942941e3bSmrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
296042941e3bSmrg	  lt_cv_dlopen_self_static, [dnl
296142941e3bSmrg	  _LT_TRY_DLOPEN_SELF(
296242941e3bSmrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
296342941e3bSmrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
296442941e3bSmrg      ])
296542941e3bSmrg    fi
29666f03b1f6Smrg
296742941e3bSmrg    CPPFLAGS="$save_CPPFLAGS"
296842941e3bSmrg    LDFLAGS="$save_LDFLAGS"
296942941e3bSmrg    LIBS="$save_LIBS"
297042941e3bSmrg    ;;
297142941e3bSmrg  esac
2972356f6debSmrg
297342941e3bSmrg  case $lt_cv_dlopen_self in
297442941e3bSmrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
297542941e3bSmrg  *) enable_dlopen_self=unknown ;;
297642941e3bSmrg  esac
29776f03b1f6Smrg
297842941e3bSmrg  case $lt_cv_dlopen_self_static in
297942941e3bSmrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
298042941e3bSmrg  *) enable_dlopen_self_static=unknown ;;
298142941e3bSmrg  esac
298298af18c5Smrgfi
298342941e3bSmrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
298442941e3bSmrg	 [Whether dlopen is supported])
298542941e3bSmrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
298642941e3bSmrg	 [Whether dlopen of programs is supported])
298742941e3bSmrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
298842941e3bSmrg	 [Whether dlopen of statically linked programs is supported])
298942941e3bSmrg])# LT_SYS_DLOPEN_SELF
29906f03b1f6Smrg
299142941e3bSmrg# Old name:
299242941e3bSmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
299342941e3bSmrgdnl aclocal-1.4 backwards compatibility:
299442941e3bSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
29956f03b1f6Smrg
29966f03b1f6Smrg
299742941e3bSmrg# _LT_COMPILER_C_O([TAGNAME])
299842941e3bSmrg# ---------------------------
299942941e3bSmrg# Check to see if options -c and -o are simultaneously supported by compiler.
300042941e3bSmrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
300142941e3bSmrgm4_defun([_LT_COMPILER_C_O],
300242941e3bSmrg[m4_require([_LT_DECL_SED])dnl
300342941e3bSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
300442941e3bSmrgm4_require([_LT_TAG_COMPILER])dnl
300542941e3bSmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
300642941e3bSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
300742941e3bSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
300842941e3bSmrg   $RM -r conftest 2>/dev/null
300942941e3bSmrg   mkdir conftest
301042941e3bSmrg   cd conftest
301142941e3bSmrg   mkdir out
301298af18c5Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
301342941e3bSmrg
301442941e3bSmrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
301598af18c5Smrg   # Insert the option either (1) after the last *FLAGS variable, or
301698af18c5Smrg   # (2) before a word containing "conftest.", or (3) at the end.
301798af18c5Smrg   # Note that $ac_compile itself does not contain backslashes and begins
301898af18c5Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
301998af18c5Smrg   lt_compile=`echo "$ac_compile" | $SED \
302098af18c5Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
302198af18c5Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
302298af18c5Smrg   -e 's:$: $lt_compiler_flag:'`
302342941e3bSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
302442941e3bSmrg   (eval "$lt_compile" 2>out/conftest.err)
302598af18c5Smrg   ac_status=$?
302642941e3bSmrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
302742941e3bSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
302842941e3bSmrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
302942941e3bSmrg   then
303098af18c5Smrg     # The compiler can only warn and ignore the option if not recognized
303142941e3bSmrg     # So say no if there are warnings
303242941e3bSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
303342941e3bSmrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
303442941e3bSmrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
303542941e3bSmrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
303698af18c5Smrg     fi
303798af18c5Smrg   fi
303842941e3bSmrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
303942941e3bSmrg   $RM conftest*
304042941e3bSmrg   # SGI C++ compiler will create directory out/ii_files/ for
304142941e3bSmrg   # template instantiation
304242941e3bSmrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
304342941e3bSmrg   $RM out/* && rmdir out
304442941e3bSmrg   cd ..
304542941e3bSmrg   $RM -r conftest
3046356f6debSmrg   $RM conftest*
304798af18c5Smrg])
304842941e3bSmrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
304942941e3bSmrg	[Does compiler simultaneously support -c and -o options?])
305042941e3bSmrg])# _LT_COMPILER_C_O
30516f03b1f6Smrg
30526f03b1f6Smrg
305342941e3bSmrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
305442941e3bSmrg# ----------------------------------
305542941e3bSmrg# Check to see if we can do hard links to lock some files if needed
305642941e3bSmrgm4_defun([_LT_COMPILER_FILE_LOCKS],
305742941e3bSmrg[m4_require([_LT_ENABLE_LOCK])dnl
305842941e3bSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
305942941e3bSmrg_LT_COMPILER_C_O([$1])
3060356f6debSmrg
306142941e3bSmrghard_links="nottested"
306242941e3bSmrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
306342941e3bSmrg  # do not overwrite the value of need_locks provided by the user
306442941e3bSmrg  AC_MSG_CHECKING([if we can lock with hard links])
306542941e3bSmrg  hard_links=yes
306642941e3bSmrg  $RM conftest*
306742941e3bSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
306842941e3bSmrg  touch conftest.a
306942941e3bSmrg  ln conftest.a conftest.b 2>&5 || hard_links=no
307042941e3bSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
307142941e3bSmrg  AC_MSG_RESULT([$hard_links])
307242941e3bSmrg  if test "$hard_links" = no; then
307342941e3bSmrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
307442941e3bSmrg    need_locks=warn
307542941e3bSmrg  fi
307698af18c5Smrgelse
307742941e3bSmrg  need_locks=no
30786f03b1f6Smrgfi
307942941e3bSmrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
308042941e3bSmrg])# _LT_COMPILER_FILE_LOCKS
3081356f6debSmrg
30826f03b1f6Smrg
308342941e3bSmrg# _LT_CHECK_OBJDIR
308442941e3bSmrg# ----------------
308542941e3bSmrgm4_defun([_LT_CHECK_OBJDIR],
308642941e3bSmrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
308742941e3bSmrg[rm -f .libs 2>/dev/null
308842941e3bSmrgmkdir .libs 2>/dev/null
308942941e3bSmrgif test -d .libs; then
309042941e3bSmrg  lt_cv_objdir=.libs
309142941e3bSmrgelse
309242941e3bSmrg  # MS-DOS does not allow filenames that begin with a dot.
309342941e3bSmrg  lt_cv_objdir=_libs
309442941e3bSmrgfi
309542941e3bSmrgrmdir .libs 2>/dev/null])
309642941e3bSmrgobjdir=$lt_cv_objdir
309742941e3bSmrg_LT_DECL([], [objdir], [0],
309842941e3bSmrg         [The name of the directory that contains temporary libtool files])dnl
309942941e3bSmrgm4_pattern_allow([LT_OBJDIR])dnl
310042941e3bSmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
310142941e3bSmrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
310242941e3bSmrg])# _LT_CHECK_OBJDIR
31036f03b1f6Smrg
31046f03b1f6Smrg
310542941e3bSmrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
310642941e3bSmrg# --------------------------------------
310742941e3bSmrg# Check hardcoding attributes.
310842941e3bSmrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
310942941e3bSmrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
311042941e3bSmrg_LT_TAGVAR(hardcode_action, $1)=
311142941e3bSmrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
311242941e3bSmrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
311342941e3bSmrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
31146f03b1f6Smrg
311542941e3bSmrg  # We can hardcode non-existent directories.
311642941e3bSmrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
311742941e3bSmrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
311842941e3bSmrg     # have to relink, otherwise we might link with an installed library
311942941e3bSmrg     # when we should be linking with a yet-to-be-installed one
312042941e3bSmrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
312142941e3bSmrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
312242941e3bSmrg    # Linking always hardcodes the temporary library directory.
312342941e3bSmrg    _LT_TAGVAR(hardcode_action, $1)=relink
312442941e3bSmrg  else
312542941e3bSmrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
312642941e3bSmrg    _LT_TAGVAR(hardcode_action, $1)=immediate
312742941e3bSmrg  fi
312842941e3bSmrgelse
312942941e3bSmrg  # We cannot hardcode anything, or else we can only hardcode existing
313042941e3bSmrg  # directories.
313142941e3bSmrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
313242941e3bSmrgfi
313342941e3bSmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
31346f03b1f6Smrg
313542941e3bSmrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
313642941e3bSmrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
313742941e3bSmrg  # Fast installation is not supported
313842941e3bSmrg  enable_fast_install=no
313942941e3bSmrgelif test "$shlibpath_overrides_runpath" = yes ||
314042941e3bSmrg     test "$enable_shared" = no; then
314142941e3bSmrg  # Fast installation is not necessary
314242941e3bSmrg  enable_fast_install=needless
314342941e3bSmrgfi
314442941e3bSmrg_LT_TAGDECL([], [hardcode_action], [0],
314542941e3bSmrg    [How to hardcode a shared library path into an executable])
314642941e3bSmrg])# _LT_LINKER_HARDCODE_LIBPATH
31476f03b1f6Smrg
31486f03b1f6Smrg
314942941e3bSmrg# _LT_CMD_STRIPLIB
315042941e3bSmrg# ----------------
315142941e3bSmrgm4_defun([_LT_CMD_STRIPLIB],
315242941e3bSmrg[m4_require([_LT_DECL_EGREP])
315342941e3bSmrgstriplib=
315442941e3bSmrgold_striplib=
315542941e3bSmrgAC_MSG_CHECKING([whether stripping libraries is possible])
315642941e3bSmrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
315742941e3bSmrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
315842941e3bSmrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
315942941e3bSmrg  AC_MSG_RESULT([yes])
316042941e3bSmrgelse
316142941e3bSmrg# FIXME - insert some real tests, host_os isn't really good enough
316242941e3bSmrg  case $host_os in
316342941e3bSmrg  darwin*)
316442941e3bSmrg    if test -n "$STRIP" ; then
316542941e3bSmrg      striplib="$STRIP -x"
316642941e3bSmrg      old_striplib="$STRIP -S"
316742941e3bSmrg      AC_MSG_RESULT([yes])
316898af18c5Smrg    else
316942941e3bSmrg      AC_MSG_RESULT([no])
317098af18c5Smrg    fi
317198af18c5Smrg    ;;
317298af18c5Smrg  *)
317342941e3bSmrg    AC_MSG_RESULT([no])
317498af18c5Smrg    ;;
317598af18c5Smrg  esac
317698af18c5Smrgfi
317742941e3bSmrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
317842941e3bSmrg_LT_DECL([], [striplib], [1])
317942941e3bSmrg])# _LT_CMD_STRIPLIB
31806f03b1f6Smrg
3181356f6debSmrg
318242941e3bSmrg# _LT_SYS_DYNAMIC_LINKER([TAG])
318342941e3bSmrg# -----------------------------
318442941e3bSmrg# PORTME Fill in your ld.so characteristics
318542941e3bSmrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
318642941e3bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
318742941e3bSmrgm4_require([_LT_DECL_EGREP])dnl
318842941e3bSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
318942941e3bSmrgm4_require([_LT_DECL_OBJDUMP])dnl
319042941e3bSmrgm4_require([_LT_DECL_SED])dnl
319142941e3bSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
319242941e3bSmrgAC_MSG_CHECKING([dynamic linker characteristics])
319342941e3bSmrgm4_if([$1],
319442941e3bSmrg	[], [
319542941e3bSmrgif test "$GCC" = yes; then
319642941e3bSmrg  case $host_os in
319742941e3bSmrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
319842941e3bSmrg    *) lt_awk_arg="/^libraries:/" ;;
319942941e3bSmrg  esac
320042941e3bSmrg  case $host_os in
320142941e3bSmrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
320242941e3bSmrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
320342941e3bSmrg  esac
320442941e3bSmrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
320542941e3bSmrg  case $lt_search_path_spec in
320642941e3bSmrg  *\;*)
320742941e3bSmrg    # if the path contains ";" then we assume it to be the separator
320842941e3bSmrg    # otherwise default to the standard path separator (i.e. ":") - it is
320942941e3bSmrg    # assumed that no part of a normal pathname contains ";" but that should
321042941e3bSmrg    # okay in the real world where ";" in dirpaths is itself problematic.
321142941e3bSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
321242941e3bSmrg    ;;
321342941e3bSmrg  *)
321442941e3bSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
321542941e3bSmrg    ;;
321642941e3bSmrg  esac
321742941e3bSmrg  # Ok, now we have the path, separated by spaces, we can step through it
321842941e3bSmrg  # and add multilib dir if necessary.
321942941e3bSmrg  lt_tmp_lt_search_path_spec=
322042941e3bSmrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
322142941e3bSmrg  for lt_sys_path in $lt_search_path_spec; do
322242941e3bSmrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
322342941e3bSmrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
322442941e3bSmrg    else
322542941e3bSmrg      test -d "$lt_sys_path" && \
322642941e3bSmrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
322742941e3bSmrg    fi
322842941e3bSmrg  done
322942941e3bSmrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
323042941e3bSmrgBEGIN {RS=" "; FS="/|\n";} {
323142941e3bSmrg  lt_foo="";
323242941e3bSmrg  lt_count=0;
323342941e3bSmrg  for (lt_i = NF; lt_i > 0; lt_i--) {
323442941e3bSmrg    if ($lt_i != "" && $lt_i != ".") {
323542941e3bSmrg      if ($lt_i == "..") {
323642941e3bSmrg        lt_count++;
323742941e3bSmrg      } else {
323842941e3bSmrg        if (lt_count == 0) {
323942941e3bSmrg          lt_foo="/" $lt_i lt_foo;
324042941e3bSmrg        } else {
324142941e3bSmrg          lt_count--;
324242941e3bSmrg        }
324342941e3bSmrg      }
324442941e3bSmrg    }
324542941e3bSmrg  }
324642941e3bSmrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
324742941e3bSmrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
324842941e3bSmrg}'`
324942941e3bSmrg  # AWK program above erroneously prepends '/' to C:/dos/paths
325042941e3bSmrg  # for these hosts.
325142941e3bSmrg  case $host_os in
325242941e3bSmrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
325342941e3bSmrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
325442941e3bSmrg  esac
325542941e3bSmrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
325698af18c5Smrgelse
325742941e3bSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
325842941e3bSmrgfi])
325942941e3bSmrglibrary_names_spec=
326042941e3bSmrglibname_spec='lib$name'
326142941e3bSmrgsoname_spec=
326242941e3bSmrgshrext_cmds=".so"
326342941e3bSmrgpostinstall_cmds=
326442941e3bSmrgpostuninstall_cmds=
326542941e3bSmrgfinish_cmds=
326642941e3bSmrgfinish_eval=
326742941e3bSmrgshlibpath_var=
326842941e3bSmrgshlibpath_overrides_runpath=unknown
326942941e3bSmrgversion_type=none
327042941e3bSmrgdynamic_linker="$host_os ld.so"
327142941e3bSmrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
327242941e3bSmrgneed_lib_prefix=unknown
327342941e3bSmrghardcode_into_libs=no
32746f03b1f6Smrg
327542941e3bSmrg# when you set need_version to no, make sure it does not cause -set_version
327642941e3bSmrg# flags to be left without arguments
327742941e3bSmrgneed_version=unknown
32786f03b1f6Smrg
327942941e3bSmrgcase $host_os in
328042941e3bSmrgaix3*)
328117caa701Smrg  version_type=linux # correct to gnu/linux during the next big refactor
328242941e3bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
328342941e3bSmrg  shlibpath_var=LIBPATH
32846f03b1f6Smrg
328542941e3bSmrg  # AIX 3 has no versioning support, so we append a major version to the name.
328642941e3bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
328742941e3bSmrg  ;;
32886f03b1f6Smrg
328942941e3bSmrgaix[[4-9]]*)
329017caa701Smrg  version_type=linux # correct to gnu/linux during the next big refactor
329142941e3bSmrg  need_lib_prefix=no
329242941e3bSmrg  need_version=no
329342941e3bSmrg  hardcode_into_libs=yes
329442941e3bSmrg  if test "$host_cpu" = ia64; then
329542941e3bSmrg    # AIX 5 supports IA64
329642941e3bSmrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
329742941e3bSmrg    shlibpath_var=LD_LIBRARY_PATH
329898af18c5Smrg  else
329942941e3bSmrg    # With GCC up to 2.95.x, collect2 would create an import file
330042941e3bSmrg    # for dependence libraries.  The import file would start with
330142941e3bSmrg    # the line `#! .'.  This would cause the generated library to
330242941e3bSmrg    # depend on `.', always an invalid library.  This was fixed in
330342941e3bSmrg    # development snapshots of GCC prior to 3.0.
330442941e3bSmrg    case $host_os in
330542941e3bSmrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
330642941e3bSmrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
330742941e3bSmrg	   echo ' yes '
330842941e3bSmrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
330942941e3bSmrg	:
331042941e3bSmrg      else
331142941e3bSmrg	can_build_shared=no
331242941e3bSmrg      fi
331342941e3bSmrg      ;;
331498af18c5Smrg    esac
331542941e3bSmrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
331642941e3bSmrg    # soname into executable. Probably we can add versioning support to
331742941e3bSmrg    # collect2, so additional links can be useful in future.
331842941e3bSmrg    if test "$aix_use_runtimelinking" = yes; then
331942941e3bSmrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
332042941e3bSmrg      # instead of lib<name>.a to let people know that these are not
332142941e3bSmrg      # typical AIX shared libraries.
332242941e3bSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
332342941e3bSmrg    else
332442941e3bSmrg      # We preserve .a as extension for shared libraries through AIX4.2
332542941e3bSmrg      # and later when we are not doing run time linking.
332642941e3bSmrg      library_names_spec='${libname}${release}.a $libname.a'
332742941e3bSmrg      soname_spec='${libname}${release}${shared_ext}$major'
332842941e3bSmrg    fi
332942941e3bSmrg    shlibpath_var=LIBPATH
33306f03b1f6Smrg  fi
333142941e3bSmrg  ;;
33326f03b1f6Smrg
333342941e3bSmrgamigaos*)
333442941e3bSmrg  case $host_cpu in
333542941e3bSmrg  powerpc)
333642941e3bSmrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
333742941e3bSmrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
333842941e3bSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
333998af18c5Smrg    ;;
334042941e3bSmrg  m68k)
334142941e3bSmrg    library_names_spec='$libname.ixlibrary $libname.a'
334242941e3bSmrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
334342941e3bSmrg    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'
3344356f6debSmrg    ;;
334542941e3bSmrg  esac
334642941e3bSmrg  ;;
334798af18c5Smrg
334842941e3bSmrgbeos*)
334942941e3bSmrg  library_names_spec='${libname}${shared_ext}'
335042941e3bSmrg  dynamic_linker="$host_os ld.so"
335142941e3bSmrg  shlibpath_var=LIBRARY_PATH
335242941e3bSmrg  ;;
33536f03b1f6Smrg
335442941e3bSmrgbsdi[[45]]*)
335517caa701Smrg  version_type=linux # correct to gnu/linux during the next big refactor
335642941e3bSmrg  need_version=no
335742941e3bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
335842941e3bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
335942941e3bSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
336042941e3bSmrg  shlibpath_var=LD_LIBRARY_PATH
336142941e3bSmrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
336242941e3bSmrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
336342941e3bSmrg  # the default ld.so.conf also contains /usr/contrib/lib and
336442941e3bSmrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
336542941e3bSmrg  # libtool to hard-code these into programs
336642941e3bSmrg  ;;
33676f03b1f6Smrg
336842941e3bSmrgcygwin* | mingw* | pw32* | cegcc*)
336942941e3bSmrg  version_type=windows
337042941e3bSmrg  shrext_cmds=".dll"
337142941e3bSmrg  need_version=no
337242941e3bSmrg  need_lib_prefix=no
33736f03b1f6Smrg
337442941e3bSmrg  case $GCC,$cc_basename in
337542941e3bSmrg  yes,*)
337642941e3bSmrg    # gcc
337742941e3bSmrg    library_names_spec='$libname.dll.a'
337842941e3bSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
337942941e3bSmrg    postinstall_cmds='base_file=`basename \${file}`~
338042941e3bSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
338142941e3bSmrg      dldir=$destdir/`dirname \$dlpath`~
338242941e3bSmrg      test -d \$dldir || mkdir -p \$dldir~
338342941e3bSmrg      $install_prog $dir/$dlname \$dldir/$dlname~
338442941e3bSmrg      chmod a+x \$dldir/$dlname~
338542941e3bSmrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
338642941e3bSmrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
338742941e3bSmrg      fi'
338842941e3bSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
338942941e3bSmrg      dlpath=$dir/\$dldll~
339042941e3bSmrg       $RM \$dlpath'
339142941e3bSmrg    shlibpath_overrides_runpath=yes
33926f03b1f6Smrg
339342941e3bSmrg    case $host_os in
339442941e3bSmrg    cygwin*)
339542941e3bSmrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
339642941e3bSmrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
339742941e3bSmrgm4_if([$1], [],[
339842941e3bSmrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
339942941e3bSmrg      ;;
340042941e3bSmrg    mingw* | cegcc*)
340142941e3bSmrg      # MinGW DLLs use traditional 'lib' prefix
340242941e3bSmrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
340342941e3bSmrg      ;;
340442941e3bSmrg    pw32*)
340542941e3bSmrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
340642941e3bSmrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
340742941e3bSmrg      ;;
340842941e3bSmrg    esac
340942941e3bSmrg    dynamic_linker='Win32 ld.exe'
341042941e3bSmrg    ;;
34116f03b1f6Smrg
341242941e3bSmrg  *,cl*)
341342941e3bSmrg    # Native MSVC
341442941e3bSmrg    libname_spec='$name'
341542941e3bSmrg    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
341642941e3bSmrg    library_names_spec='${libname}.dll.lib'
341742941e3bSmrg
341842941e3bSmrg    case $build_os in
341942941e3bSmrg    mingw*)
342042941e3bSmrg      sys_lib_search_path_spec=
342142941e3bSmrg      lt_save_ifs=$IFS
342242941e3bSmrg      IFS=';'
342342941e3bSmrg      for lt_path in $LIB
342442941e3bSmrg      do
342542941e3bSmrg        IFS=$lt_save_ifs
342642941e3bSmrg        # Let DOS variable expansion print the short 8.3 style file name.
342742941e3bSmrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
342842941e3bSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
342942941e3bSmrg      done
343042941e3bSmrg      IFS=$lt_save_ifs
343142941e3bSmrg      # Convert to MSYS style.
343242941e3bSmrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
343342941e3bSmrg      ;;
343442941e3bSmrg    cygwin*)
343542941e3bSmrg      # Convert to unix form, then to dos form, then back to unix form
343642941e3bSmrg      # but this time dos style (no spaces!) so that the unix form looks
343742941e3bSmrg      # like /cygdrive/c/PROGRA~1:/cygdr...
343842941e3bSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
343942941e3bSmrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
344042941e3bSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
344142941e3bSmrg      ;;
344242941e3bSmrg    *)
344342941e3bSmrg      sys_lib_search_path_spec="$LIB"
344442941e3bSmrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
344542941e3bSmrg        # It is most probably a Windows format PATH.
344642941e3bSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
344742941e3bSmrg      else
344842941e3bSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
344942941e3bSmrg      fi
345042941e3bSmrg      # FIXME: find the short name or the path components, as spaces are
345142941e3bSmrg      # common. (e.g. "Program Files" -> "PROGRA~1")
345242941e3bSmrg      ;;
345342941e3bSmrg    esac
34546f03b1f6Smrg
345542941e3bSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
345642941e3bSmrg    postinstall_cmds='base_file=`basename \${file}`~
345742941e3bSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
345842941e3bSmrg      dldir=$destdir/`dirname \$dlpath`~
345942941e3bSmrg      test -d \$dldir || mkdir -p \$dldir~
346042941e3bSmrg      $install_prog $dir/$dlname \$dldir/$dlname'
346142941e3bSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
346242941e3bSmrg      dlpath=$dir/\$dldll~
346342941e3bSmrg       $RM \$dlpath'
346442941e3bSmrg    shlibpath_overrides_runpath=yes
346542941e3bSmrg    dynamic_linker='Win32 link.exe'
346642941e3bSmrg    ;;
34676f03b1f6Smrg
346842941e3bSmrg  *)
346942941e3bSmrg    # Assume MSVC wrapper
347042941e3bSmrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
347142941e3bSmrg    dynamic_linker='Win32 ld.exe'
347298af18c5Smrg    ;;
347398af18c5Smrg  esac
347442941e3bSmrg  # FIXME: first we should search . and the directory the executable is in
347542941e3bSmrg  shlibpath_var=PATH
347642941e3bSmrg  ;;
34776f03b1f6Smrg
347842941e3bSmrgdarwin* | rhapsody*)
347942941e3bSmrg  dynamic_linker="$host_os dyld"
348042941e3bSmrg  version_type=darwin
348142941e3bSmrg  need_lib_prefix=no
348242941e3bSmrg  need_version=no
348342941e3bSmrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
348442941e3bSmrg  soname_spec='${libname}${release}${major}$shared_ext'
348542941e3bSmrg  shlibpath_overrides_runpath=yes
348642941e3bSmrg  shlibpath_var=DYLD_LIBRARY_PATH
348742941e3bSmrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
348842941e3bSmrgm4_if([$1], [],[
348942941e3bSmrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
349042941e3bSmrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
349142941e3bSmrg  ;;
34926f03b1f6Smrg
349342941e3bSmrgdgux*)
349417caa701Smrg  version_type=linux # correct to gnu/linux during the next big refactor
349542941e3bSmrg  need_lib_prefix=no
349642941e3bSmrg  need_version=no
349742941e3bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
349817caa701Smrg  soname_spec='${libname}${release}${shared_ext}$major'
349917caa701Smrg  shlibpath_var=LD_LIBRARY_PATH
350042941e3bSmrg  ;;
35016f03b1f6Smrg
350242941e3bSmrgfreebsd* | dragonfly*)
350342941e3bSmrg  # DragonFly does not have aout.  When/if they implement a new
350442941e3bSmrg  # versioning mechanism, adjust this.
350542941e3bSmrg  if test -x /usr/bin/objformat; then
350642941e3bSmrg    objformat=`/usr/bin/objformat`
350742941e3bSmrg  else
350842941e3bSmrg    case $host_os in
350917caa701Smrg    freebsd[[23]].*) objformat=aout ;;
351042941e3bSmrg    *) objformat=elf ;;
351142941e3bSmrg    esac
351242941e3bSmrg  fi
351342941e3bSmrg  version_type=freebsd-$objformat
351442941e3bSmrg  case $version_type in
351542941e3bSmrg    freebsd-elf*)
351642941e3bSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
351742941e3bSmrg      need_version=no
351842941e3bSmrg      need_lib_prefix=no
351942941e3bSmrg      ;;
352042941e3bSmrg    freebsd-*)
352142941e3bSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
352242941e3bSmrg      need_version=yes
352342941e3bSmrg      ;;
352442941e3bSmrg  esac
352542941e3bSmrg  shlibpath_var=LD_LIBRARY_PATH
352642941e3bSmrg  case $host_os in
352717caa701Smrg  freebsd2.*)
352842941e3bSmrg    shlibpath_overrides_runpath=yes
352942941e3bSmrg    ;;
353042941e3bSmrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
353142941e3bSmrg    shlibpath_overrides_runpath=yes
353242941e3bSmrg    hardcode_into_libs=yes
353342941e3bSmrg    ;;
353442941e3bSmrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
353542941e3bSmrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
353642941e3bSmrg    shlibpath_overrides_runpath=no
353742941e3bSmrg    hardcode_into_libs=yes
353842941e3bSmrg    ;;
353942941e3bSmrg  *) # from 4.6 on, and DragonFly
354042941e3bSmrg    shlibpath_overrides_runpath=yes
354142941e3bSmrg    hardcode_into_libs=yes
354242941e3bSmrg    ;;
354342941e3bSmrg  esac
354442941e3bSmrg  ;;
3545356f6debSmrg
354642941e3bSmrggnu*)
354717caa701Smrg  version_type=linux # correct to gnu/linux during the next big refactor
354842941e3bSmrg  need_lib_prefix=no
354942941e3bSmrg  need_version=no
355042941e3bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
355142941e3bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
355242941e3bSmrg  shlibpath_var=LD_LIBRARY_PATH
355317caa701Smrg  shlibpath_overrides_runpath=no
355442941e3bSmrg  hardcode_into_libs=yes
355542941e3bSmrg  ;;
35566f03b1f6Smrg
355742941e3bSmrghaiku*)
355817caa701Smrg  version_type=linux # correct to gnu/linux during the next big refactor
355942941e3bSmrg  need_lib_prefix=no
356042941e3bSmrg  need_version=no
356142941e3bSmrg  dynamic_linker="$host_os runtime_loader"
356242941e3bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
356342941e3bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
356442941e3bSmrg  shlibpath_var=LIBRARY_PATH
356542941e3bSmrg  shlibpath_overrides_runpath=yes
356642941e3bSmrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
356742941e3bSmrg  hardcode_into_libs=yes
356842941e3bSmrg  ;;
35696f03b1f6Smrg
357042941e3bSmrghpux9* | hpux10* | hpux11*)
357142941e3bSmrg  # Give a soname corresponding to the major version so that dld.sl refuses to
357242941e3bSmrg  # link against other versions.
357342941e3bSmrg  version_type=sunos
357442941e3bSmrg  need_lib_prefix=no
357542941e3bSmrg  need_version=no
357642941e3bSmrg  case $host_cpu in
357742941e3bSmrg  ia64*)
357842941e3bSmrg    shrext_cmds='.so'
357942941e3bSmrg    hardcode_into_libs=yes
358042941e3bSmrg    dynamic_linker="$host_os dld.so"
358142941e3bSmrg    shlibpath_var=LD_LIBRARY_PATH
358242941e3bSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
358342941e3bSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
358442941e3bSmrg    soname_spec='${libname}${release}${shared_ext}$major'
358542941e3bSmrg    if test "X$HPUX_IA64_MODE" = X32; then
358642941e3bSmrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
3587356f6debSmrg    else
358842941e3bSmrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
3589356f6debSmrg    fi
359042941e3bSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
359142941e3bSmrg    ;;
359242941e3bSmrg  hppa*64*)
359342941e3bSmrg    shrext_cmds='.sl'
359442941e3bSmrg    hardcode_into_libs=yes
359542941e3bSmrg    dynamic_linker="$host_os dld.sl"
359642941e3bSmrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
359742941e3bSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
359842941e3bSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
359942941e3bSmrg    soname_spec='${libname}${release}${shared_ext}$major'
360042941e3bSmrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
360142941e3bSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3602356f6debSmrg    ;;
3603356f6debSmrg  *)
360442941e3bSmrg    shrext_cmds='.sl'
360542941e3bSmrg    dynamic_linker="$host_os dld.sl"
360642941e3bSmrg    shlibpath_var=SHLIB_PATH
360742941e3bSmrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
360842941e3bSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
360942941e3bSmrg    soname_spec='${libname}${release}${shared_ext}$major'
36106f03b1f6Smrg    ;;
361198af18c5Smrg  esac
361242941e3bSmrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
361342941e3bSmrg  postinstall_cmds='chmod 555 $lib'
361442941e3bSmrg  # or fails outright, so override atomically:
361542941e3bSmrg  install_override_mode=555
361642941e3bSmrg  ;;
36176f03b1f6Smrg
361842941e3bSmrginterix[[3-9]]*)
361917caa701Smrg  version_type=linux # correct to gnu/linux during the next big refactor
362042941e3bSmrg  need_lib_prefix=no
362142941e3bSmrg  need_version=no
362242941e3bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
362342941e3bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
362442941e3bSmrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
362542941e3bSmrg  shlibpath_var=LD_LIBRARY_PATH
362642941e3bSmrg  shlibpath_overrides_runpath=no
362742941e3bSmrg  hardcode_into_libs=yes
362842941e3bSmrg  ;;
362998af18c5Smrg
363042941e3bSmrgirix5* | irix6* | nonstopux*)
363198af18c5Smrg  case $host_os in
363242941e3bSmrg    nonstopux*) version_type=nonstopux ;;
363342941e3bSmrg    *)
363442941e3bSmrg	if test "$lt_cv_prog_gnu_ld" = yes; then
363517caa701Smrg		version_type=linux # correct to gnu/linux during the next big refactor
363642941e3bSmrg	else
363742941e3bSmrg		version_type=irix
363842941e3bSmrg	fi ;;
363998af18c5Smrg  esac
364098af18c5Smrg  need_lib_prefix=no
364198af18c5Smrg  need_version=no
364242941e3bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
364342941e3bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
364442941e3bSmrg  case $host_os in
364542941e3bSmrg  irix5* | nonstopux*)
364642941e3bSmrg    libsuff= shlibsuff=
3647356f6debSmrg    ;;
364842941e3bSmrg  *)
364942941e3bSmrg    case $LD in # libtool.m4 will add one of these switches to LD
365042941e3bSmrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
365142941e3bSmrg      libsuff= shlibsuff= libmagic=32-bit;;
365242941e3bSmrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
365342941e3bSmrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
365442941e3bSmrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
365542941e3bSmrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
365642941e3bSmrg    *) libsuff= shlibsuff= libmagic=never-match;;
365742941e3bSmrg    esac
3658356f6debSmrg    ;;
3659356f6debSmrg  esac
366042941e3bSmrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
366142941e3bSmrg  shlibpath_overrides_runpath=no
366242941e3bSmrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
366342941e3bSmrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
366442941e3bSmrg  hardcode_into_libs=yes
366598af18c5Smrg  ;;
36666f03b1f6Smrg
366742941e3bSmrg# No shared lib support for Linux oldld, aout, or coff.
366842941e3bSmrglinux*oldld* | linux*aout* | linux*coff*)
366942941e3bSmrg  dynamic_linker=no
367098af18c5Smrg  ;;
36716f03b1f6Smrg
367217caa701Smrg# This must be glibc/ELF.
367342941e3bSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
367417caa701Smrg  version_type=linux # correct to gnu/linux during the next big refactor
367542941e3bSmrg  need_lib_prefix=no
367698af18c5Smrg  need_version=no
367798af18c5Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
367898af18c5Smrg  soname_spec='${libname}${release}${shared_ext}$major'
367942941e3bSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
368098af18c5Smrg  shlibpath_var=LD_LIBRARY_PATH
368142941e3bSmrg  shlibpath_overrides_runpath=no
368298af18c5Smrg
368342941e3bSmrg  # Some binutils ld are patched to set DT_RUNPATH
368442941e3bSmrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
368542941e3bSmrg    [lt_cv_shlibpath_overrides_runpath=no
368642941e3bSmrg    save_LDFLAGS=$LDFLAGS
368742941e3bSmrg    save_libdir=$libdir
368842941e3bSmrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
368942941e3bSmrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
369042941e3bSmrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
369142941e3bSmrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
369242941e3bSmrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
369342941e3bSmrg    LDFLAGS=$save_LDFLAGS
369442941e3bSmrg    libdir=$save_libdir
369542941e3bSmrg    ])
369642941e3bSmrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
369798af18c5Smrg
369842941e3bSmrg  # This implies no fast_install, which is unacceptable.
369942941e3bSmrg  # Some rework will be needed to allow for fast_install
370042941e3bSmrg  # before this can be enabled.
370142941e3bSmrg  hardcode_into_libs=yes
370298af18c5Smrg
370342941e3bSmrg  # Append ld.so.conf contents to the search path
370442941e3bSmrg  if test -f /etc/ld.so.conf; then
370542941e3bSmrg    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' ' '`
370642941e3bSmrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
370742941e3bSmrg  fi
37086f03b1f6Smrg
370942941e3bSmrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
371042941e3bSmrg  # powerpc, because MkLinux only supported shared libraries with the
371142941e3bSmrg  # GNU dynamic linker.  Since this was broken with cross compilers,
371242941e3bSmrg  # most powerpc-linux boxes support dynamic linking these days and
371342941e3bSmrg  # people can always --disable-shared, the test was removed, and we
371442941e3bSmrg  # assume the GNU/Linux dynamic linker is in use.
371542941e3bSmrg  dynamic_linker='GNU/Linux ld.so'
371698af18c5Smrg  ;;
37176f03b1f6Smrg
371842941e3bSmrgnetbsd*)
371942941e3bSmrg  version_type=sunos
372098af18c5Smrg  need_lib_prefix=no
372198af18c5Smrg  need_version=no
372242941e3bSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
372342941e3bSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
372442941e3bSmrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
372542941e3bSmrg    dynamic_linker='NetBSD (a.out) ld.so'
372642941e3bSmrg  else
372742941e3bSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
372842941e3bSmrg    soname_spec='${libname}${release}${shared_ext}$major'
372942941e3bSmrg    dynamic_linker='NetBSD ld.elf_so'
373042941e3bSmrg  fi
373142941e3bSmrg  shlibpath_var=LD_LIBRARY_PATH
373298af18c5Smrg  shlibpath_overrides_runpath=yes
373342941e3bSmrg  hardcode_into_libs=yes
373498af18c5Smrg  ;;
37356f03b1f6Smrg
373642941e3bSmrgnewsos6)
373717caa701Smrg  version_type=linux # correct to gnu/linux during the next big refactor
373842941e3bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
373942941e3bSmrg  shlibpath_var=LD_LIBRARY_PATH
374042941e3bSmrg  shlibpath_overrides_runpath=yes
374142941e3bSmrg  ;;
374242941e3bSmrg
374342941e3bSmrg*nto* | *qnx*)
374442941e3bSmrg  version_type=qnx
374598af18c5Smrg  need_lib_prefix=no
374698af18c5Smrg  need_version=no
374742941e3bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
374898af18c5Smrg  soname_spec='${libname}${release}${shared_ext}$major'
374998af18c5Smrg  shlibpath_var=LD_LIBRARY_PATH
375042941e3bSmrg  shlibpath_overrides_runpath=no
375142941e3bSmrg  hardcode_into_libs=yes
375242941e3bSmrg  dynamic_linker='ldqnx.so'
375398af18c5Smrg  ;;
37546f03b1f6Smrg
375542941e3bSmrgopenbsd*)
375642941e3bSmrg  version_type=sunos
375742941e3bSmrg  sys_lib_dlsearch_path_spec="/usr/lib"
375842941e3bSmrg  need_lib_prefix=no
375942941e3bSmrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
376042941e3bSmrg  case $host_os in
376142941e3bSmrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
376242941e3bSmrg    *)				need_version=no  ;;
376342941e3bSmrg  esac
376442941e3bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
376542941e3bSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
376642941e3bSmrg  shlibpath_var=LD_LIBRARY_PATH
376742941e3bSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
376898af18c5Smrg    case $host_os in
376998af18c5Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
377098af18c5Smrg	shlibpath_overrides_runpath=no
37716f03b1f6Smrg	;;
377298af18c5Smrg      *)
377398af18c5Smrg	shlibpath_overrides_runpath=yes
37746f03b1f6Smrg	;;
377598af18c5Smrg      esac
377698af18c5Smrg  else
377798af18c5Smrg    shlibpath_overrides_runpath=yes
377898af18c5Smrg  fi
377998af18c5Smrg  ;;
37806f03b1f6Smrg
378198af18c5Smrgos2*)
378298af18c5Smrg  libname_spec='$name'
378398af18c5Smrg  shrext_cmds=".dll"
378498af18c5Smrg  need_lib_prefix=no
378598af18c5Smrg  library_names_spec='$libname${shared_ext} $libname.a'
378698af18c5Smrg  dynamic_linker='OS/2 ld.exe'
378798af18c5Smrg  shlibpath_var=LIBPATH
378898af18c5Smrg  ;;
37896f03b1f6Smrg
379098af18c5Smrgosf3* | osf4* | osf5*)
379198af18c5Smrg  version_type=osf
379298af18c5Smrg  need_lib_prefix=no
379398af18c5Smrg  need_version=no
379498af18c5Smrg  soname_spec='${libname}${release}${shared_ext}$major'
379598af18c5Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
379698af18c5Smrg  shlibpath_var=LD_LIBRARY_PATH
379798af18c5Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
379898af18c5Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
379998af18c5Smrg  ;;
38006f03b1f6Smrg
380198af18c5Smrgrdos*)
380298af18c5Smrg  dynamic_linker=no
380398af18c5Smrg  ;;
38046f03b1f6Smrg
380598af18c5Smrgsolaris*)
380617caa701Smrg  version_type=linux # correct to gnu/linux during the next big refactor
380798af18c5Smrg  need_lib_prefix=no
380898af18c5Smrg  need_version=no
380998af18c5Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
381098af18c5Smrg  soname_spec='${libname}${release}${shared_ext}$major'
381198af18c5Smrg  shlibpath_var=LD_LIBRARY_PATH
381298af18c5Smrg  shlibpath_overrides_runpath=yes
381398af18c5Smrg  hardcode_into_libs=yes
381498af18c5Smrg  # ldd complains unless libraries are executable
381598af18c5Smrg  postinstall_cmds='chmod +x $lib'
381698af18c5Smrg  ;;
38176f03b1f6Smrg
381898af18c5Smrgsunos4*)
381998af18c5Smrg  version_type=sunos
382098af18c5Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
382198af18c5Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
382298af18c5Smrg  shlibpath_var=LD_LIBRARY_PATH
382398af18c5Smrg  shlibpath_overrides_runpath=yes
382498af18c5Smrg  if test "$with_gnu_ld" = yes; then
382598af18c5Smrg    need_lib_prefix=no
382698af18c5Smrg  fi
382798af18c5Smrg  need_version=yes
382898af18c5Smrg  ;;
382998af18c5Smrg
383098af18c5Smrgsysv4 | sysv4.3*)
383117caa701Smrg  version_type=linux # correct to gnu/linux during the next big refactor
383298af18c5Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
383398af18c5Smrg  soname_spec='${libname}${release}${shared_ext}$major'
383498af18c5Smrg  shlibpath_var=LD_LIBRARY_PATH
383598af18c5Smrg  case $host_vendor in
383698af18c5Smrg    sni)
383798af18c5Smrg      shlibpath_overrides_runpath=no
383898af18c5Smrg      need_lib_prefix=no
383998af18c5Smrg      runpath_var=LD_RUN_PATH
384098af18c5Smrg      ;;
384198af18c5Smrg    siemens)
384298af18c5Smrg      need_lib_prefix=no
384398af18c5Smrg      ;;
384498af18c5Smrg    motorola)
384598af18c5Smrg      need_lib_prefix=no
384698af18c5Smrg      need_version=no
384798af18c5Smrg      shlibpath_overrides_runpath=no
384898af18c5Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
384998af18c5Smrg      ;;
385098af18c5Smrg  esac
385198af18c5Smrg  ;;
385298af18c5Smrg
385398af18c5Smrgsysv4*MP*)
385498af18c5Smrg  if test -d /usr/nec ;then
385517caa701Smrg    version_type=linux # correct to gnu/linux during the next big refactor
385698af18c5Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
385798af18c5Smrg    soname_spec='$libname${shared_ext}.$major'
385898af18c5Smrg    shlibpath_var=LD_LIBRARY_PATH
385998af18c5Smrg  fi
386098af18c5Smrg  ;;
386198af18c5Smrg
386298af18c5Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
386398af18c5Smrg  version_type=freebsd-elf
386498af18c5Smrg  need_lib_prefix=no
386598af18c5Smrg  need_version=no
386698af18c5Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
386798af18c5Smrg  soname_spec='${libname}${release}${shared_ext}$major'
386898af18c5Smrg  shlibpath_var=LD_LIBRARY_PATH
3869356f6debSmrg  shlibpath_overrides_runpath=yes
387098af18c5Smrg  hardcode_into_libs=yes
387198af18c5Smrg  if test "$with_gnu_ld" = yes; then
387298af18c5Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
387398af18c5Smrg  else
387498af18c5Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
387598af18c5Smrg    case $host_os in
387698af18c5Smrg      sco3.2v5*)
387798af18c5Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
38786f03b1f6Smrg	;;
38796f03b1f6Smrg    esac
388098af18c5Smrg  fi
388198af18c5Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
388298af18c5Smrg  ;;
38836f03b1f6Smrg
3884356f6debSmrgtpf*)
3885356f6debSmrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
388617caa701Smrg  version_type=linux # correct to gnu/linux during the next big refactor
3887356f6debSmrg  need_lib_prefix=no
3888356f6debSmrg  need_version=no
3889356f6debSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
3890356f6debSmrg  shlibpath_var=LD_LIBRARY_PATH
3891356f6debSmrg  shlibpath_overrides_runpath=no
3892356f6debSmrg  hardcode_into_libs=yes
3893356f6debSmrg  ;;
3894356f6debSmrg
389598af18c5Smrguts4*)
389617caa701Smrg  version_type=linux # correct to gnu/linux during the next big refactor
389798af18c5Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
389898af18c5Smrg  soname_spec='${libname}${release}${shared_ext}$major'
389998af18c5Smrg  shlibpath_var=LD_LIBRARY_PATH
390098af18c5Smrg  ;;
39016f03b1f6Smrg
390298af18c5Smrg*)
390398af18c5Smrg  dynamic_linker=no
390498af18c5Smrg  ;;
390598af18c5Smrgesac
390698af18c5SmrgAC_MSG_RESULT([$dynamic_linker])
390798af18c5Smrgtest "$dynamic_linker" = no && can_build_shared=no
39086f03b1f6Smrg
390998af18c5Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
391098af18c5Smrgif test "$GCC" = yes; then
391198af18c5Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
391298af18c5Smrgfi
391398af18c5Smrg
3914356f6debSmrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
3915356f6debSmrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
3916356f6debSmrgfi
3917356f6debSmrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
3918356f6debSmrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
3919356f6debSmrgfi
392098af18c5Smrg
3921356f6debSmrg_LT_DECL([], [variables_saved_for_relink], [1],
3922356f6debSmrg    [Variables whose values should be saved in libtool wrapper scripts and
3923356f6debSmrg    restored at link time])
3924356f6debSmrg_LT_DECL([], [need_lib_prefix], [0],
3925356f6debSmrg    [Do we need the "lib" prefix for modules?])
3926356f6debSmrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
3927356f6debSmrg_LT_DECL([], [version_type], [0], [Library versioning type])
3928356f6debSmrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
3929356f6debSmrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
3930356f6debSmrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
3931356f6debSmrg    [Is shlibpath searched before the hard-coded library search path?])
3932356f6debSmrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
3933356f6debSmrg_LT_DECL([], [library_names_spec], [1],
3934356f6debSmrg    [[List of archive names.  First name is the real one, the rest are links.
3935356f6debSmrg    The last name is the one that the linker finds with -lNAME]])
3936356f6debSmrg_LT_DECL([], [soname_spec], [1],
3937356f6debSmrg    [[The coded name of the library, if different from the real name]])
393842941e3bSmrg_LT_DECL([], [install_override_mode], [1],
393942941e3bSmrg    [Permission mode override for installation of shared libraries])
3940356f6debSmrg_LT_DECL([], [postinstall_cmds], [2],
3941356f6debSmrg    [Command to use after installation of a shared archive])
3942356f6debSmrg_LT_DECL([], [postuninstall_cmds], [2],
3943356f6debSmrg    [Command to use after uninstallation of a shared archive])
3944356f6debSmrg_LT_DECL([], [finish_cmds], [2],
3945356f6debSmrg    [Commands used to finish a libtool library installation in a directory])
3946356f6debSmrg_LT_DECL([], [finish_eval], [1],
3947356f6debSmrg    [[As "finish_cmds", except a single script fragment to be evaled but
3948356f6debSmrg    not shown]])
3949356f6debSmrg_LT_DECL([], [hardcode_into_libs], [0],
3950356f6debSmrg    [Whether we should hardcode library paths into libraries])
3951356f6debSmrg_LT_DECL([], [sys_lib_search_path_spec], [2],
3952356f6debSmrg    [Compile-time system search path for libraries])
3953356f6debSmrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
3954356f6debSmrg    [Run-time system search path for libraries])
3955356f6debSmrg])# _LT_SYS_DYNAMIC_LINKER
3956356f6debSmrg
3957356f6debSmrg
3958356f6debSmrg# _LT_PATH_TOOL_PREFIX(TOOL)
3959356f6debSmrg# --------------------------
3960356f6debSmrg# find a file program which can recognize shared library
3961356f6debSmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
3962356f6debSmrg[m4_require([_LT_DECL_EGREP])dnl
3963356f6debSmrgAC_MSG_CHECKING([for $1])
3964356f6debSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3965356f6debSmrg[case $MAGIC_CMD in
3966356f6debSmrg[[\\/*] |  ?:[\\/]*])
3967356f6debSmrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
3968356f6debSmrg  ;;
3969356f6debSmrg*)
3970356f6debSmrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
3971356f6debSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3972356f6debSmrgdnl $ac_dummy forces splitting on constant user-supplied paths.
3973356f6debSmrgdnl POSIX.2 word splitting is done only on the output of word expansions,
3974356f6debSmrgdnl not every word.  This closes a longstanding sh security hole.
3975356f6debSmrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
3976356f6debSmrg  for ac_dir in $ac_dummy; do
397798af18c5Smrg    IFS="$lt_save_ifs"
3978356f6debSmrg    test -z "$ac_dir" && ac_dir=.
3979356f6debSmrg    if test -f $ac_dir/$1; then
3980356f6debSmrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
3981356f6debSmrg      if test -n "$file_magic_test_file"; then
3982356f6debSmrg	case $deplibs_check_method in
3983356f6debSmrg	"file_magic "*)
3984356f6debSmrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
3985356f6debSmrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3986356f6debSmrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3987356f6debSmrg	    $EGREP "$file_magic_regex" > /dev/null; then
3988356f6debSmrg	    :
3989356f6debSmrg	  else
3990356f6debSmrg	    cat <<_LT_EOF 1>&2
399198af18c5Smrg
3992356f6debSmrg*** Warning: the command libtool uses to detect shared libraries,
3993356f6debSmrg*** $file_magic_cmd, produces output that libtool cannot recognize.
3994356f6debSmrg*** The result is that libtool may fail to recognize shared libraries
3995356f6debSmrg*** as such.  This will affect the creation of libtool libraries that
3996356f6debSmrg*** depend on shared libraries, but programs linked with such libtool
3997356f6debSmrg*** libraries will work regardless of this problem.  Nevertheless, you
3998356f6debSmrg*** may want to report the problem to your system manager and/or to
3999356f6debSmrg*** bug-libtool@gnu.org
40006f03b1f6Smrg
4001356f6debSmrg_LT_EOF
400298af18c5Smrg	  fi ;;
400398af18c5Smrg	esac
400498af18c5Smrg      fi
400598af18c5Smrg      break
400698af18c5Smrg    fi
400798af18c5Smrg  done
400898af18c5Smrg  IFS="$lt_save_ifs"
400998af18c5Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
401098af18c5Smrg  ;;
401198af18c5Smrgesac])
401298af18c5SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
401398af18c5Smrgif test -n "$MAGIC_CMD"; then
401498af18c5Smrg  AC_MSG_RESULT($MAGIC_CMD)
401598af18c5Smrgelse
401698af18c5Smrg  AC_MSG_RESULT(no)
401798af18c5Smrgfi
4018356f6debSmrg_LT_DECL([], [MAGIC_CMD], [0],
4019356f6debSmrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
4020356f6debSmrg])# _LT_PATH_TOOL_PREFIX
40216f03b1f6Smrg
4022356f6debSmrg# Old name:
4023356f6debSmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
4024356f6debSmrgdnl aclocal-1.4 backwards compatibility:
4025356f6debSmrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
40266f03b1f6Smrg
4027356f6debSmrg
4028356f6debSmrg# _LT_PATH_MAGIC
4029356f6debSmrg# --------------
403098af18c5Smrg# find a file program which can recognize a shared library
4031356f6debSmrgm4_defun([_LT_PATH_MAGIC],
4032356f6debSmrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
403398af18c5Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
403498af18c5Smrg  if test -n "$ac_tool_prefix"; then
4035356f6debSmrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
403698af18c5Smrg  else
403798af18c5Smrg    MAGIC_CMD=:
403898af18c5Smrg  fi
403998af18c5Smrgfi
4040356f6debSmrg])# _LT_PATH_MAGIC
40416f03b1f6Smrg
40426f03b1f6Smrg
4043356f6debSmrg# LT_PATH_LD
404498af18c5Smrg# ----------
404598af18c5Smrg# find the pathname to the GNU or non-GNU linker
4046356f6debSmrgAC_DEFUN([LT_PATH_LD],
4047356f6debSmrg[AC_REQUIRE([AC_PROG_CC])dnl
404898af18c5SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
404998af18c5SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
4050356f6debSmrgm4_require([_LT_DECL_SED])dnl
4051356f6debSmrgm4_require([_LT_DECL_EGREP])dnl
405242941e3bSmrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
4053356f6debSmrg
4054356f6debSmrgAC_ARG_WITH([gnu-ld],
4055356f6debSmrg    [AS_HELP_STRING([--with-gnu-ld],
4056356f6debSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
4057356f6debSmrg    [test "$withval" = no || with_gnu_ld=yes],
4058356f6debSmrg    [with_gnu_ld=no])dnl
4059356f6debSmrg
406098af18c5Smrgac_prog=ld
406198af18c5Smrgif test "$GCC" = yes; then
406298af18c5Smrg  # Check if gcc -print-prog-name=ld gives a path.
406398af18c5Smrg  AC_MSG_CHECKING([for ld used by $CC])
406498af18c5Smrg  case $host in
406598af18c5Smrg  *-*-mingw*)
406698af18c5Smrg    # gcc leaves a trailing carriage return which upsets mingw
406798af18c5Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
406898af18c5Smrg  *)
406998af18c5Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
407098af18c5Smrg  esac
407198af18c5Smrg  case $ac_prog in
407298af18c5Smrg    # Accept absolute paths.
407398af18c5Smrg    [[\\/]]* | ?:[[\\/]]*)
407498af18c5Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
407598af18c5Smrg      # Canonicalize the pathname of ld
4076356f6debSmrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
4077356f6debSmrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
4078356f6debSmrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
407998af18c5Smrg      done
408098af18c5Smrg      test -z "$LD" && LD="$ac_prog"
408198af18c5Smrg      ;;
408298af18c5Smrg  "")
408398af18c5Smrg    # If it fails, then pretend we aren't using GCC.
408498af18c5Smrg    ac_prog=ld
408598af18c5Smrg    ;;
408698af18c5Smrg  *)
408798af18c5Smrg    # If it is relative, then search for the first ld in PATH.
408898af18c5Smrg    with_gnu_ld=unknown
408998af18c5Smrg    ;;
409098af18c5Smrg  esac
409198af18c5Smrgelif test "$with_gnu_ld" = yes; then
409298af18c5Smrg  AC_MSG_CHECKING([for GNU ld])
409398af18c5Smrgelse
409498af18c5Smrg  AC_MSG_CHECKING([for non-GNU ld])
409598af18c5Smrgfi
409698af18c5SmrgAC_CACHE_VAL(lt_cv_path_LD,
409798af18c5Smrg[if test -z "$LD"; then
409898af18c5Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
409998af18c5Smrg  for ac_dir in $PATH; do
410098af18c5Smrg    IFS="$lt_save_ifs"
410198af18c5Smrg    test -z "$ac_dir" && ac_dir=.
410298af18c5Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
410398af18c5Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
410498af18c5Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
410598af18c5Smrg      # but apparently some variants of GNU ld only accept -v.
410698af18c5Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
410798af18c5Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
410898af18c5Smrg      *GNU* | *'with BFD'*)
410998af18c5Smrg	test "$with_gnu_ld" != no && break
411098af18c5Smrg	;;
411198af18c5Smrg      *)
411298af18c5Smrg	test "$with_gnu_ld" != yes && break
411398af18c5Smrg	;;
411498af18c5Smrg      esac
411598af18c5Smrg    fi
411698af18c5Smrg  done
411798af18c5Smrg  IFS="$lt_save_ifs"
411898af18c5Smrgelse
411998af18c5Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
412098af18c5Smrgfi])
412198af18c5SmrgLD="$lt_cv_path_LD"
412298af18c5Smrgif test -n "$LD"; then
412398af18c5Smrg  AC_MSG_RESULT($LD)
412498af18c5Smrgelse
412598af18c5Smrg  AC_MSG_RESULT(no)
412698af18c5Smrgfi
412798af18c5Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4128356f6debSmrg_LT_PATH_LD_GNU
4129356f6debSmrgAC_SUBST([LD])
41306f03b1f6Smrg
4131356f6debSmrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
4132356f6debSmrg])# LT_PATH_LD
41336f03b1f6Smrg
4134356f6debSmrg# Old names:
4135356f6debSmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
4136356f6debSmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
4137356f6debSmrgdnl aclocal-1.4 backwards compatibility:
4138356f6debSmrgdnl AC_DEFUN([AM_PROG_LD], [])
4139356f6debSmrgdnl AC_DEFUN([AC_PROG_LD], [])
4140356f6debSmrg
4141356f6debSmrg
4142356f6debSmrg# _LT_PATH_LD_GNU
4143356f6debSmrg#- --------------
4144356f6debSmrgm4_defun([_LT_PATH_LD_GNU],
4145356f6debSmrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
414698af18c5Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
414798af18c5Smrgcase `$LD -v 2>&1 </dev/null` in
414898af18c5Smrg*GNU* | *'with BFD'*)
414998af18c5Smrg  lt_cv_prog_gnu_ld=yes
415098af18c5Smrg  ;;
415198af18c5Smrg*)
415298af18c5Smrg  lt_cv_prog_gnu_ld=no
415398af18c5Smrg  ;;
415498af18c5Smrgesac])
415598af18c5Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
4156356f6debSmrg])# _LT_PATH_LD_GNU
41576f03b1f6Smrg
41586f03b1f6Smrg
4159356f6debSmrg# _LT_CMD_RELOAD
4160356f6debSmrg# --------------
416198af18c5Smrg# find reload flag for linker
416298af18c5Smrg#   -- PORTME Some linkers may need a different reload flag.
4163356f6debSmrgm4_defun([_LT_CMD_RELOAD],
416498af18c5Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
416598af18c5Smrg  lt_cv_ld_reload_flag,
416698af18c5Smrg  [lt_cv_ld_reload_flag='-r'])
416798af18c5Smrgreload_flag=$lt_cv_ld_reload_flag
416898af18c5Smrgcase $reload_flag in
416998af18c5Smrg"" | " "*) ;;
417098af18c5Smrg*) reload_flag=" $reload_flag" ;;
417198af18c5Smrgesac
417298af18c5Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
417398af18c5Smrgcase $host_os in
417442941e3bSmrg  cygwin* | mingw* | pw32* | cegcc*)
417542941e3bSmrg    if test "$GCC" != yes; then
417642941e3bSmrg      reload_cmds=false
417742941e3bSmrg    fi
417842941e3bSmrg    ;;
417998af18c5Smrg  darwin*)
418098af18c5Smrg    if test "$GCC" = yes; then
418198af18c5Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
418298af18c5Smrg    else
418398af18c5Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
418498af18c5Smrg    fi
418598af18c5Smrg    ;;
418698af18c5Smrgesac
418742941e3bSmrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
418842941e3bSmrg_LT_TAGDECL([], [reload_cmds], [2])dnl
4189356f6debSmrg])# _LT_CMD_RELOAD
41906f03b1f6Smrg
41916f03b1f6Smrg
4192356f6debSmrg# _LT_CHECK_MAGIC_METHOD
4193356f6debSmrg# ----------------------
419498af18c5Smrg# how to check for library dependencies
419598af18c5Smrg#  -- PORTME fill in with the dynamic library characteristics
4196356f6debSmrgm4_defun([_LT_CHECK_MAGIC_METHOD],
4197356f6debSmrg[m4_require([_LT_DECL_EGREP])
4198356f6debSmrgm4_require([_LT_DECL_OBJDUMP])
4199356f6debSmrgAC_CACHE_CHECK([how to recognize dependent libraries],
420098af18c5Smrglt_cv_deplibs_check_method,
420198af18c5Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
420298af18c5Smrglt_cv_file_magic_test_file=
420398af18c5Smrglt_cv_deplibs_check_method='unknown'
420498af18c5Smrg# Need to set the preceding variable on all platforms that support
420598af18c5Smrg# interlibrary dependencies.
420698af18c5Smrg# 'none' -- dependencies not supported.
420798af18c5Smrg# `unknown' -- same as none, but documents that we really don't know.
420898af18c5Smrg# 'pass_all' -- all dependencies passed with no checks.
420998af18c5Smrg# 'test_compile' -- check by making test program.
421098af18c5Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
421198af18c5Smrg# which responds to the $file_magic_cmd with a given extended regex.
421298af18c5Smrg# If you have `file' or equivalent on your system and you're not sure
421398af18c5Smrg# whether `pass_all' will *always* work, you probably want this one.
42146f03b1f6Smrg
421598af18c5Smrgcase $host_os in
421698af18c5Smrgaix[[4-9]]*)
421798af18c5Smrg  lt_cv_deplibs_check_method=pass_all
421898af18c5Smrg  ;;
42196f03b1f6Smrg
422098af18c5Smrgbeos*)
422198af18c5Smrg  lt_cv_deplibs_check_method=pass_all
422298af18c5Smrg  ;;
42236f03b1f6Smrg
422498af18c5Smrgbsdi[[45]]*)
422598af18c5Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
422698af18c5Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
422798af18c5Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
422898af18c5Smrg  ;;
42296f03b1f6Smrg
423098af18c5Smrgcygwin*)
423198af18c5Smrg  # func_win32_libid is a shell function defined in ltmain.sh
423298af18c5Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
423398af18c5Smrg  lt_cv_file_magic_cmd='func_win32_libid'
423498af18c5Smrg  ;;
42356f03b1f6Smrg
423698af18c5Smrgmingw* | pw32*)
423798af18c5Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
423898af18c5Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
423998af18c5Smrg  # unless we find 'file', for example because we are cross-compiling.
424042941e3bSmrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
424142941e3bSmrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
424298af18c5Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
424398af18c5Smrg    lt_cv_file_magic_cmd='func_win32_libid'
424498af18c5Smrg  else
424542941e3bSmrg    # Keep this pattern in sync with the one in func_win32_libid.
424642941e3bSmrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
424798af18c5Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
42486f03b1f6Smrg  fi
424998af18c5Smrg  ;;
42506f03b1f6Smrg
425142941e3bSmrgcegcc*)
4252356f6debSmrg  # use the weaker test based on 'objdump'. See mingw*.
4253356f6debSmrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
4254356f6debSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
4255356f6debSmrg  ;;
4256356f6debSmrg
425798af18c5Smrgdarwin* | rhapsody*)
425898af18c5Smrg  lt_cv_deplibs_check_method=pass_all
425998af18c5Smrg  ;;
426098af18c5Smrg
426198af18c5Smrgfreebsd* | dragonfly*)
4262356f6debSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
426398af18c5Smrg    case $host_cpu in
426498af18c5Smrg    i*86 )
426598af18c5Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
426698af18c5Smrg      # Let's accept both of them until this is cleared up.
426798af18c5Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
426898af18c5Smrg      lt_cv_file_magic_cmd=/usr/bin/file
426998af18c5Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
42706f03b1f6Smrg      ;;
42716f03b1f6Smrg    esac
427298af18c5Smrg  else
427398af18c5Smrg    lt_cv_deplibs_check_method=pass_all
427498af18c5Smrg  fi
427598af18c5Smrg  ;;
42766f03b1f6Smrg
427798af18c5Smrggnu*)
427898af18c5Smrg  lt_cv_deplibs_check_method=pass_all
427998af18c5Smrg  ;;
428098af18c5Smrg
428142941e3bSmrghaiku*)
428242941e3bSmrg  lt_cv_deplibs_check_method=pass_all
428342941e3bSmrg  ;;
428442941e3bSmrg
428598af18c5Smrghpux10.20* | hpux11*)
428698af18c5Smrg  lt_cv_file_magic_cmd=/usr/bin/file
428798af18c5Smrg  case $host_cpu in
428898af18c5Smrg  ia64*)
428998af18c5Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
429098af18c5Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
429198af18c5Smrg    ;;
429298af18c5Smrg  hppa*64*)
429342941e3bSmrg    [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]']
429498af18c5Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
429598af18c5Smrg    ;;
429698af18c5Smrg  *)
429742941e3bSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
429898af18c5Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
42996f03b1f6Smrg    ;;
43006f03b1f6Smrg  esac
430198af18c5Smrg  ;;
43026f03b1f6Smrg
430398af18c5Smrginterix[[3-9]]*)
430498af18c5Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
430598af18c5Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
430698af18c5Smrg  ;;
43076f03b1f6Smrg
430898af18c5Smrgirix5* | irix6* | nonstopux*)
430998af18c5Smrg  case $LD in
431098af18c5Smrg  *-32|*"-32 ") libmagic=32-bit;;
431198af18c5Smrg  *-n32|*"-n32 ") libmagic=N32;;
431298af18c5Smrg  *-64|*"-64 ") libmagic=64-bit;;
431398af18c5Smrg  *) libmagic=never-match;;
431498af18c5Smrg  esac
431598af18c5Smrg  lt_cv_deplibs_check_method=pass_all
431698af18c5Smrg  ;;
43176f03b1f6Smrg
431817caa701Smrg# This must be glibc/ELF.
431942941e3bSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
432098af18c5Smrg  lt_cv_deplibs_check_method=pass_all
432198af18c5Smrg  ;;
43226f03b1f6Smrg
432398af18c5Smrgnetbsd*)
4324356f6debSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
432598af18c5Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
432698af18c5Smrg  else
432798af18c5Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
432898af18c5Smrg  fi
432998af18c5Smrg  ;;
43306f03b1f6Smrg
433198af18c5Smrgnewos6*)
433298af18c5Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
433398af18c5Smrg  lt_cv_file_magic_cmd=/usr/bin/file
433498af18c5Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
433598af18c5Smrg  ;;
43366f03b1f6Smrg
4337356f6debSmrg*nto* | *qnx*)
4338356f6debSmrg  lt_cv_deplibs_check_method=pass_all
433998af18c5Smrg  ;;
43406f03b1f6Smrg
434198af18c5Smrgopenbsd*)
4342356f6debSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
434398af18c5Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
434498af18c5Smrg  else
434598af18c5Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
434698af18c5Smrg  fi
434798af18c5Smrg  ;;
43486f03b1f6Smrg
434998af18c5Smrgosf3* | osf4* | osf5*)
435098af18c5Smrg  lt_cv_deplibs_check_method=pass_all
435198af18c5Smrg  ;;
43526f03b1f6Smrg
435398af18c5Smrgrdos*)
435498af18c5Smrg  lt_cv_deplibs_check_method=pass_all
435598af18c5Smrg  ;;
43566f03b1f6Smrg
435798af18c5Smrgsolaris*)
435898af18c5Smrg  lt_cv_deplibs_check_method=pass_all
435998af18c5Smrg  ;;
43606f03b1f6Smrg
4361356f6debSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
4362356f6debSmrg  lt_cv_deplibs_check_method=pass_all
4363356f6debSmrg  ;;
4364356f6debSmrg
436598af18c5Smrgsysv4 | sysv4.3*)
436698af18c5Smrg  case $host_vendor in
436798af18c5Smrg  motorola)
436898af18c5Smrg    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]]'
436998af18c5Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
437098af18c5Smrg    ;;
437198af18c5Smrg  ncr)
437298af18c5Smrg    lt_cv_deplibs_check_method=pass_all
437398af18c5Smrg    ;;
437498af18c5Smrg  sequent)
437598af18c5Smrg    lt_cv_file_magic_cmd='/bin/file'
437698af18c5Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
437798af18c5Smrg    ;;
437898af18c5Smrg  sni)
437998af18c5Smrg    lt_cv_file_magic_cmd='/bin/file'
438098af18c5Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
438198af18c5Smrg    lt_cv_file_magic_test_file=/lib/libc.so
438298af18c5Smrg    ;;
438398af18c5Smrg  siemens)
438498af18c5Smrg    lt_cv_deplibs_check_method=pass_all
438598af18c5Smrg    ;;
438698af18c5Smrg  pc)
438798af18c5Smrg    lt_cv_deplibs_check_method=pass_all
438898af18c5Smrg    ;;
438998af18c5Smrg  esac
439098af18c5Smrg  ;;
43916f03b1f6Smrg
4392356f6debSmrgtpf*)
439398af18c5Smrg  lt_cv_deplibs_check_method=pass_all
439498af18c5Smrg  ;;
439598af18c5Smrgesac
439698af18c5Smrg])
439742941e3bSmrg
439842941e3bSmrgfile_magic_glob=
439942941e3bSmrgwant_nocaseglob=no
440042941e3bSmrgif test "$build" = "$host"; then
440142941e3bSmrg  case $host_os in
440242941e3bSmrg  mingw* | pw32*)
440342941e3bSmrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
440442941e3bSmrg      want_nocaseglob=yes
440542941e3bSmrg    else
440642941e3bSmrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
440742941e3bSmrg    fi
440842941e3bSmrg    ;;
440942941e3bSmrg  esac
441042941e3bSmrgfi
441142941e3bSmrg
441298af18c5Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
441398af18c5Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
441498af18c5Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
4415356f6debSmrg
4416356f6debSmrg_LT_DECL([], [deplibs_check_method], [1],
4417356f6debSmrg    [Method to check whether dependent libraries are shared objects])
4418356f6debSmrg_LT_DECL([], [file_magic_cmd], [1],
441942941e3bSmrg    [Command to use when deplibs_check_method = "file_magic"])
442042941e3bSmrg_LT_DECL([], [file_magic_glob], [1],
442142941e3bSmrg    [How to find potential files when deplibs_check_method = "file_magic"])
442242941e3bSmrg_LT_DECL([], [want_nocaseglob], [1],
442342941e3bSmrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
4424356f6debSmrg])# _LT_CHECK_MAGIC_METHOD
44256f03b1f6Smrg
44266f03b1f6Smrg
4427356f6debSmrg# LT_PATH_NM
442898af18c5Smrg# ----------
4429356f6debSmrg# find the pathname to a BSD- or MS-compatible name lister
4430356f6debSmrgAC_DEFUN([LT_PATH_NM],
4431356f6debSmrg[AC_REQUIRE([AC_PROG_CC])dnl
4432356f6debSmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
443398af18c5Smrg[if test -n "$NM"; then
443498af18c5Smrg  # Let the user override the test.
443598af18c5Smrg  lt_cv_path_NM="$NM"
443698af18c5Smrgelse
443798af18c5Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
443898af18c5Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
443998af18c5Smrg    lt_nm_to_check="$lt_nm_to_check nm"
444098af18c5Smrg  fi
444198af18c5Smrg  for lt_tmp_nm in $lt_nm_to_check; do
444298af18c5Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
444398af18c5Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
444498af18c5Smrg      IFS="$lt_save_ifs"
444598af18c5Smrg      test -z "$ac_dir" && ac_dir=.
444698af18c5Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
444798af18c5Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
444898af18c5Smrg	# Check to see if the nm accepts a BSD-compat flag.
444998af18c5Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
445098af18c5Smrg	#   nm: unknown option "B" ignored
445198af18c5Smrg	# Tru64's nm complains that /dev/null is an invalid object file
445298af18c5Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
445398af18c5Smrg	*/dev/null* | *'Invalid file or object type'*)
445498af18c5Smrg	  lt_cv_path_NM="$tmp_nm -B"
445598af18c5Smrg	  break
445698af18c5Smrg	  ;;
445798af18c5Smrg	*)
445898af18c5Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
445998af18c5Smrg	  */dev/null*)
446098af18c5Smrg	    lt_cv_path_NM="$tmp_nm -p"
446198af18c5Smrg	    break
446298af18c5Smrg	    ;;
446398af18c5Smrg	  *)
446498af18c5Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
446598af18c5Smrg	    continue # so that we can try to find one that supports BSD flags
446698af18c5Smrg	    ;;
446798af18c5Smrg	  esac
446898af18c5Smrg	  ;;
446998af18c5Smrg	esac
447098af18c5Smrg      fi
447198af18c5Smrg    done
447298af18c5Smrg    IFS="$lt_save_ifs"
447398af18c5Smrg  done
4474356f6debSmrg  : ${lt_cv_path_NM=no}
447598af18c5Smrgfi])
4476356f6debSmrgif test "$lt_cv_path_NM" != "no"; then
4477356f6debSmrg  NM="$lt_cv_path_NM"
4478356f6debSmrgelse
4479356f6debSmrg  # Didn't find any BSD compatible name lister, look for dumpbin.
448042941e3bSmrg  if test -n "$DUMPBIN"; then :
448142941e3bSmrg    # Let the user override the test.
448242941e3bSmrg  else
448342941e3bSmrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
448442941e3bSmrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
448542941e3bSmrg    *COFF*)
448642941e3bSmrg      DUMPBIN="$DUMPBIN -symbols"
448742941e3bSmrg      ;;
448842941e3bSmrg    *)
448942941e3bSmrg      DUMPBIN=:
449042941e3bSmrg      ;;
449142941e3bSmrg    esac
449242941e3bSmrg  fi
4493356f6debSmrg  AC_SUBST([DUMPBIN])
4494356f6debSmrg  if test "$DUMPBIN" != ":"; then
4495356f6debSmrg    NM="$DUMPBIN"
4496356f6debSmrg  fi
4497356f6debSmrgfi
4498356f6debSmrgtest -z "$NM" && NM=nm
4499356f6debSmrgAC_SUBST([NM])
4500356f6debSmrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
4501356f6debSmrg
4502356f6debSmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
4503356f6debSmrg  [lt_cv_nm_interface="BSD nm"
4504356f6debSmrg  echo "int some_variable = 0;" > conftest.$ac_ext
450542941e3bSmrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
4506356f6debSmrg  (eval "$ac_compile" 2>conftest.err)
4507356f6debSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
450842941e3bSmrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
4509356f6debSmrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
4510356f6debSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
451142941e3bSmrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
4512356f6debSmrg  cat conftest.out >&AS_MESSAGE_LOG_FD
4513356f6debSmrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
4514356f6debSmrg    lt_cv_nm_interface="MS dumpbin"
4515356f6debSmrg  fi
4516356f6debSmrg  rm -f conftest*])
4517356f6debSmrg])# LT_PATH_NM
45186f03b1f6Smrg
4519356f6debSmrg# Old names:
4520356f6debSmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
4521356f6debSmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
4522356f6debSmrgdnl aclocal-1.4 backwards compatibility:
4523356f6debSmrgdnl AC_DEFUN([AM_PROG_NM], [])
4524356f6debSmrgdnl AC_DEFUN([AC_PROG_NM], [])
45256f03b1f6Smrg
452642941e3bSmrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
452742941e3bSmrg# --------------------------------
452842941e3bSmrg# how to determine the name of the shared library
452942941e3bSmrg# associated with a specific link library.
453042941e3bSmrg#  -- PORTME fill in with the dynamic library characteristics
453142941e3bSmrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
453242941e3bSmrg[m4_require([_LT_DECL_EGREP])
453342941e3bSmrgm4_require([_LT_DECL_OBJDUMP])
453442941e3bSmrgm4_require([_LT_DECL_DLLTOOL])
453542941e3bSmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
453642941e3bSmrglt_cv_sharedlib_from_linklib_cmd,
453742941e3bSmrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
4538356f6debSmrg
453942941e3bSmrgcase $host_os in
454042941e3bSmrgcygwin* | mingw* | pw32* | cegcc*)
454142941e3bSmrg  # two different shell functions defined in ltmain.sh
454242941e3bSmrg  # decide which to use based on capabilities of $DLLTOOL
454342941e3bSmrg  case `$DLLTOOL --help 2>&1` in
454442941e3bSmrg  *--identify-strict*)
454542941e3bSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
454642941e3bSmrg    ;;
454742941e3bSmrg  *)
454842941e3bSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
454942941e3bSmrg    ;;
455042941e3bSmrg  esac
455142941e3bSmrg  ;;
455242941e3bSmrg*)
455342941e3bSmrg  # fallback: assume linklib IS sharedlib
455442941e3bSmrg  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
455542941e3bSmrg  ;;
455642941e3bSmrgesac
455742941e3bSmrg])
455842941e3bSmrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
455942941e3bSmrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
456042941e3bSmrg
456142941e3bSmrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
456242941e3bSmrg    [Command to associate shared and link libraries])
456342941e3bSmrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
456442941e3bSmrg
456542941e3bSmrg
456642941e3bSmrg# _LT_PATH_MANIFEST_TOOL
456742941e3bSmrg# ----------------------
456842941e3bSmrg# locate the manifest tool
456942941e3bSmrgm4_defun([_LT_PATH_MANIFEST_TOOL],
457042941e3bSmrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
457142941e3bSmrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
457242941e3bSmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
457342941e3bSmrg  [lt_cv_path_mainfest_tool=no
457442941e3bSmrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
457542941e3bSmrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
457642941e3bSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
457742941e3bSmrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
457842941e3bSmrg    lt_cv_path_mainfest_tool=yes
457942941e3bSmrg  fi
458042941e3bSmrg  rm -f conftest*])
458142941e3bSmrgif test "x$lt_cv_path_mainfest_tool" != xyes; then
458242941e3bSmrg  MANIFEST_TOOL=:
458342941e3bSmrgfi
458442941e3bSmrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
458542941e3bSmrg])# _LT_PATH_MANIFEST_TOOL
458642941e3bSmrg
458742941e3bSmrg
458842941e3bSmrg# LT_LIB_M
458942941e3bSmrg# --------
459042941e3bSmrg# check for math library
459142941e3bSmrgAC_DEFUN([LT_LIB_M],
459242941e3bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
459342941e3bSmrgLIBM=
459498af18c5Smrgcase $host in
459542941e3bSmrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
459698af18c5Smrg  # These system don't have libm, or don't need it
459798af18c5Smrg  ;;
459898af18c5Smrg*-ncr-sysv4.3*)
459998af18c5Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
460098af18c5Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
460198af18c5Smrg  ;;
460298af18c5Smrg*)
460398af18c5Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
460498af18c5Smrg  ;;
460598af18c5Smrgesac
4606356f6debSmrgAC_SUBST([LIBM])
4607356f6debSmrg])# LT_LIB_M
46086f03b1f6Smrg
4609356f6debSmrg# Old name:
4610356f6debSmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
4611356f6debSmrgdnl aclocal-1.4 backwards compatibility:
4612356f6debSmrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
46136f03b1f6Smrg
46146f03b1f6Smrg
4615356f6debSmrg# _LT_COMPILER_NO_RTTI([TAGNAME])
4616356f6debSmrg# -------------------------------
4617356f6debSmrgm4_defun([_LT_COMPILER_NO_RTTI],
4618356f6debSmrg[m4_require([_LT_TAG_COMPILER])dnl
46196f03b1f6Smrg
4620356f6debSmrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
46216f03b1f6Smrg
4622356f6debSmrgif test "$GCC" = yes; then
462342941e3bSmrg  case $cc_basename in
462442941e3bSmrg  nvcc*)
462542941e3bSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
462642941e3bSmrg  *)
462742941e3bSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
462842941e3bSmrg  esac
46296f03b1f6Smrg
4630356f6debSmrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
4631356f6debSmrg    lt_cv_prog_compiler_rtti_exceptions,
4632356f6debSmrg    [-fno-rtti -fno-exceptions], [],
4633356f6debSmrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
463498af18c5Smrgfi
4635356f6debSmrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
4636356f6debSmrg	[Compiler flag to turn off builtin functions])
4637356f6debSmrg])# _LT_COMPILER_NO_RTTI
46386f03b1f6Smrg
46396f03b1f6Smrg
4640356f6debSmrg# _LT_CMD_GLOBAL_SYMBOLS
4641356f6debSmrg# ----------------------
4642356f6debSmrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
4643356f6debSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
4644356f6debSmrgAC_REQUIRE([AC_PROG_CC])dnl
464542941e3bSmrgAC_REQUIRE([AC_PROG_AWK])dnl
4646356f6debSmrgAC_REQUIRE([LT_PATH_NM])dnl
4647356f6debSmrgAC_REQUIRE([LT_PATH_LD])dnl
4648356f6debSmrgm4_require([_LT_DECL_SED])dnl
4649356f6debSmrgm4_require([_LT_DECL_EGREP])dnl
4650356f6debSmrgm4_require([_LT_TAG_COMPILER])dnl
46516f03b1f6Smrg
4652356f6debSmrg# Check for command to grab the raw symbol name followed by C symbol from nm.
4653356f6debSmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
4654356f6debSmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
4655356f6debSmrg[
4656356f6debSmrg# These are sane defaults that work on at least a few old systems.
4657356f6debSmrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
46586f03b1f6Smrg
4659356f6debSmrg# Character class describing NM global symbol codes.
4660356f6debSmrgsymcode='[[BCDEGRST]]'
46616f03b1f6Smrg
4662356f6debSmrg# Regexp to match symbols that can be accessed directly from C.
4663356f6debSmrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
46646f03b1f6Smrg
4665356f6debSmrg# Define system-specific variables.
466698af18c5Smrgcase $host_os in
4667356f6debSmrgaix*)
4668356f6debSmrg  symcode='[[BCDT]]'
466998af18c5Smrg  ;;
4670356f6debSmrgcygwin* | mingw* | pw32* | cegcc*)
4671356f6debSmrg  symcode='[[ABCDGISTW]]'
4672356f6debSmrg  ;;
4673356f6debSmrghpux*)
4674356f6debSmrg  if test "$host_cpu" = ia64; then
4675356f6debSmrg    symcode='[[ABCDEGRST]]'
467698af18c5Smrg  fi
4677356f6debSmrg  ;;
4678356f6debSmrgirix* | nonstopux*)
4679356f6debSmrg  symcode='[[BCDEGRST]]'
4680356f6debSmrg  ;;
4681356f6debSmrgosf*)
4682356f6debSmrg  symcode='[[BCDEGQRST]]'
4683356f6debSmrg  ;;
4684356f6debSmrgsolaris*)
4685356f6debSmrg  symcode='[[BDRT]]'
4686356f6debSmrg  ;;
4687356f6debSmrgsco3.2v5*)
4688356f6debSmrg  symcode='[[DT]]'
4689356f6debSmrg  ;;
4690356f6debSmrgsysv4.2uw2*)
4691356f6debSmrg  symcode='[[DT]]'
4692356f6debSmrg  ;;
4693356f6debSmrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
4694356f6debSmrg  symcode='[[ABDT]]'
4695356f6debSmrg  ;;
4696356f6debSmrgsysv4)
4697356f6debSmrg  symcode='[[DFNSTU]]'
4698356f6debSmrg  ;;
469998af18c5Smrgesac
47006f03b1f6Smrg
4701356f6debSmrg# If we're using GNU nm, then use its standard symbol codes.
4702356f6debSmrgcase `$NM -V 2>&1` in
4703356f6debSmrg*GNU* | *'with BFD'*)
4704356f6debSmrg  symcode='[[ABCDGIRSTW]]' ;;
4705356f6debSmrgesac
47066f03b1f6Smrg
4707356f6debSmrg# Transform an extracted symbol line into a proper C declaration.
4708356f6debSmrg# Some systems (esp. on ia64) link data and code symbols differently,
4709356f6debSmrg# so use this general approach.
4710356f6debSmrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
47116f03b1f6Smrg
4712356f6debSmrg# Transform an extracted symbol line into symbol name and symbol address
471342941e3bSmrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
471442941e3bSmrglt_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'"
47156f03b1f6Smrg
4716356f6debSmrg# Handle CRLF in mingw tool chain
4717356f6debSmrgopt_cr=
4718356f6debSmrgcase $build_os in
4719356f6debSmrgmingw*)
4720356f6debSmrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4721356f6debSmrg  ;;
4722356f6debSmrgesac
47236f03b1f6Smrg
4724356f6debSmrg# Try without a prefix underscore, then with it.
4725356f6debSmrgfor ac_symprfx in "" "_"; do
47266f03b1f6Smrg
4727356f6debSmrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4728356f6debSmrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
47296f03b1f6Smrg
4730356f6debSmrg  # Write the raw and C identifiers.
4731356f6debSmrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4732356f6debSmrg    # Fake it for dumpbin and say T for any non-static function
4733356f6debSmrg    # and D for any global variable.
4734356f6debSmrg    # Also find C++ and __fastcall symbols from MSVC++,
4735356f6debSmrg    # which start with @ or ?.
4736356f6debSmrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
4737356f6debSmrg"     {last_section=section; section=\$ 3};"\
473817caa701Smrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
4739356f6debSmrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4740356f6debSmrg"     \$ 0!~/External *\|/{next};"\
4741356f6debSmrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
4742356f6debSmrg"     {if(hide[section]) next};"\
4743356f6debSmrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
4744356f6debSmrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
4745356f6debSmrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
4746356f6debSmrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
4747356f6debSmrg"     ' prfx=^$ac_symprfx]"
4748356f6debSmrg  else
4749356f6debSmrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4750356f6debSmrg  fi
475142941e3bSmrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
47526f03b1f6Smrg
4753356f6debSmrg  # Check to see that the pipe works correctly.
4754356f6debSmrg  pipe_works=no
47556f03b1f6Smrg
4756356f6debSmrg  rm -f conftest*
4757356f6debSmrg  cat > conftest.$ac_ext <<_LT_EOF
4758356f6debSmrg#ifdef __cplusplus
4759356f6debSmrgextern "C" {
4760356f6debSmrg#endif
4761356f6debSmrgchar nm_test_var;
4762356f6debSmrgvoid nm_test_func(void);
4763356f6debSmrgvoid nm_test_func(void){}
4764356f6debSmrg#ifdef __cplusplus
4765356f6debSmrg}
4766356f6debSmrg#endif
4767356f6debSmrgint main(){nm_test_var='a';nm_test_func();return(0);}
4768356f6debSmrg_LT_EOF
47696f03b1f6Smrg
4770356f6debSmrg  if AC_TRY_EVAL(ac_compile); then
4771356f6debSmrg    # Now try to grab the symbols.
4772356f6debSmrg    nlist=conftest.nm
477342941e3bSmrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
4774356f6debSmrg      # Try sorting and uniquifying the output.
4775356f6debSmrg      if sort "$nlist" | uniq > "$nlist"T; then
4776356f6debSmrg	mv -f "$nlist"T "$nlist"
4777356f6debSmrg      else
4778356f6debSmrg	rm -f "$nlist"T
4779356f6debSmrg      fi
47806f03b1f6Smrg
4781356f6debSmrg      # Make sure that we snagged all the symbols we need.
4782356f6debSmrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
4783356f6debSmrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
4784356f6debSmrg	  cat <<_LT_EOF > conftest.$ac_ext
478542941e3bSmrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
478642941e3bSmrg#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
478742941e3bSmrg/* DATA imports from DLLs on WIN32 con't be const, because runtime
478842941e3bSmrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
478942941e3bSmrg# define LT@&t@_DLSYM_CONST
479042941e3bSmrg#elif defined(__osf__)
479142941e3bSmrg/* This system does not cope well with relocations in const data.  */
479242941e3bSmrg# define LT@&t@_DLSYM_CONST
479342941e3bSmrg#else
479442941e3bSmrg# define LT@&t@_DLSYM_CONST const
479542941e3bSmrg#endif
479642941e3bSmrg
4797356f6debSmrg#ifdef __cplusplus
4798356f6debSmrgextern "C" {
4799356f6debSmrg#endif
48006f03b1f6Smrg
4801356f6debSmrg_LT_EOF
4802356f6debSmrg	  # Now generate the symbol file.
4803356f6debSmrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
48046f03b1f6Smrg
4805356f6debSmrg	  cat <<_LT_EOF >> conftest.$ac_ext
48066f03b1f6Smrg
4807356f6debSmrg/* The mapping between symbol names and symbols.  */
480842941e3bSmrgLT@&t@_DLSYM_CONST struct {
4809356f6debSmrg  const char *name;
4810356f6debSmrg  void       *address;
4811356f6debSmrg}
4812356f6debSmrglt__PROGRAM__LTX_preloaded_symbols[[]] =
4813356f6debSmrg{
4814356f6debSmrg  { "@PROGRAM@", (void *) 0 },
4815356f6debSmrg_LT_EOF
4816356f6debSmrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4817356f6debSmrg	  cat <<\_LT_EOF >> conftest.$ac_ext
4818356f6debSmrg  {0, (void *) 0}
4819356f6debSmrg};
48206f03b1f6Smrg
4821356f6debSmrg/* This works around a problem in FreeBSD linker */
4822356f6debSmrg#ifdef FREEBSD_WORKAROUND
4823356f6debSmrgstatic const void *lt_preloaded_setup() {
4824356f6debSmrg  return lt__PROGRAM__LTX_preloaded_symbols;
4825356f6debSmrg}
4826356f6debSmrg#endif
48276f03b1f6Smrg
4828356f6debSmrg#ifdef __cplusplus
4829356f6debSmrg}
4830356f6debSmrg#endif
4831356f6debSmrg_LT_EOF
4832356f6debSmrg	  # Now try linking the two files.
4833356f6debSmrg	  mv conftest.$ac_objext conftstm.$ac_objext
483442941e3bSmrg	  lt_globsym_save_LIBS=$LIBS
483542941e3bSmrg	  lt_globsym_save_CFLAGS=$CFLAGS
4836356f6debSmrg	  LIBS="conftstm.$ac_objext"
4837356f6debSmrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4838356f6debSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
4839356f6debSmrg	    pipe_works=yes
4840356f6debSmrg	  fi
484142941e3bSmrg	  LIBS=$lt_globsym_save_LIBS
484242941e3bSmrg	  CFLAGS=$lt_globsym_save_CFLAGS
4843356f6debSmrg	else
4844356f6debSmrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4845356f6debSmrg	fi
4846356f6debSmrg      else
4847356f6debSmrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4848356f6debSmrg      fi
484998af18c5Smrg    else
4850356f6debSmrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
485198af18c5Smrg    fi
485298af18c5Smrg  else
4853356f6debSmrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4854356f6debSmrg    cat conftest.$ac_ext >&5
485598af18c5Smrg  fi
4856356f6debSmrg  rm -rf conftest* conftst*
48576f03b1f6Smrg
4858356f6debSmrg  # Do not use the global_symbol_pipe unless it works.
4859356f6debSmrg  if test "$pipe_works" = yes; then
4860356f6debSmrg    break
4861356f6debSmrg  else
4862356f6debSmrg    lt_cv_sys_global_symbol_pipe=
4863356f6debSmrg  fi
4864356f6debSmrgdone
4865356f6debSmrg])
4866356f6debSmrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
4867356f6debSmrg  lt_cv_sys_global_symbol_to_cdecl=
4868356f6debSmrgfi
4869356f6debSmrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4870356f6debSmrg  AC_MSG_RESULT(failed)
487198af18c5Smrgelse
4872356f6debSmrg  AC_MSG_RESULT(ok)
487398af18c5Smrgfi
48746f03b1f6Smrg
487542941e3bSmrg# Response file support.
487642941e3bSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
487742941e3bSmrg  nm_file_list_spec='@'
487842941e3bSmrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
487942941e3bSmrg  nm_file_list_spec='@'
488042941e3bSmrgfi
488142941e3bSmrg
4882356f6debSmrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4883356f6debSmrg    [Take the output of nm and produce a listing of raw symbols and C names])
4884356f6debSmrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4885356f6debSmrg    [Transform the output of nm in a proper C declaration])
4886356f6debSmrg_LT_DECL([global_symbol_to_c_name_address],
4887356f6debSmrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
4888356f6debSmrg    [Transform the output of nm in a C name address pair])
4889356f6debSmrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
4890356f6debSmrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
4891356f6debSmrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
489242941e3bSmrg_LT_DECL([], [nm_file_list_spec], [1],
489342941e3bSmrg    [Specify filename containing input files for $NM])
4894356f6debSmrg]) # _LT_CMD_GLOBAL_SYMBOLS
48956f03b1f6Smrg
48966f03b1f6Smrg
4897356f6debSmrg# _LT_COMPILER_PIC([TAGNAME])
4898356f6debSmrg# ---------------------------
4899356f6debSmrgm4_defun([_LT_COMPILER_PIC],
4900356f6debSmrg[m4_require([_LT_TAG_COMPILER])dnl
4901356f6debSmrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
4902356f6debSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4903356f6debSmrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
49046f03b1f6Smrg
4905356f6debSmrgm4_if([$1], [CXX], [
4906356f6debSmrg  # C++ specific cases for pic, static, wl, etc.
4907356f6debSmrg  if test "$GXX" = yes; then
4908356f6debSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4909356f6debSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
49106f03b1f6Smrg
4911356f6debSmrg    case $host_os in
4912356f6debSmrg    aix*)
4913356f6debSmrg      # All AIX code is PIC.
491498af18c5Smrg      if test "$host_cpu" = ia64; then
4915356f6debSmrg	# AIX 5 now supports IA64 processor
4916356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
491798af18c5Smrg      fi
4918356f6debSmrg      ;;
49196f03b1f6Smrg
4920356f6debSmrg    amigaos*)
4921356f6debSmrg      case $host_cpu in
4922356f6debSmrg      powerpc)
4923356f6debSmrg            # see comment about AmigaOS4 .so support
4924356f6debSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4925356f6debSmrg        ;;
4926356f6debSmrg      m68k)
4927356f6debSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
4928356f6debSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
4929356f6debSmrg            # like `-m68040'.
4930356f6debSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4931356f6debSmrg        ;;
4932356f6debSmrg      esac
4933356f6debSmrg      ;;
49346f03b1f6Smrg
4935356f6debSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4936356f6debSmrg      # PIC is the default for these OSes.
4937356f6debSmrg      ;;
4938356f6debSmrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
4939356f6debSmrg      # This hack is so that the source file can tell whether it is being
4940356f6debSmrg      # built for inclusion in a dll (and should export symbols for example).
4941356f6debSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4942356f6debSmrg      # (--disable-auto-import) libraries
4943356f6debSmrg      m4_if([$1], [GCJ], [],
4944356f6debSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4945356f6debSmrg      ;;
4946356f6debSmrg    darwin* | rhapsody*)
4947356f6debSmrg      # PIC is the default on this platform
4948356f6debSmrg      # Common symbols not allowed in MH_DYLIB files
4949356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4950356f6debSmrg      ;;
4951356f6debSmrg    *djgpp*)
4952356f6debSmrg      # DJGPP does not support shared libraries at all
4953356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4954356f6debSmrg      ;;
495542941e3bSmrg    haiku*)
495642941e3bSmrg      # PIC is the default for Haiku.
495742941e3bSmrg      # The "-static" flag exists, but is broken.
495842941e3bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
495942941e3bSmrg      ;;
4960356f6debSmrg    interix[[3-9]]*)
4961356f6debSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4962356f6debSmrg      # Instead, we relocate shared libraries at runtime.
4963356f6debSmrg      ;;
4964356f6debSmrg    sysv4*MP*)
4965356f6debSmrg      if test -d /usr/nec; then
4966356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4967356f6debSmrg      fi
4968356f6debSmrg      ;;
4969356f6debSmrg    hpux*)
4970356f6debSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4971356f6debSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4972356f6debSmrg      # sets the default TLS model and affects inlining.
4973356f6debSmrg      case $host_cpu in
4974356f6debSmrg      hppa*64*)
4975356f6debSmrg	;;
497698af18c5Smrg      *)
4977356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
497898af18c5Smrg	;;
4979356f6debSmrg      esac
4980356f6debSmrg      ;;
4981356f6debSmrg    *qnx* | *nto*)
4982356f6debSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4983356f6debSmrg      # it will coredump.
4984356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4985356f6debSmrg      ;;
4986356f6debSmrg    *)
4987356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4988356f6debSmrg      ;;
498998af18c5Smrg    esac
4990356f6debSmrg  else
4991356f6debSmrg    case $host_os in
4992356f6debSmrg      aix[[4-9]]*)
4993356f6debSmrg	# All AIX code is PIC.
4994356f6debSmrg	if test "$host_cpu" = ia64; then
4995356f6debSmrg	  # AIX 5 now supports IA64 processor
4996356f6debSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4997356f6debSmrg	else
4998356f6debSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4999356f6debSmrg	fi
500098af18c5Smrg	;;
5001356f6debSmrg      chorus*)
5002356f6debSmrg	case $cc_basename in
5003356f6debSmrg	cxch68*)
5004356f6debSmrg	  # Green Hills C++ Compiler
5005356f6debSmrg	  # _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"
500698af18c5Smrg	  ;;
500798af18c5Smrg	esac
500898af18c5Smrg	;;
500942941e3bSmrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
501042941e3bSmrg	# This hack is so that the source file can tell whether it is being
501142941e3bSmrg	# built for inclusion in a dll (and should export symbols for example).
501242941e3bSmrg	m4_if([$1], [GCJ], [],
501342941e3bSmrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
501442941e3bSmrg	;;
5015356f6debSmrg      dgux*)
5016356f6debSmrg	case $cc_basename in
5017356f6debSmrg	  ec++*)
5018356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5019356f6debSmrg	    ;;
5020356f6debSmrg	  ghcx*)
5021356f6debSmrg	    # Green Hills C++ Compiler
5022356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5023356f6debSmrg	    ;;
5024356f6debSmrg	  *)
5025356f6debSmrg	    ;;
5026356f6debSmrg	esac
5027356f6debSmrg	;;
5028356f6debSmrg      freebsd* | dragonfly*)
5029356f6debSmrg	# FreeBSD uses GNU C++
5030356f6debSmrg	;;
5031356f6debSmrg      hpux9* | hpux10* | hpux11*)
5032356f6debSmrg	case $cc_basename in
5033356f6debSmrg	  CC*)
5034356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5035356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5036356f6debSmrg	    if test "$host_cpu" != ia64; then
5037356f6debSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5038356f6debSmrg	    fi
5039356f6debSmrg	    ;;
5040356f6debSmrg	  aCC*)
5041356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5042356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
504398af18c5Smrg	    case $host_cpu in
5044356f6debSmrg	    hppa*64*|ia64*)
5045356f6debSmrg	      # +Z the default
504698af18c5Smrg	      ;;
504798af18c5Smrg	    *)
5048356f6debSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
504998af18c5Smrg	      ;;
505098af18c5Smrg	    esac
5051356f6debSmrg	    ;;
5052356f6debSmrg	  *)
5053356f6debSmrg	    ;;
505498af18c5Smrg	esac
505598af18c5Smrg	;;
5056356f6debSmrg      interix*)
5057356f6debSmrg	# This is c89, which is MS Visual C++ (no shared libs)
5058356f6debSmrg	# Anyone wants to do a port?
505998af18c5Smrg	;;
5060356f6debSmrg      irix5* | irix6* | nonstopux*)
5061356f6debSmrg	case $cc_basename in
5062356f6debSmrg	  CC*)
5063356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5064356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5065356f6debSmrg	    # CC pic flag -KPIC is the default.
5066356f6debSmrg	    ;;
5067356f6debSmrg	  *)
5068356f6debSmrg	    ;;
506998af18c5Smrg	esac
507098af18c5Smrg	;;
507142941e3bSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
5072356f6debSmrg	case $cc_basename in
5073356f6debSmrg	  KCC*)
5074356f6debSmrg	    # KAI C++ Compiler
5075356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5076356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5077356f6debSmrg	    ;;
5078356f6debSmrg	  ecpc* )
5079356f6debSmrg	    # old Intel C++ for x86_64 which still supported -KPIC.
5080356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5081356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5082356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5083356f6debSmrg	    ;;
5084356f6debSmrg	  icpc* )
5085356f6debSmrg	    # Intel C++, used to be incompatible with GCC.
5086356f6debSmrg	    # ICC 10 doesn't accept -KPIC any more.
5087356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5088356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5089356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5090356f6debSmrg	    ;;
5091356f6debSmrg	  pgCC* | pgcpp*)
5092356f6debSmrg	    # Portland Group C++ compiler
5093356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5094356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5095356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5096356f6debSmrg	    ;;
5097356f6debSmrg	  cxx*)
5098356f6debSmrg	    # Compaq C++
5099356f6debSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
5100356f6debSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
5101356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5102356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5103356f6debSmrg	    ;;
510442941e3bSmrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
510542941e3bSmrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
5106356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5107356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5108356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
5109356f6debSmrg	    ;;
5110356f6debSmrg	  *)
5111356f6debSmrg	    case `$CC -V 2>&1 | sed 5q` in
5112356f6debSmrg	    *Sun\ C*)
5113356f6debSmrg	      # Sun C++ 5.9
5114356f6debSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5115356f6debSmrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5116356f6debSmrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5117356f6debSmrg	      ;;
5118356f6debSmrg	    esac
5119356f6debSmrg	    ;;
5120356f6debSmrg	esac
512198af18c5Smrg	;;
5122356f6debSmrg      lynxos*)
512398af18c5Smrg	;;
5124356f6debSmrg      m88k*)
512598af18c5Smrg	;;
5126356f6debSmrg      mvs*)
5127356f6debSmrg	case $cc_basename in
5128356f6debSmrg	  cxx*)
5129356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
5130356f6debSmrg	    ;;
5131356f6debSmrg	  *)
5132356f6debSmrg	    ;;
5133356f6debSmrg	esac
513498af18c5Smrg	;;
5135356f6debSmrg      netbsd*)
513698af18c5Smrg	;;
5137356f6debSmrg      *qnx* | *nto*)
5138356f6debSmrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
5139356f6debSmrg        # it will coredump.
5140356f6debSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5141356f6debSmrg        ;;
5142356f6debSmrg      osf3* | osf4* | osf5*)
5143356f6debSmrg	case $cc_basename in
5144356f6debSmrg	  KCC*)
5145356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5146356f6debSmrg	    ;;
5147356f6debSmrg	  RCC*)
5148356f6debSmrg	    # Rational C++ 2.4.1
5149356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5150356f6debSmrg	    ;;
5151356f6debSmrg	  cxx*)
5152356f6debSmrg	    # Digital/Compaq C++
5153356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5154356f6debSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
5155356f6debSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
5156356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5157356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5158356f6debSmrg	    ;;
5159356f6debSmrg	  *)
5160356f6debSmrg	    ;;
5161356f6debSmrg	esac
516298af18c5Smrg	;;
5163356f6debSmrg      psos*)
516498af18c5Smrg	;;
5165356f6debSmrg      solaris*)
5166356f6debSmrg	case $cc_basename in
516742941e3bSmrg	  CC* | sunCC*)
5168356f6debSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
5169356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5170356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5171356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5172356f6debSmrg	    ;;
5173356f6debSmrg	  gcx*)
5174356f6debSmrg	    # Green Hills C++ Compiler
5175356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5176356f6debSmrg	    ;;
5177356f6debSmrg	  *)
5178356f6debSmrg	    ;;
5179356f6debSmrg	esac
518098af18c5Smrg	;;
5181356f6debSmrg      sunos4*)
5182356f6debSmrg	case $cc_basename in
5183356f6debSmrg	  CC*)
5184356f6debSmrg	    # Sun C++ 4.x
5185356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5186356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5187356f6debSmrg	    ;;
5188356f6debSmrg	  lcc*)
5189356f6debSmrg	    # Lucid
5190356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5191356f6debSmrg	    ;;
5192356f6debSmrg	  *)
5193356f6debSmrg	    ;;
5194356f6debSmrg	esac
519598af18c5Smrg	;;
5196356f6debSmrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5197356f6debSmrg	case $cc_basename in
5198356f6debSmrg	  CC*)
5199356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5200356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5201356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5202356f6debSmrg	    ;;
5203356f6debSmrg	esac
52046f03b1f6Smrg	;;
5205356f6debSmrg      tandem*)
5206356f6debSmrg	case $cc_basename in
5207356f6debSmrg	  NCC*)
5208356f6debSmrg	    # NonStop-UX NCC 3.20
5209356f6debSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5210356f6debSmrg	    ;;
5211356f6debSmrg	  *)
5212356f6debSmrg	    ;;
5213356f6debSmrg	esac
52146f03b1f6Smrg	;;
5215356f6debSmrg      vxworks*)
521698af18c5Smrg	;;
521798af18c5Smrg      *)
5218356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
521998af18c5Smrg	;;
522098af18c5Smrg    esac
5221356f6debSmrg  fi
5222356f6debSmrg],
5223356f6debSmrg[
5224356f6debSmrg  if test "$GCC" = yes; then
5225356f6debSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5226356f6debSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
522798af18c5Smrg
5228356f6debSmrg    case $host_os in
5229356f6debSmrg      aix*)
5230356f6debSmrg      # All AIX code is PIC.
5231356f6debSmrg      if test "$host_cpu" = ia64; then
5232356f6debSmrg	# AIX 5 now supports IA64 processor
5233356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5234356f6debSmrg      fi
5235356f6debSmrg      ;;
523698af18c5Smrg
5237356f6debSmrg    amigaos*)
5238356f6debSmrg      case $host_cpu in
5239356f6debSmrg      powerpc)
5240356f6debSmrg            # see comment about AmigaOS4 .so support
5241356f6debSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5242356f6debSmrg        ;;
5243356f6debSmrg      m68k)
5244356f6debSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
5245356f6debSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
5246356f6debSmrg            # like `-m68040'.
5247356f6debSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5248356f6debSmrg        ;;
5249356f6debSmrg      esac
5250356f6debSmrg      ;;
525198af18c5Smrg
5252356f6debSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5253356f6debSmrg      # PIC is the default for these OSes.
5254356f6debSmrg      ;;
525598af18c5Smrg
5256356f6debSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
5257356f6debSmrg      # This hack is so that the source file can tell whether it is being
5258356f6debSmrg      # built for inclusion in a dll (and should export symbols for example).
5259356f6debSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5260356f6debSmrg      # (--disable-auto-import) libraries
5261356f6debSmrg      m4_if([$1], [GCJ], [],
5262356f6debSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5263356f6debSmrg      ;;
526498af18c5Smrg
5265356f6debSmrg    darwin* | rhapsody*)
5266356f6debSmrg      # PIC is the default on this platform
5267356f6debSmrg      # Common symbols not allowed in MH_DYLIB files
5268356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5269356f6debSmrg      ;;
527098af18c5Smrg
527142941e3bSmrg    haiku*)
527242941e3bSmrg      # PIC is the default for Haiku.
527342941e3bSmrg      # The "-static" flag exists, but is broken.
527442941e3bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
527542941e3bSmrg      ;;
527642941e3bSmrg
5277356f6debSmrg    hpux*)
5278356f6debSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
5279356f6debSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
5280356f6debSmrg      # sets the default TLS model and affects inlining.
5281356f6debSmrg      case $host_cpu in
5282356f6debSmrg      hppa*64*)
5283356f6debSmrg	# +Z the default
52846f03b1f6Smrg	;;
528598af18c5Smrg      *)
5286356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
52876f03b1f6Smrg	;;
5288356f6debSmrg      esac
5289356f6debSmrg      ;;
5290356f6debSmrg
5291356f6debSmrg    interix[[3-9]]*)
5292356f6debSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5293356f6debSmrg      # Instead, we relocate shared libraries at runtime.
5294356f6debSmrg      ;;
5295356f6debSmrg
5296356f6debSmrg    msdosdjgpp*)
5297356f6debSmrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
5298356f6debSmrg      # on systems that don't support them.
5299356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5300356f6debSmrg      enable_shared=no
5301356f6debSmrg      ;;
5302356f6debSmrg
5303356f6debSmrg    *nto* | *qnx*)
5304356f6debSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
5305356f6debSmrg      # it will coredump.
5306356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5307356f6debSmrg      ;;
5308356f6debSmrg
5309356f6debSmrg    sysv4*MP*)
5310356f6debSmrg      if test -d /usr/nec; then
5311356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5312356f6debSmrg      fi
5313356f6debSmrg      ;;
5314356f6debSmrg
5315356f6debSmrg    *)
5316356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5317356f6debSmrg      ;;
531898af18c5Smrg    esac
531942941e3bSmrg
532042941e3bSmrg    case $cc_basename in
532142941e3bSmrg    nvcc*) # Cuda Compiler Driver 2.2
532242941e3bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
532317caa701Smrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
532417caa701Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
532517caa701Smrg      fi
532642941e3bSmrg      ;;
532742941e3bSmrg    esac
5328356f6debSmrg  else
5329356f6debSmrg    # PORTME Check for flag to pass linker flags through the system compiler.
5330356f6debSmrg    case $host_os in
5331356f6debSmrg    aix*)
5332356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5333356f6debSmrg      if test "$host_cpu" = ia64; then
5334356f6debSmrg	# AIX 5 now supports IA64 processor
5335356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5336356f6debSmrg      else
5337356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5338356f6debSmrg      fi
5339356f6debSmrg      ;;
5340356f6debSmrg
5341356f6debSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
5342356f6debSmrg      # This hack is so that the source file can tell whether it is being
5343356f6debSmrg      # built for inclusion in a dll (and should export symbols for example).
5344356f6debSmrg      m4_if([$1], [GCJ], [],
5345356f6debSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
5346356f6debSmrg      ;;
5347356f6debSmrg
5348356f6debSmrg    hpux9* | hpux10* | hpux11*)
5349356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5350356f6debSmrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5351356f6debSmrg      # not for PA HP-UX.
5352356f6debSmrg      case $host_cpu in
5353356f6debSmrg      hppa*64*|ia64*)
5354356f6debSmrg	# +Z the default
53556f03b1f6Smrg	;;
535698af18c5Smrg      *)
5357356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
53586f03b1f6Smrg	;;
5359356f6debSmrg      esac
5360356f6debSmrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
5361356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5362356f6debSmrg      ;;
5363356f6debSmrg
5364356f6debSmrg    irix5* | irix6* | nonstopux*)
5365356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5366356f6debSmrg      # PIC (with -KPIC) is the default.
5367356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5368356f6debSmrg      ;;
5369356f6debSmrg
537042941e3bSmrg    linux* | k*bsd*-gnu | kopensolaris*-gnu)
5371356f6debSmrg      case $cc_basename in
5372356f6debSmrg      # old Intel for x86_64 which still supported -KPIC.
5373356f6debSmrg      ecc*)
5374356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5375356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5376356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5377356f6debSmrg        ;;
5378356f6debSmrg      # icc used to be incompatible with GCC.
5379356f6debSmrg      # ICC 10 doesn't accept -KPIC any more.
5380356f6debSmrg      icc* | ifort*)
5381356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5382356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5383356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5384356f6debSmrg        ;;
5385356f6debSmrg      # Lahey Fortran 8.1.
5386356f6debSmrg      lf95*)
5387356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5388356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
5389356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
5390356f6debSmrg	;;
539142941e3bSmrg      nagfor*)
539242941e3bSmrg	# NAG Fortran compiler
539342941e3bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
539442941e3bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
539542941e3bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
539642941e3bSmrg	;;
539742941e3bSmrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
5398356f6debSmrg        # Portland Group compilers (*not* the Pentium gcc compiler,
5399356f6debSmrg	# which looks to be a dead project)
5400356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5401356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5402356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5403356f6debSmrg        ;;
5404356f6debSmrg      ccc*)
5405356f6debSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5406356f6debSmrg        # All Alpha code is PIC.
5407356f6debSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5408356f6debSmrg        ;;
540942941e3bSmrg      xl* | bgxl* | bgf* | mpixl*)
541042941e3bSmrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
5411356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5412356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
5413356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
54146f03b1f6Smrg	;;
54156f03b1f6Smrg      *)
5416356f6debSmrg	case `$CC -V 2>&1 | sed 5q` in
541717caa701Smrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
541842941e3bSmrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
5419356f6debSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5420356f6debSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
542142941e3bSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
5422356f6debSmrg	  ;;
542317caa701Smrg	*Sun\ F* | *Sun*Fortran*)
542417caa701Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
542517caa701Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
542617caa701Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
542717caa701Smrg	  ;;
542842941e3bSmrg	*Sun\ C*)
542942941e3bSmrg	  # Sun C 5.9
5430356f6debSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5431356f6debSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
543242941e3bSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5433356f6debSmrg	  ;;
543417caa701Smrg        *Intel*\ [[CF]]*Compiler*)
543517caa701Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
543617caa701Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
543717caa701Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
543817caa701Smrg	  ;;
543917caa701Smrg	*Portland\ Group*)
544017caa701Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
544117caa701Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
544217caa701Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
544317caa701Smrg	  ;;
5444356f6debSmrg	esac
54456f03b1f6Smrg	;;
5446356f6debSmrg      esac
5447356f6debSmrg      ;;
54486f03b1f6Smrg
5449356f6debSmrg    newsos6)
5450356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5451356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5452356f6debSmrg      ;;
54536f03b1f6Smrg
5454356f6debSmrg    *nto* | *qnx*)
5455356f6debSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
5456356f6debSmrg      # it will coredump.
5457356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
5458356f6debSmrg      ;;
54596f03b1f6Smrg
5460356f6debSmrg    osf3* | osf4* | osf5*)
5461356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5462356f6debSmrg      # All OSF/1 code is PIC.
5463356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5464356f6debSmrg      ;;
54656f03b1f6Smrg
5466356f6debSmrg    rdos*)
5467356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5468356f6debSmrg      ;;
54696f03b1f6Smrg
5470356f6debSmrg    solaris*)
5471356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5472356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5473356f6debSmrg      case $cc_basename in
547442941e3bSmrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
5475356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
5476356f6debSmrg      *)
5477356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
5478356f6debSmrg      esac
5479356f6debSmrg      ;;
54806f03b1f6Smrg
5481356f6debSmrg    sunos4*)
5482356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5483356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5484356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5485356f6debSmrg      ;;
548698af18c5Smrg
5487356f6debSmrg    sysv4 | sysv4.2uw2* | sysv4.3*)
5488356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5489356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5490356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5491356f6debSmrg      ;;
549298af18c5Smrg
5493356f6debSmrg    sysv4*MP*)
5494356f6debSmrg      if test -d /usr/nec ;then
5495356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
5496356f6debSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5497356f6debSmrg      fi
5498356f6debSmrg      ;;
54996f03b1f6Smrg
5500356f6debSmrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5501356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5502356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5503356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5504356f6debSmrg      ;;
55056f03b1f6Smrg
5506356f6debSmrg    unicos*)
5507356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5508356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5509356f6debSmrg      ;;
55106f03b1f6Smrg
5511356f6debSmrg    uts4*)
5512356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5513356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5514356f6debSmrg      ;;
55156f03b1f6Smrg
5516356f6debSmrg    *)
5517356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5518356f6debSmrg      ;;
551998af18c5Smrg    esac
5520356f6debSmrg  fi
5521356f6debSmrg])
5522356f6debSmrgcase $host_os in
5523356f6debSmrg  # For platforms which do not support PIC, -DPIC is meaningless:
5524356f6debSmrg  *djgpp*)
5525356f6debSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
5526356f6debSmrg    ;;
5527356f6debSmrg  *)
5528356f6debSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
5529356f6debSmrg    ;;
5530356f6debSmrgesac
553142941e3bSmrg
553242941e3bSmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
553342941e3bSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
553442941e3bSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
553542941e3bSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
55366f03b1f6Smrg
5537356f6debSmrg#
5538356f6debSmrg# Check to make sure the PIC flag actually works.
5539356f6debSmrg#
5540356f6debSmrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
5541356f6debSmrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
5542356f6debSmrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
5543356f6debSmrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
5544356f6debSmrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
5545356f6debSmrg     "" | " "*) ;;
5546356f6debSmrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
5547356f6debSmrg     esac],
5548356f6debSmrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
5549356f6debSmrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
555098af18c5Smrgfi
5551356f6debSmrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
5552356f6debSmrg	[Additional compiler flags for building library objects])
55536f03b1f6Smrg
555442941e3bSmrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
555542941e3bSmrg	[How to pass a linker flag through the compiler])
5556356f6debSmrg#
5557356f6debSmrg# Check to make sure the static flag actually works.
5558356f6debSmrg#
5559356f6debSmrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
5560356f6debSmrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
5561356f6debSmrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
5562356f6debSmrg  $lt_tmp_static_flag,
5563356f6debSmrg  [],
5564356f6debSmrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
5565356f6debSmrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
5566356f6debSmrg	[Compiler flag to prevent dynamic linking])
5567356f6debSmrg])# _LT_COMPILER_PIC
55686f03b1f6Smrg
556998af18c5Smrg
5570356f6debSmrg# _LT_LINKER_SHLIBS([TAGNAME])
5571356f6debSmrg# ----------------------------
5572356f6debSmrg# See if the linker supports building shared libraries.
5573356f6debSmrgm4_defun([_LT_LINKER_SHLIBS],
5574356f6debSmrg[AC_REQUIRE([LT_PATH_LD])dnl
5575356f6debSmrgAC_REQUIRE([LT_PATH_NM])dnl
557642941e3bSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
5577356f6debSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
5578356f6debSmrgm4_require([_LT_DECL_EGREP])dnl
5579356f6debSmrgm4_require([_LT_DECL_SED])dnl
5580356f6debSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
5581356f6debSmrgm4_require([_LT_TAG_COMPILER])dnl
5582356f6debSmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5583356f6debSmrgm4_if([$1], [CXX], [
5584356f6debSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
558542941e3bSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5586356f6debSmrg  case $host_os in
5587356f6debSmrg  aix[[4-9]]*)
5588356f6debSmrg    # If we're using GNU nm, then we don't want the "-C" option.
5589356f6debSmrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
559042941e3bSmrg    # Also, AIX nm treats weak defined symbols like other global defined
559142941e3bSmrg    # symbols, whereas GNU nm marks them as "W".
5592356f6debSmrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
559342941e3bSmrg      _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'
5594356f6debSmrg    else
5595356f6debSmrg      _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'
559698af18c5Smrg    fi
559798af18c5Smrg    ;;
5598356f6debSmrg  pw32*)
5599356f6debSmrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
560042941e3bSmrg    ;;
5601356f6debSmrg  cygwin* | mingw* | cegcc*)
560242941e3bSmrg    case $cc_basename in
560317caa701Smrg    cl*)
560417caa701Smrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
560517caa701Smrg      ;;
560642941e3bSmrg    *)
560742941e3bSmrg      _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'
560842941e3bSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
560942941e3bSmrg      ;;
561042941e3bSmrg    esac
561142941e3bSmrg    ;;
5612356f6debSmrg  *)
5613356f6debSmrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
561442941e3bSmrg    ;;
5615356f6debSmrg  esac
5616356f6debSmrg], [
5617356f6debSmrg  runpath_var=
5618356f6debSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=
5619356f6debSmrg  _LT_TAGVAR(always_export_symbols, $1)=no
5620356f6debSmrg  _LT_TAGVAR(archive_cmds, $1)=
5621356f6debSmrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
5622356f6debSmrg  _LT_TAGVAR(compiler_needs_object, $1)=no
5623356f6debSmrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5624356f6debSmrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5625356f6debSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5626356f6debSmrg  _LT_TAGVAR(hardcode_automatic, $1)=no
5627356f6debSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
5628356f6debSmrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
5629356f6debSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5630356f6debSmrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5631356f6debSmrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
5632356f6debSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5633356f6debSmrg  _LT_TAGVAR(inherit_rpath, $1)=no
5634356f6debSmrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
5635356f6debSmrg  _LT_TAGVAR(module_cmds, $1)=
5636356f6debSmrg  _LT_TAGVAR(module_expsym_cmds, $1)=
5637356f6debSmrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
5638356f6debSmrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
5639356f6debSmrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
5640356f6debSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5641356f6debSmrg  # include_expsyms should be a list of space-separated symbols to be *always*
5642356f6debSmrg  # included in the symbol list
5643356f6debSmrg  _LT_TAGVAR(include_expsyms, $1)=
5644356f6debSmrg  # exclude_expsyms can be an extended regexp of symbols to exclude
5645356f6debSmrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
5646356f6debSmrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5647356f6debSmrg  # as well as any symbol that contains `d'.
5648356f6debSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5649356f6debSmrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5650356f6debSmrg  # platforms (ab)use it in PIC code, but their linkers get confused if
5651356f6debSmrg  # the symbol is explicitly referenced.  Since portable code cannot
5652356f6debSmrg  # rely on this symbol name, it's probably fine to never include it in
5653356f6debSmrg  # preloaded symbol tables.
5654356f6debSmrg  # Exclude shared library initialization/finalization symbols.
5655356f6debSmrgdnl Note also adjust exclude_expsyms for C++ above.
5656356f6debSmrg  extract_expsyms_cmds=
56576f03b1f6Smrg
5658356f6debSmrg  case $host_os in
5659356f6debSmrg  cygwin* | mingw* | pw32* | cegcc*)
5660356f6debSmrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
5661356f6debSmrg    # When not using gcc, we currently assume that we are using
5662356f6debSmrg    # Microsoft Visual C++.
5663356f6debSmrg    if test "$GCC" != yes; then
5664356f6debSmrg      with_gnu_ld=no
566598af18c5Smrg    fi
56666f03b1f6Smrg    ;;
5667356f6debSmrg  interix*)
5668356f6debSmrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
5669356f6debSmrg    with_gnu_ld=yes
5670356f6debSmrg    ;;
5671356f6debSmrg  openbsd*)
5672356f6debSmrg    with_gnu_ld=no
5673356f6debSmrg    ;;
567498af18c5Smrg  esac
56756f03b1f6Smrg
5676356f6debSmrg  _LT_TAGVAR(ld_shlibs, $1)=yes
567742941e3bSmrg
567842941e3bSmrg  # On some targets, GNU ld is compatible enough with the native linker
567942941e3bSmrg  # that we're better off using the native interface for both.
568042941e3bSmrg  lt_use_gnu_ld_interface=no
5681356f6debSmrg  if test "$with_gnu_ld" = yes; then
568242941e3bSmrg    case $host_os in
568342941e3bSmrg      aix*)
568442941e3bSmrg	# The AIX port of GNU ld has always aspired to compatibility
568542941e3bSmrg	# with the native linker.  However, as the warning in the GNU ld
568642941e3bSmrg	# block says, versions before 2.19.5* couldn't really create working
568742941e3bSmrg	# shared libraries, regardless of the interface used.
568842941e3bSmrg	case `$LD -v 2>&1` in
568942941e3bSmrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
569042941e3bSmrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
569142941e3bSmrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
569242941e3bSmrg	  *)
569342941e3bSmrg	    lt_use_gnu_ld_interface=yes
569442941e3bSmrg	    ;;
569542941e3bSmrg	esac
569642941e3bSmrg	;;
569742941e3bSmrg      *)
569842941e3bSmrg	lt_use_gnu_ld_interface=yes
569942941e3bSmrg	;;
570042941e3bSmrg    esac
570142941e3bSmrg  fi
570242941e3bSmrg
570342941e3bSmrg  if test "$lt_use_gnu_ld_interface" = yes; then
5704356f6debSmrg    # If archive_cmds runs LD, not CC, wlarc should be empty
5705356f6debSmrg    wlarc='${wl}'
57066f03b1f6Smrg
5707356f6debSmrg    # Set some defaults for GNU ld with shared library support. These
5708356f6debSmrg    # are reset later if shared libraries are not supported. Putting them
5709356f6debSmrg    # here allows them to be overridden if necessary.
5710356f6debSmrg    runpath_var=LD_RUN_PATH
5711356f6debSmrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5712356f6debSmrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5713356f6debSmrg    # ancient GNU ld didn't support --whole-archive et. al.
5714356f6debSmrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
5715356f6debSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5716356f6debSmrg    else
5717356f6debSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5718356f6debSmrg    fi
5719356f6debSmrg    supports_anon_versioning=no
5720356f6debSmrg    case `$LD -v 2>&1` in
572142941e3bSmrg      *GNU\ gold*) supports_anon_versioning=yes ;;
5722356f6debSmrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5723356f6debSmrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5724356f6debSmrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5725356f6debSmrg      *\ 2.11.*) ;; # other 2.11 versions
5726356f6debSmrg      *) supports_anon_versioning=yes ;;
5727356f6debSmrg    esac
57286f03b1f6Smrg
5729356f6debSmrg    # See if GNU ld supports shared libraries.
5730356f6debSmrg    case $host_os in
5731356f6debSmrg    aix[[3-9]]*)
5732356f6debSmrg      # On AIX/PPC, the GNU linker is very broken
5733356f6debSmrg      if test "$host_cpu" != ia64; then
5734356f6debSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5735356f6debSmrg	cat <<_LT_EOF 1>&2
57366f03b1f6Smrg
573742941e3bSmrg*** Warning: the GNU linker, at least up to release 2.19, is reported
5738356f6debSmrg*** to be unable to reliably create shared libraries on AIX.
5739356f6debSmrg*** Therefore, libtool is disabling shared libraries support.  If you
574042941e3bSmrg*** really care for shared libraries, you may want to install binutils
574142941e3bSmrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
574242941e3bSmrg*** You will then need to restart the configuration process.
57436f03b1f6Smrg
5744356f6debSmrg_LT_EOF
5745356f6debSmrg      fi
5746356f6debSmrg      ;;
57476f03b1f6Smrg
5748356f6debSmrg    amigaos*)
5749356f6debSmrg      case $host_cpu in
5750356f6debSmrg      powerpc)
5751356f6debSmrg            # see comment about AmigaOS4 .so support
5752356f6debSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5753356f6debSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5754356f6debSmrg        ;;
5755356f6debSmrg      m68k)
5756356f6debSmrg            _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)'
5757356f6debSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5758356f6debSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5759356f6debSmrg        ;;
5760356f6debSmrg      esac
5761356f6debSmrg      ;;
57626f03b1f6Smrg
5763356f6debSmrg    beos*)
5764356f6debSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5765356f6debSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5766356f6debSmrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5767356f6debSmrg	# support --undefined.  This deserves some investigation.  FIXME
5768356f6debSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5769356f6debSmrg      else
5770356f6debSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5771356f6debSmrg      fi
5772356f6debSmrg      ;;
57736f03b1f6Smrg
5774356f6debSmrg    cygwin* | mingw* | pw32* | cegcc*)
5775356f6debSmrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5776356f6debSmrg      # as there is no search path for DLLs.
5777356f6debSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
577842941e3bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
5779356f6debSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5780356f6debSmrg      _LT_TAGVAR(always_export_symbols, $1)=no
5781356f6debSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
578242941e3bSmrg      _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'
578342941e3bSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5784356f6debSmrg
5785356f6debSmrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5786356f6debSmrg        _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'
5787356f6debSmrg	# If the export-symbols file already is a .def file (1st line
5788356f6debSmrg	# is EXPORTS), use it as is; otherwise, prepend...
5789356f6debSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5790356f6debSmrg	  cp $export_symbols $output_objdir/$soname.def;
5791356f6debSmrg	else
5792356f6debSmrg	  echo EXPORTS > $output_objdir/$soname.def;
5793356f6debSmrg	  cat $export_symbols >> $output_objdir/$soname.def;
5794356f6debSmrg	fi~
5795356f6debSmrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5796356f6debSmrg      else
5797356f6debSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5798356f6debSmrg      fi
5799356f6debSmrg      ;;
58006f03b1f6Smrg
580142941e3bSmrg    haiku*)
580242941e3bSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
580342941e3bSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
580442941e3bSmrg      ;;
580542941e3bSmrg
5806356f6debSmrg    interix[[3-9]]*)
5807356f6debSmrg      _LT_TAGVAR(hardcode_direct, $1)=no
5808356f6debSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5809356f6debSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5810356f6debSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5811356f6debSmrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5812356f6debSmrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
5813356f6debSmrg      # default) and relocated if they conflict, which is a slow very memory
5814356f6debSmrg      # consuming and fragmenting process.  To avoid this, we pick a random,
5815356f6debSmrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5816356f6debSmrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5817356f6debSmrg      _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'
5818356f6debSmrg      _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'
5819356f6debSmrg      ;;
58206f03b1f6Smrg
582142941e3bSmrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
5822356f6debSmrg      tmp_diet=no
5823356f6debSmrg      if test "$host_os" = linux-dietlibc; then
5824356f6debSmrg	case $cc_basename in
5825356f6debSmrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
5826356f6debSmrg	esac
5827356f6debSmrg      fi
5828356f6debSmrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5829356f6debSmrg	 && test "$tmp_diet" = no
5830356f6debSmrg      then
583142941e3bSmrg	tmp_addflag=' $pic_flag'
5832356f6debSmrg	tmp_sharedflag='-shared'
5833356f6debSmrg	case $cc_basename,$host_cpu in
5834356f6debSmrg        pgcc*)				# Portland Group C compiler
583542941e3bSmrg	  _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'
5836356f6debSmrg	  tmp_addflag=' $pic_flag'
5837356f6debSmrg	  ;;
583842941e3bSmrg	pgf77* | pgf90* | pgf95* | pgfortran*)
583942941e3bSmrg					# Portland Group f77 and f90 compilers
584042941e3bSmrg	  _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'
5841356f6debSmrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
5842356f6debSmrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
5843356f6debSmrg	  tmp_addflag=' -i_dynamic' ;;
5844356f6debSmrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5845356f6debSmrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5846356f6debSmrg	ifc* | ifort*)			# Intel Fortran compiler
5847356f6debSmrg	  tmp_addflag=' -nofor_main' ;;
5848356f6debSmrg	lf95*)				# Lahey Fortran 8.1
5849356f6debSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5850356f6debSmrg	  tmp_sharedflag='--shared' ;;
585142941e3bSmrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
5852356f6debSmrg	  tmp_sharedflag='-qmkshrobj'
5853356f6debSmrg	  tmp_addflag= ;;
585442941e3bSmrg	nvcc*)	# Cuda Compiler Driver 2.2
585542941e3bSmrg	  _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'
585642941e3bSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
585742941e3bSmrg	  ;;
5858356f6debSmrg	esac
5859356f6debSmrg	case `$CC -V 2>&1 | sed 5q` in
5860356f6debSmrg	*Sun\ C*)			# Sun C 5.9
586142941e3bSmrg	  _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'
5862356f6debSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5863356f6debSmrg	  tmp_sharedflag='-G' ;;
5864356f6debSmrg	*Sun\ F*)			# Sun Fortran 8.3
5865356f6debSmrg	  tmp_sharedflag='-G' ;;
5866356f6debSmrg	esac
5867356f6debSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
58686f03b1f6Smrg
5869356f6debSmrg        if test "x$supports_anon_versioning" = xyes; then
5870356f6debSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5871356f6debSmrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5872356f6debSmrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
5873356f6debSmrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5874356f6debSmrg        fi
58756f03b1f6Smrg
5876356f6debSmrg	case $cc_basename in
587742941e3bSmrg	xlf* | bgf* | bgxlf* | mpixlf*)
5878356f6debSmrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
5879356f6debSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
588017caa701Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
588142941e3bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5882356f6debSmrg	  if test "x$supports_anon_versioning" = xyes; then
5883356f6debSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5884356f6debSmrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5885356f6debSmrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
588642941e3bSmrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
5887356f6debSmrg	  fi
5888356f6debSmrg	  ;;
5889356f6debSmrg	esac
5890356f6debSmrg      else
5891356f6debSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
5892356f6debSmrg      fi
5893356f6debSmrg      ;;
58946f03b1f6Smrg
5895356f6debSmrg    netbsd*)
5896356f6debSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5897356f6debSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5898356f6debSmrg	wlarc=
5899356f6debSmrg      else
590042941e3bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
590142941e3bSmrg	_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'
5902356f6debSmrg      fi
5903356f6debSmrg      ;;
59046f03b1f6Smrg
5905356f6debSmrg    solaris*)
5906356f6debSmrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
5907356f6debSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5908356f6debSmrg	cat <<_LT_EOF 1>&2
59096f03b1f6Smrg
5910356f6debSmrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
5911356f6debSmrg*** create shared libraries on Solaris systems.  Therefore, libtool
5912356f6debSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
5913356f6debSmrg*** binutils to release 2.9.1 or newer.  Another option is to modify
5914356f6debSmrg*** your PATH or compiler configuration so that the native linker is
5915356f6debSmrg*** used, and then restart.
59166f03b1f6Smrg
5917356f6debSmrg_LT_EOF
5918356f6debSmrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
591942941e3bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
592042941e3bSmrg	_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'
5921356f6debSmrg      else
5922356f6debSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5923356f6debSmrg      fi
5924356f6debSmrg      ;;
59256f03b1f6Smrg
5926356f6debSmrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5927356f6debSmrg      case `$LD -v 2>&1` in
5928356f6debSmrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5929356f6debSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5930356f6debSmrg	cat <<_LT_EOF 1>&2
59316f03b1f6Smrg
5932356f6debSmrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
5933356f6debSmrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
5934356f6debSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
5935356f6debSmrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
5936356f6debSmrg*** your PATH or compiler configuration so that the native linker is
5937356f6debSmrg*** used, and then restart.
59386f03b1f6Smrg
5939356f6debSmrg_LT_EOF
5940356f6debSmrg	;;
5941356f6debSmrg	*)
5942356f6debSmrg	  # For security reasons, it is highly recommended that you always
5943356f6debSmrg	  # use absolute paths for naming shared libraries, and exclude the
5944356f6debSmrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
5945356f6debSmrg	  # requires that you compile everything twice, which is a pain.
5946356f6debSmrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5947356f6debSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5948356f6debSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5949356f6debSmrg	    _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'
5950356f6debSmrg	  else
5951356f6debSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5952356f6debSmrg	  fi
5953356f6debSmrg	;;
5954356f6debSmrg      esac
5955356f6debSmrg      ;;
59566f03b1f6Smrg
5957356f6debSmrg    sunos4*)
5958356f6debSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5959356f6debSmrg      wlarc=
5960356f6debSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5961356f6debSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5962356f6debSmrg      ;;
59636f03b1f6Smrg
5964356f6debSmrg    *)
5965356f6debSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
596642941e3bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
596742941e3bSmrg	_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'
5968356f6debSmrg      else
5969356f6debSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5970356f6debSmrg      fi
5971356f6debSmrg      ;;
5972356f6debSmrg    esac
59736f03b1f6Smrg
5974356f6debSmrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
5975356f6debSmrg      runpath_var=
5976356f6debSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5977356f6debSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5978356f6debSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5979356f6debSmrg    fi
5980356f6debSmrg  else
5981356f6debSmrg    # PORTME fill in a description of your system's linker (not GNU ld)
5982356f6debSmrg    case $host_os in
5983356f6debSmrg    aix3*)
5984356f6debSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5985356f6debSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
5986356f6debSmrg      _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'
5987356f6debSmrg      # Note: this linker hardcodes the directories in LIBPATH if there
5988356f6debSmrg      # are no directories specified by -L.
5989356f6debSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5990356f6debSmrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
5991356f6debSmrg	# Neither direct hardcoding nor static linking is supported with a
5992356f6debSmrg	# broken collect2.
5993356f6debSmrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
5994356f6debSmrg      fi
5995356f6debSmrg      ;;
59966f03b1f6Smrg
5997356f6debSmrg    aix[[4-9]]*)
5998356f6debSmrg      if test "$host_cpu" = ia64; then
5999356f6debSmrg	# On IA64, the linker does run time linking by default, so we don't
6000356f6debSmrg	# have to do anything special.
6001356f6debSmrg	aix_use_runtimelinking=no
6002356f6debSmrg	exp_sym_flag='-Bexport'
6003356f6debSmrg	no_entry_flag=""
6004356f6debSmrg      else
6005356f6debSmrg	# If we're using GNU nm, then we don't want the "-C" option.
6006356f6debSmrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
600742941e3bSmrg	# Also, AIX nm treats weak defined symbols like other global
600842941e3bSmrg	# defined symbols, whereas GNU nm marks them as "W".
6009356f6debSmrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
601042941e3bSmrg	  _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'
6011356f6debSmrg	else
6012356f6debSmrg	  _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'
6013356f6debSmrg	fi
6014356f6debSmrg	aix_use_runtimelinking=no
60156f03b1f6Smrg
6016356f6debSmrg	# Test if we are trying to use run time linking or normal
6017356f6debSmrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
6018356f6debSmrg	# need to do runtime linking.
6019356f6debSmrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6020356f6debSmrg	  for ld_flag in $LDFLAGS; do
6021356f6debSmrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
6022356f6debSmrg	    aix_use_runtimelinking=yes
6023356f6debSmrg	    break
6024356f6debSmrg	  fi
6025356f6debSmrg	  done
6026356f6debSmrg	  ;;
6027356f6debSmrg	esac
60286f03b1f6Smrg
6029356f6debSmrg	exp_sym_flag='-bexport'
6030356f6debSmrg	no_entry_flag='-bnoentry'
6031356f6debSmrg      fi
60326f03b1f6Smrg
6033356f6debSmrg      # When large executables or shared objects are built, AIX ld can
6034356f6debSmrg      # have problems creating the table of contents.  If linking a library
6035356f6debSmrg      # or program results in "error TOC overflow" add -mminimal-toc to
6036356f6debSmrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6037356f6debSmrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
60386f03b1f6Smrg
6039356f6debSmrg      _LT_TAGVAR(archive_cmds, $1)=''
6040356f6debSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6041356f6debSmrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6042356f6debSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6043356f6debSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
6044356f6debSmrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
60456f03b1f6Smrg
6046356f6debSmrg      if test "$GCC" = yes; then
6047356f6debSmrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
6048356f6debSmrg	# We only want to do this on AIX 4.2 and lower, the check
6049356f6debSmrg	# below for broken collect2 doesn't work under 4.3+
6050356f6debSmrg	  collect2name=`${CC} -print-prog-name=collect2`
6051356f6debSmrg	  if test -f "$collect2name" &&
6052356f6debSmrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6053356f6debSmrg	  then
6054356f6debSmrg	  # We have reworked collect2
6055356f6debSmrg	  :
6056356f6debSmrg	  else
6057356f6debSmrg	  # We have old collect2
6058356f6debSmrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
6059356f6debSmrg	  # It fails to find uninstalled libraries when the uninstalled
6060356f6debSmrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
6061356f6debSmrg	  # to unsupported forces relinking
6062356f6debSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
6063356f6debSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6064356f6debSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
6065356f6debSmrg	  fi
6066356f6debSmrg	  ;;
6067356f6debSmrg	esac
6068356f6debSmrg	shared_flag='-shared'
6069356f6debSmrg	if test "$aix_use_runtimelinking" = yes; then
6070356f6debSmrg	  shared_flag="$shared_flag "'${wl}-G'
6071356f6debSmrg	fi
6072356f6debSmrg      else
6073356f6debSmrg	# not using gcc
6074356f6debSmrg	if test "$host_cpu" = ia64; then
6075356f6debSmrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6076356f6debSmrg	# chokes on -Wl,-G. The following line is correct:
6077356f6debSmrg	  shared_flag='-G'
6078356f6debSmrg	else
6079356f6debSmrg	  if test "$aix_use_runtimelinking" = yes; then
6080356f6debSmrg	    shared_flag='${wl}-G'
6081356f6debSmrg	  else
6082356f6debSmrg	    shared_flag='${wl}-bM:SRE'
6083356f6debSmrg	  fi
6084356f6debSmrg	fi
6085356f6debSmrg      fi
60866f03b1f6Smrg
6087356f6debSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
6088356f6debSmrg      # It seems that -bexpall does not export symbols beginning with
6089356f6debSmrg      # underscore (_), so it is better to generate a list of symbols to export.
6090356f6debSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
6091356f6debSmrg      if test "$aix_use_runtimelinking" = yes; then
6092356f6debSmrg	# Warning - without using the other runtime loading flags (-brtl),
6093356f6debSmrg	# -berok will link without error, but may produce a broken library.
6094356f6debSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
6095356f6debSmrg        # Determine the default libpath from the value encoded in an
6096356f6debSmrg        # empty executable.
609742941e3bSmrg        _LT_SYS_MODULE_PATH_AIX([$1])
6098356f6debSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
609942941e3bSmrg        _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"
6100356f6debSmrg      else
6101356f6debSmrg	if test "$host_cpu" = ia64; then
6102356f6debSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6103356f6debSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6104356f6debSmrg	  _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"
6105356f6debSmrg	else
6106356f6debSmrg	 # Determine the default libpath from the value encoded in an
6107356f6debSmrg	 # empty executable.
610842941e3bSmrg	 _LT_SYS_MODULE_PATH_AIX([$1])
6109356f6debSmrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6110356f6debSmrg	  # Warning - without using the other run time loading flags,
6111356f6debSmrg	  # -berok will link without error, but may produce a broken library.
6112356f6debSmrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6113356f6debSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
611442941e3bSmrg	  if test "$with_gnu_ld" = yes; then
611542941e3bSmrg	    # We only use this code for GNU lds that support --whole-archive.
611642941e3bSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
611742941e3bSmrg	  else
611842941e3bSmrg	    # Exported symbols can be pulled into shared objects from archives
611942941e3bSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
612042941e3bSmrg	  fi
6121356f6debSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6122356f6debSmrg	  # This is similar to how AIX traditionally builds its shared libraries.
6123356f6debSmrg	  _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'
6124356f6debSmrg	fi
6125356f6debSmrg      fi
6126356f6debSmrg      ;;
61276f03b1f6Smrg
6128356f6debSmrg    amigaos*)
6129356f6debSmrg      case $host_cpu in
6130356f6debSmrg      powerpc)
6131356f6debSmrg            # see comment about AmigaOS4 .so support
6132356f6debSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6133356f6debSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
6134356f6debSmrg        ;;
6135356f6debSmrg      m68k)
6136356f6debSmrg            _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)'
6137356f6debSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6138356f6debSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
6139356f6debSmrg        ;;
6140356f6debSmrg      esac
6141356f6debSmrg      ;;
61426f03b1f6Smrg
6143356f6debSmrg    bsdi[[45]]*)
6144356f6debSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
6145356f6debSmrg      ;;
61466f03b1f6Smrg
6147356f6debSmrg    cygwin* | mingw* | pw32* | cegcc*)
6148356f6debSmrg      # When not using gcc, we currently assume that we are using
6149356f6debSmrg      # Microsoft Visual C++.
6150356f6debSmrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
6151356f6debSmrg      # no search path for DLLs.
615242941e3bSmrg      case $cc_basename in
615342941e3bSmrg      cl*)
615442941e3bSmrg	# Native MSVC
615542941e3bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
615642941e3bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
615742941e3bSmrg	_LT_TAGVAR(always_export_symbols, $1)=yes
615842941e3bSmrg	_LT_TAGVAR(file_list_spec, $1)='@'
615942941e3bSmrg	# Tell ltmain to make .lib files, not .a files.
616042941e3bSmrg	libext=lib
616142941e3bSmrg	# Tell ltmain to make .dll files, not .so files.
616242941e3bSmrg	shrext_cmds=".dll"
616342941e3bSmrg	# FIXME: Setting linknames here is a bad hack.
616442941e3bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
616542941e3bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
616642941e3bSmrg	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
616742941e3bSmrg	  else
616842941e3bSmrg	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
616942941e3bSmrg	  fi~
617042941e3bSmrg	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
617142941e3bSmrg	  linknames='
617242941e3bSmrg	# The linker will not automatically build a static lib if we build a DLL.
617342941e3bSmrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
617442941e3bSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
617517caa701Smrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
617642941e3bSmrg	_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'
617742941e3bSmrg	# Don't use ranlib
617842941e3bSmrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
617942941e3bSmrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
618042941e3bSmrg	  lt_tool_outputfile="@TOOL_OUTPUT@"~
618142941e3bSmrg	  case $lt_outputfile in
618242941e3bSmrg	    *.exe|*.EXE) ;;
618342941e3bSmrg	    *)
618442941e3bSmrg	      lt_outputfile="$lt_outputfile.exe"
618542941e3bSmrg	      lt_tool_outputfile="$lt_tool_outputfile.exe"
618642941e3bSmrg	      ;;
618742941e3bSmrg	  esac~
618842941e3bSmrg	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
618942941e3bSmrg	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
619042941e3bSmrg	    $RM "$lt_outputfile.manifest";
619142941e3bSmrg	  fi'
619242941e3bSmrg	;;
619342941e3bSmrg      *)
619442941e3bSmrg	# Assume MSVC wrapper
619542941e3bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
619642941e3bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
619742941e3bSmrg	# Tell ltmain to make .lib files, not .a files.
619842941e3bSmrg	libext=lib
619942941e3bSmrg	# Tell ltmain to make .dll files, not .so files.
620042941e3bSmrg	shrext_cmds=".dll"
620142941e3bSmrg	# FIXME: Setting linknames here is a bad hack.
620242941e3bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
620342941e3bSmrg	# The linker will automatically build a .lib file if we build a DLL.
620442941e3bSmrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
620542941e3bSmrg	# FIXME: Should let the user specify the lib program.
620642941e3bSmrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
620742941e3bSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
620842941e3bSmrg	;;
620942941e3bSmrg      esac
6210356f6debSmrg      ;;
62116f03b1f6Smrg
6212356f6debSmrg    darwin* | rhapsody*)
6213356f6debSmrg      _LT_DARWIN_LINKER_FEATURES($1)
6214356f6debSmrg      ;;
62156f03b1f6Smrg
6216356f6debSmrg    dgux*)
6217356f6debSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6218356f6debSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6219356f6debSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6220356f6debSmrg      ;;
62216f03b1f6Smrg
6222356f6debSmrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
6223356f6debSmrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
6224356f6debSmrg    # does not break anything, and helps significantly (at the cost of a little
6225356f6debSmrg    # extra space).
6226356f6debSmrg    freebsd2.2*)
6227356f6debSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
6228356f6debSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6229356f6debSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6230356f6debSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6231356f6debSmrg      ;;
62326f03b1f6Smrg
6233356f6debSmrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
623417caa701Smrg    freebsd2.*)
6235356f6debSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6236356f6debSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6237356f6debSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6238356f6debSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6239356f6debSmrg      ;;
62406f03b1f6Smrg
6241356f6debSmrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
6242356f6debSmrg    freebsd* | dragonfly*)
624342941e3bSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6244356f6debSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6245356f6debSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6246356f6debSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6247356f6debSmrg      ;;
62486f03b1f6Smrg
6249356f6debSmrg    hpux9*)
6250356f6debSmrg      if test "$GCC" = yes; then
625142941e3bSmrg	_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'
6252356f6debSmrg      else
6253356f6debSmrg	_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'
6254356f6debSmrg      fi
6255356f6debSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6256356f6debSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6257356f6debSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
62586f03b1f6Smrg
6259356f6debSmrg      # hardcode_minus_L: Not really in the search PATH,
6260356f6debSmrg      # but as the default location of the library.
6261356f6debSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6262356f6debSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
62636f03b1f6Smrg      ;;
6264356f6debSmrg
6265356f6debSmrg    hpux10*)
626642941e3bSmrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
626742941e3bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6268356f6debSmrg      else
6269356f6debSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
6270356f6debSmrg      fi
6271356f6debSmrg      if test "$with_gnu_ld" = no; then
6272356f6debSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6273356f6debSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
6274356f6debSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
6275356f6debSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6276356f6debSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6277356f6debSmrg	# hardcode_minus_L: Not really in the search PATH,
6278356f6debSmrg	# but as the default location of the library.
6279356f6debSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
6280356f6debSmrg      fi
62816f03b1f6Smrg      ;;
62826f03b1f6Smrg
6283356f6debSmrg    hpux11*)
628442941e3bSmrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
6285356f6debSmrg	case $host_cpu in
6286356f6debSmrg	hppa*64*)
6287356f6debSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6288356f6debSmrg	  ;;
6289356f6debSmrg	ia64*)
629042941e3bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6291356f6debSmrg	  ;;
6292356f6debSmrg	*)
629342941e3bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6294356f6debSmrg	  ;;
6295356f6debSmrg	esac
6296356f6debSmrg      else
6297356f6debSmrg	case $host_cpu in
6298356f6debSmrg	hppa*64*)
6299356f6debSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6300356f6debSmrg	  ;;
6301356f6debSmrg	ia64*)
6302356f6debSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6303356f6debSmrg	  ;;
6304356f6debSmrg	*)
630542941e3bSmrg	m4_if($1, [], [
630642941e3bSmrg	  # Older versions of the 11.00 compiler do not understand -b yet
630742941e3bSmrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
630842941e3bSmrg	  _LT_LINKER_OPTION([if $CC understands -b],
630942941e3bSmrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
631042941e3bSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
631142941e3bSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
631242941e3bSmrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
6313356f6debSmrg	  ;;
6314356f6debSmrg	esac
6315356f6debSmrg      fi
6316356f6debSmrg      if test "$with_gnu_ld" = no; then
6317356f6debSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6318356f6debSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
63196f03b1f6Smrg
6320356f6debSmrg	case $host_cpu in
6321356f6debSmrg	hppa*64*|ia64*)
6322356f6debSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
6323356f6debSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6324356f6debSmrg	  ;;
6325356f6debSmrg	*)
6326356f6debSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
6327356f6debSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6328356f6debSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
63296f03b1f6Smrg
6330356f6debSmrg	  # hardcode_minus_L: Not really in the search PATH,
6331356f6debSmrg	  # but as the default location of the library.
6332356f6debSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
6333356f6debSmrg	  ;;
6334356f6debSmrg	esac
6335356f6debSmrg      fi
6336356f6debSmrg      ;;
63376f03b1f6Smrg
6338356f6debSmrg    irix5* | irix6* | nonstopux*)
6339356f6debSmrg      if test "$GCC" = yes; then
634042941e3bSmrg	_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'
6341356f6debSmrg	# Try to use the -exported_symbol ld option, if it does not
6342356f6debSmrg	# work, assume that -exports_file does not work either and
6343356f6debSmrg	# implicitly export all symbols.
634442941e3bSmrg	# This should be the same for all languages, so no per-tag cache variable.
634542941e3bSmrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
634642941e3bSmrg	  [lt_cv_irix_exported_symbol],
634742941e3bSmrg	  [save_LDFLAGS="$LDFLAGS"
634842941e3bSmrg	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
634942941e3bSmrg	   AC_LINK_IFELSE(
635042941e3bSmrg	     [AC_LANG_SOURCE(
635142941e3bSmrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
635242941e3bSmrg			      [C++], [[int foo (void) { return 0; }]],
635342941e3bSmrg			      [Fortran 77], [[
635442941e3bSmrg      subroutine foo
635542941e3bSmrg      end]],
635642941e3bSmrg			      [Fortran], [[
635742941e3bSmrg      subroutine foo
635842941e3bSmrg      end]])])],
635942941e3bSmrg	      [lt_cv_irix_exported_symbol=yes],
636042941e3bSmrg	      [lt_cv_irix_exported_symbol=no])
636142941e3bSmrg           LDFLAGS="$save_LDFLAGS"])
636242941e3bSmrg	if test "$lt_cv_irix_exported_symbol" = yes; then
636342941e3bSmrg          _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'
636442941e3bSmrg	fi
6365356f6debSmrg      else
636642941e3bSmrg	_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'
636742941e3bSmrg	_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'
6368356f6debSmrg      fi
6369356f6debSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6370356f6debSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6371356f6debSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6372356f6debSmrg      _LT_TAGVAR(inherit_rpath, $1)=yes
6373356f6debSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
6374356f6debSmrg      ;;
63756f03b1f6Smrg
6376356f6debSmrg    netbsd*)
6377356f6debSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6378356f6debSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
6379356f6debSmrg      else
6380356f6debSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
6381356f6debSmrg      fi
6382356f6debSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6383356f6debSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6384356f6debSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6385356f6debSmrg      ;;
63866f03b1f6Smrg
6387356f6debSmrg    newsos6)
6388356f6debSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6389356f6debSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6390356f6debSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6391356f6debSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6392356f6debSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6393356f6debSmrg      ;;
63946f03b1f6Smrg
6395356f6debSmrg    *nto* | *qnx*)
6396356f6debSmrg      ;;
63976f03b1f6Smrg
6398356f6debSmrg    openbsd*)
6399356f6debSmrg      if test -f /usr/libexec/ld.so; then
6400356f6debSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
6401356f6debSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6402356f6debSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6403356f6debSmrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6404356f6debSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6405356f6debSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
6406356f6debSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6407356f6debSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6408356f6debSmrg	else
6409356f6debSmrg	  case $host_os in
6410356f6debSmrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
6411356f6debSmrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6412356f6debSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6413356f6debSmrg	     ;;
6414356f6debSmrg	   *)
6415356f6debSmrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6416356f6debSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6417356f6debSmrg	     ;;
6418356f6debSmrg	  esac
6419356f6debSmrg	fi
6420356f6debSmrg      else
6421356f6debSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
6422356f6debSmrg      fi
6423356f6debSmrg      ;;
64246f03b1f6Smrg
6425356f6debSmrg    os2*)
6426356f6debSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6427356f6debSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6428356f6debSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
642942941e3bSmrg      _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'
6430356f6debSmrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
6431356f6debSmrg      ;;
64326f03b1f6Smrg
6433356f6debSmrg    osf3*)
6434356f6debSmrg      if test "$GCC" = yes; then
6435356f6debSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
643642941e3bSmrg	_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'
6437356f6debSmrg      else
6438356f6debSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
643942941e3bSmrg	_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'
6440356f6debSmrg      fi
6441356f6debSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6442356f6debSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6443356f6debSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6444356f6debSmrg      ;;
64456f03b1f6Smrg
6446356f6debSmrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
6447356f6debSmrg      if test "$GCC" = yes; then
6448356f6debSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
644942941e3bSmrg	_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'
6450356f6debSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6451356f6debSmrg      else
6452356f6debSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
645342941e3bSmrg	_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'
6454356f6debSmrg	_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~
645542941e3bSmrg	$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'
64566f03b1f6Smrg
6457356f6debSmrg	# Both c and cxx compiler support -rpath directly
6458356f6debSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6459356f6debSmrg      fi
6460356f6debSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
6461356f6debSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6462356f6debSmrg      ;;
64636f03b1f6Smrg
6464356f6debSmrg    solaris*)
6465356f6debSmrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
6466356f6debSmrg      if test "$GCC" = yes; then
6467356f6debSmrg	wlarc='${wl}'
646842941e3bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6469356f6debSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
647042941e3bSmrg	  $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'
6471356f6debSmrg      else
6472356f6debSmrg	case `$CC -V 2>&1` in
6473356f6debSmrg	*"Compilers 5.0"*)
6474356f6debSmrg	  wlarc=''
6475356f6debSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6476356f6debSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6477356f6debSmrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
6478356f6debSmrg	  ;;
6479356f6debSmrg	*)
6480356f6debSmrg	  wlarc='${wl}'
6481356f6debSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
6482356f6debSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6483356f6debSmrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
6484356f6debSmrg	  ;;
6485356f6debSmrg	esac
6486356f6debSmrg      fi
6487356f6debSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6488356f6debSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6489356f6debSmrg      case $host_os in
6490356f6debSmrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6491356f6debSmrg      *)
6492356f6debSmrg	# The compiler driver will combine and reorder linker options,
6493356f6debSmrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
6494356f6debSmrg	# but is careful enough not to reorder.
6495356f6debSmrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
6496356f6debSmrg	if test "$GCC" = yes; then
6497356f6debSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6498356f6debSmrg	else
6499356f6debSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6500356f6debSmrg	fi
6501356f6debSmrg	;;
6502356f6debSmrg      esac
6503356f6debSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
6504356f6debSmrg      ;;
65056f03b1f6Smrg
6506356f6debSmrg    sunos4*)
6507356f6debSmrg      if test "x$host_vendor" = xsequent; then
6508356f6debSmrg	# Use $CC to link under sequent, because it throws in some extra .o
6509356f6debSmrg	# files that make .init and .fini sections work.
6510356f6debSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
6511356f6debSmrg      else
6512356f6debSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
6513356f6debSmrg      fi
6514356f6debSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6515356f6debSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6516356f6debSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
6517356f6debSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6518356f6debSmrg      ;;
65196f03b1f6Smrg
6520356f6debSmrg    sysv4)
6521356f6debSmrg      case $host_vendor in
6522356f6debSmrg	sni)
6523356f6debSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6524356f6debSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
6525356f6debSmrg	;;
6526356f6debSmrg	siemens)
6527356f6debSmrg	  ## LD is ld it makes a PLAMLIB
6528356f6debSmrg	  ## CC just makes a GrossModule.
6529356f6debSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6530356f6debSmrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
6531356f6debSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
6532356f6debSmrg        ;;
6533356f6debSmrg	motorola)
6534356f6debSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6535356f6debSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
6536356f6debSmrg	;;
6537356f6debSmrg      esac
6538356f6debSmrg      runpath_var='LD_RUN_PATH'
6539356f6debSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6540356f6debSmrg      ;;
65416f03b1f6Smrg
6542356f6debSmrg    sysv4.3*)
6543356f6debSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6544356f6debSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6545356f6debSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
6546356f6debSmrg      ;;
65476f03b1f6Smrg
6548356f6debSmrg    sysv4*MP*)
6549356f6debSmrg      if test -d /usr/nec; then
6550356f6debSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6551356f6debSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6552356f6debSmrg	runpath_var=LD_RUN_PATH
6553356f6debSmrg	hardcode_runpath_var=yes
6554356f6debSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
6555356f6debSmrg      fi
6556356f6debSmrg      ;;
65576f03b1f6Smrg
6558356f6debSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6559356f6debSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6560356f6debSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6561356f6debSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6562356f6debSmrg      runpath_var='LD_RUN_PATH'
65636f03b1f6Smrg
6564356f6debSmrg      if test "$GCC" = yes; then
6565356f6debSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6566356f6debSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6567356f6debSmrg      else
6568356f6debSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6569356f6debSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6570356f6debSmrg      fi
6571356f6debSmrg      ;;
65726f03b1f6Smrg
6573356f6debSmrg    sysv5* | sco3.2v5* | sco5v6*)
6574356f6debSmrg      # Note: We can NOT use -z defs as we might desire, because we do not
6575356f6debSmrg      # link with -lc, and that would cause any symbols used from libc to
6576356f6debSmrg      # always be unresolved, which means just about no library would
6577356f6debSmrg      # ever link correctly.  If we're not using GNU ld we use -z text
6578356f6debSmrg      # though, which does catch some bad symbols but isn't as heavy-handed
6579356f6debSmrg      # as -z defs.
6580356f6debSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6581356f6debSmrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6582356f6debSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6583356f6debSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6584356f6debSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6585356f6debSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6586356f6debSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
6587356f6debSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6588356f6debSmrg      runpath_var='LD_RUN_PATH'
65896f03b1f6Smrg
6590356f6debSmrg      if test "$GCC" = yes; then
6591356f6debSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6592356f6debSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6593356f6debSmrg      else
6594356f6debSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6595356f6debSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6596356f6debSmrg      fi
6597356f6debSmrg      ;;
65986f03b1f6Smrg
6599356f6debSmrg    uts4*)
6600356f6debSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6601356f6debSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6602356f6debSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6603356f6debSmrg      ;;
66046f03b1f6Smrg
6605356f6debSmrg    *)
6606356f6debSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
6607356f6debSmrg      ;;
6608356f6debSmrg    esac
66096f03b1f6Smrg
6610356f6debSmrg    if test x$host_vendor = xsni; then
6611356f6debSmrg      case $host in
6612356f6debSmrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6613356f6debSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
6614356f6debSmrg	;;
6615356f6debSmrg      esac
6616356f6debSmrg    fi
6617356f6debSmrg  fi
6618356f6debSmrg])
6619356f6debSmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6620356f6debSmrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
66216f03b1f6Smrg
6622356f6debSmrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
66236f03b1f6Smrg
6624356f6debSmrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
6625356f6debSmrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
6626356f6debSmrg_LT_DECL([], [extract_expsyms_cmds], [2],
6627356f6debSmrg    [The commands to extract the exported symbol list from a shared archive])
66286f03b1f6Smrg
6629356f6debSmrg#
6630356f6debSmrg# Do we need to explicitly link libc?
6631356f6debSmrg#
6632356f6debSmrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
6633356f6debSmrgx|xyes)
6634356f6debSmrg  # Assume -lc should be added
6635356f6debSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
66366f03b1f6Smrg
6637356f6debSmrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
6638356f6debSmrg    case $_LT_TAGVAR(archive_cmds, $1) in
6639356f6debSmrg    *'~'*)
6640356f6debSmrg      # FIXME: we may have to deal with multi-command sequences.
6641356f6debSmrg      ;;
6642356f6debSmrg    '$CC '*)
6643356f6debSmrg      # Test whether the compiler implicitly links with -lc since on some
6644356f6debSmrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
6645356f6debSmrg      # to ld, don't add -lc before -lgcc.
664642941e3bSmrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
664742941e3bSmrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
664842941e3bSmrg	[$RM conftest*
664942941e3bSmrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
665042941e3bSmrg
665142941e3bSmrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
665242941e3bSmrg	  soname=conftest
665342941e3bSmrg	  lib=conftest
665442941e3bSmrg	  libobjs=conftest.$ac_objext
665542941e3bSmrg	  deplibs=
665642941e3bSmrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
665742941e3bSmrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
665842941e3bSmrg	  compiler_flags=-v
665942941e3bSmrg	  linker_flags=-v
666042941e3bSmrg	  verstring=
666142941e3bSmrg	  output_objdir=.
666242941e3bSmrg	  libname=conftest
666342941e3bSmrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
666442941e3bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
666542941e3bSmrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
666642941e3bSmrg	  then
666742941e3bSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
666842941e3bSmrg	  else
666942941e3bSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
667042941e3bSmrg	  fi
667142941e3bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
667242941e3bSmrg	else
667342941e3bSmrg	  cat conftest.err 1>&5
667442941e3bSmrg	fi
667542941e3bSmrg	$RM conftest*
667642941e3bSmrg	])
667742941e3bSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
6678356f6debSmrg      ;;
6679356f6debSmrg    esac
6680356f6debSmrg  fi
6681356f6debSmrg  ;;
6682356f6debSmrgesac
66836f03b1f6Smrg
6684356f6debSmrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
6685356f6debSmrg    [Whether or not to add -lc for building shared libraries])
6686356f6debSmrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
6687356f6debSmrg    [enable_shared_with_static_runtimes], [0],
6688356f6debSmrg    [Whether or not to disallow shared libs when runtime libs are static])
6689356f6debSmrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
6690356f6debSmrg    [Compiler flag to allow reflexive dlopens])
6691356f6debSmrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
6692356f6debSmrg    [Compiler flag to generate shared objects directly from archives])
6693356f6debSmrg_LT_TAGDECL([], [compiler_needs_object], [1],
6694356f6debSmrg    [Whether the compiler copes with passing no objects directly])
6695356f6debSmrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
6696356f6debSmrg    [Create an old-style archive from a shared archive])
6697356f6debSmrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
6698356f6debSmrg    [Create a temporary old-style archive to link instead of a shared archive])
6699356f6debSmrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
6700356f6debSmrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
6701356f6debSmrg_LT_TAGDECL([], [module_cmds], [2],
6702356f6debSmrg    [Commands used to build a loadable module if different from building
6703356f6debSmrg    a shared archive.])
6704356f6debSmrg_LT_TAGDECL([], [module_expsym_cmds], [2])
6705356f6debSmrg_LT_TAGDECL([], [with_gnu_ld], [1],
6706356f6debSmrg    [Whether we are building with GNU ld or not])
6707356f6debSmrg_LT_TAGDECL([], [allow_undefined_flag], [1],
6708356f6debSmrg    [Flag that allows shared libraries with undefined symbols to be built])
6709356f6debSmrg_LT_TAGDECL([], [no_undefined_flag], [1],
6710356f6debSmrg    [Flag that enforces no undefined symbols])
6711356f6debSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
6712356f6debSmrg    [Flag to hardcode $libdir into a binary during linking.
6713356f6debSmrg    This must work even if $libdir does not exist])
6714356f6debSmrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
6715356f6debSmrg    [Whether we need a single "-rpath" flag with a separated argument])
6716356f6debSmrg_LT_TAGDECL([], [hardcode_direct], [0],
6717356f6debSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
6718356f6debSmrg    DIR into the resulting binary])
6719356f6debSmrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
6720356f6debSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
6721356f6debSmrg    DIR into the resulting binary and the resulting library dependency is
6722356f6debSmrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
6723356f6debSmrg    library is relocated])
6724356f6debSmrg_LT_TAGDECL([], [hardcode_minus_L], [0],
6725356f6debSmrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
6726356f6debSmrg    into the resulting binary])
6727356f6debSmrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
6728356f6debSmrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
6729356f6debSmrg    into the resulting binary])
6730356f6debSmrg_LT_TAGDECL([], [hardcode_automatic], [0],
6731356f6debSmrg    [Set to "yes" if building a shared library automatically hardcodes DIR
6732356f6debSmrg    into the library and all subsequent libraries and executables linked
6733356f6debSmrg    against it])
6734356f6debSmrg_LT_TAGDECL([], [inherit_rpath], [0],
6735356f6debSmrg    [Set to yes if linker adds runtime paths of dependent libraries
6736356f6debSmrg    to runtime path list])
6737356f6debSmrg_LT_TAGDECL([], [link_all_deplibs], [0],
6738356f6debSmrg    [Whether libtool must link a program against all its dependency libraries])
6739356f6debSmrg_LT_TAGDECL([], [always_export_symbols], [0],
6740356f6debSmrg    [Set to "yes" if exported symbols are required])
6741356f6debSmrg_LT_TAGDECL([], [export_symbols_cmds], [2],
6742356f6debSmrg    [The commands to list exported symbols])
6743356f6debSmrg_LT_TAGDECL([], [exclude_expsyms], [1],
6744356f6debSmrg    [Symbols that should not be listed in the preloaded symbols])
6745356f6debSmrg_LT_TAGDECL([], [include_expsyms], [1],
6746356f6debSmrg    [Symbols that must always be exported])
6747356f6debSmrg_LT_TAGDECL([], [prelink_cmds], [2],
6748356f6debSmrg    [Commands necessary for linking programs (against libraries) with templates])
674942941e3bSmrg_LT_TAGDECL([], [postlink_cmds], [2],
675042941e3bSmrg    [Commands necessary for finishing linking programs])
6751356f6debSmrg_LT_TAGDECL([], [file_list_spec], [1],
6752356f6debSmrg    [Specify filename containing input files])
6753356f6debSmrgdnl FIXME: Not yet implemented
6754356f6debSmrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
6755356f6debSmrgdnl    [Compiler flag to generate thread safe objects])
6756356f6debSmrg])# _LT_LINKER_SHLIBS
6757356f6debSmrg
6758356f6debSmrg
6759356f6debSmrg# _LT_LANG_C_CONFIG([TAG])
6760356f6debSmrg# ------------------------
6761356f6debSmrg# Ensure that the configuration variables for a C compiler are suitably
6762356f6debSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
6763356f6debSmrg# the compiler configuration to `libtool'.
6764356f6debSmrgm4_defun([_LT_LANG_C_CONFIG],
6765356f6debSmrg[m4_require([_LT_DECL_EGREP])dnl
6766356f6debSmrglt_save_CC="$CC"
6767356f6debSmrgAC_LANG_PUSH(C)
67686f03b1f6Smrg
6769356f6debSmrg# Source file extension for C test sources.
6770356f6debSmrgac_ext=c
67716f03b1f6Smrg
6772356f6debSmrg# Object file extension for compiled C test sources.
6773356f6debSmrgobjext=o
6774356f6debSmrg_LT_TAGVAR(objext, $1)=$objext
67756f03b1f6Smrg
6776356f6debSmrg# Code to be used in simple compile tests
6777356f6debSmrglt_simple_compile_test_code="int some_variable = 0;"
67786f03b1f6Smrg
6779356f6debSmrg# Code to be used in simple link tests
6780356f6debSmrglt_simple_link_test_code='int main(){return(0);}'
67816f03b1f6Smrg
6782356f6debSmrg_LT_TAG_COMPILER
6783356f6debSmrg# Save the default compiler, since it gets overwritten when the other
6784356f6debSmrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
6785356f6debSmrgcompiler_DEFAULT=$CC
67866f03b1f6Smrg
6787356f6debSmrg# save warnings/boilerplate of simple test code
6788356f6debSmrg_LT_COMPILER_BOILERPLATE
6789356f6debSmrg_LT_LINKER_BOILERPLATE
67906f03b1f6Smrg
6791356f6debSmrgif test -n "$compiler"; then
6792356f6debSmrg  _LT_COMPILER_NO_RTTI($1)
6793356f6debSmrg  _LT_COMPILER_PIC($1)
6794356f6debSmrg  _LT_COMPILER_C_O($1)
6795356f6debSmrg  _LT_COMPILER_FILE_LOCKS($1)
6796356f6debSmrg  _LT_LINKER_SHLIBS($1)
6797356f6debSmrg  _LT_SYS_DYNAMIC_LINKER($1)
6798356f6debSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
6799356f6debSmrg  LT_SYS_DLOPEN_SELF
6800356f6debSmrg  _LT_CMD_STRIPLIB
6801356f6debSmrg
6802356f6debSmrg  # Report which library types will actually be built
6803356f6debSmrg  AC_MSG_CHECKING([if libtool supports shared libraries])
6804356f6debSmrg  AC_MSG_RESULT([$can_build_shared])
6805356f6debSmrg
6806356f6debSmrg  AC_MSG_CHECKING([whether to build shared libraries])
6807356f6debSmrg  test "$can_build_shared" = "no" && enable_shared=no
6808356f6debSmrg
6809356f6debSmrg  # On AIX, shared libraries and static libraries use the same namespace, and
6810356f6debSmrg  # are all built from PIC.
6811356f6debSmrg  case $host_os in
6812356f6debSmrg  aix3*)
6813356f6debSmrg    test "$enable_shared" = yes && enable_static=no
6814356f6debSmrg    if test -n "$RANLIB"; then
6815356f6debSmrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
6816356f6debSmrg      postinstall_cmds='$RANLIB $lib'
6817356f6debSmrg    fi
6818356f6debSmrg    ;;
68196f03b1f6Smrg
6820356f6debSmrg  aix[[4-9]]*)
6821356f6debSmrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6822356f6debSmrg      test "$enable_shared" = yes && enable_static=no
6823356f6debSmrg    fi
6824356f6debSmrg    ;;
6825356f6debSmrg  esac
6826356f6debSmrg  AC_MSG_RESULT([$enable_shared])
68276f03b1f6Smrg
6828356f6debSmrg  AC_MSG_CHECKING([whether to build static libraries])
6829356f6debSmrg  # Make sure either enable_shared or enable_static is yes.
6830356f6debSmrg  test "$enable_shared" = yes || enable_static=yes
6831356f6debSmrg  AC_MSG_RESULT([$enable_static])
68326f03b1f6Smrg
6833356f6debSmrg  _LT_CONFIG($1)
6834356f6debSmrgfi
6835356f6debSmrgAC_LANG_POP
6836356f6debSmrgCC="$lt_save_CC"
6837356f6debSmrg])# _LT_LANG_C_CONFIG
683898af18c5Smrg
683998af18c5Smrg
6840356f6debSmrg# _LT_LANG_CXX_CONFIG([TAG])
6841356f6debSmrg# --------------------------
6842356f6debSmrg# Ensure that the configuration variables for a C++ compiler are suitably
6843356f6debSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
6844356f6debSmrg# the compiler configuration to `libtool'.
6845356f6debSmrgm4_defun([_LT_LANG_CXX_CONFIG],
684642941e3bSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6847356f6debSmrgm4_require([_LT_DECL_EGREP])dnl
684842941e3bSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
684942941e3bSmrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
685042941e3bSmrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
685142941e3bSmrg    (test "X$CXX" != "Xg++"))) ; then
685242941e3bSmrg  AC_PROG_CXXCPP
685342941e3bSmrgelse
685442941e3bSmrg  _lt_caught_CXX_error=yes
685542941e3bSmrgfi
6856356f6debSmrg
6857356f6debSmrgAC_LANG_PUSH(C++)
6858356f6debSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6859356f6debSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
6860356f6debSmrg_LT_TAGVAR(always_export_symbols, $1)=no
6861356f6debSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
6862356f6debSmrg_LT_TAGVAR(compiler_needs_object, $1)=no
6863356f6debSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6864356f6debSmrg_LT_TAGVAR(hardcode_direct, $1)=no
6865356f6debSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6866356f6debSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6867356f6debSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
6868356f6debSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
6869356f6debSmrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6870356f6debSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
6871356f6debSmrg_LT_TAGVAR(inherit_rpath, $1)=no
6872356f6debSmrg_LT_TAGVAR(module_cmds, $1)=
6873356f6debSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
6874356f6debSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
6875356f6debSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
687642941e3bSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
687742941e3bSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6878356f6debSmrg_LT_TAGVAR(no_undefined_flag, $1)=
6879356f6debSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
6880356f6debSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
688198af18c5Smrg
6882356f6debSmrg# Source file extension for C++ test sources.
6883356f6debSmrgac_ext=cpp
688498af18c5Smrg
6885356f6debSmrg# Object file extension for compiled C++ test sources.
6886356f6debSmrgobjext=o
6887356f6debSmrg_LT_TAGVAR(objext, $1)=$objext
6888356f6debSmrg
6889356f6debSmrg# No sense in running all these tests if we already determined that
6890356f6debSmrg# the CXX compiler isn't working.  Some variables (like enable_shared)
6891356f6debSmrg# are currently assumed to apply to all compilers on this platform,
6892356f6debSmrg# and will be corrupted by setting them based on a non-working compiler.
6893356f6debSmrgif test "$_lt_caught_CXX_error" != yes; then
6894356f6debSmrg  # Code to be used in simple compile tests
6895356f6debSmrg  lt_simple_compile_test_code="int some_variable = 0;"
6896356f6debSmrg
6897356f6debSmrg  # Code to be used in simple link tests
6898356f6debSmrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
6899356f6debSmrg
6900356f6debSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6901356f6debSmrg  _LT_TAG_COMPILER
6902356f6debSmrg
6903356f6debSmrg  # save warnings/boilerplate of simple test code
6904356f6debSmrg  _LT_COMPILER_BOILERPLATE
6905356f6debSmrg  _LT_LINKER_BOILERPLATE
6906356f6debSmrg
6907356f6debSmrg  # Allow CC to be a program name with arguments.
6908356f6debSmrg  lt_save_CC=$CC
690942941e3bSmrg  lt_save_CFLAGS=$CFLAGS
6910356f6debSmrg  lt_save_LD=$LD
6911356f6debSmrg  lt_save_GCC=$GCC
6912356f6debSmrg  GCC=$GXX
6913356f6debSmrg  lt_save_with_gnu_ld=$with_gnu_ld
6914356f6debSmrg  lt_save_path_LD=$lt_cv_path_LD
6915356f6debSmrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
6916356f6debSmrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
6917356f6debSmrg  else
6918356f6debSmrg    $as_unset lt_cv_prog_gnu_ld
6919356f6debSmrg  fi
6920356f6debSmrg  if test -n "${lt_cv_path_LDCXX+set}"; then
6921356f6debSmrg    lt_cv_path_LD=$lt_cv_path_LDCXX
6922356f6debSmrg  else
6923356f6debSmrg    $as_unset lt_cv_path_LD
6924356f6debSmrg  fi
6925356f6debSmrg  test -z "${LDCXX+set}" || LD=$LDCXX
6926356f6debSmrg  CC=${CXX-"c++"}
692742941e3bSmrg  CFLAGS=$CXXFLAGS
6928356f6debSmrg  compiler=$CC
6929356f6debSmrg  _LT_TAGVAR(compiler, $1)=$CC
6930356f6debSmrg  _LT_CC_BASENAME([$compiler])
693198af18c5Smrg
6932356f6debSmrg  if test -n "$compiler"; then
6933356f6debSmrg    # We don't want -fno-exception when compiling C++ code, so set the
6934356f6debSmrg    # no_builtin_flag separately
6935356f6debSmrg    if test "$GXX" = yes; then
6936356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
6937356f6debSmrg    else
6938356f6debSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
6939356f6debSmrg    fi
694098af18c5Smrg
6941356f6debSmrg    if test "$GXX" = yes; then
6942356f6debSmrg      # Set up default GNU C++ configuration
694398af18c5Smrg
6944356f6debSmrg      LT_PATH_LD
694598af18c5Smrg
6946356f6debSmrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
6947356f6debSmrg      # archiving commands below assume that GNU ld is being used.
6948356f6debSmrg      if test "$with_gnu_ld" = yes; then
694942941e3bSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
695042941e3bSmrg        _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'
695198af18c5Smrg
6952356f6debSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6953356f6debSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
695498af18c5Smrg
6955356f6debSmrg        # If archive_cmds runs LD, not CC, wlarc should be empty
6956356f6debSmrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
6957356f6debSmrg        #     investigate it a little bit more. (MM)
6958356f6debSmrg        wlarc='${wl}'
695998af18c5Smrg
6960356f6debSmrg        # ancient GNU ld didn't support --whole-archive et. al.
6961356f6debSmrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
6962356f6debSmrg	  $GREP 'no-whole-archive' > /dev/null; then
6963356f6debSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6964356f6debSmrg        else
6965356f6debSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
6966356f6debSmrg        fi
6967356f6debSmrg      else
6968356f6debSmrg        with_gnu_ld=no
6969356f6debSmrg        wlarc=
6970356f6debSmrg
6971356f6debSmrg        # A generic and very simple default shared library creation
6972356f6debSmrg        # command for GNU C++ for the case where it uses the native
6973356f6debSmrg        # linker, instead of GNU ld.  If possible, this setting should
6974356f6debSmrg        # overridden to take advantage of the native linker features on
6975356f6debSmrg        # the platform it is being used on.
6976356f6debSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6977356f6debSmrg      fi
697898af18c5Smrg
6979356f6debSmrg      # Commands to make compiler produce verbose output that lists
6980356f6debSmrg      # what "hidden" libraries, object files and flags are used when
6981356f6debSmrg      # linking a shared library.
698242941e3bSmrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
698398af18c5Smrg
6984356f6debSmrg    else
6985356f6debSmrg      GXX=no
6986356f6debSmrg      with_gnu_ld=no
6987356f6debSmrg      wlarc=
6988356f6debSmrg    fi
698998af18c5Smrg
6990356f6debSmrg    # PORTME: fill in a description of your system's C++ link characteristics
6991356f6debSmrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
6992356f6debSmrg    _LT_TAGVAR(ld_shlibs, $1)=yes
6993356f6debSmrg    case $host_os in
6994356f6debSmrg      aix3*)
6995356f6debSmrg        # FIXME: insert proper C++ library support
6996356f6debSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6997356f6debSmrg        ;;
6998356f6debSmrg      aix[[4-9]]*)
6999356f6debSmrg        if test "$host_cpu" = ia64; then
7000356f6debSmrg          # On IA64, the linker does run time linking by default, so we don't
7001356f6debSmrg          # have to do anything special.
7002356f6debSmrg          aix_use_runtimelinking=no
7003356f6debSmrg          exp_sym_flag='-Bexport'
7004356f6debSmrg          no_entry_flag=""
7005356f6debSmrg        else
7006356f6debSmrg          aix_use_runtimelinking=no
7007356f6debSmrg
7008356f6debSmrg          # Test if we are trying to use run time linking or normal
7009356f6debSmrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
7010356f6debSmrg          # need to do runtime linking.
7011356f6debSmrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
7012356f6debSmrg	    for ld_flag in $LDFLAGS; do
7013356f6debSmrg	      case $ld_flag in
7014356f6debSmrg	      *-brtl*)
7015356f6debSmrg	        aix_use_runtimelinking=yes
7016356f6debSmrg	        break
7017356f6debSmrg	        ;;
7018356f6debSmrg	      esac
7019356f6debSmrg	    done
7020356f6debSmrg	    ;;
7021356f6debSmrg          esac
702298af18c5Smrg
7023356f6debSmrg          exp_sym_flag='-bexport'
7024356f6debSmrg          no_entry_flag='-bnoentry'
7025356f6debSmrg        fi
702698af18c5Smrg
7027356f6debSmrg        # When large executables or shared objects are built, AIX ld can
7028356f6debSmrg        # have problems creating the table of contents.  If linking a library
7029356f6debSmrg        # or program results in "error TOC overflow" add -mminimal-toc to
7030356f6debSmrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
7031356f6debSmrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
7032356f6debSmrg
7033356f6debSmrg        _LT_TAGVAR(archive_cmds, $1)=''
7034356f6debSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
7035356f6debSmrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7036356f6debSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7037356f6debSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
7038356f6debSmrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
7039356f6debSmrg
7040356f6debSmrg        if test "$GXX" = yes; then
7041356f6debSmrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
7042356f6debSmrg          # We only want to do this on AIX 4.2 and lower, the check
7043356f6debSmrg          # below for broken collect2 doesn't work under 4.3+
7044356f6debSmrg	  collect2name=`${CC} -print-prog-name=collect2`
7045356f6debSmrg	  if test -f "$collect2name" &&
7046356f6debSmrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
7047356f6debSmrg	  then
7048356f6debSmrg	    # We have reworked collect2
7049356f6debSmrg	    :
7050356f6debSmrg	  else
7051356f6debSmrg	    # We have old collect2
7052356f6debSmrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
7053356f6debSmrg	    # It fails to find uninstalled libraries when the uninstalled
7054356f6debSmrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
7055356f6debSmrg	    # to unsupported forces relinking
7056356f6debSmrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
7057356f6debSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
7058356f6debSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
7059356f6debSmrg	  fi
7060356f6debSmrg          esac
7061356f6debSmrg          shared_flag='-shared'
7062356f6debSmrg	  if test "$aix_use_runtimelinking" = yes; then
7063356f6debSmrg	    shared_flag="$shared_flag "'${wl}-G'
7064356f6debSmrg	  fi
7065356f6debSmrg        else
7066356f6debSmrg          # not using gcc
7067356f6debSmrg          if test "$host_cpu" = ia64; then
7068356f6debSmrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
7069356f6debSmrg	  # chokes on -Wl,-G. The following line is correct:
7070356f6debSmrg	  shared_flag='-G'
7071356f6debSmrg          else
7072356f6debSmrg	    if test "$aix_use_runtimelinking" = yes; then
7073356f6debSmrg	      shared_flag='${wl}-G'
7074356f6debSmrg	    else
7075356f6debSmrg	      shared_flag='${wl}-bM:SRE'
7076356f6debSmrg	    fi
7077356f6debSmrg          fi
7078356f6debSmrg        fi
707998af18c5Smrg
7080356f6debSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
7081356f6debSmrg        # It seems that -bexpall does not export symbols beginning with
7082356f6debSmrg        # underscore (_), so it is better to generate a list of symbols to
7083356f6debSmrg	# export.
7084356f6debSmrg        _LT_TAGVAR(always_export_symbols, $1)=yes
7085356f6debSmrg        if test "$aix_use_runtimelinking" = yes; then
7086356f6debSmrg          # Warning - without using the other runtime loading flags (-brtl),
7087356f6debSmrg          # -berok will link without error, but may produce a broken library.
7088356f6debSmrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
7089356f6debSmrg          # Determine the default libpath from the value encoded in an empty
7090356f6debSmrg          # executable.
709142941e3bSmrg          _LT_SYS_MODULE_PATH_AIX([$1])
7092356f6debSmrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7093356f6debSmrg
709442941e3bSmrg          _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"
7095356f6debSmrg        else
7096356f6debSmrg          if test "$host_cpu" = ia64; then
7097356f6debSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
7098356f6debSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
7099356f6debSmrg	    _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"
7100356f6debSmrg          else
7101356f6debSmrg	    # Determine the default libpath from the value encoded in an
7102356f6debSmrg	    # empty executable.
710342941e3bSmrg	    _LT_SYS_MODULE_PATH_AIX([$1])
7104356f6debSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7105356f6debSmrg	    # Warning - without using the other run time loading flags,
7106356f6debSmrg	    # -berok will link without error, but may produce a broken library.
7107356f6debSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
7108356f6debSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
710942941e3bSmrg	    if test "$with_gnu_ld" = yes; then
711042941e3bSmrg	      # We only use this code for GNU lds that support --whole-archive.
711142941e3bSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
711242941e3bSmrg	    else
711342941e3bSmrg	      # Exported symbols can be pulled into shared objects from archives
711442941e3bSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
711542941e3bSmrg	    fi
7116356f6debSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
7117356f6debSmrg	    # This is similar to how AIX traditionally builds its shared
7118356f6debSmrg	    # libraries.
7119356f6debSmrg	    _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'
7120356f6debSmrg          fi
7121356f6debSmrg        fi
7122356f6debSmrg        ;;
712398af18c5Smrg
7124356f6debSmrg      beos*)
7125356f6debSmrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
7126356f6debSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
7127356f6debSmrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
7128356f6debSmrg	  # support --undefined.  This deserves some investigation.  FIXME
7129356f6debSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7130356f6debSmrg	else
7131356f6debSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
7132356f6debSmrg	fi
7133356f6debSmrg	;;
713498af18c5Smrg
7135356f6debSmrg      chorus*)
7136356f6debSmrg        case $cc_basename in
7137356f6debSmrg          *)
7138356f6debSmrg	  # FIXME: insert proper C++ library support
7139356f6debSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
7140356f6debSmrg	  ;;
7141356f6debSmrg        esac
7142356f6debSmrg        ;;
714398af18c5Smrg
7144356f6debSmrg      cygwin* | mingw* | pw32* | cegcc*)
714542941e3bSmrg	case $GXX,$cc_basename in
714642941e3bSmrg	,cl* | no,cl*)
714742941e3bSmrg	  # Native MSVC
714842941e3bSmrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
714942941e3bSmrg	  # no search path for DLLs.
715042941e3bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
715142941e3bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
715242941e3bSmrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
715342941e3bSmrg	  _LT_TAGVAR(file_list_spec, $1)='@'
715442941e3bSmrg	  # Tell ltmain to make .lib files, not .a files.
715542941e3bSmrg	  libext=lib
715642941e3bSmrg	  # Tell ltmain to make .dll files, not .so files.
715742941e3bSmrg	  shrext_cmds=".dll"
715842941e3bSmrg	  # FIXME: Setting linknames here is a bad hack.
715942941e3bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
716042941e3bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
716142941e3bSmrg	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
716242941e3bSmrg	    else
716342941e3bSmrg	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
716442941e3bSmrg	    fi~
716542941e3bSmrg	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
716642941e3bSmrg	    linknames='
716742941e3bSmrg	  # The linker will not automatically build a static lib if we build a DLL.
716842941e3bSmrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
716942941e3bSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
717042941e3bSmrg	  # Don't use ranlib
717142941e3bSmrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
717242941e3bSmrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
717342941e3bSmrg	    lt_tool_outputfile="@TOOL_OUTPUT@"~
717442941e3bSmrg	    case $lt_outputfile in
717542941e3bSmrg	      *.exe|*.EXE) ;;
717642941e3bSmrg	      *)
717742941e3bSmrg		lt_outputfile="$lt_outputfile.exe"
717842941e3bSmrg		lt_tool_outputfile="$lt_tool_outputfile.exe"
717942941e3bSmrg		;;
718042941e3bSmrg	    esac~
718142941e3bSmrg	    func_to_tool_file "$lt_outputfile"~
718242941e3bSmrg	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
718342941e3bSmrg	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
718442941e3bSmrg	      $RM "$lt_outputfile.manifest";
718542941e3bSmrg	    fi'
718642941e3bSmrg	  ;;
718742941e3bSmrg	*)
718842941e3bSmrg	  # g++
718942941e3bSmrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
719042941e3bSmrg	  # as there is no search path for DLLs.
719142941e3bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
719242941e3bSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
719342941e3bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
719442941e3bSmrg	  _LT_TAGVAR(always_export_symbols, $1)=no
719542941e3bSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
719642941e3bSmrg
719742941e3bSmrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
719842941e3bSmrg	    _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'
719942941e3bSmrg	    # If the export-symbols file already is a .def file (1st line
720042941e3bSmrg	    # is EXPORTS), use it as is; otherwise, prepend...
720142941e3bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
720242941e3bSmrg	      cp $export_symbols $output_objdir/$soname.def;
720342941e3bSmrg	    else
720442941e3bSmrg	      echo EXPORTS > $output_objdir/$soname.def;
720542941e3bSmrg	      cat $export_symbols >> $output_objdir/$soname.def;
720642941e3bSmrg	    fi~
720742941e3bSmrg	    $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'
720842941e3bSmrg	  else
720942941e3bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
721042941e3bSmrg	  fi
721142941e3bSmrg	  ;;
721242941e3bSmrg	esac
721342941e3bSmrg	;;
7214356f6debSmrg      darwin* | rhapsody*)
7215356f6debSmrg        _LT_DARWIN_LINKER_FEATURES($1)
7216356f6debSmrg	;;
721798af18c5Smrg
7218356f6debSmrg      dgux*)
7219356f6debSmrg        case $cc_basename in
7220356f6debSmrg          ec++*)
7221356f6debSmrg	    # FIXME: insert proper C++ library support
7222356f6debSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7223356f6debSmrg	    ;;
7224356f6debSmrg          ghcx*)
7225356f6debSmrg	    # Green Hills C++ Compiler
7226356f6debSmrg	    # FIXME: insert proper C++ library support
7227356f6debSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7228356f6debSmrg	    ;;
7229356f6debSmrg          *)
7230356f6debSmrg	    # FIXME: insert proper C++ library support
7231356f6debSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7232356f6debSmrg	    ;;
7233356f6debSmrg        esac
7234356f6debSmrg        ;;
723598af18c5Smrg
723617caa701Smrg      freebsd2.*)
7237356f6debSmrg        # C++ shared libraries reported to be fairly broken before
7238356f6debSmrg	# switch to ELF
7239356f6debSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7240356f6debSmrg        ;;
724198af18c5Smrg
7242356f6debSmrg      freebsd-elf*)
7243356f6debSmrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7244356f6debSmrg        ;;
724598af18c5Smrg
7246356f6debSmrg      freebsd* | dragonfly*)
7247356f6debSmrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
7248356f6debSmrg        # conventions
7249356f6debSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
7250356f6debSmrg        ;;
725198af18c5Smrg
7252356f6debSmrg      gnu*)
7253356f6debSmrg        ;;
725498af18c5Smrg
725542941e3bSmrg      haiku*)
725642941e3bSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
725742941e3bSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
725842941e3bSmrg        ;;
725942941e3bSmrg
7260356f6debSmrg      hpux9*)
7261356f6debSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7262356f6debSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7263356f6debSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7264356f6debSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
7265356f6debSmrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
7266356f6debSmrg				             # but as the default
7267356f6debSmrg				             # location of the library.
7268356f6debSmrg
7269356f6debSmrg        case $cc_basename in
7270356f6debSmrg          CC*)
7271356f6debSmrg            # FIXME: insert proper C++ library support
7272356f6debSmrg            _LT_TAGVAR(ld_shlibs, $1)=no
7273356f6debSmrg            ;;
7274356f6debSmrg          aCC*)
7275356f6debSmrg            _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'
7276356f6debSmrg            # Commands to make compiler produce verbose output that lists
7277356f6debSmrg            # what "hidden" libraries, object files and flags are used when
7278356f6debSmrg            # linking a shared library.
7279356f6debSmrg            #
7280356f6debSmrg            # There doesn't appear to be a way to prevent this compiler from
7281356f6debSmrg            # explicitly linking system object files so we need to strip them
7282356f6debSmrg            # from the output so that they don't get included in the library
7283356f6debSmrg            # dependencies.
728442941e3bSmrg            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"'
7285356f6debSmrg            ;;
7286356f6debSmrg          *)
7287356f6debSmrg            if test "$GXX" = yes; then
728842941e3bSmrg              _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'
7289356f6debSmrg            else
7290356f6debSmrg              # FIXME: insert proper C++ library support
7291356f6debSmrg              _LT_TAGVAR(ld_shlibs, $1)=no
7292356f6debSmrg            fi
7293356f6debSmrg            ;;
7294356f6debSmrg        esac
7295356f6debSmrg        ;;
729698af18c5Smrg
7297356f6debSmrg      hpux10*|hpux11*)
7298356f6debSmrg        if test $with_gnu_ld = no; then
7299356f6debSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
7300356f6debSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7301356f6debSmrg
7302356f6debSmrg          case $host_cpu in
7303356f6debSmrg            hppa*64*|ia64*)
7304356f6debSmrg              ;;
7305356f6debSmrg            *)
7306356f6debSmrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7307356f6debSmrg              ;;
7308356f6debSmrg          esac
7309356f6debSmrg        fi
7310356f6debSmrg        case $host_cpu in
7311356f6debSmrg          hppa*64*|ia64*)
7312356f6debSmrg            _LT_TAGVAR(hardcode_direct, $1)=no
7313356f6debSmrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7314356f6debSmrg            ;;
7315356f6debSmrg          *)
7316356f6debSmrg            _LT_TAGVAR(hardcode_direct, $1)=yes
7317356f6debSmrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7318356f6debSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
7319356f6debSmrg					         # but as the default
7320356f6debSmrg					         # location of the library.
7321356f6debSmrg            ;;
7322356f6debSmrg        esac
7323356f6debSmrg
7324356f6debSmrg        case $cc_basename in
7325356f6debSmrg          CC*)
7326356f6debSmrg	    # FIXME: insert proper C++ library support
7327356f6debSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7328356f6debSmrg	    ;;
7329356f6debSmrg          aCC*)
7330356f6debSmrg	    case $host_cpu in
7331356f6debSmrg	      hppa*64*)
7332356f6debSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7333356f6debSmrg	        ;;
7334356f6debSmrg	      ia64*)
7335356f6debSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7336356f6debSmrg	        ;;
7337356f6debSmrg	      *)
7338356f6debSmrg	        _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'
7339356f6debSmrg	        ;;
7340356f6debSmrg	    esac
7341356f6debSmrg	    # Commands to make compiler produce verbose output that lists
7342356f6debSmrg	    # what "hidden" libraries, object files and flags are used when
7343356f6debSmrg	    # linking a shared library.
7344356f6debSmrg	    #
7345356f6debSmrg	    # There doesn't appear to be a way to prevent this compiler from
7346356f6debSmrg	    # explicitly linking system object files so we need to strip them
7347356f6debSmrg	    # from the output so that they don't get included in the library
7348356f6debSmrg	    # dependencies.
734942941e3bSmrg	    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"'
7350356f6debSmrg	    ;;
7351356f6debSmrg          *)
7352356f6debSmrg	    if test "$GXX" = yes; then
7353356f6debSmrg	      if test $with_gnu_ld = no; then
7354356f6debSmrg	        case $host_cpu in
7355356f6debSmrg	          hppa*64*)
7356356f6debSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7357356f6debSmrg	            ;;
7358356f6debSmrg	          ia64*)
735942941e3bSmrg	            _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'
7360356f6debSmrg	            ;;
7361356f6debSmrg	          *)
736242941e3bSmrg	            _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'
7363356f6debSmrg	            ;;
7364356f6debSmrg	        esac
7365356f6debSmrg	      fi
7366356f6debSmrg	    else
7367356f6debSmrg	      # FIXME: insert proper C++ library support
7368356f6debSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
7369356f6debSmrg	    fi
7370356f6debSmrg	    ;;
7371356f6debSmrg        esac
7372356f6debSmrg        ;;
737398af18c5Smrg
7374356f6debSmrg      interix[[3-9]]*)
7375356f6debSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
7376356f6debSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7377356f6debSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7378356f6debSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7379356f6debSmrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
7380356f6debSmrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
7381356f6debSmrg	# default) and relocated if they conflict, which is a slow very memory
7382356f6debSmrg	# consuming and fragmenting process.  To avoid this, we pick a random,
7383356f6debSmrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
7384356f6debSmrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
7385356f6debSmrg	_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'
7386356f6debSmrg	_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'
7387356f6debSmrg	;;
7388356f6debSmrg      irix5* | irix6*)
7389356f6debSmrg        case $cc_basename in
7390356f6debSmrg          CC*)
7391356f6debSmrg	    # SGI C++
739242941e3bSmrg	    _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'
7393356f6debSmrg
7394356f6debSmrg	    # Archives containing C++ object files must be created using
7395356f6debSmrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
7396356f6debSmrg	    # necessary to make sure instantiated templates are included
7397356f6debSmrg	    # in the archive.
7398356f6debSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
7399356f6debSmrg	    ;;
7400356f6debSmrg          *)
7401356f6debSmrg	    if test "$GXX" = yes; then
7402356f6debSmrg	      if test "$with_gnu_ld" = no; then
740342941e3bSmrg	        _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'
7404356f6debSmrg	      else
740542941e3bSmrg	        _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'
7406356f6debSmrg	      fi
7407356f6debSmrg	    fi
7408356f6debSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7409356f6debSmrg	    ;;
7410356f6debSmrg        esac
7411356f6debSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7412356f6debSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7413356f6debSmrg        _LT_TAGVAR(inherit_rpath, $1)=yes
7414356f6debSmrg        ;;
741598af18c5Smrg
741642941e3bSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
7417356f6debSmrg        case $cc_basename in
7418356f6debSmrg          KCC*)
7419356f6debSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7420356f6debSmrg
7421356f6debSmrg	    # KCC will only create a shared library if the output file
7422356f6debSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7423356f6debSmrg	    # to its proper name (with version) after linking.
7424356f6debSmrg	    _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'
7425356f6debSmrg	    _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'
7426356f6debSmrg	    # Commands to make compiler produce verbose output that lists
7427356f6debSmrg	    # what "hidden" libraries, object files and flags are used when
7428356f6debSmrg	    # linking a shared library.
7429356f6debSmrg	    #
7430356f6debSmrg	    # There doesn't appear to be a way to prevent this compiler from
7431356f6debSmrg	    # explicitly linking system object files so we need to strip them
7432356f6debSmrg	    # from the output so that they don't get included in the library
7433356f6debSmrg	    # dependencies.
743442941e3bSmrg	    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"'
7435356f6debSmrg
7436356f6debSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7437356f6debSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7438356f6debSmrg
7439356f6debSmrg	    # Archives containing C++ object files must be created using
7440356f6debSmrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
7441356f6debSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
7442356f6debSmrg	    ;;
7443356f6debSmrg	  icpc* | ecpc* )
7444356f6debSmrg	    # Intel C++
7445356f6debSmrg	    with_gnu_ld=yes
7446356f6debSmrg	    # version 8.0 and above of icpc choke on multiply defined symbols
7447356f6debSmrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
7448356f6debSmrg	    # earlier do not add the objects themselves.
7449356f6debSmrg	    case `$CC -V 2>&1` in
7450356f6debSmrg	      *"Version 7."*)
7451356f6debSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7452356f6debSmrg		_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'
7453356f6debSmrg		;;
7454356f6debSmrg	      *)  # Version 8.0 or newer
7455356f6debSmrg	        tmp_idyn=
7456356f6debSmrg	        case $host_cpu in
7457356f6debSmrg		  ia64*) tmp_idyn=' -i_dynamic';;
7458356f6debSmrg		esac
7459356f6debSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7460356f6debSmrg		_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'
7461356f6debSmrg		;;
7462356f6debSmrg	    esac
7463356f6debSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7464356f6debSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7465356f6debSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7466356f6debSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
7467356f6debSmrg	    ;;
7468356f6debSmrg          pgCC* | pgcpp*)
7469356f6debSmrg            # Portland Group C++ compiler
7470356f6debSmrg	    case `$CC -V` in
747142941e3bSmrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
7472356f6debSmrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
7473356f6debSmrg		rm -rf $tpldir~
7474356f6debSmrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
747542941e3bSmrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
7476356f6debSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
7477356f6debSmrg		rm -rf $tpldir~
7478356f6debSmrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
747942941e3bSmrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
7480356f6debSmrg		$RANLIB $oldlib'
7481356f6debSmrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
7482356f6debSmrg		rm -rf $tpldir~
7483356f6debSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
748442941e3bSmrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
7485356f6debSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
7486356f6debSmrg		rm -rf $tpldir~
7487356f6debSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
748842941e3bSmrg		$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'
7489356f6debSmrg	      ;;
749042941e3bSmrg	    *) # Version 6 and above use weak symbols
7491356f6debSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
7492356f6debSmrg	      _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'
7493356f6debSmrg	      ;;
7494356f6debSmrg	    esac
749598af18c5Smrg
7496356f6debSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
7497356f6debSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
749842941e3bSmrg	    _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'
7499356f6debSmrg            ;;
7500356f6debSmrg	  cxx*)
7501356f6debSmrg	    # Compaq C++
7502356f6debSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
7503356f6debSmrg	    _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'
750498af18c5Smrg
7505356f6debSmrg	    runpath_var=LD_RUN_PATH
7506356f6debSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7507356f6debSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
750898af18c5Smrg
7509356f6debSmrg	    # Commands to make compiler produce verbose output that lists
7510356f6debSmrg	    # what "hidden" libraries, object files and flags are used when
7511356f6debSmrg	    # linking a shared library.
7512356f6debSmrg	    #
7513356f6debSmrg	    # There doesn't appear to be a way to prevent this compiler from
7514356f6debSmrg	    # explicitly linking system object files so we need to strip them
7515356f6debSmrg	    # from the output so that they don't get included in the library
7516356f6debSmrg	    # dependencies.
751742941e3bSmrg	    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'
7518356f6debSmrg	    ;;
751942941e3bSmrg	  xl* | mpixl* | bgxl*)
7520356f6debSmrg	    # IBM XL 8.0 on PPC, with GNU ld
7521356f6debSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7522356f6debSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7523356f6debSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
7524356f6debSmrg	    if test "x$supports_anon_versioning" = xyes; then
7525356f6debSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7526356f6debSmrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7527356f6debSmrg		echo "local: *; };" >> $output_objdir/$libname.ver~
7528356f6debSmrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
7529356f6debSmrg	    fi
7530356f6debSmrg	    ;;
7531356f6debSmrg	  *)
7532356f6debSmrg	    case `$CC -V 2>&1 | sed 5q` in
7533356f6debSmrg	    *Sun\ C*)
7534356f6debSmrg	      # Sun C++ 5.9
7535356f6debSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7536356f6debSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7537356f6debSmrg	      _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'
7538356f6debSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
753942941e3bSmrg	      _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'
7540356f6debSmrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
7541356f6debSmrg
7542356f6debSmrg	      # Not sure whether something based on
7543356f6debSmrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
7544356f6debSmrg	      # would be better.
754542941e3bSmrg	      output_verbose_link_cmd='func_echo_all'
7546356f6debSmrg
7547356f6debSmrg	      # Archives containing C++ object files must be created using
7548356f6debSmrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7549356f6debSmrg	      # necessary to make sure instantiated templates are included
7550356f6debSmrg	      # in the archive.
7551356f6debSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7552356f6debSmrg	      ;;
7553356f6debSmrg	    esac
7554356f6debSmrg	    ;;
7555356f6debSmrg	esac
7556356f6debSmrg	;;
755798af18c5Smrg
7558356f6debSmrg      lynxos*)
7559356f6debSmrg        # FIXME: insert proper C++ library support
7560356f6debSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
7561356f6debSmrg	;;
756298af18c5Smrg
7563356f6debSmrg      m88k*)
7564356f6debSmrg        # FIXME: insert proper C++ library support
7565356f6debSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7566356f6debSmrg	;;
756798af18c5Smrg
7568356f6debSmrg      mvs*)
7569356f6debSmrg        case $cc_basename in
7570356f6debSmrg          cxx*)
7571356f6debSmrg	    # FIXME: insert proper C++ library support
7572356f6debSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7573356f6debSmrg	    ;;
7574356f6debSmrg	  *)
7575356f6debSmrg	    # FIXME: insert proper C++ library support
7576356f6debSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7577356f6debSmrg	    ;;
7578356f6debSmrg	esac
7579356f6debSmrg	;;
758098af18c5Smrg
7581356f6debSmrg      netbsd*)
7582356f6debSmrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7583356f6debSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
7584356f6debSmrg	  wlarc=
7585356f6debSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7586356f6debSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
7587356f6debSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7588356f6debSmrg	fi
7589356f6debSmrg	# Workaround some broken pre-1.5 toolchains
7590356f6debSmrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
7591356f6debSmrg	;;
759298af18c5Smrg
7593356f6debSmrg      *nto* | *qnx*)
7594356f6debSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
7595356f6debSmrg	;;
759698af18c5Smrg
7597356f6debSmrg      openbsd2*)
7598356f6debSmrg        # C++ shared libraries are fairly broken
7599356f6debSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
7600356f6debSmrg	;;
760198af18c5Smrg
7602356f6debSmrg      openbsd*)
7603356f6debSmrg	if test -f /usr/libexec/ld.so; then
7604356f6debSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
7605356f6debSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7606356f6debSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7607356f6debSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7608356f6debSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7609356f6debSmrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
7610356f6debSmrg	    _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'
7611356f6debSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
7612356f6debSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
7613356f6debSmrg	  fi
761442941e3bSmrg	  output_verbose_link_cmd=func_echo_all
7615356f6debSmrg	else
7616356f6debSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
7617356f6debSmrg	fi
7618356f6debSmrg	;;
761998af18c5Smrg
7620356f6debSmrg      osf3* | osf4* | osf5*)
7621356f6debSmrg        case $cc_basename in
7622356f6debSmrg          KCC*)
7623356f6debSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7624356f6debSmrg
7625356f6debSmrg	    # KCC will only create a shared library if the output file
7626356f6debSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7627356f6debSmrg	    # to its proper name (with version) after linking.
7628356f6debSmrg	    _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'
7629356f6debSmrg
7630356f6debSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
7631356f6debSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7632356f6debSmrg
7633356f6debSmrg	    # Archives containing C++ object files must be created using
7634356f6debSmrg	    # the KAI C++ compiler.
7635356f6debSmrg	    case $host in
7636356f6debSmrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
7637356f6debSmrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
7638356f6debSmrg	    esac
7639356f6debSmrg	    ;;
7640356f6debSmrg          RCC*)
7641356f6debSmrg	    # Rational C++ 2.4.1
7642356f6debSmrg	    # FIXME: insert proper C++ library support
7643356f6debSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7644356f6debSmrg	    ;;
7645356f6debSmrg          cxx*)
7646356f6debSmrg	    case $host in
7647356f6debSmrg	      osf3*)
7648356f6debSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
764942941e3bSmrg	        _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'
7650356f6debSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7651356f6debSmrg		;;
7652356f6debSmrg	      *)
7653356f6debSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
765442941e3bSmrg	        _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'
7655356f6debSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7656356f6debSmrg	          echo "-hidden">> $lib.exp~
765742941e3bSmrg	          $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~
7658356f6debSmrg	          $RM $lib.exp'
7659356f6debSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7660356f6debSmrg		;;
7661356f6debSmrg	    esac
766298af18c5Smrg
7663356f6debSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
766498af18c5Smrg
7665356f6debSmrg	    # Commands to make compiler produce verbose output that lists
7666356f6debSmrg	    # what "hidden" libraries, object files and flags are used when
7667356f6debSmrg	    # linking a shared library.
7668356f6debSmrg	    #
7669356f6debSmrg	    # There doesn't appear to be a way to prevent this compiler from
7670356f6debSmrg	    # explicitly linking system object files so we need to strip them
7671356f6debSmrg	    # from the output so that they don't get included in the library
7672356f6debSmrg	    # dependencies.
767342941e3bSmrg	    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"'
7674356f6debSmrg	    ;;
7675356f6debSmrg	  *)
7676356f6debSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
7677356f6debSmrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
7678356f6debSmrg	      case $host in
7679356f6debSmrg	        osf3*)
768042941e3bSmrg	          _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'
7681356f6debSmrg		  ;;
7682356f6debSmrg	        *)
768342941e3bSmrg	          _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'
7684356f6debSmrg		  ;;
7685356f6debSmrg	      esac
7686356f6debSmrg
7687356f6debSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
7688356f6debSmrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7689356f6debSmrg
7690356f6debSmrg	      # Commands to make compiler produce verbose output that lists
7691356f6debSmrg	      # what "hidden" libraries, object files and flags are used when
7692356f6debSmrg	      # linking a shared library.
769342941e3bSmrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7694356f6debSmrg
7695356f6debSmrg	    else
7696356f6debSmrg	      # FIXME: insert proper C++ library support
7697356f6debSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
7698356f6debSmrg	    fi
7699356f6debSmrg	    ;;
7700356f6debSmrg        esac
7701356f6debSmrg        ;;
770298af18c5Smrg
7703356f6debSmrg      psos*)
7704356f6debSmrg        # FIXME: insert proper C++ library support
7705356f6debSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7706356f6debSmrg        ;;
770798af18c5Smrg
7708356f6debSmrg      sunos4*)
7709356f6debSmrg        case $cc_basename in
7710356f6debSmrg          CC*)
7711356f6debSmrg	    # Sun C++ 4.x
7712356f6debSmrg	    # FIXME: insert proper C++ library support
7713356f6debSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7714356f6debSmrg	    ;;
7715356f6debSmrg          lcc*)
7716356f6debSmrg	    # Lucid
7717356f6debSmrg	    # FIXME: insert proper C++ library support
7718356f6debSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7719356f6debSmrg	    ;;
7720356f6debSmrg          *)
7721356f6debSmrg	    # FIXME: insert proper C++ library support
7722356f6debSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7723356f6debSmrg	    ;;
7724356f6debSmrg        esac
7725356f6debSmrg        ;;
772698af18c5Smrg
7727356f6debSmrg      solaris*)
7728356f6debSmrg        case $cc_basename in
772942941e3bSmrg          CC* | sunCC*)
7730356f6debSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
7731356f6debSmrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
7732356f6debSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7733356f6debSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7734356f6debSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7735356f6debSmrg	      $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'
7736356f6debSmrg
7737356f6debSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7738356f6debSmrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7739356f6debSmrg	    case $host_os in
7740356f6debSmrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7741356f6debSmrg	      *)
7742356f6debSmrg		# The compiler driver will combine and reorder linker options,
7743356f6debSmrg		# but understands `-z linker_flag'.
7744356f6debSmrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
7745356f6debSmrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7746356f6debSmrg	        ;;
7747356f6debSmrg	    esac
7748356f6debSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
774998af18c5Smrg
775042941e3bSmrg	    output_verbose_link_cmd='func_echo_all'
775198af18c5Smrg
7752356f6debSmrg	    # Archives containing C++ object files must be created using
7753356f6debSmrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7754356f6debSmrg	    # necessary to make sure instantiated templates are included
7755356f6debSmrg	    # in the archive.
7756356f6debSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7757356f6debSmrg	    ;;
7758356f6debSmrg          gcx*)
7759356f6debSmrg	    # Green Hills C++ Compiler
7760356f6debSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
776198af18c5Smrg
7762356f6debSmrg	    # The C++ compiler must be used to create the archive.
7763356f6debSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
7764356f6debSmrg	    ;;
7765356f6debSmrg          *)
7766356f6debSmrg	    # GNU C++ compiler with Solaris linker
7767356f6debSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
7768356f6debSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
7769356f6debSmrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
777042941e3bSmrg	        _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'
7771356f6debSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
777242941e3bSmrg		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7773356f6debSmrg
7774356f6debSmrg	        # Commands to make compiler produce verbose output that lists
7775356f6debSmrg	        # what "hidden" libraries, object files and flags are used when
7776356f6debSmrg	        # linking a shared library.
777742941e3bSmrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7778356f6debSmrg	      else
7779356f6debSmrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
7780356f6debSmrg	        # platform.
7781356f6debSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7782356f6debSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7783356f6debSmrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7784356f6debSmrg
7785356f6debSmrg	        # Commands to make compiler produce verbose output that lists
7786356f6debSmrg	        # what "hidden" libraries, object files and flags are used when
7787356f6debSmrg	        # linking a shared library.
778842941e3bSmrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7789356f6debSmrg	      fi
7790356f6debSmrg
7791356f6debSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
7792356f6debSmrg	      case $host_os in
7793356f6debSmrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7794356f6debSmrg		*)
7795356f6debSmrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
7796356f6debSmrg		  ;;
7797356f6debSmrg	      esac
7798356f6debSmrg	    fi
7799356f6debSmrg	    ;;
7800356f6debSmrg        esac
7801356f6debSmrg        ;;
780298af18c5Smrg
7803356f6debSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7804356f6debSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7805356f6debSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7806356f6debSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7807356f6debSmrg      runpath_var='LD_RUN_PATH'
780898af18c5Smrg
7809356f6debSmrg      case $cc_basename in
7810356f6debSmrg        CC*)
7811356f6debSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7812356f6debSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7813356f6debSmrg	  ;;
7814356f6debSmrg	*)
7815356f6debSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7816356f6debSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7817356f6debSmrg	  ;;
7818356f6debSmrg      esac
7819356f6debSmrg      ;;
782098af18c5Smrg
7821356f6debSmrg      sysv5* | sco3.2v5* | sco5v6*)
7822356f6debSmrg	# Note: We can NOT use -z defs as we might desire, because we do not
7823356f6debSmrg	# link with -lc, and that would cause any symbols used from libc to
7824356f6debSmrg	# always be unresolved, which means just about no library would
7825356f6debSmrg	# ever link correctly.  If we're not using GNU ld we use -z text
7826356f6debSmrg	# though, which does catch some bad symbols but isn't as heavy-handed
7827356f6debSmrg	# as -z defs.
7828356f6debSmrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
7829356f6debSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
7830356f6debSmrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7831356f6debSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7832356f6debSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
7833356f6debSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7834356f6debSmrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
7835356f6debSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
7836356f6debSmrg	runpath_var='LD_RUN_PATH'
783798af18c5Smrg
7838356f6debSmrg	case $cc_basename in
7839356f6debSmrg          CC*)
7840356f6debSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7841356f6debSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
784242941e3bSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
784342941e3bSmrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
784442941e3bSmrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
784542941e3bSmrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
7846356f6debSmrg	    ;;
7847356f6debSmrg	  *)
7848356f6debSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7849356f6debSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7850356f6debSmrg	    ;;
7851356f6debSmrg	esac
7852356f6debSmrg      ;;
785398af18c5Smrg
7854356f6debSmrg      tandem*)
7855356f6debSmrg        case $cc_basename in
7856356f6debSmrg          NCC*)
7857356f6debSmrg	    # NonStop-UX NCC 3.20
7858356f6debSmrg	    # FIXME: insert proper C++ library support
7859356f6debSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7860356f6debSmrg	    ;;
7861356f6debSmrg          *)
7862356f6debSmrg	    # FIXME: insert proper C++ library support
7863356f6debSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7864356f6debSmrg	    ;;
7865356f6debSmrg        esac
7866356f6debSmrg        ;;
786798af18c5Smrg
7868356f6debSmrg      vxworks*)
7869356f6debSmrg        # FIXME: insert proper C++ library support
7870356f6debSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7871356f6debSmrg        ;;
787298af18c5Smrg
7873356f6debSmrg      *)
7874356f6debSmrg        # FIXME: insert proper C++ library support
7875356f6debSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7876356f6debSmrg        ;;
7877356f6debSmrg    esac
787898af18c5Smrg
7879356f6debSmrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7880356f6debSmrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
7881356f6debSmrg
7882356f6debSmrg    _LT_TAGVAR(GCC, $1)="$GXX"
7883356f6debSmrg    _LT_TAGVAR(LD, $1)="$LD"
7884356f6debSmrg
7885356f6debSmrg    ## CAVEAT EMPTOR:
7886356f6debSmrg    ## There is no encapsulation within the following macros, do not change
7887356f6debSmrg    ## the running order or otherwise move them around unless you know exactly
7888356f6debSmrg    ## what you are doing...
7889356f6debSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
7890356f6debSmrg    _LT_COMPILER_PIC($1)
7891356f6debSmrg    _LT_COMPILER_C_O($1)
7892356f6debSmrg    _LT_COMPILER_FILE_LOCKS($1)
7893356f6debSmrg    _LT_LINKER_SHLIBS($1)
7894356f6debSmrg    _LT_SYS_DYNAMIC_LINKER($1)
7895356f6debSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7896356f6debSmrg
7897356f6debSmrg    _LT_CONFIG($1)
7898356f6debSmrg  fi # test -n "$compiler"
7899356f6debSmrg
7900356f6debSmrg  CC=$lt_save_CC
790142941e3bSmrg  CFLAGS=$lt_save_CFLAGS
7902356f6debSmrg  LDCXX=$LD
7903356f6debSmrg  LD=$lt_save_LD
7904356f6debSmrg  GCC=$lt_save_GCC
7905356f6debSmrg  with_gnu_ld=$lt_save_with_gnu_ld
7906356f6debSmrg  lt_cv_path_LDCXX=$lt_cv_path_LD
7907356f6debSmrg  lt_cv_path_LD=$lt_save_path_LD
7908356f6debSmrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
7909356f6debSmrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
7910356f6debSmrgfi # test "$_lt_caught_CXX_error" != yes
791198af18c5Smrg
7912356f6debSmrgAC_LANG_POP
7913356f6debSmrg])# _LT_LANG_CXX_CONFIG
791498af18c5Smrg
791598af18c5Smrg
791642941e3bSmrg# _LT_FUNC_STRIPNAME_CNF
791742941e3bSmrg# ----------------------
791842941e3bSmrg# func_stripname_cnf prefix suffix name
791942941e3bSmrg# strip PREFIX and SUFFIX off of NAME.
792042941e3bSmrg# PREFIX and SUFFIX must not contain globbing or regex special
792142941e3bSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
792242941e3bSmrg# dot (in which case that matches only a dot).
792342941e3bSmrg#
792442941e3bSmrg# This function is identical to the (non-XSI) version of func_stripname,
792542941e3bSmrg# except this one can be used by m4 code that may be executed by configure,
792642941e3bSmrg# rather than the libtool script.
792742941e3bSmrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
792842941e3bSmrgAC_REQUIRE([_LT_DECL_SED])
792942941e3bSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
793042941e3bSmrgfunc_stripname_cnf ()
793142941e3bSmrg{
793242941e3bSmrg  case ${2} in
793342941e3bSmrg  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
793442941e3bSmrg  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
793542941e3bSmrg  esac
793642941e3bSmrg} # func_stripname_cnf
793742941e3bSmrg])# _LT_FUNC_STRIPNAME_CNF
793842941e3bSmrg
7939356f6debSmrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
794098af18c5Smrg# ---------------------------------
7941356f6debSmrg# Figure out "hidden" library dependencies from verbose
7942356f6debSmrg# compiler output when linking a shared library.
7943356f6debSmrg# Parse the compiler output and extract the necessary
7944356f6debSmrg# objects, libraries and library flags.
7945356f6debSmrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
7946356f6debSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
794742941e3bSmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
7948356f6debSmrg# Dependencies to place before and after the object being linked:
7949356f6debSmrg_LT_TAGVAR(predep_objects, $1)=
7950356f6debSmrg_LT_TAGVAR(postdep_objects, $1)=
7951356f6debSmrg_LT_TAGVAR(predeps, $1)=
7952356f6debSmrg_LT_TAGVAR(postdeps, $1)=
7953356f6debSmrg_LT_TAGVAR(compiler_lib_search_path, $1)=
795498af18c5Smrg
7955356f6debSmrgdnl we can't use the lt_simple_compile_test_code here,
7956356f6debSmrgdnl because it contains code intended for an executable,
7957356f6debSmrgdnl not a library.  It's possible we should let each
7958356f6debSmrgdnl tag define a new lt_????_link_test_code variable,
7959356f6debSmrgdnl but it's only used here...
7960356f6debSmrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
7961356f6debSmrgint a;
7962356f6debSmrgvoid foo (void) { a = 0; }
7963356f6debSmrg_LT_EOF
7964356f6debSmrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
7965356f6debSmrgclass Foo
7966356f6debSmrg{
7967356f6debSmrgpublic:
7968356f6debSmrg  Foo (void) { a = 0; }
7969356f6debSmrgprivate:
7970356f6debSmrg  int a;
7971356f6debSmrg};
7972356f6debSmrg_LT_EOF
7973356f6debSmrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
7974356f6debSmrg      subroutine foo
7975356f6debSmrg      implicit none
7976356f6debSmrg      integer*4 a
7977356f6debSmrg      a=0
7978356f6debSmrg      return
7979356f6debSmrg      end
7980356f6debSmrg_LT_EOF
7981356f6debSmrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
7982356f6debSmrg      subroutine foo
7983356f6debSmrg      implicit none
7984356f6debSmrg      integer a
7985356f6debSmrg      a=0
7986356f6debSmrg      return
7987356f6debSmrg      end
7988356f6debSmrg_LT_EOF
7989356f6debSmrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
7990356f6debSmrgpublic class foo {
7991356f6debSmrg  private int a;
7992356f6debSmrg  public void bar (void) {
7993356f6debSmrg    a = 0;
7994356f6debSmrg  }
7995356f6debSmrg};
7996356f6debSmrg_LT_EOF
799717caa701Smrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
799817caa701Smrgpackage foo
799917caa701Smrgfunc foo() {
800017caa701Smrg}
800117caa701Smrg_LT_EOF
8002356f6debSmrg])
800342941e3bSmrg
800442941e3bSmrg_lt_libdeps_save_CFLAGS=$CFLAGS
800542941e3bSmrgcase "$CC $CFLAGS " in #(
800642941e3bSmrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
800742941e3bSmrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
800817caa701Smrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
800942941e3bSmrgesac
801042941e3bSmrg
8011356f6debSmrgdnl Parse the compiler output and extract the necessary
8012356f6debSmrgdnl objects, libraries and library flags.
8013356f6debSmrgif AC_TRY_EVAL(ac_compile); then
8014356f6debSmrg  # Parse the compiler output and extract the necessary
8015356f6debSmrg  # objects, libraries and library flags.
801698af18c5Smrg
8017356f6debSmrg  # Sentinel used to keep track of whether or not we are before
8018356f6debSmrg  # the conftest object file.
8019356f6debSmrg  pre_test_object_deps_done=no
802098af18c5Smrg
8021356f6debSmrg  for p in `eval "$output_verbose_link_cmd"`; do
802242941e3bSmrg    case ${prev}${p} in
802398af18c5Smrg
8024356f6debSmrg    -L* | -R* | -l*)
8025356f6debSmrg       # Some compilers place space between "-{L,R}" and the path.
8026356f6debSmrg       # Remove the space.
8027356f6debSmrg       if test $p = "-L" ||
8028356f6debSmrg          test $p = "-R"; then
8029356f6debSmrg	 prev=$p
8030356f6debSmrg	 continue
8031356f6debSmrg       fi
8032356f6debSmrg
803342941e3bSmrg       # Expand the sysroot to ease extracting the directories later.
803442941e3bSmrg       if test -z "$prev"; then
803542941e3bSmrg         case $p in
803642941e3bSmrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
803742941e3bSmrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
803842941e3bSmrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
803942941e3bSmrg         esac
804042941e3bSmrg       fi
804142941e3bSmrg       case $p in
804242941e3bSmrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
804342941e3bSmrg       esac
8044356f6debSmrg       if test "$pre_test_object_deps_done" = no; then
804542941e3bSmrg	 case ${prev} in
804642941e3bSmrg	 -L | -R)
8047356f6debSmrg	   # Internal compiler library paths should come after those
8048356f6debSmrg	   # provided the user.  The postdeps already come after the
8049356f6debSmrg	   # user supplied libs so there is no need to process them.
8050356f6debSmrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
8051356f6debSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
8052356f6debSmrg	   else
8053356f6debSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
8054356f6debSmrg	   fi
8055356f6debSmrg	   ;;
8056356f6debSmrg	 # The "-l" case would never come before the object being
8057356f6debSmrg	 # linked, so don't bother handling this case.
8058356f6debSmrg	 esac
8059356f6debSmrg       else
8060356f6debSmrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
8061356f6debSmrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
8062356f6debSmrg	 else
8063356f6debSmrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
8064356f6debSmrg	 fi
8065356f6debSmrg       fi
806642941e3bSmrg       prev=
8067356f6debSmrg       ;;
8068356f6debSmrg
806942941e3bSmrg    *.lto.$objext) ;; # Ignore GCC LTO objects
8070356f6debSmrg    *.$objext)
8071356f6debSmrg       # This assumes that the test object file only shows up
8072356f6debSmrg       # once in the compiler output.
8073356f6debSmrg       if test "$p" = "conftest.$objext"; then
8074356f6debSmrg	 pre_test_object_deps_done=yes
8075356f6debSmrg	 continue
8076356f6debSmrg       fi
8077356f6debSmrg
8078356f6debSmrg       if test "$pre_test_object_deps_done" = no; then
8079356f6debSmrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
8080356f6debSmrg	   _LT_TAGVAR(predep_objects, $1)="$p"
8081356f6debSmrg	 else
8082356f6debSmrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
8083356f6debSmrg	 fi
8084356f6debSmrg       else
8085356f6debSmrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
8086356f6debSmrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
8087356f6debSmrg	 else
8088356f6debSmrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
8089356f6debSmrg	 fi
8090356f6debSmrg       fi
8091356f6debSmrg       ;;
8092356f6debSmrg
8093356f6debSmrg    *) ;; # Ignore the rest.
8094356f6debSmrg
8095356f6debSmrg    esac
8096356f6debSmrg  done
8097356f6debSmrg
8098356f6debSmrg  # Clean up.
8099356f6debSmrg  rm -f a.out a.exe
8100356f6debSmrgelse
8101356f6debSmrg  echo "libtool.m4: error: problem compiling $1 test program"
8102356f6debSmrgfi
8103356f6debSmrg
8104356f6debSmrg$RM -f confest.$objext
810542941e3bSmrgCFLAGS=$_lt_libdeps_save_CFLAGS
8106356f6debSmrg
8107356f6debSmrg# PORTME: override above test on systems where it is broken
8108356f6debSmrgm4_if([$1], [CXX],
8109356f6debSmrg[case $host_os in
8110356f6debSmrginterix[[3-9]]*)
8111356f6debSmrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
8112356f6debSmrg  # hack all around it, let's just trust "g++" to DTRT.
8113356f6debSmrg  _LT_TAGVAR(predep_objects,$1)=
8114356f6debSmrg  _LT_TAGVAR(postdep_objects,$1)=
8115356f6debSmrg  _LT_TAGVAR(postdeps,$1)=
811698af18c5Smrg  ;;
8117356f6debSmrg
8118356f6debSmrglinux*)
8119356f6debSmrg  case `$CC -V 2>&1 | sed 5q` in
8120356f6debSmrg  *Sun\ C*)
8121356f6debSmrg    # Sun C++ 5.9
8122356f6debSmrg
8123356f6debSmrg    # The more standards-conforming stlport4 library is
8124356f6debSmrg    # incompatible with the Cstd library. Avoid specifying
8125356f6debSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
8126356f6debSmrg    # -library=stlport4 depends on it.
8127356f6debSmrg    case " $CXX $CXXFLAGS " in
8128356f6debSmrg    *" -library=stlport4 "*)
8129356f6debSmrg      solaris_use_stlport4=yes
8130356f6debSmrg      ;;
8131356f6debSmrg    esac
8132356f6debSmrg
8133356f6debSmrg    if test "$solaris_use_stlport4" != yes; then
8134356f6debSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8135356f6debSmrg    fi
8136356f6debSmrg    ;;
8137356f6debSmrg  esac
813898af18c5Smrg  ;;
8139356f6debSmrg
814098af18c5Smrgsolaris*)
8141356f6debSmrg  case $cc_basename in
814242941e3bSmrg  CC* | sunCC*)
8143356f6debSmrg    # The more standards-conforming stlport4 library is
8144356f6debSmrg    # incompatible with the Cstd library. Avoid specifying
8145356f6debSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
8146356f6debSmrg    # -library=stlport4 depends on it.
8147356f6debSmrg    case " $CXX $CXXFLAGS " in
8148356f6debSmrg    *" -library=stlport4 "*)
8149356f6debSmrg      solaris_use_stlport4=yes
8150356f6debSmrg      ;;
8151356f6debSmrg    esac
815298af18c5Smrg
8153356f6debSmrg    # Adding this requires a known-good setup of shared libraries for
8154356f6debSmrg    # Sun compiler versions before 5.6, else PIC objects from an old
8155356f6debSmrg    # archive will be linked into the output, leading to subtle bugs.
8156356f6debSmrg    if test "$solaris_use_stlport4" != yes; then
8157356f6debSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
8158356f6debSmrg    fi
8159356f6debSmrg    ;;
8160356f6debSmrg  esac
816198af18c5Smrg  ;;
816298af18c5Smrgesac
8163356f6debSmrg])
816498af18c5Smrg
8165356f6debSmrgcase " $_LT_TAGVAR(postdeps, $1) " in
8166356f6debSmrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
816798af18c5Smrgesac
8168356f6debSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
8169356f6debSmrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
8170356f6debSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
8171356f6debSmrgfi
8172356f6debSmrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
8173356f6debSmrg    [The directories searched by this compiler when creating a shared library])
8174356f6debSmrg_LT_TAGDECL([], [predep_objects], [1],
8175356f6debSmrg    [Dependencies to place before and after the objects being linked to
8176356f6debSmrg    create a shared library])
8177356f6debSmrg_LT_TAGDECL([], [postdep_objects], [1])
8178356f6debSmrg_LT_TAGDECL([], [predeps], [1])
8179356f6debSmrg_LT_TAGDECL([], [postdeps], [1])
8180356f6debSmrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
8181356f6debSmrg    [The library search path used internally by the compiler when linking
8182356f6debSmrg    a shared library])
8183356f6debSmrg])# _LT_SYS_HIDDEN_LIBDEPS
8184356f6debSmrg
8185356f6debSmrg
8186356f6debSmrg# _LT_LANG_F77_CONFIG([TAG])
8187356f6debSmrg# --------------------------
8188356f6debSmrg# Ensure that the configuration variables for a Fortran 77 compiler are
8189356f6debSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
8190356f6debSmrg# to write the compiler configuration to `libtool'.
8191356f6debSmrgm4_defun([_LT_LANG_F77_CONFIG],
819242941e3bSmrg[AC_LANG_PUSH(Fortran 77)
819342941e3bSmrgif test -z "$F77" || test "X$F77" = "Xno"; then
819442941e3bSmrg  _lt_disable_F77=yes
819542941e3bSmrgfi
819698af18c5Smrg
8197356f6debSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8198356f6debSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
8199356f6debSmrg_LT_TAGVAR(always_export_symbols, $1)=no
8200356f6debSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
8201356f6debSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
8202356f6debSmrg_LT_TAGVAR(hardcode_direct, $1)=no
8203356f6debSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8204356f6debSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8205356f6debSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
8206356f6debSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
8207356f6debSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
8208356f6debSmrg_LT_TAGVAR(inherit_rpath, $1)=no
8209356f6debSmrg_LT_TAGVAR(module_cmds, $1)=
8210356f6debSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
8211356f6debSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
8212356f6debSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
821342941e3bSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
821442941e3bSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8215356f6debSmrg_LT_TAGVAR(no_undefined_flag, $1)=
8216356f6debSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
8217356f6debSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
821898af18c5Smrg
8219356f6debSmrg# Source file extension for f77 test sources.
8220356f6debSmrgac_ext=f
822198af18c5Smrg
8222356f6debSmrg# Object file extension for compiled f77 test sources.
8223356f6debSmrgobjext=o
8224356f6debSmrg_LT_TAGVAR(objext, $1)=$objext
8225356f6debSmrg
8226356f6debSmrg# No sense in running all these tests if we already determined that
8227356f6debSmrg# the F77 compiler isn't working.  Some variables (like enable_shared)
8228356f6debSmrg# are currently assumed to apply to all compilers on this platform,
8229356f6debSmrg# and will be corrupted by setting them based on a non-working compiler.
8230356f6debSmrgif test "$_lt_disable_F77" != yes; then
8231356f6debSmrg  # Code to be used in simple compile tests
8232356f6debSmrg  lt_simple_compile_test_code="\
8233356f6debSmrg      subroutine t
8234356f6debSmrg      return
8235356f6debSmrg      end
8236356f6debSmrg"
823798af18c5Smrg
8238356f6debSmrg  # Code to be used in simple link tests
8239356f6debSmrg  lt_simple_link_test_code="\
8240356f6debSmrg      program t
8241356f6debSmrg      end
8242356f6debSmrg"
824398af18c5Smrg
8244356f6debSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8245356f6debSmrg  _LT_TAG_COMPILER
824698af18c5Smrg
8247356f6debSmrg  # save warnings/boilerplate of simple test code
8248356f6debSmrg  _LT_COMPILER_BOILERPLATE
8249356f6debSmrg  _LT_LINKER_BOILERPLATE
825098af18c5Smrg
8251356f6debSmrg  # Allow CC to be a program name with arguments.
8252356f6debSmrg  lt_save_CC="$CC"
8253356f6debSmrg  lt_save_GCC=$GCC
825442941e3bSmrg  lt_save_CFLAGS=$CFLAGS
8255356f6debSmrg  CC=${F77-"f77"}
825642941e3bSmrg  CFLAGS=$FFLAGS
8257356f6debSmrg  compiler=$CC
8258356f6debSmrg  _LT_TAGVAR(compiler, $1)=$CC
8259356f6debSmrg  _LT_CC_BASENAME([$compiler])
8260356f6debSmrg  GCC=$G77
8261356f6debSmrg  if test -n "$compiler"; then
8262356f6debSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
8263356f6debSmrg    AC_MSG_RESULT([$can_build_shared])
826498af18c5Smrg
8265356f6debSmrg    AC_MSG_CHECKING([whether to build shared libraries])
8266356f6debSmrg    test "$can_build_shared" = "no" && enable_shared=no
8267356f6debSmrg
8268356f6debSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
8269356f6debSmrg    # are all built from PIC.
8270356f6debSmrg    case $host_os in
8271356f6debSmrg      aix3*)
8272356f6debSmrg        test "$enable_shared" = yes && enable_static=no
8273356f6debSmrg        if test -n "$RANLIB"; then
8274356f6debSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
8275356f6debSmrg          postinstall_cmds='$RANLIB $lib'
8276356f6debSmrg        fi
8277356f6debSmrg        ;;
8278356f6debSmrg      aix[[4-9]]*)
8279356f6debSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8280356f6debSmrg	  test "$enable_shared" = yes && enable_static=no
828198af18c5Smrg	fi
8282356f6debSmrg        ;;
8283356f6debSmrg    esac
8284356f6debSmrg    AC_MSG_RESULT([$enable_shared])
8285356f6debSmrg
8286356f6debSmrg    AC_MSG_CHECKING([whether to build static libraries])
8287356f6debSmrg    # Make sure either enable_shared or enable_static is yes.
8288356f6debSmrg    test "$enable_shared" = yes || enable_static=yes
8289356f6debSmrg    AC_MSG_RESULT([$enable_static])
8290356f6debSmrg
8291356f6debSmrg    _LT_TAGVAR(GCC, $1)="$G77"
8292356f6debSmrg    _LT_TAGVAR(LD, $1)="$LD"
8293356f6debSmrg
8294356f6debSmrg    ## CAVEAT EMPTOR:
8295356f6debSmrg    ## There is no encapsulation within the following macros, do not change
8296356f6debSmrg    ## the running order or otherwise move them around unless you know exactly
8297356f6debSmrg    ## what you are doing...
8298356f6debSmrg    _LT_COMPILER_PIC($1)
8299356f6debSmrg    _LT_COMPILER_C_O($1)
8300356f6debSmrg    _LT_COMPILER_FILE_LOCKS($1)
8301356f6debSmrg    _LT_LINKER_SHLIBS($1)
8302356f6debSmrg    _LT_SYS_DYNAMIC_LINKER($1)
8303356f6debSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
8304356f6debSmrg
8305356f6debSmrg    _LT_CONFIG($1)
8306356f6debSmrg  fi # test -n "$compiler"
8307356f6debSmrg
8308356f6debSmrg  GCC=$lt_save_GCC
8309356f6debSmrg  CC="$lt_save_CC"
831042941e3bSmrg  CFLAGS="$lt_save_CFLAGS"
8311356f6debSmrgfi # test "$_lt_disable_F77" != yes
831298af18c5Smrg
8313356f6debSmrgAC_LANG_POP
8314356f6debSmrg])# _LT_LANG_F77_CONFIG
8315356f6debSmrg
8316356f6debSmrg
8317356f6debSmrg# _LT_LANG_FC_CONFIG([TAG])
8318356f6debSmrg# -------------------------
8319356f6debSmrg# Ensure that the configuration variables for a Fortran compiler are
8320356f6debSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
8321356f6debSmrg# to write the compiler configuration to `libtool'.
8322356f6debSmrgm4_defun([_LT_LANG_FC_CONFIG],
832342941e3bSmrg[AC_LANG_PUSH(Fortran)
832442941e3bSmrg
832542941e3bSmrgif test -z "$FC" || test "X$FC" = "Xno"; then
832642941e3bSmrg  _lt_disable_FC=yes
832742941e3bSmrgfi
8328356f6debSmrg
8329356f6debSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8330356f6debSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
8331356f6debSmrg_LT_TAGVAR(always_export_symbols, $1)=no
8332356f6debSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
8333356f6debSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
8334356f6debSmrg_LT_TAGVAR(hardcode_direct, $1)=no
8335356f6debSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
8336356f6debSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
8337356f6debSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
8338356f6debSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
8339356f6debSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
8340356f6debSmrg_LT_TAGVAR(inherit_rpath, $1)=no
8341356f6debSmrg_LT_TAGVAR(module_cmds, $1)=
8342356f6debSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
8343356f6debSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
8344356f6debSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
834542941e3bSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
834642941e3bSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8347356f6debSmrg_LT_TAGVAR(no_undefined_flag, $1)=
8348356f6debSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
8349356f6debSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8350356f6debSmrg
8351356f6debSmrg# Source file extension for fc test sources.
8352356f6debSmrgac_ext=${ac_fc_srcext-f}
8353356f6debSmrg
8354356f6debSmrg# Object file extension for compiled fc test sources.
8355356f6debSmrgobjext=o
8356356f6debSmrg_LT_TAGVAR(objext, $1)=$objext
8357356f6debSmrg
8358356f6debSmrg# No sense in running all these tests if we already determined that
8359356f6debSmrg# the FC compiler isn't working.  Some variables (like enable_shared)
8360356f6debSmrg# are currently assumed to apply to all compilers on this platform,
8361356f6debSmrg# and will be corrupted by setting them based on a non-working compiler.
8362356f6debSmrgif test "$_lt_disable_FC" != yes; then
8363356f6debSmrg  # Code to be used in simple compile tests
8364356f6debSmrg  lt_simple_compile_test_code="\
8365356f6debSmrg      subroutine t
8366356f6debSmrg      return
8367356f6debSmrg      end
8368356f6debSmrg"
836998af18c5Smrg
8370356f6debSmrg  # Code to be used in simple link tests
8371356f6debSmrg  lt_simple_link_test_code="\
8372356f6debSmrg      program t
8373356f6debSmrg      end
8374356f6debSmrg"
83756f03b1f6Smrg
8376356f6debSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8377356f6debSmrg  _LT_TAG_COMPILER
83786f03b1f6Smrg
8379356f6debSmrg  # save warnings/boilerplate of simple test code
8380356f6debSmrg  _LT_COMPILER_BOILERPLATE
8381356f6debSmrg  _LT_LINKER_BOILERPLATE
83826f03b1f6Smrg
8383356f6debSmrg  # Allow CC to be a program name with arguments.
8384356f6debSmrg  lt_save_CC="$CC"
8385356f6debSmrg  lt_save_GCC=$GCC
838642941e3bSmrg  lt_save_CFLAGS=$CFLAGS
8387356f6debSmrg  CC=${FC-"f95"}
838842941e3bSmrg  CFLAGS=$FCFLAGS
8389356f6debSmrg  compiler=$CC
8390356f6debSmrg  GCC=$ac_cv_fc_compiler_gnu
83916f03b1f6Smrg
8392356f6debSmrg  _LT_TAGVAR(compiler, $1)=$CC
8393356f6debSmrg  _LT_CC_BASENAME([$compiler])
83946f03b1f6Smrg
8395356f6debSmrg  if test -n "$compiler"; then
8396356f6debSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
8397356f6debSmrg    AC_MSG_RESULT([$can_build_shared])
83986f03b1f6Smrg
8399356f6debSmrg    AC_MSG_CHECKING([whether to build shared libraries])
8400356f6debSmrg    test "$can_build_shared" = "no" && enable_shared=no
84016f03b1f6Smrg
8402356f6debSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
8403356f6debSmrg    # are all built from PIC.
8404356f6debSmrg    case $host_os in
8405356f6debSmrg      aix3*)
8406356f6debSmrg        test "$enable_shared" = yes && enable_static=no
8407356f6debSmrg        if test -n "$RANLIB"; then
8408356f6debSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
8409356f6debSmrg          postinstall_cmds='$RANLIB $lib'
8410356f6debSmrg        fi
8411356f6debSmrg        ;;
8412356f6debSmrg      aix[[4-9]]*)
8413356f6debSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
8414356f6debSmrg	  test "$enable_shared" = yes && enable_static=no
8415356f6debSmrg	fi
8416356f6debSmrg        ;;
8417356f6debSmrg    esac
8418356f6debSmrg    AC_MSG_RESULT([$enable_shared])
8419356f6debSmrg
8420356f6debSmrg    AC_MSG_CHECKING([whether to build static libraries])
8421356f6debSmrg    # Make sure either enable_shared or enable_static is yes.
8422356f6debSmrg    test "$enable_shared" = yes || enable_static=yes
8423356f6debSmrg    AC_MSG_RESULT([$enable_static])
8424356f6debSmrg
8425356f6debSmrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
8426356f6debSmrg    _LT_TAGVAR(LD, $1)="$LD"
8427356f6debSmrg
8428356f6debSmrg    ## CAVEAT EMPTOR:
8429356f6debSmrg    ## There is no encapsulation within the following macros, do not change
8430356f6debSmrg    ## the running order or otherwise move them around unless you know exactly
8431356f6debSmrg    ## what you are doing...
8432356f6debSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
8433356f6debSmrg    _LT_COMPILER_PIC($1)
8434356f6debSmrg    _LT_COMPILER_C_O($1)
8435356f6debSmrg    _LT_COMPILER_FILE_LOCKS($1)
8436356f6debSmrg    _LT_LINKER_SHLIBS($1)
8437356f6debSmrg    _LT_SYS_DYNAMIC_LINKER($1)
8438356f6debSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
8439356f6debSmrg
8440356f6debSmrg    _LT_CONFIG($1)
8441356f6debSmrg  fi # test -n "$compiler"
8442356f6debSmrg
8443356f6debSmrg  GCC=$lt_save_GCC
844442941e3bSmrg  CC=$lt_save_CC
844542941e3bSmrg  CFLAGS=$lt_save_CFLAGS
8446356f6debSmrgfi # test "$_lt_disable_FC" != yes
84476f03b1f6Smrg
8448356f6debSmrgAC_LANG_POP
8449356f6debSmrg])# _LT_LANG_FC_CONFIG
84506f03b1f6Smrg
84516f03b1f6Smrg
8452356f6debSmrg# _LT_LANG_GCJ_CONFIG([TAG])
8453356f6debSmrg# --------------------------
8454356f6debSmrg# Ensure that the configuration variables for the GNU Java Compiler compiler
8455356f6debSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8456356f6debSmrg# to write the compiler configuration to `libtool'.
8457356f6debSmrgm4_defun([_LT_LANG_GCJ_CONFIG],
8458356f6debSmrg[AC_REQUIRE([LT_PROG_GCJ])dnl
8459356f6debSmrgAC_LANG_SAVE
84606f03b1f6Smrg
8461356f6debSmrg# Source file extension for Java test sources.
8462356f6debSmrgac_ext=java
84636f03b1f6Smrg
8464356f6debSmrg# Object file extension for compiled Java test sources.
8465356f6debSmrgobjext=o
8466356f6debSmrg_LT_TAGVAR(objext, $1)=$objext
84676f03b1f6Smrg
8468356f6debSmrg# Code to be used in simple compile tests
8469356f6debSmrglt_simple_compile_test_code="class foo {}"
84706f03b1f6Smrg
8471356f6debSmrg# Code to be used in simple link tests
8472356f6debSmrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
84736f03b1f6Smrg
8474356f6debSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8475356f6debSmrg_LT_TAG_COMPILER
8476356f6debSmrg
8477356f6debSmrg# save warnings/boilerplate of simple test code
8478356f6debSmrg_LT_COMPILER_BOILERPLATE
8479356f6debSmrg_LT_LINKER_BOILERPLATE
8480356f6debSmrg
8481356f6debSmrg# Allow CC to be a program name with arguments.
848242941e3bSmrglt_save_CC=$CC
848342941e3bSmrglt_save_CFLAGS=$CFLAGS
8484356f6debSmrglt_save_GCC=$GCC
8485356f6debSmrgGCC=yes
8486356f6debSmrgCC=${GCJ-"gcj"}
848742941e3bSmrgCFLAGS=$GCJFLAGS
8488356f6debSmrgcompiler=$CC
8489356f6debSmrg_LT_TAGVAR(compiler, $1)=$CC
8490356f6debSmrg_LT_TAGVAR(LD, $1)="$LD"
8491356f6debSmrg_LT_CC_BASENAME([$compiler])
8492356f6debSmrg
8493356f6debSmrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
8494356f6debSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
84956f03b1f6Smrg
8496356f6debSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
849742941e3bSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
849842941e3bSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
84996f03b1f6Smrg
8500356f6debSmrgif test -n "$compiler"; then
8501356f6debSmrg  _LT_COMPILER_NO_RTTI($1)
8502356f6debSmrg  _LT_COMPILER_PIC($1)
8503356f6debSmrg  _LT_COMPILER_C_O($1)
8504356f6debSmrg  _LT_COMPILER_FILE_LOCKS($1)
8505356f6debSmrg  _LT_LINKER_SHLIBS($1)
8506356f6debSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
85076f03b1f6Smrg
8508356f6debSmrg  _LT_CONFIG($1)
8509356f6debSmrgfi
85106f03b1f6Smrg
8511356f6debSmrgAC_LANG_RESTORE
85126f03b1f6Smrg
8513356f6debSmrgGCC=$lt_save_GCC
851442941e3bSmrgCC=$lt_save_CC
851542941e3bSmrgCFLAGS=$lt_save_CFLAGS
8516356f6debSmrg])# _LT_LANG_GCJ_CONFIG
85176f03b1f6Smrg
85186f03b1f6Smrg
851917caa701Smrg# _LT_LANG_GO_CONFIG([TAG])
852017caa701Smrg# --------------------------
852117caa701Smrg# Ensure that the configuration variables for the GNU Go compiler
852217caa701Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
852317caa701Smrg# to write the compiler configuration to `libtool'.
852417caa701Smrgm4_defun([_LT_LANG_GO_CONFIG],
852517caa701Smrg[AC_REQUIRE([LT_PROG_GO])dnl
852617caa701SmrgAC_LANG_SAVE
852717caa701Smrg
852817caa701Smrg# Source file extension for Go test sources.
852917caa701Smrgac_ext=go
853017caa701Smrg
853117caa701Smrg# Object file extension for compiled Go test sources.
853217caa701Smrgobjext=o
853317caa701Smrg_LT_TAGVAR(objext, $1)=$objext
853417caa701Smrg
853517caa701Smrg# Code to be used in simple compile tests
853617caa701Smrglt_simple_compile_test_code="package main; func main() { }"
853717caa701Smrg
853817caa701Smrg# Code to be used in simple link tests
853917caa701Smrglt_simple_link_test_code='package main; func main() { }'
854017caa701Smrg
854117caa701Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
854217caa701Smrg_LT_TAG_COMPILER
854317caa701Smrg
854417caa701Smrg# save warnings/boilerplate of simple test code
854517caa701Smrg_LT_COMPILER_BOILERPLATE
854617caa701Smrg_LT_LINKER_BOILERPLATE
854717caa701Smrg
854817caa701Smrg# Allow CC to be a program name with arguments.
854917caa701Smrglt_save_CC=$CC
855017caa701Smrglt_save_CFLAGS=$CFLAGS
855117caa701Smrglt_save_GCC=$GCC
855217caa701SmrgGCC=yes
855317caa701SmrgCC=${GOC-"gccgo"}
855417caa701SmrgCFLAGS=$GOFLAGS
855517caa701Smrgcompiler=$CC
855617caa701Smrg_LT_TAGVAR(compiler, $1)=$CC
855717caa701Smrg_LT_TAGVAR(LD, $1)="$LD"
855817caa701Smrg_LT_CC_BASENAME([$compiler])
855917caa701Smrg
856017caa701Smrg# Go did not exist at the time GCC didn't implicitly link libc in.
856117caa701Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
856217caa701Smrg
856317caa701Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
856417caa701Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
856517caa701Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
856617caa701Smrg
856717caa701Smrgif test -n "$compiler"; then
856817caa701Smrg  _LT_COMPILER_NO_RTTI($1)
856917caa701Smrg  _LT_COMPILER_PIC($1)
857017caa701Smrg  _LT_COMPILER_C_O($1)
857117caa701Smrg  _LT_COMPILER_FILE_LOCKS($1)
857217caa701Smrg  _LT_LINKER_SHLIBS($1)
857317caa701Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
857417caa701Smrg
857517caa701Smrg  _LT_CONFIG($1)
857617caa701Smrgfi
857717caa701Smrg
857817caa701SmrgAC_LANG_RESTORE
857917caa701Smrg
858017caa701SmrgGCC=$lt_save_GCC
858117caa701SmrgCC=$lt_save_CC
858217caa701SmrgCFLAGS=$lt_save_CFLAGS
858317caa701Smrg])# _LT_LANG_GO_CONFIG
858417caa701Smrg
858517caa701Smrg
8586356f6debSmrg# _LT_LANG_RC_CONFIG([TAG])
8587356f6debSmrg# -------------------------
8588356f6debSmrg# Ensure that the configuration variables for the Windows resource compiler
8589356f6debSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8590356f6debSmrg# to write the compiler configuration to `libtool'.
8591356f6debSmrgm4_defun([_LT_LANG_RC_CONFIG],
8592356f6debSmrg[AC_REQUIRE([LT_PROG_RC])dnl
8593356f6debSmrgAC_LANG_SAVE
85946f03b1f6Smrg
8595356f6debSmrg# Source file extension for RC test sources.
8596356f6debSmrgac_ext=rc
85976f03b1f6Smrg
8598356f6debSmrg# Object file extension for compiled RC test sources.
8599356f6debSmrgobjext=o
8600356f6debSmrg_LT_TAGVAR(objext, $1)=$objext
86016f03b1f6Smrg
8602356f6debSmrg# Code to be used in simple compile tests
8603356f6debSmrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
86046f03b1f6Smrg
8605356f6debSmrg# Code to be used in simple link tests
8606356f6debSmrglt_simple_link_test_code="$lt_simple_compile_test_code"
8607356f6debSmrg
8608356f6debSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8609356f6debSmrg_LT_TAG_COMPILER
8610356f6debSmrg
8611356f6debSmrg# save warnings/boilerplate of simple test code
8612356f6debSmrg_LT_COMPILER_BOILERPLATE
8613356f6debSmrg_LT_LINKER_BOILERPLATE
8614356f6debSmrg
8615356f6debSmrg# Allow CC to be a program name with arguments.
8616356f6debSmrglt_save_CC="$CC"
861742941e3bSmrglt_save_CFLAGS=$CFLAGS
8618356f6debSmrglt_save_GCC=$GCC
8619356f6debSmrgGCC=
8620356f6debSmrgCC=${RC-"windres"}
862142941e3bSmrgCFLAGS=
8622356f6debSmrgcompiler=$CC
8623356f6debSmrg_LT_TAGVAR(compiler, $1)=$CC
8624356f6debSmrg_LT_CC_BASENAME([$compiler])
8625356f6debSmrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8626356f6debSmrg
8627356f6debSmrgif test -n "$compiler"; then
8628356f6debSmrg  :
8629356f6debSmrg  _LT_CONFIG($1)
863098af18c5Smrgfi
86316f03b1f6Smrg
8632356f6debSmrgGCC=$lt_save_GCC
8633356f6debSmrgAC_LANG_RESTORE
863442941e3bSmrgCC=$lt_save_CC
863542941e3bSmrgCFLAGS=$lt_save_CFLAGS
8636356f6debSmrg])# _LT_LANG_RC_CONFIG
8637356f6debSmrg
8638356f6debSmrg
8639356f6debSmrg# LT_PROG_GCJ
8640356f6debSmrg# -----------
8641356f6debSmrgAC_DEFUN([LT_PROG_GCJ],
8642356f6debSmrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8643356f6debSmrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8644356f6debSmrg    [AC_CHECK_TOOL(GCJ, gcj,)
8645356f6debSmrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
8646356f6debSmrg      AC_SUBST(GCJFLAGS)])])[]dnl
864798af18c5Smrg])
86486f03b1f6Smrg
8649356f6debSmrg# Old name:
8650356f6debSmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
8651356f6debSmrgdnl aclocal-1.4 backwards compatibility:
8652356f6debSmrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
86536f03b1f6Smrg
86546f03b1f6Smrg
865517caa701Smrg# LT_PROG_GO
865617caa701Smrg# ----------
865717caa701SmrgAC_DEFUN([LT_PROG_GO],
865817caa701Smrg[AC_CHECK_TOOL(GOC, gccgo,)
865917caa701Smrg])
866017caa701Smrg
866117caa701Smrg
8662356f6debSmrg# LT_PROG_RC
8663356f6debSmrg# ----------
8664356f6debSmrgAC_DEFUN([LT_PROG_RC],
8665356f6debSmrg[AC_CHECK_TOOL(RC, windres,)
8666356f6debSmrg])
86676f03b1f6Smrg
8668356f6debSmrg# Old name:
8669356f6debSmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
8670356f6debSmrgdnl aclocal-1.4 backwards compatibility:
8671356f6debSmrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
86726f03b1f6Smrg
86736f03b1f6Smrg
8674356f6debSmrg# _LT_DECL_EGREP
8675356f6debSmrg# --------------
8676356f6debSmrg# If we don't have a new enough Autoconf to choose the best grep
8677356f6debSmrg# available, choose the one first in the user's PATH.
8678356f6debSmrgm4_defun([_LT_DECL_EGREP],
8679356f6debSmrg[AC_REQUIRE([AC_PROG_EGREP])dnl
8680356f6debSmrgAC_REQUIRE([AC_PROG_FGREP])dnl
8681356f6debSmrgtest -z "$GREP" && GREP=grep
8682356f6debSmrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8683356f6debSmrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
8684356f6debSmrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
8685356f6debSmrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8686356f6debSmrgAC_SUBST([GREP])
8687356f6debSmrg])
86886f03b1f6Smrg
86896f03b1f6Smrg
8690356f6debSmrg# _LT_DECL_OBJDUMP
8691356f6debSmrg# --------------
8692356f6debSmrg# If we don't have a new enough Autoconf to choose the best objdump
8693356f6debSmrg# available, choose the one first in the user's PATH.
8694356f6debSmrgm4_defun([_LT_DECL_OBJDUMP],
8695356f6debSmrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
8696356f6debSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
8697356f6debSmrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
8698356f6debSmrgAC_SUBST([OBJDUMP])
8699356f6debSmrg])
87006f03b1f6Smrg
870142941e3bSmrg# _LT_DECL_DLLTOOL
870242941e3bSmrg# ----------------
870342941e3bSmrg# Ensure DLLTOOL variable is set.
870442941e3bSmrgm4_defun([_LT_DECL_DLLTOOL],
870542941e3bSmrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
870642941e3bSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
870742941e3bSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
870842941e3bSmrgAC_SUBST([DLLTOOL])
870942941e3bSmrg])
87106f03b1f6Smrg
8711356f6debSmrg# _LT_DECL_SED
8712356f6debSmrg# ------------
8713356f6debSmrg# Check for a fully-functional sed program, that truncates
8714356f6debSmrg# as few characters as possible.  Prefer GNU sed if found.
8715356f6debSmrgm4_defun([_LT_DECL_SED],
8716356f6debSmrg[AC_PROG_SED
8717356f6debSmrgtest -z "$SED" && SED=sed
8718356f6debSmrgXsed="$SED -e 1s/^X//"
8719356f6debSmrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8720356f6debSmrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8721356f6debSmrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8722356f6debSmrg])# _LT_DECL_SED
8723356f6debSmrg
8724356f6debSmrgm4_ifndef([AC_PROG_SED], [
8725356f6debSmrg# NOTE: This macro has been submitted for inclusion into   #
8726356f6debSmrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
8727356f6debSmrg#  a released version of Autoconf we should remove this    #
8728356f6debSmrg#  macro and use it instead.                               #
8729356f6debSmrg
8730356f6debSmrgm4_defun([AC_PROG_SED],
8731356f6debSmrg[AC_MSG_CHECKING([for a sed that does not truncate output])
8732356f6debSmrgAC_CACHE_VAL(lt_cv_path_SED,
8733356f6debSmrg[# Loop through the user's path and test for sed and gsed.
8734356f6debSmrg# Then use that list of sed's as ones to test for truncation.
8735356f6debSmrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8736356f6debSmrgfor as_dir in $PATH
8737356f6debSmrgdo
8738356f6debSmrg  IFS=$as_save_IFS
8739356f6debSmrg  test -z "$as_dir" && as_dir=.
8740356f6debSmrg  for lt_ac_prog in sed gsed; do
8741356f6debSmrg    for ac_exec_ext in '' $ac_executable_extensions; do
8742356f6debSmrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8743356f6debSmrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
874498af18c5Smrg      fi
8745356f6debSmrg    done
8746356f6debSmrg  done
8747356f6debSmrgdone
8748356f6debSmrgIFS=$as_save_IFS
8749356f6debSmrglt_ac_max=0
8750356f6debSmrglt_ac_count=0
8751356f6debSmrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
8752356f6debSmrg# along with /bin/sed that truncates output.
8753356f6debSmrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8754356f6debSmrg  test ! -f $lt_ac_sed && continue
8755356f6debSmrg  cat /dev/null > conftest.in
8756356f6debSmrg  lt_ac_count=0
8757356f6debSmrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8758356f6debSmrg  # Check for GNU sed and select it if it is found.
8759356f6debSmrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8760356f6debSmrg    lt_cv_path_SED=$lt_ac_sed
8761356f6debSmrg    break
8762356f6debSmrg  fi
8763356f6debSmrg  while true; do
8764356f6debSmrg    cat conftest.in conftest.in >conftest.tmp
8765356f6debSmrg    mv conftest.tmp conftest.in
8766356f6debSmrg    cp conftest.in conftest.nl
8767356f6debSmrg    echo >>conftest.nl
8768356f6debSmrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8769356f6debSmrg    cmp -s conftest.out conftest.nl || break
8770356f6debSmrg    # 10000 chars as input seems more than enough
8771356f6debSmrg    test $lt_ac_count -gt 10 && break
8772356f6debSmrg    lt_ac_count=`expr $lt_ac_count + 1`
8773356f6debSmrg    if test $lt_ac_count -gt $lt_ac_max; then
8774356f6debSmrg      lt_ac_max=$lt_ac_count
8775356f6debSmrg      lt_cv_path_SED=$lt_ac_sed
8776356f6debSmrg    fi
8777356f6debSmrg  done
8778356f6debSmrgdone
8779356f6debSmrg])
8780356f6debSmrgSED=$lt_cv_path_SED
8781356f6debSmrgAC_SUBST([SED])
8782356f6debSmrgAC_MSG_RESULT([$SED])
8783356f6debSmrg])#AC_PROG_SED
8784356f6debSmrg])#m4_ifndef
8785356f6debSmrg
8786356f6debSmrg# Old name:
8787356f6debSmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
8788356f6debSmrgdnl aclocal-1.4 backwards compatibility:
8789356f6debSmrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
8790356f6debSmrg
8791356f6debSmrg
8792356f6debSmrg# _LT_CHECK_SHELL_FEATURES
8793356f6debSmrg# ------------------------
8794356f6debSmrg# Find out whether the shell is Bourne or XSI compatible,
8795356f6debSmrg# or has some other useful features.
8796356f6debSmrgm4_defun([_LT_CHECK_SHELL_FEATURES],
8797356f6debSmrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
8798356f6debSmrg# Try some XSI features
8799356f6debSmrgxsi_shell=no
8800356f6debSmrg( _lt_dummy="a/b/c"
880142941e3bSmrg  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
880242941e3bSmrg      = c,a/b,b/c, \
8803356f6debSmrg    && eval 'test $(( 1 + 1 )) -eq 2 \
8804356f6debSmrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
8805356f6debSmrg  && xsi_shell=yes
8806356f6debSmrgAC_MSG_RESULT([$xsi_shell])
8807356f6debSmrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
8808356f6debSmrg
8809356f6debSmrgAC_MSG_CHECKING([whether the shell understands "+="])
8810356f6debSmrglt_shell_append=no
8811356f6debSmrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
8812356f6debSmrg    >/dev/null 2>&1 \
8813356f6debSmrg  && lt_shell_append=yes
8814356f6debSmrgAC_MSG_RESULT([$lt_shell_append])
8815356f6debSmrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
8816356f6debSmrg
8817356f6debSmrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8818356f6debSmrg  lt_unset=unset
8819356f6debSmrgelse
8820356f6debSmrg  lt_unset=false
8821356f6debSmrgfi
8822356f6debSmrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8823356f6debSmrg
8824356f6debSmrg# test EBCDIC or ASCII
8825356f6debSmrgcase `echo X|tr X '\101'` in
8826356f6debSmrg A) # ASCII based system
8827356f6debSmrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8828356f6debSmrg  lt_SP2NL='tr \040 \012'
8829356f6debSmrg  lt_NL2SP='tr \015\012 \040\040'
8830356f6debSmrg  ;;
8831356f6debSmrg *) # EBCDIC based system
8832356f6debSmrg  lt_SP2NL='tr \100 \n'
8833356f6debSmrg  lt_NL2SP='tr \r\n \100\100'
8834356f6debSmrg  ;;
8835356f6debSmrgesac
8836356f6debSmrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8837356f6debSmrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8838356f6debSmrg])# _LT_CHECK_SHELL_FEATURES
88396f03b1f6Smrg
88406f03b1f6Smrg
884142941e3bSmrg# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
884242941e3bSmrg# ------------------------------------------------------
884342941e3bSmrg# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
884442941e3bSmrg# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
884542941e3bSmrgm4_defun([_LT_PROG_FUNCTION_REPLACE],
884642941e3bSmrg[dnl {
884742941e3bSmrgsed -e '/^$1 ()$/,/^} # $1 /c\
884842941e3bSmrg$1 ()\
884942941e3bSmrg{\
885042941e3bSmrgm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
885142941e3bSmrg} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
885242941e3bSmrg  && mv -f "$cfgfile.tmp" "$cfgfile" \
885342941e3bSmrg    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
885442941e3bSmrgtest 0 -eq $? || _lt_function_replace_fail=:
885542941e3bSmrg])
88566f03b1f6Smrg
88576f03b1f6Smrg
885842941e3bSmrg# _LT_PROG_REPLACE_SHELLFNS
885942941e3bSmrg# -------------------------
886042941e3bSmrg# Replace existing portable implementations of several shell functions with
886142941e3bSmrg# equivalent extended shell implementations where those features are available..
886242941e3bSmrgm4_defun([_LT_PROG_REPLACE_SHELLFNS],
886342941e3bSmrg[if test x"$xsi_shell" = xyes; then
886442941e3bSmrg  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
886542941e3bSmrg    case ${1} in
886642941e3bSmrg      */*) func_dirname_result="${1%/*}${2}" ;;
886742941e3bSmrg      *  ) func_dirname_result="${3}" ;;
886842941e3bSmrg    esac])
886942941e3bSmrg
887042941e3bSmrg  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
887142941e3bSmrg    func_basename_result="${1##*/}"])
887242941e3bSmrg
887342941e3bSmrg  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
887442941e3bSmrg    case ${1} in
887542941e3bSmrg      */*) func_dirname_result="${1%/*}${2}" ;;
887642941e3bSmrg      *  ) func_dirname_result="${3}" ;;
887742941e3bSmrg    esac
887842941e3bSmrg    func_basename_result="${1##*/}"])
88796f03b1f6Smrg
888042941e3bSmrg  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
888142941e3bSmrg    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
888242941e3bSmrg    # positional parameters, so assign one to ordinary parameter first.
888342941e3bSmrg    func_stripname_result=${3}
888442941e3bSmrg    func_stripname_result=${func_stripname_result#"${1}"}
888542941e3bSmrg    func_stripname_result=${func_stripname_result%"${2}"}])
88866f03b1f6Smrg
888742941e3bSmrg  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
888842941e3bSmrg    func_split_long_opt_name=${1%%=*}
888942941e3bSmrg    func_split_long_opt_arg=${1#*=}])
88906f03b1f6Smrg
889142941e3bSmrg  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
889242941e3bSmrg    func_split_short_opt_arg=${1#??}
889342941e3bSmrg    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
88946f03b1f6Smrg
889542941e3bSmrg  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
889642941e3bSmrg    case ${1} in
889742941e3bSmrg      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
889842941e3bSmrg      *)    func_lo2o_result=${1} ;;
889942941e3bSmrg    esac])
89006f03b1f6Smrg
890142941e3bSmrg  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
8902356f6debSmrg
890342941e3bSmrg  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
89046f03b1f6Smrg
890542941e3bSmrg  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
890642941e3bSmrgfi
89076f03b1f6Smrg
890842941e3bSmrgif test x"$lt_shell_append" = xyes; then
890942941e3bSmrg  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
89106f03b1f6Smrg
891142941e3bSmrg  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
891242941e3bSmrg    func_quote_for_eval "${2}"
891342941e3bSmrgdnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
891442941e3bSmrg    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
89156f03b1f6Smrg
891642941e3bSmrg  # Save a `func_append' function call where possible by direct use of '+='
891742941e3bSmrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
891842941e3bSmrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
891942941e3bSmrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
892042941e3bSmrg  test 0 -eq $? || _lt_function_replace_fail=:
892142941e3bSmrgelse
892242941e3bSmrg  # Save a `func_append' function call even when '+=' is not available
892342941e3bSmrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
892442941e3bSmrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
892542941e3bSmrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
892642941e3bSmrg  test 0 -eq $? || _lt_function_replace_fail=:
892742941e3bSmrgfi
89286f03b1f6Smrg
892942941e3bSmrgif test x"$_lt_function_replace_fail" = x":"; then
893042941e3bSmrg  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
893142941e3bSmrgfi
893242941e3bSmrg])
89336f03b1f6Smrg
893442941e3bSmrg# _LT_PATH_CONVERSION_FUNCTIONS
893542941e3bSmrg# -----------------------------
893642941e3bSmrg# Determine which file name conversion functions should be used by
893742941e3bSmrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
893842941e3bSmrg# for certain cross-compile configurations and native mingw.
893942941e3bSmrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
894042941e3bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
894142941e3bSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
894242941e3bSmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
894342941e3bSmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
894442941e3bSmrg[case $host in
894542941e3bSmrg  *-*-mingw* )
894642941e3bSmrg    case $build in
894742941e3bSmrg      *-*-mingw* ) # actually msys
894842941e3bSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
894942941e3bSmrg        ;;
895042941e3bSmrg      *-*-cygwin* )
895142941e3bSmrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
895242941e3bSmrg        ;;
895342941e3bSmrg      * ) # otherwise, assume *nix
895442941e3bSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
895542941e3bSmrg        ;;
895642941e3bSmrg    esac
8957356f6debSmrg    ;;
895842941e3bSmrg  *-*-cygwin* )
895942941e3bSmrg    case $build in
896042941e3bSmrg      *-*-mingw* ) # actually msys
896142941e3bSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
896242941e3bSmrg        ;;
896342941e3bSmrg      *-*-cygwin* )
896442941e3bSmrg        lt_cv_to_host_file_cmd=func_convert_file_noop
896542941e3bSmrg        ;;
896642941e3bSmrg      * ) # otherwise, assume *nix
896742941e3bSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
896842941e3bSmrg        ;;
896942941e3bSmrg    esac
8970356f6debSmrg    ;;
897142941e3bSmrg  * ) # unhandled hosts (and "normal" native builds)
897242941e3bSmrg    lt_cv_to_host_file_cmd=func_convert_file_noop
897342941e3bSmrg    ;;
897442941e3bSmrgesac
897542941e3bSmrg])
897642941e3bSmrgto_host_file_cmd=$lt_cv_to_host_file_cmd
897742941e3bSmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
897842941e3bSmrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
897942941e3bSmrg         [0], [convert $build file names to $host format])dnl
898042941e3bSmrg
898142941e3bSmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
898242941e3bSmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
898342941e3bSmrg[#assume ordinary cross tools, or native build.
898442941e3bSmrglt_cv_to_tool_file_cmd=func_convert_file_noop
898542941e3bSmrgcase $host in
898642941e3bSmrg  *-*-mingw* )
898742941e3bSmrg    case $build in
898842941e3bSmrg      *-*-mingw* ) # actually msys
898942941e3bSmrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
899042941e3bSmrg        ;;
899142941e3bSmrg    esac
899242941e3bSmrg    ;;
899342941e3bSmrgesac
8994356f6debSmrg])
899542941e3bSmrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
899642941e3bSmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
899742941e3bSmrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
899842941e3bSmrg         [0], [convert $build files to toolchain format])dnl
899942941e3bSmrg])# _LT_PATH_CONVERSION_FUNCTIONS
90006f03b1f6Smrg
9001356f6debSmrg# Helper functions for option handling.                    -*- Autoconf -*-
9002356f6debSmrg#
900342941e3bSmrg#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
900442941e3bSmrg#   Inc.
9005356f6debSmrg#   Written by Gary V. Vaughan, 2004
9006356f6debSmrg#
9007356f6debSmrg# This file is free software; the Free Software Foundation gives
9008356f6debSmrg# unlimited permission to copy and/or distribute it, with or without
9009356f6debSmrg# modifications, as long as this notice is preserved.
90106f03b1f6Smrg
901142941e3bSmrg# serial 7 ltoptions.m4
90126f03b1f6Smrg
9013356f6debSmrg# This is to help aclocal find these macros, as it can't see m4_define.
9014356f6debSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
9015356f6debSmrg
9016356f6debSmrg
9017356f6debSmrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
9018356f6debSmrg# ------------------------------------------
9019356f6debSmrgm4_define([_LT_MANGLE_OPTION],
9020356f6debSmrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
9021356f6debSmrg
9022356f6debSmrg
9023356f6debSmrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
9024356f6debSmrg# ---------------------------------------
9025356f6debSmrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
9026356f6debSmrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
9027356f6debSmrg# saved as a flag.
9028356f6debSmrgm4_define([_LT_SET_OPTION],
9029356f6debSmrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
9030356f6debSmrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
9031356f6debSmrg        _LT_MANGLE_DEFUN([$1], [$2]),
9032356f6debSmrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
9033356f6debSmrg])
9034356f6debSmrg
9035356f6debSmrg
9036356f6debSmrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
9037356f6debSmrg# ------------------------------------------------------------
9038356f6debSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
9039356f6debSmrgm4_define([_LT_IF_OPTION],
9040356f6debSmrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
9041356f6debSmrg
9042356f6debSmrg
9043356f6debSmrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
9044356f6debSmrg# -------------------------------------------------------
9045356f6debSmrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
9046356f6debSmrg# are set.
9047356f6debSmrgm4_define([_LT_UNLESS_OPTIONS],
9048356f6debSmrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9049356f6debSmrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
9050356f6debSmrg		      [m4_define([$0_found])])])[]dnl
9051356f6debSmrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
9052356f6debSmrg])[]dnl
9053356f6debSmrg])
90546f03b1f6Smrg
90556f03b1f6Smrg
9056356f6debSmrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
9057356f6debSmrg# ----------------------------------------
9058356f6debSmrg# OPTION-LIST is a space-separated list of Libtool options associated
9059356f6debSmrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
9060356f6debSmrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
9061356f6debSmrg# the unknown option and exit.
9062356f6debSmrgm4_defun([_LT_SET_OPTIONS],
9063356f6debSmrg[# Set options
9064356f6debSmrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
9065356f6debSmrg    [_LT_SET_OPTION([$1], _LT_Option)])
9066356f6debSmrg
9067356f6debSmrgm4_if([$1],[LT_INIT],[
9068356f6debSmrg  dnl
9069356f6debSmrg  dnl Simply set some default values (i.e off) if boolean options were not
9070356f6debSmrg  dnl specified:
9071356f6debSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
9072356f6debSmrg  ])
9073356f6debSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
9074356f6debSmrg  ])
9075356f6debSmrg  dnl
9076356f6debSmrg  dnl If no reference was made to various pairs of opposing options, then
9077356f6debSmrg  dnl we run the default mode handler for the pair.  For example, if neither
9078356f6debSmrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
9079356f6debSmrg  dnl archives by default:
9080356f6debSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
9081356f6debSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
9082356f6debSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
9083356f6debSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
9084356f6debSmrg  		   [_LT_ENABLE_FAST_INSTALL])
9085356f6debSmrg  ])
9086356f6debSmrg])# _LT_SET_OPTIONS
90876f03b1f6Smrg
908898af18c5Smrg
908998af18c5Smrg
9090356f6debSmrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
9091356f6debSmrg# -----------------------------------------
9092356f6debSmrgm4_define([_LT_MANGLE_DEFUN],
9093356f6debSmrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
90946f03b1f6Smrg
90956f03b1f6Smrg
9096356f6debSmrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
9097356f6debSmrg# -----------------------------------------------
9098356f6debSmrgm4_define([LT_OPTION_DEFINE],
9099356f6debSmrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
9100356f6debSmrg])# LT_OPTION_DEFINE
91016f03b1f6Smrg
91026f03b1f6Smrg
9103356f6debSmrg# dlopen
9104356f6debSmrg# ------
9105356f6debSmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
9106356f6debSmrg])
91076f03b1f6Smrg
9108356f6debSmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
9109356f6debSmrg[_LT_SET_OPTION([LT_INIT], [dlopen])
9110356f6debSmrgAC_DIAGNOSE([obsolete],
9111356f6debSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
9112356f6debSmrgput the `dlopen' option into LT_INIT's first parameter.])
9113356f6debSmrg])
91146f03b1f6Smrg
9115356f6debSmrgdnl aclocal-1.4 backwards compatibility:
9116356f6debSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
91176f03b1f6Smrg
91186f03b1f6Smrg
9119356f6debSmrg# win32-dll
9120356f6debSmrg# ---------
9121356f6debSmrg# Declare package support for building win32 dll's.
9122356f6debSmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
9123356f6debSmrg[enable_win32_dll=yes
91246f03b1f6Smrg
9125356f6debSmrgcase $host in
912642941e3bSmrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
9127356f6debSmrg  AC_CHECK_TOOL(AS, as, false)
9128356f6debSmrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
9129356f6debSmrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
9130356f6debSmrg  ;;
9131356f6debSmrgesac
91326f03b1f6Smrg
9133356f6debSmrgtest -z "$AS" && AS=as
913442941e3bSmrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
91356f03b1f6Smrg
9136356f6debSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
913742941e3bSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
91386f03b1f6Smrg
9139356f6debSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
914042941e3bSmrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
9141356f6debSmrg])# win32-dll
91426f03b1f6Smrg
9143356f6debSmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
9144356f6debSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
9145356f6debSmrg_LT_SET_OPTION([LT_INIT], [win32-dll])
9146356f6debSmrgAC_DIAGNOSE([obsolete],
9147356f6debSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
9148356f6debSmrgput the `win32-dll' option into LT_INIT's first parameter.])
9149356f6debSmrg])
91506f03b1f6Smrg
9151356f6debSmrgdnl aclocal-1.4 backwards compatibility:
9152356f6debSmrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
915398af18c5Smrg
91546f03b1f6Smrg
9155356f6debSmrg# _LT_ENABLE_SHARED([DEFAULT])
9156356f6debSmrg# ----------------------------
9157356f6debSmrg# implement the --enable-shared flag, and supports the `shared' and
9158356f6debSmrg# `disable-shared' LT_INIT options.
9159356f6debSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9160356f6debSmrgm4_define([_LT_ENABLE_SHARED],
9161356f6debSmrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
9162356f6debSmrgAC_ARG_ENABLE([shared],
9163356f6debSmrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
9164356f6debSmrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
9165356f6debSmrg    [p=${PACKAGE-default}
9166356f6debSmrg    case $enableval in
9167356f6debSmrg    yes) enable_shared=yes ;;
9168356f6debSmrg    no) enable_shared=no ;;
9169356f6debSmrg    *)
9170356f6debSmrg      enable_shared=no
9171356f6debSmrg      # Look at the argument we got.  We use all the common list separators.
9172356f6debSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9173356f6debSmrg      for pkg in $enableval; do
9174356f6debSmrg	IFS="$lt_save_ifs"
9175356f6debSmrg	if test "X$pkg" = "X$p"; then
9176356f6debSmrg	  enable_shared=yes
9177356f6debSmrg	fi
9178356f6debSmrg      done
9179356f6debSmrg      IFS="$lt_save_ifs"
918098af18c5Smrg      ;;
9181356f6debSmrg    esac],
9182356f6debSmrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
91836f03b1f6Smrg
9184356f6debSmrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
9185356f6debSmrg	[Whether or not to build shared libraries])
9186356f6debSmrg])# _LT_ENABLE_SHARED
91876f03b1f6Smrg
9188356f6debSmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
9189356f6debSmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
91906f03b1f6Smrg
9191356f6debSmrg# Old names:
9192356f6debSmrgAC_DEFUN([AC_ENABLE_SHARED],
9193356f6debSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
9194356f6debSmrg])
91956f03b1f6Smrg
9196356f6debSmrgAC_DEFUN([AC_DISABLE_SHARED],
9197356f6debSmrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
9198356f6debSmrg])
91996f03b1f6Smrg
9200356f6debSmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
9201356f6debSmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
9202356f6debSmrg
9203356f6debSmrgdnl aclocal-1.4 backwards compatibility:
9204356f6debSmrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
9205356f6debSmrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
92066f03b1f6Smrg
92076f03b1f6Smrg
92086f03b1f6Smrg
9209356f6debSmrg# _LT_ENABLE_STATIC([DEFAULT])
9210356f6debSmrg# ----------------------------
9211356f6debSmrg# implement the --enable-static flag, and support the `static' and
9212356f6debSmrg# `disable-static' LT_INIT options.
9213356f6debSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9214356f6debSmrgm4_define([_LT_ENABLE_STATIC],
9215356f6debSmrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
9216356f6debSmrgAC_ARG_ENABLE([static],
9217356f6debSmrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
9218356f6debSmrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
9219356f6debSmrg    [p=${PACKAGE-default}
9220356f6debSmrg    case $enableval in
9221356f6debSmrg    yes) enable_static=yes ;;
9222356f6debSmrg    no) enable_static=no ;;
922398af18c5Smrg    *)
9224356f6debSmrg     enable_static=no
9225356f6debSmrg      # Look at the argument we got.  We use all the common list separators.
9226356f6debSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9227356f6debSmrg      for pkg in $enableval; do
9228356f6debSmrg	IFS="$lt_save_ifs"
9229356f6debSmrg	if test "X$pkg" = "X$p"; then
9230356f6debSmrg	  enable_static=yes
9231356f6debSmrg	fi
9232356f6debSmrg      done
9233356f6debSmrg      IFS="$lt_save_ifs"
923498af18c5Smrg      ;;
9235356f6debSmrg    esac],
9236356f6debSmrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
92376f03b1f6Smrg
9238356f6debSmrg    _LT_DECL([build_old_libs], [enable_static], [0],
9239356f6debSmrg	[Whether or not to build static libraries])
9240356f6debSmrg])# _LT_ENABLE_STATIC
92416f03b1f6Smrg
9242356f6debSmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
9243356f6debSmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
92446f03b1f6Smrg
9245356f6debSmrg# Old names:
9246356f6debSmrgAC_DEFUN([AC_ENABLE_STATIC],
9247356f6debSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
9248356f6debSmrg])
92496f03b1f6Smrg
9250356f6debSmrgAC_DEFUN([AC_DISABLE_STATIC],
9251356f6debSmrg[_LT_SET_OPTION([LT_INIT], [disable-static])
9252356f6debSmrg])
9253356f6debSmrg
9254356f6debSmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
9255356f6debSmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
9256356f6debSmrg
9257356f6debSmrgdnl aclocal-1.4 backwards compatibility:
9258356f6debSmrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
9259356f6debSmrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
92606f03b1f6Smrg
92616f03b1f6Smrg
92626f03b1f6Smrg
9263356f6debSmrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
9264356f6debSmrg# ----------------------------------
9265356f6debSmrg# implement the --enable-fast-install flag, and support the `fast-install'
9266356f6debSmrg# and `disable-fast-install' LT_INIT options.
9267356f6debSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
9268356f6debSmrgm4_define([_LT_ENABLE_FAST_INSTALL],
9269356f6debSmrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
9270356f6debSmrgAC_ARG_ENABLE([fast-install],
9271356f6debSmrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
9272356f6debSmrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
9273356f6debSmrg    [p=${PACKAGE-default}
9274356f6debSmrg    case $enableval in
9275356f6debSmrg    yes) enable_fast_install=yes ;;
9276356f6debSmrg    no) enable_fast_install=no ;;
9277356f6debSmrg    *)
9278356f6debSmrg      enable_fast_install=no
9279356f6debSmrg      # Look at the argument we got.  We use all the common list separators.
9280356f6debSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
9281356f6debSmrg      for pkg in $enableval; do
9282356f6debSmrg	IFS="$lt_save_ifs"
9283356f6debSmrg	if test "X$pkg" = "X$p"; then
9284356f6debSmrg	  enable_fast_install=yes
9285356f6debSmrg	fi
9286356f6debSmrg      done
9287356f6debSmrg      IFS="$lt_save_ifs"
9288356f6debSmrg      ;;
9289356f6debSmrg    esac],
9290356f6debSmrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
9291356f6debSmrg
9292356f6debSmrg_LT_DECL([fast_install], [enable_fast_install], [0],
9293356f6debSmrg	 [Whether or not to optimize for fast installation])dnl
9294356f6debSmrg])# _LT_ENABLE_FAST_INSTALL
9295356f6debSmrg
9296356f6debSmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
9297356f6debSmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
92986f03b1f6Smrg
9299356f6debSmrg# Old names:
9300356f6debSmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
9301356f6debSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
9302356f6debSmrgAC_DIAGNOSE([obsolete],
9303356f6debSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
9304356f6debSmrgthe `fast-install' option into LT_INIT's first parameter.])
93056f03b1f6Smrg])
93066f03b1f6Smrg
9307356f6debSmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
9308356f6debSmrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
9309356f6debSmrgAC_DIAGNOSE([obsolete],
9310356f6debSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
9311356f6debSmrgthe `disable-fast-install' option into LT_INIT's first parameter.])
931298af18c5Smrg])
93136f03b1f6Smrg
9314356f6debSmrgdnl aclocal-1.4 backwards compatibility:
9315356f6debSmrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
9316356f6debSmrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
93176f03b1f6Smrg
93186f03b1f6Smrg
9319356f6debSmrg# _LT_WITH_PIC([MODE])
9320356f6debSmrg# --------------------
9321356f6debSmrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
9322356f6debSmrg# LT_INIT options.
9323356f6debSmrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
9324356f6debSmrgm4_define([_LT_WITH_PIC],
9325356f6debSmrg[AC_ARG_WITH([pic],
932617caa701Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
9327356f6debSmrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
932817caa701Smrg    [lt_p=${PACKAGE-default}
932917caa701Smrg    case $withval in
933017caa701Smrg    yes|no) pic_mode=$withval ;;
933117caa701Smrg    *)
933217caa701Smrg      pic_mode=default
933317caa701Smrg      # Look at the argument we got.  We use all the common list separators.
933417caa701Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
933517caa701Smrg      for lt_pkg in $withval; do
933617caa701Smrg	IFS="$lt_save_ifs"
933717caa701Smrg	if test "X$lt_pkg" = "X$lt_p"; then
933817caa701Smrg	  pic_mode=yes
933917caa701Smrg	fi
934017caa701Smrg      done
934117caa701Smrg      IFS="$lt_save_ifs"
934217caa701Smrg      ;;
934317caa701Smrg    esac],
9344356f6debSmrg    [pic_mode=default])
93456f03b1f6Smrg
9346356f6debSmrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
934798af18c5Smrg
9348356f6debSmrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
9349356f6debSmrg])# _LT_WITH_PIC
9350356f6debSmrg
935142941e3bSmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
935242941e3bSmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
935342941e3bSmrg
935442941e3bSmrg# Old name:
935542941e3bSmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
935642941e3bSmrg[_LT_SET_OPTION([LT_INIT], [pic-only])
935742941e3bSmrgAC_DIAGNOSE([obsolete],
935842941e3bSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
935942941e3bSmrgput the `pic-only' option into LT_INIT's first parameter.])
936042941e3bSmrg])
936142941e3bSmrg
936242941e3bSmrgdnl aclocal-1.4 backwards compatibility:
936342941e3bSmrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
936442941e3bSmrg
936542941e3bSmrg
936642941e3bSmrgm4_define([_LTDL_MODE], [])
936742941e3bSmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
936842941e3bSmrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
936942941e3bSmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
937042941e3bSmrg		 [m4_define([_LTDL_MODE], [recursive])])
937142941e3bSmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
937242941e3bSmrg		 [m4_define([_LTDL_MODE], [subproject])])
937342941e3bSmrg
937442941e3bSmrgm4_define([_LTDL_TYPE], [])
937542941e3bSmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
937642941e3bSmrg		 [m4_define([_LTDL_TYPE], [installable])])
937742941e3bSmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
937842941e3bSmrg		 [m4_define([_LTDL_TYPE], [convenience])])
937942941e3bSmrg
938042941e3bSmrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
938142941e3bSmrg#
938242941e3bSmrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
938342941e3bSmrg# Written by Gary V. Vaughan, 2004
938442941e3bSmrg#
938542941e3bSmrg# This file is free software; the Free Software Foundation gives
938642941e3bSmrg# unlimited permission to copy and/or distribute it, with or without
938742941e3bSmrg# modifications, as long as this notice is preserved.
938842941e3bSmrg
938942941e3bSmrg# serial 6 ltsugar.m4
939042941e3bSmrg
939142941e3bSmrg# This is to help aclocal find these macros, as it can't see m4_define.
939242941e3bSmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
939342941e3bSmrg
939442941e3bSmrg
939542941e3bSmrg# lt_join(SEP, ARG1, [ARG2...])
939642941e3bSmrg# -----------------------------
939742941e3bSmrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
939842941e3bSmrg# associated separator.
939942941e3bSmrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
940042941e3bSmrg# versions in m4sugar had bugs.
940142941e3bSmrgm4_define([lt_join],
940242941e3bSmrg[m4_if([$#], [1], [],
940342941e3bSmrg       [$#], [2], [[$2]],
940442941e3bSmrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
940542941e3bSmrgm4_define([_lt_join],
940642941e3bSmrg[m4_if([$#$2], [2], [],
940742941e3bSmrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
940842941e3bSmrg
940942941e3bSmrg
941042941e3bSmrg# lt_car(LIST)
941142941e3bSmrg# lt_cdr(LIST)
941242941e3bSmrg# ------------
941342941e3bSmrg# Manipulate m4 lists.
941442941e3bSmrg# These macros are necessary as long as will still need to support
941542941e3bSmrg# Autoconf-2.59 which quotes differently.
941642941e3bSmrgm4_define([lt_car], [[$1]])
941742941e3bSmrgm4_define([lt_cdr],
941842941e3bSmrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
941942941e3bSmrg       [$#], 1, [],
942042941e3bSmrg       [m4_dquote(m4_shift($@))])])
942142941e3bSmrgm4_define([lt_unquote], $1)
942242941e3bSmrg
942342941e3bSmrg
942442941e3bSmrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
942542941e3bSmrg# ------------------------------------------
942642941e3bSmrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
942742941e3bSmrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
942842941e3bSmrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
942942941e3bSmrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
943042941e3bSmrg# than defined and empty).
943142941e3bSmrg#
943242941e3bSmrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
943342941e3bSmrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
943442941e3bSmrgm4_define([lt_append],
943542941e3bSmrg[m4_define([$1],
943642941e3bSmrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
943742941e3bSmrg
943842941e3bSmrg
943942941e3bSmrg
944042941e3bSmrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
944142941e3bSmrg# ----------------------------------------------------------
944242941e3bSmrg# Produce a SEP delimited list of all paired combinations of elements of
944342941e3bSmrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
944442941e3bSmrg# has the form PREFIXmINFIXSUFFIXn.
944542941e3bSmrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
944642941e3bSmrgm4_define([lt_combine],
944742941e3bSmrg[m4_if(m4_eval([$# > 3]), [1],
944842941e3bSmrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
944942941e3bSmrg[[m4_foreach([_Lt_prefix], [$2],
945042941e3bSmrg	     [m4_foreach([_Lt_suffix],
945142941e3bSmrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
945242941e3bSmrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
945342941e3bSmrg
945442941e3bSmrg
945542941e3bSmrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
945642941e3bSmrg# -----------------------------------------------------------------------
945742941e3bSmrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
945842941e3bSmrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
945942941e3bSmrgm4_define([lt_if_append_uniq],
946042941e3bSmrg[m4_ifdef([$1],
946142941e3bSmrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
946242941e3bSmrg		 [lt_append([$1], [$2], [$3])$4],
946342941e3bSmrg		 [$5])],
946442941e3bSmrg	  [lt_append([$1], [$2], [$3])$4])])
946542941e3bSmrg
946642941e3bSmrg
946742941e3bSmrg# lt_dict_add(DICT, KEY, VALUE)
946842941e3bSmrg# -----------------------------
946942941e3bSmrgm4_define([lt_dict_add],
947042941e3bSmrg[m4_define([$1($2)], [$3])])
947142941e3bSmrg
947242941e3bSmrg
947342941e3bSmrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
947442941e3bSmrg# --------------------------------------------
947542941e3bSmrgm4_define([lt_dict_add_subkey],
947642941e3bSmrg[m4_define([$1($2:$3)], [$4])])
947742941e3bSmrg
947842941e3bSmrg
947942941e3bSmrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
948042941e3bSmrg# ----------------------------------
948142941e3bSmrgm4_define([lt_dict_fetch],
948242941e3bSmrg[m4_ifval([$3],
948342941e3bSmrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
948442941e3bSmrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
948542941e3bSmrg
948642941e3bSmrg
948742941e3bSmrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
948842941e3bSmrg# -----------------------------------------------------------------
948942941e3bSmrgm4_define([lt_if_dict_fetch],
949042941e3bSmrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
949142941e3bSmrg	[$5],
949242941e3bSmrg    [$6])])
949342941e3bSmrg
949442941e3bSmrg
949542941e3bSmrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
949642941e3bSmrg# --------------------------------------------------------------
949742941e3bSmrgm4_define([lt_dict_filter],
949842941e3bSmrg[m4_if([$5], [], [],
949942941e3bSmrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
950042941e3bSmrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
950142941e3bSmrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
950242941e3bSmrg])
950342941e3bSmrg
950442941e3bSmrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
950542941e3bSmrg#
950642941e3bSmrg#   Copyright (C) 2004 Free Software Foundation, Inc.
950742941e3bSmrg#   Written by Scott James Remnant, 2004
950842941e3bSmrg#
950942941e3bSmrg# This file is free software; the Free Software Foundation gives
951042941e3bSmrg# unlimited permission to copy and/or distribute it, with or without
951142941e3bSmrg# modifications, as long as this notice is preserved.
951242941e3bSmrg
951342941e3bSmrg# @configure_input@
951442941e3bSmrg
951517caa701Smrg# serial 3337 ltversion.m4
951642941e3bSmrg# This file is part of GNU Libtool
951742941e3bSmrg
951817caa701Smrgm4_define([LT_PACKAGE_VERSION], [2.4.2])
951917caa701Smrgm4_define([LT_PACKAGE_REVISION], [1.3337])
952042941e3bSmrg
952142941e3bSmrgAC_DEFUN([LTVERSION_VERSION],
952217caa701Smrg[macro_version='2.4.2'
952317caa701Smrgmacro_revision='1.3337'
952442941e3bSmrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
952542941e3bSmrg_LT_DECL(, macro_revision, 0)
952642941e3bSmrg])
952742941e3bSmrg
952842941e3bSmrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
952942941e3bSmrg#
953042941e3bSmrg#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
953142941e3bSmrg#   Written by Scott James Remnant, 2004.
953242941e3bSmrg#
953342941e3bSmrg# This file is free software; the Free Software Foundation gives
953442941e3bSmrg# unlimited permission to copy and/or distribute it, with or without
953542941e3bSmrg# modifications, as long as this notice is preserved.
953642941e3bSmrg
953742941e3bSmrg# serial 5 lt~obsolete.m4
953842941e3bSmrg
953942941e3bSmrg# These exist entirely to fool aclocal when bootstrapping libtool.
954042941e3bSmrg#
954142941e3bSmrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
954242941e3bSmrg# which have later been changed to m4_define as they aren't part of the
954342941e3bSmrg# exported API, or moved to Autoconf or Automake where they belong.
954442941e3bSmrg#
954542941e3bSmrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
954642941e3bSmrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
954742941e3bSmrg# using a macro with the same name in our local m4/libtool.m4 it'll
954842941e3bSmrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
954942941e3bSmrg# and doesn't know about Autoconf macros at all.)
955042941e3bSmrg#
955142941e3bSmrg# So we provide this file, which has a silly filename so it's always
955242941e3bSmrg# included after everything else.  This provides aclocal with the
955342941e3bSmrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
955442941e3bSmrg# because those macros already exist, or will be overwritten later.
955542941e3bSmrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
955642941e3bSmrg#
955742941e3bSmrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
955842941e3bSmrg# Yes, that means every name once taken will need to remain here until
955942941e3bSmrg# we give up compatibility with versions before 1.7, at which point
956042941e3bSmrg# we need to keep only those names which we still refer to.
956142941e3bSmrg
956242941e3bSmrg# This is to help aclocal find these macros, as it can't see m4_define.
956342941e3bSmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
956442941e3bSmrg
956542941e3bSmrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
956642941e3bSmrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
956742941e3bSmrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
956842941e3bSmrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
956942941e3bSmrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
957042941e3bSmrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
957142941e3bSmrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
957242941e3bSmrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
957342941e3bSmrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
957442941e3bSmrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
957542941e3bSmrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
957642941e3bSmrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
957742941e3bSmrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
957842941e3bSmrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
957942941e3bSmrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
958042941e3bSmrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
958142941e3bSmrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
958242941e3bSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
958342941e3bSmrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
958442941e3bSmrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
958542941e3bSmrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
958642941e3bSmrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
958742941e3bSmrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
958842941e3bSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
958942941e3bSmrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
959042941e3bSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
959142941e3bSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
959242941e3bSmrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
959342941e3bSmrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
959442941e3bSmrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
959542941e3bSmrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
959642941e3bSmrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
959742941e3bSmrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
959842941e3bSmrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
959942941e3bSmrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
960042941e3bSmrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
960142941e3bSmrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
960242941e3bSmrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
960342941e3bSmrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
960442941e3bSmrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
960542941e3bSmrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
960642941e3bSmrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
960742941e3bSmrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
960842941e3bSmrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
960942941e3bSmrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
961042941e3bSmrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
961142941e3bSmrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
961242941e3bSmrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
961342941e3bSmrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
961442941e3bSmrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
961542941e3bSmrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
961642941e3bSmrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
961742941e3bSmrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
961842941e3bSmrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
961942941e3bSmrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
962042941e3bSmrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
962142941e3bSmrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
962242941e3bSmrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
962342941e3bSmrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
962442941e3bSmrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
962542941e3bSmrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
962642941e3bSmrg
962717caa701Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
962817caa701Smrg# 
962917caa701Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
963017caa701Smrg#
963117caa701Smrg# This program is free software; you can redistribute it and/or modify
963217caa701Smrg# it under the terms of the GNU General Public License as published by
963317caa701Smrg# the Free Software Foundation; either version 2 of the License, or
963417caa701Smrg# (at your option) any later version.
963517caa701Smrg#
963617caa701Smrg# This program is distributed in the hope that it will be useful, but
963717caa701Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
963817caa701Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
963917caa701Smrg# General Public License for more details.
964017caa701Smrg#
964117caa701Smrg# You should have received a copy of the GNU General Public License
964217caa701Smrg# along with this program; if not, write to the Free Software
964317caa701Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
964417caa701Smrg#
964517caa701Smrg# As a special exception to the GNU General Public License, if you
964617caa701Smrg# distribute this file as part of a program that contains a
964717caa701Smrg# configuration script generated by Autoconf, you may include it under
964817caa701Smrg# the same distribution terms that you use for the rest of that program.
964917caa701Smrg
965017caa701Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
965117caa701Smrg# ----------------------------------
965217caa701SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
965317caa701Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
965417caa701Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
965517caa701SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
965617caa701Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
965717caa701Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
965817caa701Smrgfi
965917caa701Smrgif test -n "$PKG_CONFIG"; then
966017caa701Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
966117caa701Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
966217caa701Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
966317caa701Smrg		AC_MSG_RESULT([yes])
966417caa701Smrg	else
966517caa701Smrg		AC_MSG_RESULT([no])
966617caa701Smrg		PKG_CONFIG=""
966717caa701Smrg	fi
966817caa701Smrg		
966917caa701Smrgfi[]dnl
967017caa701Smrg])# PKG_PROG_PKG_CONFIG
967117caa701Smrg
967217caa701Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
967317caa701Smrg#
967417caa701Smrg# Check to see whether a particular set of modules exists.  Similar
967517caa701Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
967617caa701Smrg#
967717caa701Smrg#
967817caa701Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
967917caa701Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
968017caa701Smrg# PKG_CHECK_EXISTS manually
968117caa701Smrg# --------------------------------------------------------------
968217caa701SmrgAC_DEFUN([PKG_CHECK_EXISTS],
968317caa701Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
968417caa701Smrgif test -n "$PKG_CONFIG" && \
968517caa701Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
968617caa701Smrg  m4_ifval([$2], [$2], [:])
968717caa701Smrgm4_ifvaln([$3], [else
968817caa701Smrg  $3])dnl
968917caa701Smrgfi])
969017caa701Smrg
969117caa701Smrg
969217caa701Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
969317caa701Smrg# ---------------------------------------------
969417caa701Smrgm4_define([_PKG_CONFIG],
969517caa701Smrg[if test -n "$$1"; then
969617caa701Smrg    pkg_cv_[]$1="$$1"
969717caa701Smrg elif test -n "$PKG_CONFIG"; then
969817caa701Smrg    PKG_CHECK_EXISTS([$3],
969917caa701Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
970017caa701Smrg		     [pkg_failed=yes])
970117caa701Smrg else
970217caa701Smrg    pkg_failed=untried
970317caa701Smrgfi[]dnl
970417caa701Smrg])# _PKG_CONFIG
970517caa701Smrg
970617caa701Smrg# _PKG_SHORT_ERRORS_SUPPORTED
970717caa701Smrg# -----------------------------
970817caa701SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
970917caa701Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
971017caa701Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
971117caa701Smrg        _pkg_short_errors_supported=yes
971217caa701Smrgelse
971317caa701Smrg        _pkg_short_errors_supported=no
971417caa701Smrgfi[]dnl
971517caa701Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
971617caa701Smrg
971717caa701Smrg
971817caa701Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
971917caa701Smrg# [ACTION-IF-NOT-FOUND])
972017caa701Smrg#
972117caa701Smrg#
972217caa701Smrg# Note that if there is a possibility the first call to
972317caa701Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
972417caa701Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
972517caa701Smrg#
972617caa701Smrg#
972717caa701Smrg# --------------------------------------------------------------
972817caa701SmrgAC_DEFUN([PKG_CHECK_MODULES],
972917caa701Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
973017caa701SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
973117caa701SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
973217caa701Smrg
973317caa701Smrgpkg_failed=no
973417caa701SmrgAC_MSG_CHECKING([for $1])
973517caa701Smrg
973617caa701Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
973717caa701Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
973817caa701Smrg
973917caa701Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
974017caa701Smrgand $1[]_LIBS to avoid the need to call pkg-config.
974117caa701SmrgSee the pkg-config man page for more details.])
974217caa701Smrg
974317caa701Smrgif test $pkg_failed = yes; then
974417caa701Smrg        _PKG_SHORT_ERRORS_SUPPORTED
974517caa701Smrg        if test $_pkg_short_errors_supported = yes; then
974617caa701Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
974717caa701Smrg        else 
974817caa701Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
974917caa701Smrg        fi
975017caa701Smrg	# Put the nasty error message in config.log where it belongs
975117caa701Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
975217caa701Smrg
975317caa701Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
975417caa701Smrg[Package requirements ($2) were not met:
975517caa701Smrg
975617caa701Smrg$$1_PKG_ERRORS
975717caa701Smrg
975817caa701SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
975917caa701Smrginstalled software in a non-standard prefix.
976017caa701Smrg
976117caa701Smrg_PKG_TEXT
976217caa701Smrg])],
976317caa701Smrg		[AC_MSG_RESULT([no])
976417caa701Smrg                $4])
976517caa701Smrgelif test $pkg_failed = untried; then
976617caa701Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
976717caa701Smrg[The pkg-config script could not be found or is too old.  Make sure it
976817caa701Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
976917caa701Smrgpath to pkg-config.
977017caa701Smrg
977117caa701Smrg_PKG_TEXT
977217caa701Smrg
977317caa701SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
977417caa701Smrg		[$4])
977517caa701Smrgelse
977617caa701Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
977717caa701Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
977817caa701Smrg        AC_MSG_RESULT([yes])
977917caa701Smrg	ifelse([$3], , :, [$3])
978017caa701Smrgfi[]dnl
978117caa701Smrg])# PKG_CHECK_MODULES
978217caa701Smrg
978342941e3bSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
978442941e3bSmrgdnl
978542941e3bSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
978642941e3bSmrgdnl 
978742941e3bSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
978842941e3bSmrgdnl copy of this software and associated documentation files (the "Software"),
978942941e3bSmrgdnl to deal in the Software without restriction, including without limitation
979042941e3bSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
979142941e3bSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
979242941e3bSmrgdnl Software is furnished to do so, subject to the following conditions:
979342941e3bSmrgdnl
979442941e3bSmrgdnl The above copyright notice and this permission notice (including the next
979542941e3bSmrgdnl paragraph) shall be included in all copies or substantial portions of the
979642941e3bSmrgdnl Software.
979742941e3bSmrgdnl
979842941e3bSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
979942941e3bSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
980042941e3bSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
980142941e3bSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
980242941e3bSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
980342941e3bSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
980442941e3bSmrgdnl DEALINGS IN THE SOFTWARE.
980542941e3bSmrg
980642941e3bSmrg# XORG_MACROS_VERSION(required-version)
980742941e3bSmrg# -------------------------------------
980842941e3bSmrg# Minimum version: 1.1.0
980942941e3bSmrg#
981042941e3bSmrg# If you're using a macro added in Version 1.1 or newer, include this in
981142941e3bSmrg# your configure.ac with the minimum required version, such as:
981242941e3bSmrg# XORG_MACROS_VERSION(1.1)
981342941e3bSmrg#
981442941e3bSmrg# To ensure that this macro is defined, also add:
981542941e3bSmrg# m4_ifndef([XORG_MACROS_VERSION],
981642941e3bSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
981742941e3bSmrg#
981842941e3bSmrg#
981942941e3bSmrg# See the "minimum version" comment for each macro you use to see what 
982042941e3bSmrg# version you require.
982142941e3bSmrgm4_defun([XORG_MACROS_VERSION],[
982217caa701Smrgm4_define([vers_have], [1.17])
982342941e3bSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
982442941e3bSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
982542941e3bSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
982642941e3bSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
982742941e3bSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
982842941e3bSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
982942941e3bSmrgm4_undefine([vers_have])
983042941e3bSmrgm4_undefine([maj_have])
983142941e3bSmrgm4_undefine([maj_needed])
983242941e3bSmrg]) # XORG_MACROS_VERSION
983342941e3bSmrg
983442941e3bSmrg# XORG_PROG_RAWCPP()
983542941e3bSmrg# ------------------
983642941e3bSmrg# Minimum version: 1.0.0
983742941e3bSmrg#
983842941e3bSmrg# Find cpp program and necessary flags for use in pre-processing text files
983942941e3bSmrg# such as man pages and config files
984042941e3bSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
984142941e3bSmrgAC_REQUIRE([AC_PROG_CPP])
984242941e3bSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
984342941e3bSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
984442941e3bSmrg
984542941e3bSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
984642941e3bSmrg# which is not the best choice for supporting other OS'es, but covers most
984742941e3bSmrg# of the ones we need for now.
984842941e3bSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
984942941e3bSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
985042941e3bSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
985142941e3bSmrg	AC_MSG_RESULT([no])
985242941e3bSmrgelse
985342941e3bSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
985442941e3bSmrg		RAWCPPFLAGS=-undef
985542941e3bSmrg		AC_MSG_RESULT([yes])
985642941e3bSmrg	# under Cygwin unix is still defined even with -undef
985742941e3bSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
985842941e3bSmrg		RAWCPPFLAGS="-undef -ansi"
985942941e3bSmrg		AC_MSG_RESULT([yes, with -ansi])
986042941e3bSmrg	else
986142941e3bSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
986242941e3bSmrg	fi
986342941e3bSmrgfi
986442941e3bSmrgrm -f conftest.$ac_ext
986542941e3bSmrg
986642941e3bSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
986742941e3bSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
986842941e3bSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
986942941e3bSmrg	AC_MSG_RESULT([no])
987042941e3bSmrgelse
987142941e3bSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
987242941e3bSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
987342941e3bSmrg		AC_MSG_RESULT([yes])
987442941e3bSmrg	else
987542941e3bSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
987642941e3bSmrg	fi
987742941e3bSmrgfi
987842941e3bSmrgrm -f conftest.$ac_ext
987942941e3bSmrgAC_SUBST(RAWCPPFLAGS)
988042941e3bSmrg]) # XORG_PROG_RAWCPP
988142941e3bSmrg
988242941e3bSmrg# XORG_MANPAGE_SECTIONS()
988342941e3bSmrg# -----------------------
988442941e3bSmrg# Minimum version: 1.0.0
988542941e3bSmrg#
988642941e3bSmrg# Determine which sections man pages go in for the different man page types
988742941e3bSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
988842941e3bSmrg# Not sure if there's any better way than just hardcoding by OS name.
988942941e3bSmrg# Override default settings by setting environment variables
989042941e3bSmrg# Added MAN_SUBSTS in version 1.8
989142941e3bSmrg# Added AC_PROG_SED in version 1.8
989242941e3bSmrg
989342941e3bSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
989442941e3bSmrgAC_REQUIRE([AC_CANONICAL_HOST])
989542941e3bSmrgAC_REQUIRE([AC_PROG_SED])
989642941e3bSmrg
989742941e3bSmrgif test x$APP_MAN_SUFFIX = x    ; then
989842941e3bSmrg    APP_MAN_SUFFIX=1
989942941e3bSmrgfi
990042941e3bSmrgif test x$APP_MAN_DIR = x    ; then
990142941e3bSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
990242941e3bSmrgfi
990342941e3bSmrg
990442941e3bSmrgif test x$LIB_MAN_SUFFIX = x    ; then
990542941e3bSmrg    LIB_MAN_SUFFIX=3
990642941e3bSmrgfi
990742941e3bSmrgif test x$LIB_MAN_DIR = x    ; then
990842941e3bSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
990942941e3bSmrgfi
991042941e3bSmrg
991142941e3bSmrgif test x$FILE_MAN_SUFFIX = x    ; then
991242941e3bSmrg    case $host_os in
991342941e3bSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
991442941e3bSmrg	*)		FILE_MAN_SUFFIX=5  ;;
991542941e3bSmrg    esac
991642941e3bSmrgfi
991742941e3bSmrgif test x$FILE_MAN_DIR = x    ; then
991842941e3bSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
991942941e3bSmrgfi
992042941e3bSmrg
992142941e3bSmrgif test x$MISC_MAN_SUFFIX = x    ; then
992242941e3bSmrg    case $host_os in
992342941e3bSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
992442941e3bSmrg	*)		MISC_MAN_SUFFIX=7  ;;
992542941e3bSmrg    esac
992642941e3bSmrgfi
992742941e3bSmrgif test x$MISC_MAN_DIR = x    ; then
992842941e3bSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
992942941e3bSmrgfi
993042941e3bSmrg
993142941e3bSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
993242941e3bSmrg    case $host_os in
993342941e3bSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
993442941e3bSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
993542941e3bSmrg    esac
993642941e3bSmrgfi
993742941e3bSmrgif test x$DRIVER_MAN_DIR = x    ; then
993842941e3bSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
993942941e3bSmrgfi
994042941e3bSmrg
994142941e3bSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
994242941e3bSmrg    case $host_os in
994342941e3bSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
994442941e3bSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
994542941e3bSmrg    esac
994642941e3bSmrgfi
994742941e3bSmrgif test x$ADMIN_MAN_DIR = x    ; then
994842941e3bSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
994942941e3bSmrgfi
995042941e3bSmrg
995142941e3bSmrg
995242941e3bSmrgAC_SUBST([APP_MAN_SUFFIX])
995342941e3bSmrgAC_SUBST([LIB_MAN_SUFFIX])
995442941e3bSmrgAC_SUBST([FILE_MAN_SUFFIX])
995542941e3bSmrgAC_SUBST([MISC_MAN_SUFFIX])
995642941e3bSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
995742941e3bSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
995842941e3bSmrgAC_SUBST([APP_MAN_DIR])
995942941e3bSmrgAC_SUBST([LIB_MAN_DIR])
996042941e3bSmrgAC_SUBST([FILE_MAN_DIR])
996142941e3bSmrgAC_SUBST([MISC_MAN_DIR])
996242941e3bSmrgAC_SUBST([DRIVER_MAN_DIR])
996342941e3bSmrgAC_SUBST([ADMIN_MAN_DIR])
996442941e3bSmrg
996542941e3bSmrgXORG_MAN_PAGE="X Version 11"
996642941e3bSmrgAC_SUBST([XORG_MAN_PAGE])
996742941e3bSmrgMAN_SUBSTS="\
996842941e3bSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
996942941e3bSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
997042941e3bSmrg	-e 's|__xservername__|Xorg|g' \
997142941e3bSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
997242941e3bSmrg	-e 's|__projectroot__|\$(prefix)|g' \
997342941e3bSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
997442941e3bSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
997542941e3bSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
997642941e3bSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
997742941e3bSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
997842941e3bSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
997942941e3bSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
998042941e3bSmrgAC_SUBST([MAN_SUBSTS])
998142941e3bSmrg
998242941e3bSmrg]) # XORG_MANPAGE_SECTIONS
998342941e3bSmrg
998442941e3bSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
998542941e3bSmrg# ------------------------
998642941e3bSmrg# Minimum version: 1.7.0
998742941e3bSmrg#
998842941e3bSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
998942941e3bSmrg# provided by xorg-sgml-doctools, if installed.
999042941e3bSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
999142941e3bSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
999242941e3bSmrgXORG_SGML_PATH=
999342941e3bSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
999442941e3bSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
999542941e3bSmrg    [m4_ifval([$1],[:],
999642941e3bSmrg        [if test x"$cross_compiling" != x"yes" ; then
999742941e3bSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
999842941e3bSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
999942941e3bSmrg         fi])
1000042941e3bSmrg    ])
1000142941e3bSmrg
1000242941e3bSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
1000342941e3bSmrg# the path and the name of the doc stylesheet
1000442941e3bSmrgif test "x$XORG_SGML_PATH" != "x" ; then
1000542941e3bSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
1000642941e3bSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
1000742941e3bSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1000842941e3bSmrgelse
1000942941e3bSmrg   AC_MSG_RESULT([no])
1001042941e3bSmrgfi
1001142941e3bSmrg
1001242941e3bSmrgAC_SUBST(XORG_SGML_PATH)
1001342941e3bSmrgAC_SUBST(STYLESHEET_SRCDIR)
1001442941e3bSmrgAC_SUBST(XSL_STYLESHEET)
1001542941e3bSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
1001642941e3bSmrg]) # XORG_CHECK_SGML_DOCTOOLS
1001742941e3bSmrg
1001842941e3bSmrg# XORG_CHECK_LINUXDOC
1001942941e3bSmrg# -------------------
1002042941e3bSmrg# Minimum version: 1.0.0
1002142941e3bSmrg#
1002242941e3bSmrg# Defines the variable MAKE_TEXT if the necessary tools and
1002342941e3bSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1002442941e3bSmrg# Whether or not the necessary tools and files are found can be checked
1002542941e3bSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1002642941e3bSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1002742941e3bSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1002842941e3bSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
1002942941e3bSmrg
1003042941e3bSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1003142941e3bSmrg
1003242941e3bSmrgAC_MSG_CHECKING([whether to build documentation])
1003342941e3bSmrg
1003442941e3bSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
1003542941e3bSmrg   BUILDDOC=yes
1003642941e3bSmrgelse
1003742941e3bSmrg   BUILDDOC=no
1003842941e3bSmrgfi
1003942941e3bSmrg
1004042941e3bSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
1004142941e3bSmrg
1004242941e3bSmrgAC_MSG_RESULT([$BUILDDOC])
1004342941e3bSmrg
1004442941e3bSmrgAC_MSG_CHECKING([whether to build pdf documentation])
1004542941e3bSmrg
1004642941e3bSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
1004742941e3bSmrg   BUILDPDFDOC=yes
1004842941e3bSmrgelse
1004942941e3bSmrg   BUILDPDFDOC=no
1005042941e3bSmrgfi
1005142941e3bSmrg
1005242941e3bSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1005342941e3bSmrg
1005442941e3bSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1005542941e3bSmrg
1005642941e3bSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1005742941e3bSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1005842941e3bSmrgMAKE_PDF="$PS2PDF"
1005942941e3bSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1006042941e3bSmrg
1006142941e3bSmrgAC_SUBST(MAKE_TEXT)
1006242941e3bSmrgAC_SUBST(MAKE_PS)
1006342941e3bSmrgAC_SUBST(MAKE_PDF)
1006442941e3bSmrgAC_SUBST(MAKE_HTML)
1006542941e3bSmrg]) # XORG_CHECK_LINUXDOC
1006642941e3bSmrg
1006742941e3bSmrg# XORG_CHECK_DOCBOOK
1006842941e3bSmrg# -------------------
1006942941e3bSmrg# Minimum version: 1.0.0
1007042941e3bSmrg#
1007142941e3bSmrg# Checks for the ability to build output formats from SGML DocBook source.
1007242941e3bSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1007342941e3bSmrg# indicates whether the necessary tools and files are found and, if set,
1007442941e3bSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1007542941e3bSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1007642941e3bSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1007742941e3bSmrg
1007842941e3bSmrgBUILDTXTDOC=no
1007942941e3bSmrgBUILDPDFDOC=no
1008042941e3bSmrgBUILDPSDOC=no
1008142941e3bSmrgBUILDHTMLDOC=no
1008242941e3bSmrg
1008342941e3bSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1008442941e3bSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1008542941e3bSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1008642941e3bSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1008742941e3bSmrg
1008842941e3bSmrgAC_MSG_CHECKING([whether to build text documentation])
1008942941e3bSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1009042941e3bSmrg   test x$BUILD_TXTDOC != xno; then
1009142941e3bSmrg	BUILDTXTDOC=yes
1009242941e3bSmrgfi
1009342941e3bSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1009442941e3bSmrgAC_MSG_RESULT([$BUILDTXTDOC])
1009542941e3bSmrg
1009642941e3bSmrgAC_MSG_CHECKING([whether to build PDF documentation])
1009742941e3bSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1009842941e3bSmrg   test x$BUILD_PDFDOC != xno; then
1009942941e3bSmrg	BUILDPDFDOC=yes
1010042941e3bSmrgfi
1010142941e3bSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1010242941e3bSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1010342941e3bSmrg
1010442941e3bSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
1010542941e3bSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1010642941e3bSmrg   test x$BUILD_PSDOC != xno; then
1010742941e3bSmrg	BUILDPSDOC=yes
1010842941e3bSmrgfi
1010942941e3bSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1011042941e3bSmrgAC_MSG_RESULT([$BUILDPSDOC])
1011142941e3bSmrg
1011242941e3bSmrgAC_MSG_CHECKING([whether to build HTML documentation])
1011342941e3bSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1011442941e3bSmrg   test x$BUILD_HTMLDOC != xno; then
1011542941e3bSmrg	BUILDHTMLDOC=yes
1011642941e3bSmrgfi
1011742941e3bSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1011842941e3bSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1011942941e3bSmrg
1012042941e3bSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1012142941e3bSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1012242941e3bSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1012342941e3bSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1012442941e3bSmrg
1012542941e3bSmrgAC_SUBST(MAKE_TEXT)
1012642941e3bSmrgAC_SUBST(MAKE_PS)
1012742941e3bSmrgAC_SUBST(MAKE_PDF)
1012842941e3bSmrgAC_SUBST(MAKE_HTML)
1012942941e3bSmrg]) # XORG_CHECK_DOCBOOK
1013042941e3bSmrg
1013142941e3bSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
1013242941e3bSmrg# ----------------
1013342941e3bSmrg# Minimum version: 1.5.0
1013442941e3bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1013542941e3bSmrg#
1013642941e3bSmrg# Documentation tools are not always available on all platforms and sometimes
1013742941e3bSmrg# not at the appropriate level. This macro enables a module to test for the
1013842941e3bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1013942941e3bSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
1014042941e3bSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
1014142941e3bSmrg# --with-xmlto assumes 'auto'.
1014242941e3bSmrg#
1014342941e3bSmrg# Interface to module:
1014442941e3bSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
1014542941e3bSmrg# XMLTO:	returns the path of the xmlto program found
1014642941e3bSmrg#		returns the path set by the user in the environment
1014742941e3bSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
1014842941e3bSmrg#		'no' user instructs the module not to use xmlto
1014942941e3bSmrg#
1015042941e3bSmrg# Added in version 1.10.0
1015142941e3bSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
1015242941e3bSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
1015342941e3bSmrg#
1015442941e3bSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
1015542941e3bSmrg#
1015642941e3bSmrgAC_DEFUN([XORG_WITH_XMLTO],[
1015742941e3bSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
1015842941e3bSmrgm4_define([_defopt], m4_default([$2], [auto]))
1015942941e3bSmrgAC_ARG_WITH(xmlto,
1016042941e3bSmrg	AS_HELP_STRING([--with-xmlto],
1016142941e3bSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
1016242941e3bSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
1016342941e3bSmrgm4_undefine([_defopt])
1016442941e3bSmrg
1016542941e3bSmrgif test "x$use_xmlto" = x"auto"; then
1016642941e3bSmrg   AC_PATH_PROG([XMLTO], [xmlto])
1016742941e3bSmrg   if test "x$XMLTO" = "x"; then
1016842941e3bSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
1016942941e3bSmrg	have_xmlto=no
1017042941e3bSmrg   else
1017142941e3bSmrg        have_xmlto=yes
1017242941e3bSmrg   fi
1017342941e3bSmrgelif test "x$use_xmlto" = x"yes" ; then
1017442941e3bSmrg   AC_PATH_PROG([XMLTO], [xmlto])
1017542941e3bSmrg   if test "x$XMLTO" = "x"; then
1017642941e3bSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
1017742941e3bSmrg   fi
1017842941e3bSmrg   have_xmlto=yes
1017942941e3bSmrgelif test "x$use_xmlto" = x"no" ; then
1018042941e3bSmrg   if test "x$XMLTO" != "x"; then
1018142941e3bSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
1018242941e3bSmrg   fi
1018342941e3bSmrg   have_xmlto=no
1018442941e3bSmrgelse
1018542941e3bSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
1018642941e3bSmrgfi
1018742941e3bSmrg
1018842941e3bSmrg# Test for a minimum version of xmlto, if provided.
1018942941e3bSmrgm4_ifval([$1],
1019042941e3bSmrg[if test "$have_xmlto" = yes; then
1019142941e3bSmrg    # scrape the xmlto version
1019242941e3bSmrg    AC_MSG_CHECKING([the xmlto version])
1019342941e3bSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
1019442941e3bSmrg    AC_MSG_RESULT([$xmlto_version])
1019542941e3bSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
1019642941e3bSmrg        [if test "x$use_xmlto" = xauto; then
1019742941e3bSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
1019842941e3bSmrg            have_xmlto=no
1019942941e3bSmrg        else
1020042941e3bSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
1020142941e3bSmrg        fi])
1020242941e3bSmrgfi])
1020342941e3bSmrg
1020442941e3bSmrg# Test for the ability of xmlto to generate a text target
1020542941e3bSmrghave_xmlto_text=no
1020642941e3bSmrgcat > conftest.xml << "EOF"
1020742941e3bSmrgEOF
1020842941e3bSmrgAS_IF([test "$have_xmlto" = yes],
1020942941e3bSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1021042941e3bSmrg             [have_xmlto_text=yes],
1021142941e3bSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
1021242941e3bSmrgrm -f conftest.xml
1021342941e3bSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
1021442941e3bSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
1021542941e3bSmrg]) # XORG_WITH_XMLTO
1021642941e3bSmrg
1021742941e3bSmrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
1021842941e3bSmrg# --------------------------------------------
1021942941e3bSmrg# Minimum version: 1.12.0
1022042941e3bSmrg# Minimum version for optional DEFAULT argument: 1.12.0
1022142941e3bSmrg#
1022242941e3bSmrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
1022342941e3bSmrg# XML-based language used for the transformation of XML documents.
1022442941e3bSmrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
1022542941e3bSmrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
1022642941e3bSmrg# The XSLT processor is often used as a standalone tool for transformations.
1022742941e3bSmrg# It should not be assumed that this tool is used only to work with documnetation.
1022842941e3bSmrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
1022942941e3bSmrg#
1023042941e3bSmrg# Interface to module:
1023142941e3bSmrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
1023242941e3bSmrg# XSLTPROC:	 returns the path of the xsltproc program found
1023342941e3bSmrg#		 returns the path set by the user in the environment
1023442941e3bSmrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
1023542941e3bSmrg#		  'no' user instructs the module not to use xsltproc
1023642941e3bSmrg# have_xsltproc: returns yes if xsltproc found in PATH or no
1023742941e3bSmrg#
1023842941e3bSmrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
1023942941e3bSmrg#
1024042941e3bSmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
1024142941e3bSmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
1024242941e3bSmrg# Preserves the interface, should it be implemented later
1024342941e3bSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
1024442941e3bSmrgm4_define([_defopt], m4_default([$2], [auto]))
1024542941e3bSmrgAC_ARG_WITH(xsltproc,
1024642941e3bSmrg	AS_HELP_STRING([--with-xsltproc],
1024742941e3bSmrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
1024842941e3bSmrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
1024942941e3bSmrgm4_undefine([_defopt])
1025042941e3bSmrg
1025142941e3bSmrgif test "x$use_xsltproc" = x"auto"; then
1025242941e3bSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
1025342941e3bSmrg   if test "x$XSLTPROC" = "x"; then
1025442941e3bSmrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
1025542941e3bSmrg	have_xsltproc=no
1025642941e3bSmrg   else
1025742941e3bSmrg        have_xsltproc=yes
1025842941e3bSmrg   fi
1025942941e3bSmrgelif test "x$use_xsltproc" = x"yes" ; then
1026042941e3bSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
1026142941e3bSmrg   if test "x$XSLTPROC" = "x"; then
1026242941e3bSmrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
1026342941e3bSmrg   fi
1026442941e3bSmrg   have_xsltproc=yes
1026542941e3bSmrgelif test "x$use_xsltproc" = x"no" ; then
1026642941e3bSmrg   if test "x$XSLTPROC" != "x"; then
1026742941e3bSmrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
1026842941e3bSmrg   fi
1026942941e3bSmrg   have_xsltproc=no
1027042941e3bSmrgelse
1027142941e3bSmrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
1027242941e3bSmrgfi
1027342941e3bSmrg
1027442941e3bSmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
1027542941e3bSmrg]) # XORG_WITH_XSLTPROC
1027642941e3bSmrg
1027742941e3bSmrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
1027842941e3bSmrg# ----------------------------------------
1027942941e3bSmrg# Minimum version: 1.15.0
1028042941e3bSmrg#
1028142941e3bSmrg# PERL (Practical Extraction and Report Language) is a language optimized for
1028242941e3bSmrg# scanning arbitrary text files, extracting information from those text files,
1028342941e3bSmrg# and printing reports based on that information.
1028442941e3bSmrg#
1028542941e3bSmrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
1028642941e3bSmrg#
1028742941e3bSmrg# Interface to module:
1028842941e3bSmrg# HAVE_PERL: used in makefiles to conditionally scan text files
1028942941e3bSmrg# PERL:	     returns the path of the perl program found
1029042941e3bSmrg#	     returns the path set by the user in the environment
1029142941e3bSmrg# --with-perl: 'yes' user instructs the module to use perl
1029242941e3bSmrg#	       'no' user instructs the module not to use perl
1029342941e3bSmrg# have_perl: returns yes if perl found in PATH or no
1029442941e3bSmrg#
1029542941e3bSmrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
1029642941e3bSmrg#
1029742941e3bSmrgAC_DEFUN([XORG_WITH_PERL],[
1029842941e3bSmrgAC_ARG_VAR([PERL], [Path to perl command])
1029942941e3bSmrg# Preserves the interface, should it be implemented later
1030042941e3bSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
1030142941e3bSmrgm4_define([_defopt], m4_default([$2], [auto]))
1030242941e3bSmrgAC_ARG_WITH(perl,
1030342941e3bSmrg	AS_HELP_STRING([--with-perl],
1030442941e3bSmrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
1030542941e3bSmrg	   [use_perl=$withval], [use_perl=]_defopt)
1030642941e3bSmrgm4_undefine([_defopt])
1030742941e3bSmrg
1030842941e3bSmrgif test "x$use_perl" = x"auto"; then
1030942941e3bSmrg   AC_PATH_PROG([PERL], [perl])
1031042941e3bSmrg   if test "x$PERL" = "x"; then
1031142941e3bSmrg        AC_MSG_WARN([perl not found - cannot extract information and report])
1031242941e3bSmrg	have_perl=no
1031342941e3bSmrg   else
1031442941e3bSmrg        have_perl=yes
1031542941e3bSmrg   fi
1031642941e3bSmrgelif test "x$use_perl" = x"yes" ; then
1031742941e3bSmrg   AC_PATH_PROG([PERL], [perl])
1031842941e3bSmrg   if test "x$PERL" = "x"; then
1031942941e3bSmrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
1032042941e3bSmrg   fi
1032142941e3bSmrg   have_perl=yes
1032242941e3bSmrgelif test "x$use_perl" = x"no" ; then
1032342941e3bSmrg   if test "x$PERL" != "x"; then
1032442941e3bSmrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
1032542941e3bSmrg   fi
1032642941e3bSmrg   have_perl=no
1032742941e3bSmrgelse
1032842941e3bSmrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
1032942941e3bSmrgfi
1033042941e3bSmrg
1033142941e3bSmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
1033242941e3bSmrg]) # XORG_WITH_PERL
1033342941e3bSmrg
1033442941e3bSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
1033542941e3bSmrg# ----------------
1033642941e3bSmrg# Minimum version: 1.5.0
1033742941e3bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1033842941e3bSmrg#
1033942941e3bSmrg# Documentation tools are not always available on all platforms and sometimes
1034042941e3bSmrg# not at the appropriate level. This macro enables a module to test for the
1034142941e3bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1034242941e3bSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
1034342941e3bSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
1034442941e3bSmrg# --with-asciidoc assumes 'auto'.
1034542941e3bSmrg#
1034642941e3bSmrg# Interface to module:
1034742941e3bSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
1034842941e3bSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
1034942941e3bSmrg#		 returns the path set by the user in the environment
1035042941e3bSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
1035142941e3bSmrg#		  'no' user instructs the module not to use asciidoc
1035242941e3bSmrg#
1035342941e3bSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
1035442941e3bSmrg#
1035542941e3bSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
1035642941e3bSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
1035742941e3bSmrgm4_define([_defopt], m4_default([$2], [auto]))
1035842941e3bSmrgAC_ARG_WITH(asciidoc,
1035942941e3bSmrg	AS_HELP_STRING([--with-asciidoc],
1036042941e3bSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
1036142941e3bSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
1036242941e3bSmrgm4_undefine([_defopt])
1036342941e3bSmrg
1036442941e3bSmrgif test "x$use_asciidoc" = x"auto"; then
1036542941e3bSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1036642941e3bSmrg   if test "x$ASCIIDOC" = "x"; then
1036742941e3bSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
1036842941e3bSmrg	have_asciidoc=no
1036942941e3bSmrg   else
1037042941e3bSmrg        have_asciidoc=yes
1037142941e3bSmrg   fi
1037242941e3bSmrgelif test "x$use_asciidoc" = x"yes" ; then
1037342941e3bSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1037442941e3bSmrg   if test "x$ASCIIDOC" = "x"; then
1037542941e3bSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
1037642941e3bSmrg   fi
1037742941e3bSmrg   have_asciidoc=yes
1037842941e3bSmrgelif test "x$use_asciidoc" = x"no" ; then
1037942941e3bSmrg   if test "x$ASCIIDOC" != "x"; then
1038042941e3bSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
1038142941e3bSmrg   fi
1038242941e3bSmrg   have_asciidoc=no
1038342941e3bSmrgelse
1038442941e3bSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
1038542941e3bSmrgfi
1038642941e3bSmrgm4_ifval([$1],
1038742941e3bSmrg[if test "$have_asciidoc" = yes; then
1038842941e3bSmrg    # scrape the asciidoc version
1038942941e3bSmrg    AC_MSG_CHECKING([the asciidoc version])
1039042941e3bSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
1039142941e3bSmrg    AC_MSG_RESULT([$asciidoc_version])
1039242941e3bSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
1039342941e3bSmrg        [if test "x$use_asciidoc" = xauto; then
1039442941e3bSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
1039542941e3bSmrg            have_asciidoc=no
1039642941e3bSmrg        else
1039742941e3bSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
1039842941e3bSmrg        fi])
1039942941e3bSmrgfi])
1040042941e3bSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
1040142941e3bSmrg]) # XORG_WITH_ASCIIDOC
1040242941e3bSmrg
1040342941e3bSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
1040442941e3bSmrg# --------------------------------
1040542941e3bSmrg# Minimum version: 1.5.0
1040642941e3bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1040742941e3bSmrg#
1040842941e3bSmrg# Documentation tools are not always available on all platforms and sometimes
1040942941e3bSmrg# not at the appropriate level. This macro enables a module to test for the
1041042941e3bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1041142941e3bSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
1041242941e3bSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
1041342941e3bSmrg# --with-doxygen assumes 'auto'.
1041442941e3bSmrg#
1041542941e3bSmrg# Interface to module:
1041642941e3bSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
1041742941e3bSmrg# DOXYGEN:	 returns the path of the doxygen program found
1041842941e3bSmrg#		 returns the path set by the user in the environment
1041942941e3bSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
1042042941e3bSmrg#		  'no' user instructs the module not to use doxygen
1042142941e3bSmrg#
1042242941e3bSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
1042342941e3bSmrg#
1042442941e3bSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
1042542941e3bSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
1042642941e3bSmrgm4_define([_defopt], m4_default([$2], [auto]))
1042742941e3bSmrgAC_ARG_WITH(doxygen,
1042842941e3bSmrg	AS_HELP_STRING([--with-doxygen],
1042942941e3bSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
1043042941e3bSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
1043142941e3bSmrgm4_undefine([_defopt])
1043242941e3bSmrg
1043342941e3bSmrgif test "x$use_doxygen" = x"auto"; then
1043442941e3bSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1043542941e3bSmrg   if test "x$DOXYGEN" = "x"; then
1043642941e3bSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
1043742941e3bSmrg	have_doxygen=no
1043842941e3bSmrg   else
1043942941e3bSmrg        have_doxygen=yes
1044042941e3bSmrg   fi
1044142941e3bSmrgelif test "x$use_doxygen" = x"yes" ; then
1044242941e3bSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1044342941e3bSmrg   if test "x$DOXYGEN" = "x"; then
1044442941e3bSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
1044542941e3bSmrg   fi
1044642941e3bSmrg   have_doxygen=yes
1044742941e3bSmrgelif test "x$use_doxygen" = x"no" ; then
1044842941e3bSmrg   if test "x$DOXYGEN" != "x"; then
1044942941e3bSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
1045042941e3bSmrg   fi
1045142941e3bSmrg   have_doxygen=no
1045242941e3bSmrgelse
1045342941e3bSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
1045442941e3bSmrgfi
1045542941e3bSmrgm4_ifval([$1],
1045642941e3bSmrg[if test "$have_doxygen" = yes; then
1045742941e3bSmrg    # scrape the doxygen version
1045842941e3bSmrg    AC_MSG_CHECKING([the doxygen version])
1045942941e3bSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
1046042941e3bSmrg    AC_MSG_RESULT([$doxygen_version])
1046142941e3bSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
1046242941e3bSmrg        [if test "x$use_doxygen" = xauto; then
1046342941e3bSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
1046442941e3bSmrg            have_doxygen=no
1046542941e3bSmrg        else
1046642941e3bSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
1046742941e3bSmrg        fi])
1046842941e3bSmrgfi])
1046942941e3bSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
1047042941e3bSmrg]) # XORG_WITH_DOXYGEN
1047142941e3bSmrg
1047242941e3bSmrg# XORG_WITH_GROFF([DEFAULT])
1047342941e3bSmrg# ----------------
1047442941e3bSmrg# Minimum version: 1.6.0
1047542941e3bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1047642941e3bSmrg#
1047742941e3bSmrg# Documentation tools are not always available on all platforms and sometimes
1047842941e3bSmrg# not at the appropriate level. This macro enables a module to test for the
1047942941e3bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1048042941e3bSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
1048142941e3bSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
1048242941e3bSmrg# --with-groff assumes 'auto'.
1048342941e3bSmrg#
1048442941e3bSmrg# Interface to module:
1048542941e3bSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
1048642941e3bSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
1048742941e3bSmrg# HAVE_GROFF_MS: the -ms macros package
1048842941e3bSmrg# GROFF:	 returns the path of the groff program found
1048942941e3bSmrg#		 returns the path set by the user in the environment
1049042941e3bSmrg# --with-groff:	 'yes' user instructs the module to use groff
1049142941e3bSmrg#		 'no' user instructs the module not to use groff
1049242941e3bSmrg#
1049342941e3bSmrg# Added in version 1.9.0:
1049442941e3bSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
1049542941e3bSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
1049642941e3bSmrg#		   psselect from the psutils package.
1049742941e3bSmrg#		   the ghostcript package. Refer to the grohtml man pages
1049842941e3bSmrg#
1049942941e3bSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
1050042941e3bSmrg#
1050142941e3bSmrg# OS and distros often splits groff in a basic and full package, the former
1050242941e3bSmrg# having the groff program and the later having devices, fonts and macros
1050342941e3bSmrg# Checking for the groff executable is not enough.
1050442941e3bSmrg#
1050542941e3bSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
1050642941e3bSmrg# unset HAVE_GROFF or GROFF env variables.
1050742941e3bSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
1050842941e3bSmrg#
1050942941e3bSmrgAC_DEFUN([XORG_WITH_GROFF],[
1051042941e3bSmrgAC_ARG_VAR([GROFF], [Path to groff command])
1051142941e3bSmrgm4_define([_defopt], m4_default([$1], [auto]))
1051242941e3bSmrgAC_ARG_WITH(groff,
1051342941e3bSmrg	AS_HELP_STRING([--with-groff],
1051442941e3bSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
1051542941e3bSmrg	   [use_groff=$withval], [use_groff=]_defopt)
1051642941e3bSmrgm4_undefine([_defopt])
1051742941e3bSmrg
1051842941e3bSmrgif test "x$use_groff" = x"auto"; then
1051942941e3bSmrg   AC_PATH_PROG([GROFF], [groff])
1052042941e3bSmrg   if test "x$GROFF" = "x"; then
1052142941e3bSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
1052242941e3bSmrg	have_groff=no
1052342941e3bSmrg   else
1052442941e3bSmrg        have_groff=yes
1052542941e3bSmrg   fi
1052642941e3bSmrgelif test "x$use_groff" = x"yes" ; then
1052742941e3bSmrg   AC_PATH_PROG([GROFF], [groff])
1052842941e3bSmrg   if test "x$GROFF" = "x"; then
1052942941e3bSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
1053042941e3bSmrg   fi
1053142941e3bSmrg   have_groff=yes
1053242941e3bSmrgelif test "x$use_groff" = x"no" ; then
1053342941e3bSmrg   if test "x$GROFF" != "x"; then
1053442941e3bSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
1053542941e3bSmrg   fi
1053642941e3bSmrg   have_groff=no
1053742941e3bSmrgelse
1053842941e3bSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
1053942941e3bSmrgfi
1054042941e3bSmrg
1054142941e3bSmrg# We have groff, test for the presence of the macro packages
1054242941e3bSmrgif test "x$have_groff" = x"yes"; then
1054342941e3bSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
1054442941e3bSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
1054542941e3bSmrg        groff_ms_works=yes
1054642941e3bSmrg    else
1054742941e3bSmrg        groff_ms_works=no
1054842941e3bSmrg    fi
1054942941e3bSmrg    AC_MSG_RESULT([$groff_ms_works])
1055042941e3bSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
1055142941e3bSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
1055242941e3bSmrg        groff_mm_works=yes
1055342941e3bSmrg    else
1055442941e3bSmrg        groff_mm_works=no
1055542941e3bSmrg    fi
1055642941e3bSmrg    AC_MSG_RESULT([$groff_mm_works])
1055742941e3bSmrgfi
1055842941e3bSmrg
1055942941e3bSmrg# We have groff, test for HTML dependencies, one command per package
1056042941e3bSmrgif test "x$have_groff" = x"yes"; then
1056142941e3bSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
1056242941e3bSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
1056342941e3bSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
1056442941e3bSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
1056542941e3bSmrg      have_groff_html=yes
1056642941e3bSmrg   else
1056742941e3bSmrg      have_groff_html=no
1056842941e3bSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
1056942941e3bSmrg   fi
1057042941e3bSmrgfi
1057142941e3bSmrg
1057242941e3bSmrg# Set Automake conditionals for Makefiles
1057342941e3bSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
1057442941e3bSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
1057542941e3bSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
1057642941e3bSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
1057742941e3bSmrg]) # XORG_WITH_GROFF
1057842941e3bSmrg
1057942941e3bSmrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
1058042941e3bSmrg# ---------------------------------------
1058142941e3bSmrg# Minimum version: 1.6.0
1058242941e3bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1058342941e3bSmrg# Minimum version for optional MIN-VERSION argument: 1.15.0
1058442941e3bSmrg#
1058542941e3bSmrg# Documentation tools are not always available on all platforms and sometimes
1058642941e3bSmrg# not at the appropriate level. This macro enables a module to test for the
1058742941e3bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1058842941e3bSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
1058942941e3bSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
1059042941e3bSmrg# --with-fop assumes 'auto'.
1059142941e3bSmrg#
1059242941e3bSmrg# Interface to module:
1059342941e3bSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
1059442941e3bSmrg# FOP:	 	returns the path of the fop program found
1059542941e3bSmrg#		returns the path set by the user in the environment
1059642941e3bSmrg# --with-fop: 	'yes' user instructs the module to use fop
1059742941e3bSmrg#		'no' user instructs the module not to use fop
1059842941e3bSmrg#
1059942941e3bSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
1060042941e3bSmrg#
1060142941e3bSmrgAC_DEFUN([XORG_WITH_FOP],[
1060242941e3bSmrgAC_ARG_VAR([FOP], [Path to fop command])
1060342941e3bSmrgm4_define([_defopt], m4_default([$2], [auto]))
1060442941e3bSmrgAC_ARG_WITH(fop,
1060542941e3bSmrg	AS_HELP_STRING([--with-fop],
1060642941e3bSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
1060742941e3bSmrg	   [use_fop=$withval], [use_fop=]_defopt)
1060842941e3bSmrgm4_undefine([_defopt])
1060942941e3bSmrg
1061042941e3bSmrgif test "x$use_fop" = x"auto"; then
1061142941e3bSmrg   AC_PATH_PROG([FOP], [fop])
1061242941e3bSmrg   if test "x$FOP" = "x"; then
1061342941e3bSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
1061442941e3bSmrg	have_fop=no
1061542941e3bSmrg   else
1061642941e3bSmrg        have_fop=yes
1061742941e3bSmrg   fi
1061842941e3bSmrgelif test "x$use_fop" = x"yes" ; then
1061942941e3bSmrg   AC_PATH_PROG([FOP], [fop])
1062042941e3bSmrg   if test "x$FOP" = "x"; then
1062142941e3bSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
1062242941e3bSmrg   fi
1062342941e3bSmrg   have_fop=yes
1062442941e3bSmrgelif test "x$use_fop" = x"no" ; then
1062542941e3bSmrg   if test "x$FOP" != "x"; then
1062642941e3bSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
1062742941e3bSmrg   fi
1062842941e3bSmrg   have_fop=no
1062942941e3bSmrgelse
1063042941e3bSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
1063142941e3bSmrgfi
1063242941e3bSmrg
1063342941e3bSmrg# Test for a minimum version of fop, if provided.
1063442941e3bSmrgm4_ifval([$1],
1063542941e3bSmrg[if test "$have_fop" = yes; then
1063642941e3bSmrg    # scrape the fop version
1063742941e3bSmrg    AC_MSG_CHECKING([for fop minimum version])
1063842941e3bSmrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
1063942941e3bSmrg    AC_MSG_RESULT([$fop_version])
1064042941e3bSmrg    AS_VERSION_COMPARE([$fop_version], [$1],
1064142941e3bSmrg        [if test "x$use_fop" = xauto; then
1064242941e3bSmrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
1064342941e3bSmrg            have_fop=no
1064442941e3bSmrg        else
1064542941e3bSmrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
1064642941e3bSmrg        fi])
1064742941e3bSmrgfi])
1064842941e3bSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
1064942941e3bSmrg]) # XORG_WITH_FOP
1065042941e3bSmrg
1065142941e3bSmrg# XORG_WITH_PS2PDF([DEFAULT])
1065242941e3bSmrg# ----------------
1065342941e3bSmrg# Minimum version: 1.6.0
1065442941e3bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1065542941e3bSmrg#
1065642941e3bSmrg# Documentation tools are not always available on all platforms and sometimes
1065742941e3bSmrg# not at the appropriate level. This macro enables a module to test for the
1065842941e3bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1065942941e3bSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
1066042941e3bSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
1066142941e3bSmrg# --with-ps2pdf assumes 'auto'.
1066242941e3bSmrg#
1066342941e3bSmrg# Interface to module:
1066442941e3bSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
1066542941e3bSmrg# PS2PDF:	returns the path of the ps2pdf program found
1066642941e3bSmrg#		returns the path set by the user in the environment
1066742941e3bSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
1066842941e3bSmrg#		 'no' user instructs the module not to use ps2pdf
1066942941e3bSmrg#
1067042941e3bSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
1067142941e3bSmrg#
1067242941e3bSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
1067342941e3bSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
1067442941e3bSmrgm4_define([_defopt], m4_default([$1], [auto]))
1067542941e3bSmrgAC_ARG_WITH(ps2pdf,
1067642941e3bSmrg	AS_HELP_STRING([--with-ps2pdf],
1067742941e3bSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
1067842941e3bSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
1067942941e3bSmrgm4_undefine([_defopt])
1068042941e3bSmrg
1068142941e3bSmrgif test "x$use_ps2pdf" = x"auto"; then
1068242941e3bSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1068342941e3bSmrg   if test "x$PS2PDF" = "x"; then
1068442941e3bSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
1068542941e3bSmrg	have_ps2pdf=no
1068642941e3bSmrg   else
1068742941e3bSmrg        have_ps2pdf=yes
1068842941e3bSmrg   fi
1068942941e3bSmrgelif test "x$use_ps2pdf" = x"yes" ; then
1069042941e3bSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1069142941e3bSmrg   if test "x$PS2PDF" = "x"; then
1069242941e3bSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
1069342941e3bSmrg   fi
1069442941e3bSmrg   have_ps2pdf=yes
1069542941e3bSmrgelif test "x$use_ps2pdf" = x"no" ; then
1069642941e3bSmrg   if test "x$PS2PDF" != "x"; then
1069742941e3bSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
1069842941e3bSmrg   fi
1069942941e3bSmrg   have_ps2pdf=no
1070042941e3bSmrgelse
1070142941e3bSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
1070242941e3bSmrgfi
1070342941e3bSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
1070442941e3bSmrg]) # XORG_WITH_PS2PDF
1070542941e3bSmrg
1070642941e3bSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
1070742941e3bSmrg# ----------------
1070842941e3bSmrg# Minimum version: 1.6.0
1070942941e3bSmrg#
1071042941e3bSmrg# Documentation tools are not always available on all platforms and sometimes
1071142941e3bSmrg# not at the appropriate level. This macro enables a builder to skip all
1071242941e3bSmrg# documentation targets except traditional man pages.
1071342941e3bSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1071442941e3bSmrg# maximum flexibilty in controlling documentation building.
1071542941e3bSmrg# Refer to:
1071642941e3bSmrg# XORG_WITH_XMLTO         --with-xmlto
1071742941e3bSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1071842941e3bSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1071942941e3bSmrg# XORG_WITH_FOP           --with-fop
1072042941e3bSmrg# XORG_WITH_GROFF         --with-groff
1072142941e3bSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1072242941e3bSmrg#
1072342941e3bSmrg# Interface to module:
1072442941e3bSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
1072542941e3bSmrg# --enable-docs: 'yes' user instructs the module to generate docs
1072642941e3bSmrg#		 'no' user instructs the module not to generate docs
1072742941e3bSmrg# parm1:	specify the default value, yes or no.
1072842941e3bSmrg#
1072942941e3bSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
1073042941e3bSmrgm4_define([docs_default], m4_default([$1], [yes]))
1073142941e3bSmrgAC_ARG_ENABLE(docs,
1073242941e3bSmrg	AS_HELP_STRING([--enable-docs],
1073342941e3bSmrg	   [Enable building the documentation (default: ]docs_default[)]),
1073442941e3bSmrg	   [build_docs=$enableval], [build_docs=]docs_default)
1073542941e3bSmrgm4_undefine([docs_default])
1073642941e3bSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
1073742941e3bSmrgAC_MSG_CHECKING([whether to build documentation])
1073842941e3bSmrgAC_MSG_RESULT([$build_docs])
1073942941e3bSmrg]) # XORG_ENABLE_DOCS
1074042941e3bSmrg
1074142941e3bSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
1074242941e3bSmrg# ----------------
1074342941e3bSmrg# Minimum version: 1.6.0
1074442941e3bSmrg#
1074542941e3bSmrg# This macro enables a builder to skip all developer documentation.
1074642941e3bSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1074742941e3bSmrg# maximum flexibilty in controlling documentation building.
1074842941e3bSmrg# Refer to:
1074942941e3bSmrg# XORG_WITH_XMLTO         --with-xmlto
1075042941e3bSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1075142941e3bSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1075242941e3bSmrg# XORG_WITH_FOP           --with-fop
1075342941e3bSmrg# XORG_WITH_GROFF         --with-groff
1075442941e3bSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1075542941e3bSmrg#
1075642941e3bSmrg# Interface to module:
1075742941e3bSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
1075842941e3bSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
1075942941e3bSmrg#			'no' user instructs the module not to generate developer docs
1076042941e3bSmrg# parm1:		specify the default value, yes or no.
1076142941e3bSmrg#
1076242941e3bSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1076342941e3bSmrgm4_define([devel_default], m4_default([$1], [yes]))
1076442941e3bSmrgAC_ARG_ENABLE(devel-docs,
1076542941e3bSmrg	AS_HELP_STRING([--enable-devel-docs],
1076642941e3bSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
1076742941e3bSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
1076842941e3bSmrgm4_undefine([devel_default])
1076942941e3bSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1077042941e3bSmrgAC_MSG_CHECKING([whether to build developer documentation])
1077142941e3bSmrgAC_MSG_RESULT([$build_devel_docs])
1077242941e3bSmrg]) # XORG_ENABLE_DEVEL_DOCS
1077342941e3bSmrg
1077442941e3bSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
1077542941e3bSmrg# ----------------
1077642941e3bSmrg# Minimum version: 1.6.0
1077742941e3bSmrg#
1077842941e3bSmrg# This macro enables a builder to skip all functional specification targets.
1077942941e3bSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1078042941e3bSmrg# maximum flexibilty in controlling documentation building.
1078142941e3bSmrg# Refer to:
1078242941e3bSmrg# XORG_WITH_XMLTO         --with-xmlto
1078342941e3bSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1078442941e3bSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1078542941e3bSmrg# XORG_WITH_FOP           --with-fop
1078642941e3bSmrg# XORG_WITH_GROFF         --with-groff
1078742941e3bSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1078842941e3bSmrg#
1078942941e3bSmrg# Interface to module:
1079042941e3bSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
1079142941e3bSmrg# --enable-specs:	'yes' user instructs the module to generate specs
1079242941e3bSmrg#			'no' user instructs the module not to generate specs
1079342941e3bSmrg# parm1:		specify the default value, yes or no.
1079442941e3bSmrg#
1079542941e3bSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
1079642941e3bSmrgm4_define([spec_default], m4_default([$1], [yes]))
1079742941e3bSmrgAC_ARG_ENABLE(specs,
1079842941e3bSmrg	AS_HELP_STRING([--enable-specs],
1079942941e3bSmrg	   [Enable building the specs (default: ]spec_default[)]),
1080042941e3bSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
1080142941e3bSmrgm4_undefine([spec_default])
1080242941e3bSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
1080342941e3bSmrgAC_MSG_CHECKING([whether to build functional specifications])
1080442941e3bSmrgAC_MSG_RESULT([$build_specs])
1080542941e3bSmrg]) # XORG_ENABLE_SPECS
1080642941e3bSmrg
1080742941e3bSmrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
1080842941e3bSmrg# ----------------------------------------------
1080942941e3bSmrg# Minimum version: 1.13.0
1081042941e3bSmrg#
1081142941e3bSmrg# This macro enables a builder to enable/disable unit testing
1081242941e3bSmrg# It makes no assumption about the test cases implementation
1081342941e3bSmrg# Test cases may or may not use Automake "Support for test suites"
1081442941e3bSmrg# They may or may not use the software utility library GLib
1081542941e3bSmrg#
1081642941e3bSmrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
1081742941e3bSmrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
1081842941e3bSmrg# The variable enable_unit_tests is used by other macros in this file.
1081942941e3bSmrg#
1082042941e3bSmrg# Interface to module:
1082142941e3bSmrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
1082242941e3bSmrg# enable_unit_tests:    used in configure.ac for additional configuration
1082342941e3bSmrg# --enable-unit-tests:	'yes' user instructs the module to build tests
1082442941e3bSmrg#			'no' user instructs the module not to build tests
1082542941e3bSmrg# parm1:		specify the default value, yes or no.
1082642941e3bSmrg#
1082742941e3bSmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
1082842941e3bSmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
1082942941e3bSmrgAC_BEFORE([$0], [XORG_LD_WRAP])
1083042941e3bSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
1083142941e3bSmrgm4_define([_defopt], m4_default([$1], [auto]))
1083242941e3bSmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
1083342941e3bSmrg	[Enable building unit test cases (default: ]_defopt[)]),
1083442941e3bSmrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
1083542941e3bSmrgm4_undefine([_defopt])
1083642941e3bSmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
1083742941e3bSmrgAC_MSG_CHECKING([whether to build unit test cases])
1083842941e3bSmrgAC_MSG_RESULT([$enable_unit_tests])
1083942941e3bSmrg]) # XORG_ENABLE_UNIT_TESTS
1084042941e3bSmrg
1084117caa701Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
1084217caa701Smrg# ------------------------------------------------------
1084317caa701Smrg# Minimum version: 1.17.0
1084417caa701Smrg#
1084517caa701Smrg# This macro enables a builder to enable/disable integration testing
1084617caa701Smrg# It makes no assumption about the test cases' implementation
1084717caa701Smrg# Test cases may or may not use Automake "Support for test suites"
1084817caa701Smrg#
1084917caa701Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
1085017caa701Smrg# usually requires less dependencies and may be built and run under less
1085117caa701Smrg# stringent environments than integration tests.
1085217caa701Smrg#
1085317caa701Smrg# Interface to module:
1085417caa701Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
1085517caa701Smrg# enable_integration_tests:   used in configure.ac for additional configuration
1085617caa701Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
1085717caa701Smrg#                             'no' user instructs the module not to build tests
1085817caa701Smrg# parm1:                      specify the default value, yes or no.
1085917caa701Smrg#
1086017caa701SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
1086117caa701SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
1086217caa701Smrgm4_define([_defopt], m4_default([$1], [auto]))
1086317caa701SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
1086417caa701Smrg	[Enable building integration test cases (default: ]_defopt[)]),
1086517caa701Smrg	[enable_integration_tests=$enableval],
1086617caa701Smrg	[enable_integration_tests=]_defopt)
1086717caa701Smrgm4_undefine([_defopt])
1086817caa701SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
1086917caa701Smrg	[test "x$enable_integration_tests" != xno])
1087017caa701SmrgAC_MSG_CHECKING([whether to build unit test cases])
1087117caa701SmrgAC_MSG_RESULT([$enable_integration_tests])
1087217caa701Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
1087317caa701Smrg
1087442941e3bSmrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
1087542941e3bSmrg# ----------------------------------------
1087642941e3bSmrg# Minimum version: 1.13.0
1087742941e3bSmrg#
1087842941e3bSmrg# GLib is a library which provides advanced data structures and functions.
1087942941e3bSmrg# This macro enables a module to test for the presence of Glib.
1088042941e3bSmrg#
1088142941e3bSmrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
1088242941e3bSmrg# Otherwise the value of $enable_unit_tests is blank.
1088342941e3bSmrg#
1088417caa701Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
1088517caa701Smrg# test support usually requires less dependencies and may be built and run under
1088617caa701Smrg# less stringent environments than integration tests.
1088717caa701Smrg#
1088842941e3bSmrg# Interface to module:
1088942941e3bSmrg# HAVE_GLIB: used in makefiles to conditionally build targets
1089042941e3bSmrg# with_glib: used in configure.ac to know if GLib has been found
1089142941e3bSmrg# --with-glib:	'yes' user instructs the module to use glib
1089242941e3bSmrg#		'no' user instructs the module not to use glib
1089342941e3bSmrg#
1089442941e3bSmrgAC_DEFUN([XORG_WITH_GLIB],[
1089542941e3bSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
1089642941e3bSmrgm4_define([_defopt], m4_default([$2], [auto]))
1089742941e3bSmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
1089842941e3bSmrg	[Use GLib library for unit testing (default: ]_defopt[)]),
1089942941e3bSmrg	[with_glib=$withval], [with_glib=]_defopt)
1090042941e3bSmrgm4_undefine([_defopt])
1090142941e3bSmrg
1090242941e3bSmrghave_glib=no
1090342941e3bSmrg# Do not probe GLib if user explicitly disabled unit testing
1090442941e3bSmrgif test "x$enable_unit_tests" != x"no"; then
1090542941e3bSmrg  # Do not probe GLib if user explicitly disabled it
1090642941e3bSmrg  if test "x$with_glib" != x"no"; then
1090742941e3bSmrg    m4_ifval(
1090842941e3bSmrg      [$1],
1090942941e3bSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
1091042941e3bSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
1091142941e3bSmrg    )
1091242941e3bSmrg  fi
1091342941e3bSmrgfi
1091442941e3bSmrg
1091542941e3bSmrg# Not having GLib when unit testing has been explicitly requested is an error
1091642941e3bSmrgif test "x$enable_unit_tests" = x"yes"; then
1091742941e3bSmrg  if test "x$have_glib" = x"no"; then
1091842941e3bSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1091942941e3bSmrg  fi
1092042941e3bSmrgfi
10921356f6debSmrg
1092242941e3bSmrg# Having unit testing disabled when GLib has been explicitly requested is an error
1092342941e3bSmrgif test "x$enable_unit_tests" = x"no"; then
1092442941e3bSmrg  if test "x$with_glib" = x"yes"; then
1092542941e3bSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1092642941e3bSmrg  fi
1092742941e3bSmrgfi
109286f03b1f6Smrg
1092942941e3bSmrg# Not having GLib when it has been explicitly requested is an error
1093042941e3bSmrgif test "x$with_glib" = x"yes"; then
1093142941e3bSmrg  if test "x$have_glib" = x"no"; then
1093242941e3bSmrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
1093342941e3bSmrg  fi
1093442941e3bSmrgfi
109356f03b1f6Smrg
1093642941e3bSmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
1093742941e3bSmrg]) # XORG_WITH_GLIB
109386f03b1f6Smrg
1093942941e3bSmrg# XORG_LD_WRAP([required|optional])
1094042941e3bSmrg# ---------------------------------
1094142941e3bSmrg# Minimum version: 1.13.0
1094242941e3bSmrg#
1094342941e3bSmrg# Check if linker supports -wrap, passed via compiler flags
1094442941e3bSmrg#
1094542941e3bSmrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
1094642941e3bSmrg# Otherwise the value of $enable_unit_tests is blank.
1094742941e3bSmrg#
1094842941e3bSmrg# Argument added in 1.16.0 - default is "required", to match existing behavior
1094942941e3bSmrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
1095042941e3bSmrg# available, an argument of "optional" allows use when some unit tests require
1095142941e3bSmrg# ld -wrap and others do not.
1095242941e3bSmrg#
1095342941e3bSmrgAC_DEFUN([XORG_LD_WRAP],[
1095442941e3bSmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
1095542941e3bSmrg    [AC_LANG_PROGRAM([#include <stdlib.h>
1095642941e3bSmrg                      void __wrap_exit(int status) { return; }],
1095742941e3bSmrg                     [exit(0);])])
1095842941e3bSmrg# Not having ld wrap when unit testing has been explicitly requested is an error
1095942941e3bSmrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
1096042941e3bSmrg  if test "x$have_ld_wrap" = x"no"; then
1096142941e3bSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
1096242941e3bSmrg  fi
1096342941e3bSmrgfi
1096442941e3bSmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
1096542941e3bSmrg#
1096642941e3bSmrg]) # XORG_LD_WRAP
10967356f6debSmrg
1096842941e3bSmrg# XORG_CHECK_LINKER_FLAGS
1096942941e3bSmrg# -----------------------
1097042941e3bSmrg# SYNOPSIS
1097142941e3bSmrg#
1097242941e3bSmrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
1097342941e3bSmrg#
1097442941e3bSmrg# DESCRIPTION
1097542941e3bSmrg#
1097642941e3bSmrg#   Check whether the given linker FLAGS work with the current language's
1097742941e3bSmrg#   linker, or whether they give an error.
1097842941e3bSmrg#
1097942941e3bSmrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
1098042941e3bSmrg#   success/failure.
1098142941e3bSmrg#
1098242941e3bSmrg#   PROGRAM-SOURCE is the program source to link with, if needed
1098342941e3bSmrg#
1098442941e3bSmrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
1098542941e3bSmrg#
1098642941e3bSmrg# LICENSE
1098742941e3bSmrg#
1098842941e3bSmrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
1098942941e3bSmrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
1099042941e3bSmrg#   Copyright (c) 2009 Matteo Frigo
1099142941e3bSmrg#
1099242941e3bSmrg#   This program is free software: you can redistribute it and/or modify it
1099342941e3bSmrg#   under the terms of the GNU General Public License as published by the
1099442941e3bSmrg#   Free Software Foundation, either version 3 of the License, or (at your
1099542941e3bSmrg#   option) any later version.
1099642941e3bSmrg#
1099742941e3bSmrg#   This program is distributed in the hope that it will be useful, but
1099842941e3bSmrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
1099942941e3bSmrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
1100042941e3bSmrg#   Public License for more details.
1100142941e3bSmrg#
1100242941e3bSmrg#   You should have received a copy of the GNU General Public License along
1100342941e3bSmrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
1100442941e3bSmrg#
1100542941e3bSmrg#   As a special exception, the respective Autoconf Macro's copyright owner
1100642941e3bSmrg#   gives unlimited permission to copy, distribute and modify the configure
1100742941e3bSmrg#   scripts that are the output of Autoconf when processing the Macro. You
1100842941e3bSmrg#   need not follow the terms of the GNU General Public License when using
1100942941e3bSmrg#   or distributing such scripts, even though portions of the text of the
1101042941e3bSmrg#   Macro appear in them. The GNU General Public License (GPL) does govern
1101142941e3bSmrg#   all other use of the material that constitutes the Autoconf Macro.
1101242941e3bSmrg#
1101342941e3bSmrg#   This special exception to the GPL applies to versions of the Autoconf
1101442941e3bSmrg#   Macro released by the Autoconf Archive. When you make and distribute a
1101542941e3bSmrg#   modified version of the Autoconf Macro, you may extend this special
1101642941e3bSmrg#   exception to the GPL to apply to your modified version as well.#
1101742941e3bSmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
1101842941e3bSmrg[AC_MSG_CHECKING([whether the linker accepts $1])
1101942941e3bSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
1102042941e3bSmrgAS_LITERAL_IF([$1],
1102142941e3bSmrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
1102242941e3bSmrg      ax_save_FLAGS=$LDFLAGS
1102342941e3bSmrg      LDFLAGS="$1"
1102442941e3bSmrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
1102542941e3bSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1102642941e3bSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1102742941e3bSmrg      LDFLAGS=$ax_save_FLAGS])],
1102842941e3bSmrg  [ax_save_FLAGS=$LDFLAGS
1102942941e3bSmrg   LDFLAGS="$1"
1103042941e3bSmrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
1103142941e3bSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1103242941e3bSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1103342941e3bSmrg   LDFLAGS=$ax_save_FLAGS])
1103442941e3bSmrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
1103542941e3bSmrgAC_MSG_RESULT($xorg_check_linker_flags)
1103642941e3bSmrgif test "x$xorg_check_linker_flags" = xyes; then
1103742941e3bSmrg	m4_default([$2], :)
1103842941e3bSmrgelse
1103942941e3bSmrg	m4_default([$3], :)
1104042941e3bSmrgfi
1104142941e3bSmrg]) # XORG_CHECK_LINKER_FLAGS
11042356f6debSmrg
1104342941e3bSmrg# XORG_MEMORY_CHECK_FLAGS
1104442941e3bSmrg# -----------------------
1104542941e3bSmrg# Minimum version: 1.16.0
1104698af18c5Smrg#
1104742941e3bSmrg# This macro attempts to find appropriate memory checking functionality
1104842941e3bSmrg# for various platforms which unit testing code may use to catch various
1104942941e3bSmrg# forms of memory allocation and access errors in testing.
1105098af18c5Smrg#
1105142941e3bSmrg# Interface to module:
1105242941e3bSmrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
1105342941e3bSmrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
1105442941e3bSmrg#
1105542941e3bSmrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
1105642941e3bSmrg#
1105742941e3bSmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
110586f03b1f6Smrg
1105942941e3bSmrgAC_REQUIRE([AC_CANONICAL_HOST])
1106042941e3bSmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
1106142941e3bSmrg           [Environment variables to enable memory checking in tests])
110626f03b1f6Smrg
1106342941e3bSmrg# Check for different types of support on different platforms
1106442941e3bSmrgcase $host_os in
1106542941e3bSmrg    solaris*)
1106642941e3bSmrg        AC_CHECK_LIB([umem], [umem_alloc],
1106742941e3bSmrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
1106842941e3bSmrg        ;;
1106942941e3bSmrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
1107042941e3bSmrg        # both directly and inverted, so should not be 0 or 255.
1107142941e3bSmrg        malloc_debug_env='MALLOC_PERTURB_=15'
1107242941e3bSmrg        ;;
1107342941e3bSmrg    darwin*)
1107442941e3bSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
1107542941e3bSmrg        ;;
1107642941e3bSmrg    *bsd*)
1107742941e3bSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
1107842941e3bSmrg        ;;
1107942941e3bSmrgesac
110806f03b1f6Smrg
1108142941e3bSmrg# User supplied flags override default flags
1108242941e3bSmrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
1108342941e3bSmrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
1108442941e3bSmrgfi
11085356f6debSmrg
1108642941e3bSmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
1108742941e3bSmrg]) # XORG_WITH_LINT
11088356f6debSmrg
1108942941e3bSmrg# XORG_CHECK_MALLOC_ZERO
1109042941e3bSmrg# ----------------------
1109142941e3bSmrg# Minimum version: 1.0.0
1109242941e3bSmrg#
1109342941e3bSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1109442941e3bSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1109542941e3bSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1109642941e3bSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1109742941e3bSmrgAC_ARG_ENABLE(malloc0returnsnull,
1109842941e3bSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1109942941e3bSmrg		       [malloc(0) returns NULL (default: auto)]),
1110042941e3bSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1110142941e3bSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
11102356f6debSmrg
1110342941e3bSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1110442941e3bSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1110542941e3bSmrg	AC_RUN_IFELSE([AC_LANG_PROGRAM([
1110642941e3bSmrg#include <stdlib.h>
1110742941e3bSmrg],[
1110842941e3bSmrg    char *m0, *r0, *c0, *p;
1110942941e3bSmrg    m0 = malloc(0);
1111042941e3bSmrg    p = malloc(10);
1111142941e3bSmrg    r0 = realloc(p,0);
1111242941e3bSmrg    c0 = calloc(0,10);
1111342941e3bSmrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
1111442941e3bSmrg])],
1111542941e3bSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
1111642941e3bSmrg		[MALLOC_ZERO_RETURNS_NULL=no],
1111742941e3bSmrg		[MALLOC_ZERO_RETURNS_NULL=yes])
1111842941e3bSmrgfi
1111942941e3bSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
11120356f6debSmrg
1112142941e3bSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1112242941e3bSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1112342941e3bSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1112442941e3bSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1112542941e3bSmrgelse
1112642941e3bSmrg	MALLOC_ZERO_CFLAGS=""
1112742941e3bSmrg	XMALLOC_ZERO_CFLAGS=""
1112842941e3bSmrg	XTMALLOC_ZERO_CFLAGS=""
1112942941e3bSmrgfi
11130356f6debSmrg
1113142941e3bSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1113242941e3bSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1113342941e3bSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1113442941e3bSmrg]) # XORG_CHECK_MALLOC_ZERO
1113542941e3bSmrg
1113642941e3bSmrg# XORG_WITH_LINT()
1113742941e3bSmrg# ----------------
1113842941e3bSmrg# Minimum version: 1.1.0
11139356f6debSmrg#
1114042941e3bSmrg# This macro enables the use of a tool that flags some suspicious and
1114142941e3bSmrg# non-portable constructs (likely to be bugs) in C language source code.
1114242941e3bSmrg# It will attempt to locate the tool and use appropriate options.
1114342941e3bSmrg# There are various lint type tools on different platforms.
1114442941e3bSmrg#
1114542941e3bSmrg# Interface to module:
1114642941e3bSmrg# LINT:		returns the path to the tool found on the platform
1114742941e3bSmrg#		or the value set to LINT on the configure cmd line
1114842941e3bSmrg#		also an Automake conditional
1114942941e3bSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
1115042941e3bSmrg#
1115142941e3bSmrg# --with-lint:	'yes' user instructs the module to use lint
1115242941e3bSmrg#		'no' user instructs the module not to use lint (default)
1115342941e3bSmrg#
1115442941e3bSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1115542941e3bSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
1115642941e3bSmrg#
1115742941e3bSmrgAC_DEFUN([XORG_WITH_LINT],[
11158356f6debSmrg
1115942941e3bSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
1116042941e3bSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1116142941e3bSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1116242941e3bSmrg		[Use a lint-style source code checker (default: disabled)])],
1116342941e3bSmrg		[use_lint=$withval], [use_lint=no])
11164356f6debSmrg
1116542941e3bSmrg# Obtain platform specific info like program name and options
1116642941e3bSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
1116742941e3bSmrgcase $host_os in
1116842941e3bSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1116942941e3bSmrg	lint_name=splint
1117042941e3bSmrg	lint_options="-badflag"
1117142941e3bSmrg	;;
1117242941e3bSmrg  *freebsd* | *netbsd*)
1117342941e3bSmrg	lint_name=lint
1117442941e3bSmrg	lint_options="-u -b"
1117542941e3bSmrg	;;
1117642941e3bSmrg  *solaris*)
1117742941e3bSmrg	lint_name=lint
1117842941e3bSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1117942941e3bSmrg	;;
1118042941e3bSmrgesac
11181356f6debSmrg
1118242941e3bSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
1118342941e3bSmrgif test "x$use_lint" = x"yes" ; then
1118442941e3bSmrg   AC_PATH_PROG([LINT], [$lint_name])
1118542941e3bSmrg   if test "x$LINT" = "x"; then
1118642941e3bSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
1118742941e3bSmrg   fi
1118842941e3bSmrgelif test "x$use_lint" = x"no" ; then
1118942941e3bSmrg   if test "x$LINT" != "x"; then
1119042941e3bSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
1119142941e3bSmrg   fi
1119242941e3bSmrgelse
1119342941e3bSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
1119442941e3bSmrgfi
11195356f6debSmrg
1119642941e3bSmrg# User supplied flags override default flags
1119742941e3bSmrgif test "x$LINT_FLAGS" != "x"; then
1119842941e3bSmrg   lint_options=$LINT_FLAGS
1119942941e3bSmrgfi
11200356f6debSmrg
1120142941e3bSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
1120242941e3bSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
1120342941e3bSmrg
1120442941e3bSmrg]) # XORG_WITH_LINT
1120542941e3bSmrg
1120642941e3bSmrg# XORG_LINT_LIBRARY(LIBNAME)
1120742941e3bSmrg# --------------------------
1120842941e3bSmrg# Minimum version: 1.1.0
1120942941e3bSmrg#
1121042941e3bSmrg# Sets up flags for building lint libraries for checking programs that call
1121142941e3bSmrg# functions in the library.
1121242941e3bSmrg#
1121342941e3bSmrg# Interface to module:
1121442941e3bSmrg# LINTLIB		- Automake variable with the name of lint library file to make
1121542941e3bSmrg# MAKE_LINT_LIB		- Automake conditional
1121642941e3bSmrg#
1121742941e3bSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
1121842941e3bSmrg#			  - 'no' user instructs the module not to create a lint library (default)
1121942941e3bSmrg
1122042941e3bSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1122142941e3bSmrgAC_REQUIRE([XORG_WITH_LINT])
1122242941e3bSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1122342941e3bSmrg	[Create lint library (default: disabled)])],
1122442941e3bSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1122542941e3bSmrg
1122642941e3bSmrgif test "x$make_lint_lib" = x"yes" ; then
1122742941e3bSmrg   LINTLIB=llib-l$1.ln
1122842941e3bSmrg   if test "x$LINT" = "x"; then
1122942941e3bSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
1123042941e3bSmrg   fi
1123142941e3bSmrgelif test "x$make_lint_lib" != x"no" ; then
1123242941e3bSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
1123342941e3bSmrgfi
11234356f6debSmrg
1123542941e3bSmrgAC_SUBST(LINTLIB)
1123642941e3bSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
11237356f6debSmrg
1123842941e3bSmrg]) # XORG_LINT_LIBRARY
112396f03b1f6Smrg
1124042941e3bSmrg# XORG_COMPILER_BRAND
1124142941e3bSmrg# -------------------
1124242941e3bSmrg# Minimum version: 1.14.0
1124342941e3bSmrg#
1124442941e3bSmrg# Checks for various brands of compilers and sets flags as appropriate:
1124542941e3bSmrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
1124642941e3bSmrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
1124742941e3bSmrg#   clang compiler - sets CLANGCC to "yes"
1124842941e3bSmrg#   Intel compiler - sets INTELCC to "yes"
1124942941e3bSmrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
1125042941e3bSmrg#
1125142941e3bSmrgAC_DEFUN([XORG_COMPILER_BRAND], [
1125242941e3bSmrgAC_LANG_CASE(
1125342941e3bSmrg	[C], [
1125442941e3bSmrg		AC_REQUIRE([AC_PROG_CC_C99])
1125542941e3bSmrg	],
1125642941e3bSmrg	[C++], [
1125742941e3bSmrg		AC_REQUIRE([AC_PROG_CXX])
1125842941e3bSmrg	]
1125942941e3bSmrg)
1126042941e3bSmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
1126142941e3bSmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1126242941e3bSmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1126342941e3bSmrg]) # XORG_COMPILER_BRAND
112646f03b1f6Smrg
1126542941e3bSmrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
1126642941e3bSmrg# ---------------
1126742941e3bSmrg# Minimum version: 1.16.0
1126842941e3bSmrg#
1126942941e3bSmrg# Test if the compiler works when passed the given flag as a command line argument.
1127042941e3bSmrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
1127142941e3bSmrg# next flag in the list until there are no more options.
1127242941e3bSmrg#
1127342941e3bSmrg# Note that this does not guarantee that the compiler supports the flag as some
1127442941e3bSmrg# compilers will simply ignore arguments that they do not understand, but we do
1127542941e3bSmrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
1127642941e3bSmrg# -Werror=unused-command-line-argument
1127742941e3bSmrg#
1127842941e3bSmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
1127942941e3bSmrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
1128042941e3bSmrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
1128142941e3bSmrg
1128242941e3bSmrgAC_LANG_COMPILER_REQUIRE
1128342941e3bSmrg
1128442941e3bSmrgAC_LANG_CASE(
1128542941e3bSmrg	[C], [
1128642941e3bSmrg		AC_REQUIRE([AC_PROG_CC_C99])
1128742941e3bSmrg		define([PREFIX], [C])
1128817caa701Smrg		define([CACHE_PREFIX], [cc])
1128917caa701Smrg		define([COMPILER], [$CC])
1129042941e3bSmrg	],
1129142941e3bSmrg	[C++], [
1129242941e3bSmrg		define([PREFIX], [CXX])
1129317caa701Smrg		define([CACHE_PREFIX], [cxx])
1129417caa701Smrg		define([COMPILER], [$CXX])
1129542941e3bSmrg	]
1129642941e3bSmrg)
112976f03b1f6Smrg
1129842941e3bSmrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
1129942941e3bSmrg
1130017caa701Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
1130142941e3bSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1130217caa701Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
1130317caa701Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
1130442941e3bSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1130517caa701Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
1130617caa701Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
1130717caa701Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
1130842941e3bSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1130942941e3bSmrgfi
113106f03b1f6Smrg
1131117caa701Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
1131217caa701Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
1131342941e3bSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1131442941e3bSmrg	fi
1131542941e3bSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1131617caa701Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
1131717caa701Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
1131842941e3bSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1131917caa701Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
1132017caa701Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
1132117caa701Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
1132242941e3bSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1132342941e3bSmrgfi
113246f03b1f6Smrg
1132542941e3bSmrgfound="no"
1132642941e3bSmrgm4_foreach([flag], m4_cdr($@), [
1132742941e3bSmrg	if test $found = "no" ; then
1132842941e3bSmrg		if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
1132942941e3bSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1133042941e3bSmrg		fi
1133142941e3bSmrg
1133242941e3bSmrg		if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
1133342941e3bSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1133442941e3bSmrg		fi
1133542941e3bSmrg
1133642941e3bSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
1133742941e3bSmrg
1133842941e3bSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
1133917caa701Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
1134017caa701Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
1134117caa701Smrg		AC_CACHE_VAL($cacheid,
1134242941e3bSmrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
1134317caa701Smrg					     [eval $cacheid=yes],
1134417caa701Smrg					     [eval $cacheid=no])])
1134542941e3bSmrg
1134642941e3bSmrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1134742941e3bSmrg
1134817caa701Smrg		eval supported=\$$cacheid
1134942941e3bSmrg		AC_MSG_RESULT([$supported])
1135042941e3bSmrg		if test "$supported" = "yes" ; then
1135142941e3bSmrg			$1="$$1 ]flag["
1135242941e3bSmrg			found="yes"
1135342941e3bSmrg		fi
1135442941e3bSmrg	fi
1135542941e3bSmrg])
1135642941e3bSmrg]) # XORG_TESTSET_CFLAG
113576f03b1f6Smrg
1135842941e3bSmrg# XORG_COMPILER_FLAGS
1135942941e3bSmrg# ---------------
1136042941e3bSmrg# Minimum version: 1.16.0
1136142941e3bSmrg#
1136242941e3bSmrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
1136342941e3bSmrg# arguments supported by the selected compiler which do NOT alter the generated
1136442941e3bSmrg# code.  These arguments will cause the compiler to print various warnings
1136542941e3bSmrg# during compilation AND turn a conservative set of warnings into errors.
1136642941e3bSmrg#
1136742941e3bSmrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
1136842941e3bSmrg# future versions of util-macros as options are added to new compilers.
1136942941e3bSmrg#
1137042941e3bSmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
1137142941e3bSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
1137242941e3bSmrg
1137342941e3bSmrgAC_ARG_ENABLE(selective-werror,
1137442941e3bSmrg              AS_HELP_STRING([--disable-selective-werror],
1137542941e3bSmrg                             [Turn off selective compiler errors. (default: enabled)]),
1137642941e3bSmrg              [SELECTIVE_WERROR=$enableval],
1137742941e3bSmrg              [SELECTIVE_WERROR=yes])
1137842941e3bSmrg
1137942941e3bSmrgAC_LANG_CASE(
1138042941e3bSmrg        [C], [
1138142941e3bSmrg                define([PREFIX], [C])
1138242941e3bSmrg        ],
1138342941e3bSmrg        [C++], [
1138442941e3bSmrg                define([PREFIX], [CXX])
1138542941e3bSmrg        ]
1138642941e3bSmrg)
1138742941e3bSmrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
1138842941e3bSmrgif test "x$SUNCC" = "xyes"; then
1138942941e3bSmrg    [BASE_]PREFIX[FLAGS]="-v"
1139042941e3bSmrgelse
1139142941e3bSmrg    [BASE_]PREFIX[FLAGS]=""
1139242941e3bSmrgfi
113936f03b1f6Smrg
1139442941e3bSmrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
1139542941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
1139642941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
1139742941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
1139842941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
1139942941e3bSmrg
1140042941e3bSmrgAC_LANG_CASE(
1140142941e3bSmrg	[C], [
1140242941e3bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
1140342941e3bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
1140442941e3bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
1140542941e3bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
1140642941e3bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
1140742941e3bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
1140842941e3bSmrg	]
1140942941e3bSmrg)
114106f03b1f6Smrg
1141142941e3bSmrg# This chunk adds additional warnings that could catch undesired effects.
1141242941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
1141342941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
1141442941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
1141542941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
1141642941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
1141742941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
1141842941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
1141942941e3bSmrg
1142042941e3bSmrg# These are currently disabled because they are noisy.  They will be enabled
1142142941e3bSmrg# in the future once the codebase is sufficiently modernized to silence
1142242941e3bSmrg# them.  For now, I don't want them to drown out the other warnings.
1142342941e3bSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
1142442941e3bSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
1142542941e3bSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
1142642941e3bSmrg
1142742941e3bSmrg# Turn some warnings into errors, so we don't accidently get successful builds
1142842941e3bSmrg# when there are problems that should be fixed.
1142942941e3bSmrg
1143042941e3bSmrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
1143142941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
1143242941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
1143342941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
1143442941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
1143542941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
1143642941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
1143742941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
1143842941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
1143942941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
1144042941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
1144142941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
1144242941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
1144342941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
1144442941e3bSmrgelse
1144542941e3bSmrgAC_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])
1144642941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
1144742941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
1144842941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
1144942941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
1145042941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
1145142941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
1145242941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
1145342941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
1145442941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
1145542941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
1145642941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
1145742941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
1145842941e3bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
1145942941e3bSmrgfi
114606f03b1f6Smrg
1146142941e3bSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
1146242941e3bSmrg]) # XORG_COMPILER_FLAGS
1146342941e3bSmrg
1146442941e3bSmrg# XORG_CWARNFLAGS
1146542941e3bSmrg# ---------------
1146642941e3bSmrg# Minimum version: 1.2.0
1146742941e3bSmrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
11468356f6debSmrg#
1146942941e3bSmrg# Defines CWARNFLAGS to enable C compiler warnings.
11470356f6debSmrg#
1147142941e3bSmrg# This function is deprecated because it defines -fno-strict-aliasing
1147242941e3bSmrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
1147342941e3bSmrg# is needed, then it should be added explicitly in the module when
1147442941e3bSmrg# it is updated to use BASE_CFLAGS.
1147542941e3bSmrg#
1147642941e3bSmrgAC_DEFUN([XORG_CWARNFLAGS], [
1147742941e3bSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
1147842941e3bSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
1147942941e3bSmrgAC_LANG_CASE(
1148042941e3bSmrg	[C], [
1148142941e3bSmrg		CWARNFLAGS="$BASE_CFLAGS"
1148242941e3bSmrg		if  test "x$GCC" = xyes ; then
1148342941e3bSmrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
1148442941e3bSmrg		fi
1148542941e3bSmrg		AC_SUBST(CWARNFLAGS)
1148642941e3bSmrg	]
1148742941e3bSmrg)
1148842941e3bSmrg]) # XORG_CWARNFLAGS
114896f03b1f6Smrg
1149042941e3bSmrg# XORG_STRICT_OPTION
1149142941e3bSmrg# -----------------------
1149242941e3bSmrg# Minimum version: 1.3.0
1149342941e3bSmrg#
1149442941e3bSmrg# Add configure option to enable strict compilation flags, such as treating
1149542941e3bSmrg# warnings as fatal errors.
1149642941e3bSmrg# If --enable-strict-compilation is passed to configure, adds strict flags to
1149742941e3bSmrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
1149842941e3bSmrg#
1149942941e3bSmrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
1150042941e3bSmrg# when strict compilation is unconditionally desired.
1150142941e3bSmrgAC_DEFUN([XORG_STRICT_OPTION], [
1150242941e3bSmrgAC_REQUIRE([XORG_CWARNFLAGS])
1150342941e3bSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
115046f03b1f6Smrg
1150542941e3bSmrgAC_ARG_ENABLE(strict-compilation,
1150642941e3bSmrg			  AS_HELP_STRING([--enable-strict-compilation],
1150742941e3bSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
1150842941e3bSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
115096f03b1f6Smrg
1151042941e3bSmrgAC_LANG_CASE(
1151142941e3bSmrg        [C], [
1151242941e3bSmrg                define([PREFIX], [C])
1151342941e3bSmrg        ],
1151442941e3bSmrg        [C++], [
1151542941e3bSmrg                define([PREFIX], [CXX])
1151642941e3bSmrg        ]
1151742941e3bSmrg)
11518356f6debSmrg
1151942941e3bSmrg[STRICT_]PREFIX[FLAGS]=""
1152042941e3bSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
1152142941e3bSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
11522356f6debSmrg
1152342941e3bSmrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
1152442941e3bSmrg# activate it with -Werror, so we add it here explicitly.
1152542941e3bSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
11526356f6debSmrg
1152742941e3bSmrgif test "x$STRICT_COMPILE" = "xyes"; then
1152842941e3bSmrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
1152942941e3bSmrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
1153042941e3bSmrgfi
1153142941e3bSmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
1153242941e3bSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
1153342941e3bSmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
1153442941e3bSmrg]) # XORG_STRICT_OPTION
11535356f6debSmrg
1153642941e3bSmrg# XORG_DEFAULT_OPTIONS
1153742941e3bSmrg# --------------------
1153842941e3bSmrg# Minimum version: 1.3.0
11539356f6debSmrg#
1154042941e3bSmrg# Defines default options for X.Org modules.
11541356f6debSmrg#
1154242941e3bSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
1154342941e3bSmrgAC_REQUIRE([AC_PROG_INSTALL])
1154442941e3bSmrgXORG_COMPILER_FLAGS
1154542941e3bSmrgXORG_CWARNFLAGS
1154642941e3bSmrgXORG_STRICT_OPTION
1154742941e3bSmrgXORG_RELEASE_VERSION
1154842941e3bSmrgXORG_CHANGELOG
1154942941e3bSmrgXORG_INSTALL
1155042941e3bSmrgXORG_MANPAGE_SECTIONS
1155142941e3bSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
1155242941e3bSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
1155342941e3bSmrg]) # XORG_DEFAULT_OPTIONS
1155442941e3bSmrg
1155542941e3bSmrg# XORG_INSTALL()
1155642941e3bSmrg# ----------------
1155742941e3bSmrg# Minimum version: 1.4.0
11558356f6debSmrg#
1155942941e3bSmrg# Defines the variable INSTALL_CMD as the command to copy
1156042941e3bSmrg# INSTALL from $prefix/share/util-macros.
11561356f6debSmrg#
1156242941e3bSmrgAC_DEFUN([XORG_INSTALL], [
1156342941e3bSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
1156442941e3bSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
1156542941e3bSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
1156642941e3bSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
1156742941e3bSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
1156842941e3bSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
1156942941e3bSmrgAC_SUBST([INSTALL_CMD])
1157042941e3bSmrg]) # XORG_INSTALL
1157142941e3bSmrgdnl Copyright 2005 Red Hat, Inc
1157242941e3bSmrgdnl
1157342941e3bSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1157442941e3bSmrgdnl documentation for any purpose is hereby granted without fee, provided that
1157542941e3bSmrgdnl the above copyright notice appear in all copies and that both that
1157642941e3bSmrgdnl copyright notice and this permission notice appear in supporting
1157742941e3bSmrgdnl documentation.
1157842941e3bSmrgdnl
1157942941e3bSmrgdnl The above copyright notice and this permission notice shall be included
1158042941e3bSmrgdnl in all copies or substantial portions of the Software.
1158142941e3bSmrgdnl
1158242941e3bSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1158342941e3bSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1158442941e3bSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1158542941e3bSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1158642941e3bSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1158742941e3bSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1158842941e3bSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
1158942941e3bSmrgdnl
1159042941e3bSmrgdnl Except as contained in this notice, the name of the copyright holders shall
1159142941e3bSmrgdnl not be used in advertising or otherwise to promote the sale, use or
1159242941e3bSmrgdnl other dealings in this Software without prior written authorization
1159342941e3bSmrgdnl from the copyright holders.
1159442941e3bSmrgdnl
11595356f6debSmrg
1159642941e3bSmrg# XORG_RELEASE_VERSION
1159742941e3bSmrg# --------------------
1159842941e3bSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1159942941e3bSmrg 
1160042941e3bSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1160142941e3bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1160242941e3bSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1160342941e3bSmrg		[Major version of this package])
1160442941e3bSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1160542941e3bSmrg	if test "x$PVM" = "x"; then
1160642941e3bSmrg		PVM="0"
1160742941e3bSmrg	fi
1160842941e3bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1160942941e3bSmrg		[$PVM],
1161042941e3bSmrg		[Minor version of this package])
1161142941e3bSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1161242941e3bSmrg	if test "x$PVP" = "x"; then
1161342941e3bSmrg		PVP="0"
1161442941e3bSmrg	fi
1161542941e3bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1161642941e3bSmrg		[$PVP],
1161742941e3bSmrg		[Patch version of this package])
1161842941e3bSmrg])
11619356f6debSmrg
1162042941e3bSmrg# XORG_CHANGELOG()
1162142941e3bSmrg# ----------------
1162242941e3bSmrg# Minimum version: 1.2.0
1162342941e3bSmrg#
1162442941e3bSmrg# Defines the variable CHANGELOG_CMD as the command to generate
1162542941e3bSmrg# ChangeLog from git.
1162642941e3bSmrg#
1162742941e3bSmrg#
1162842941e3bSmrgAC_DEFUN([XORG_CHANGELOG], [
1162942941e3bSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
1163042941e3bSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
1163142941e3bSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
1163242941e3bSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
1163342941e3bSmrgAC_SUBST([CHANGELOG_CMD])
1163442941e3bSmrg]) # XORG_CHANGELOG
116356f03b1f6Smrg
11636