aclocal.m4 revision 84bf8334
184bf8334Smrg# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
2a73597f9Smrg
384bf8334Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
4659607e0Smrg
5659607e0Smrg# This file is free software; the Free Software Foundation
6659607e0Smrg# gives unlimited permission to copy and/or distribute it,
7659607e0Smrg# with or without modifications, as long as this notice is preserved.
8659607e0Smrg
9659607e0Smrg# This program is distributed in the hope that it will be useful,
10659607e0Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11659607e0Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12659607e0Smrg# PARTICULAR PURPOSE.
13659607e0Smrg
1484bf8334Smrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15fc27e79cSmrgm4_ifndef([AC_AUTOCONF_VERSION],
16fc27e79cSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1784bf8334Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
1884bf8334Smrg[m4_warning([this file was generated for autoconf 2.68.
19fc27e79cSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
20fc27e79cSmrgIf you have problems, you may need to regenerate the build system entirely.
21a73597f9SmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22659607e0Smrg
2384bf8334Smrg# Copyright (C) 2002-2013 Free Software Foundation, Inc.
246aab59a7Smrg#
2584bf8334Smrg# This file is free software; the Free Software Foundation
2684bf8334Smrg# gives unlimited permission to copy and/or distribute it,
2784bf8334Smrg# with or without modifications, as long as this notice is preserved.
2884bf8334Smrg
2984bf8334Smrg# AM_AUTOMAKE_VERSION(VERSION)
3084bf8334Smrg# ----------------------------
3184bf8334Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
3284bf8334Smrg# generated from the m4 files accompanying Automake X.Y.
3384bf8334Smrg# (This private macro should not be called outside this file.)
3484bf8334SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
3584bf8334Smrg[am__api_version='1.14'
3684bf8334Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
3784bf8334Smrgdnl require some minimum version.  Point them to the right macro.
3884bf8334Smrgm4_if([$1], [1.14.1], [],
3984bf8334Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
4084bf8334Smrg])
4184bf8334Smrg
4284bf8334Smrg# _AM_AUTOCONF_VERSION(VERSION)
4384bf8334Smrg# -----------------------------
4484bf8334Smrg# aclocal traces this macro to find the Autoconf version.
4584bf8334Smrg# This is a private macro too.  Using m4_define simplifies
4684bf8334Smrg# the logic in aclocal, which can simply ignore this definition.
4784bf8334Smrgm4_define([_AM_AUTOCONF_VERSION], [])
4884bf8334Smrg
4984bf8334Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
5084bf8334Smrg# -------------------------------
5184bf8334Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
5284bf8334Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
5384bf8334SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
5484bf8334Smrg[AM_AUTOMAKE_VERSION([1.14.1])dnl
5584bf8334Smrgm4_ifndef([AC_AUTOCONF_VERSION],
5684bf8334Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
5784bf8334Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
5884bf8334Smrg
5984bf8334Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
6084bf8334Smrg
6184bf8334Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
626aab59a7Smrg#
6384bf8334Smrg# This file is free software; the Free Software Foundation
6484bf8334Smrg# gives unlimited permission to copy and/or distribute it,
6584bf8334Smrg# with or without modifications, as long as this notice is preserved.
66fc27e79cSmrg
6784bf8334Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
6884bf8334Smrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
6984bf8334Smrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
706aab59a7Smrg#
7184bf8334Smrg# Of course, Automake must honor this variable whenever it calls a
7284bf8334Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
7384bf8334Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
7484bf8334Smrg# depending on how configure is run.  This is pretty annoying, since
7584bf8334Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
7684bf8334Smrg# source directory, any form will work fine, but in subdirectories a
7784bf8334Smrg# relative path needs to be adjusted first.
786aab59a7Smrg#
7984bf8334Smrg# $ac_aux_dir/missing
8084bf8334Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
8184bf8334Smrg# $top_srcdir/$ac_aux_dir/missing
8284bf8334Smrg#    fails if $ac_aux_dir is absolute,
8384bf8334Smrg#    fails when called from a subdirectory in a VPATH build with
8484bf8334Smrg#          a relative $ac_aux_dir
856aab59a7Smrg#
8684bf8334Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
8784bf8334Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
8884bf8334Smrg# harmless because $srcdir is '.', but things will broke when you
8984bf8334Smrg# start a VPATH build or use an absolute $srcdir.
906aab59a7Smrg#
9184bf8334Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
9284bf8334Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
9384bf8334Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
9484bf8334Smrg# and then we would define $MISSING as
9584bf8334Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
9684bf8334Smrg# This will work as long as MISSING is not called from configure, because
9784bf8334Smrg# unfortunately $(top_srcdir) has no meaning in configure.
9884bf8334Smrg# However there are other variables, like CC, which are often used in
9984bf8334Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
1006aab59a7Smrg#
10184bf8334Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
10284bf8334Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
10384bf8334Smrg# configured tree to be moved without reconfiguration.
104659607e0Smrg
10584bf8334SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
10684bf8334Smrg[dnl Rely on autoconf to set up CDPATH properly.
10784bf8334SmrgAC_PREREQ([2.50])dnl
10884bf8334Smrg# expand $ac_aux_dir to an absolute path
10984bf8334Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
110a73597f9Smrg])
111659607e0Smrg
11284bf8334Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
113659607e0Smrg
11484bf8334Smrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
11584bf8334Smrg#
11684bf8334Smrg# This file is free software; the Free Software Foundation
11784bf8334Smrg# gives unlimited permission to copy and/or distribute it,
11884bf8334Smrg# with or without modifications, as long as this notice is preserved.
119659607e0Smrg
12084bf8334Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
12184bf8334Smrg# -------------------------------------
12284bf8334Smrg# Define a conditional.
12384bf8334SmrgAC_DEFUN([AM_CONDITIONAL],
12484bf8334Smrg[AC_PREREQ([2.52])dnl
12584bf8334Smrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
12684bf8334Smrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
12784bf8334SmrgAC_SUBST([$1_TRUE])dnl
12884bf8334SmrgAC_SUBST([$1_FALSE])dnl
12984bf8334Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
13084bf8334Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
13184bf8334Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
13284bf8334Smrgif $2; then
13384bf8334Smrg  $1_TRUE=
13484bf8334Smrg  $1_FALSE='#'
13584bf8334Smrgelse
13684bf8334Smrg  $1_TRUE='#'
13784bf8334Smrg  $1_FALSE=
13884bf8334Smrgfi
13984bf8334SmrgAC_CONFIG_COMMANDS_PRE(
14084bf8334Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
14184bf8334Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
14284bf8334SmrgUsually this means the macro was only invoked conditionally.]])
14384bf8334Smrgfi])])
144659607e0Smrg
14584bf8334Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
14684bf8334Smrg#
14784bf8334Smrg# This file is free software; the Free Software Foundation
14884bf8334Smrg# gives unlimited permission to copy and/or distribute it,
14984bf8334Smrg# with or without modifications, as long as this notice is preserved.
150659607e0Smrg
151659607e0Smrg
15284bf8334Smrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
15384bf8334Smrg# written in clear, in which case automake, when reading aclocal.m4,
15484bf8334Smrg# will think it sees a *use*, and therefore will trigger all it's
15584bf8334Smrg# C support machinery.  Also note that it means that autoscan, seeing
15684bf8334Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
157659607e0Smrg
158659607e0Smrg
15984bf8334Smrg# _AM_DEPENDENCIES(NAME)
160a73597f9Smrg# ----------------------
16184bf8334Smrg# See how the compiler implements dependency checking.
16284bf8334Smrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
16384bf8334Smrg# We try a few techniques and use that to set a single cache variable.
16484bf8334Smrg#
16584bf8334Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
16684bf8334Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
16784bf8334Smrg# dependency, and given that the user is not expected to run this macro,
16884bf8334Smrg# just rely on AC_PROG_CC.
16984bf8334SmrgAC_DEFUN([_AM_DEPENDENCIES],
17084bf8334Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
17184bf8334SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
17284bf8334SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
17384bf8334SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
174a73597f9Smrg
17584bf8334Smrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
17684bf8334Smrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
17784bf8334Smrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
17884bf8334Smrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
17984bf8334Smrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
18084bf8334Smrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
18184bf8334Smrg                    [depcc="$$1"   am_compiler_list=])
182a73597f9Smrg
18384bf8334SmrgAC_CACHE_CHECK([dependency style of $depcc],
18484bf8334Smrg               [am_cv_$1_dependencies_compiler_type],
18584bf8334Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
18684bf8334Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
18784bf8334Smrg  # making bogus files that we don't know about and never remove.  For
18884bf8334Smrg  # instance it was reported that on HP-UX the gcc test will end up
18984bf8334Smrg  # making a dummy file named 'D' -- because '-MD' means "put the output
19084bf8334Smrg  # in D".
19184bf8334Smrg  rm -rf conftest.dir
19284bf8334Smrg  mkdir conftest.dir
19384bf8334Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
19484bf8334Smrg  # using a relative directory.
19584bf8334Smrg  cp "$am_depcomp" conftest.dir
19684bf8334Smrg  cd conftest.dir
19784bf8334Smrg  # We will build objects and dependencies in a subdirectory because
19884bf8334Smrg  # it helps to detect inapplicable dependency modes.  For instance
19984bf8334Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
20084bf8334Smrg  # side effect of compilation, but ICC will put the dependencies in
20184bf8334Smrg  # the current directory while Tru64 will put them in the object
20284bf8334Smrg  # directory.
20384bf8334Smrg  mkdir sub
204659607e0Smrg
20584bf8334Smrg  am_cv_$1_dependencies_compiler_type=none
20684bf8334Smrg  if test "$am_compiler_list" = ""; then
20784bf8334Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
208a73597f9Smrg  fi
20984bf8334Smrg  am__universal=false
21084bf8334Smrg  m4_case([$1], [CC],
21184bf8334Smrg    [case " $depcc " in #(
21284bf8334Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
21384bf8334Smrg     esac],
21484bf8334Smrg    [CXX],
21584bf8334Smrg    [case " $depcc " in #(
21684bf8334Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
21784bf8334Smrg     esac])
218fc27e79cSmrg
21984bf8334Smrg  for depmode in $am_compiler_list; do
22084bf8334Smrg    # Setup a source with many dependencies, because some compilers
22184bf8334Smrg    # like to wrap large dependency lists on column 80 (with \), and
22284bf8334Smrg    # we should not choose a depcomp mode which is confused by this.
22384bf8334Smrg    #
22484bf8334Smrg    # We need to recreate these files for each test, as the compiler may
22584bf8334Smrg    # overwrite some of them when testing with obscure command lines.
22684bf8334Smrg    # This happens at least with the AIX C compiler.
22784bf8334Smrg    : > sub/conftest.c
22884bf8334Smrg    for i in 1 2 3 4 5 6; do
22984bf8334Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
23084bf8334Smrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
23184bf8334Smrg      # Solaris 10 /bin/sh.
23284bf8334Smrg      echo '/* dummy */' > sub/conftst$i.h
23384bf8334Smrg    done
23484bf8334Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
235fc27e79cSmrg
23684bf8334Smrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
23784bf8334Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
23884bf8334Smrg    # handle '-M -o', and we need to detect this.  Also, some Intel
23984bf8334Smrg    # versions had trouble with output in subdirs.
24084bf8334Smrg    am__obj=sub/conftest.${OBJEXT-o}
24184bf8334Smrg    am__minus_obj="-o $am__obj"
24284bf8334Smrg    case $depmode in
24384bf8334Smrg    gcc)
24484bf8334Smrg      # This depmode causes a compiler race in universal mode.
24584bf8334Smrg      test "$am__universal" = false || continue
24684bf8334Smrg      ;;
24784bf8334Smrg    nosideeffect)
24884bf8334Smrg      # After this tag, mechanisms are not by side-effect, so they'll
24984bf8334Smrg      # only be used when explicitly requested.
25084bf8334Smrg      if test "x$enable_dependency_tracking" = xyes; then
25184bf8334Smrg	continue
25284bf8334Smrg      else
25384bf8334Smrg	break
25484bf8334Smrg      fi
25584bf8334Smrg      ;;
25684bf8334Smrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
25784bf8334Smrg      # This compiler won't grok '-c -o', but also, the minuso test has
25884bf8334Smrg      # not run yet.  These depmodes are late enough in the game, and
25984bf8334Smrg      # so weak that their functioning should not be impacted.
26084bf8334Smrg      am__obj=conftest.${OBJEXT-o}
26184bf8334Smrg      am__minus_obj=
26284bf8334Smrg      ;;
26384bf8334Smrg    none) break ;;
26484bf8334Smrg    esac
26584bf8334Smrg    if depmode=$depmode \
26684bf8334Smrg       source=sub/conftest.c object=$am__obj \
26784bf8334Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
26884bf8334Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
26984bf8334Smrg         >/dev/null 2>conftest.err &&
27084bf8334Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
27184bf8334Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
27284bf8334Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
27384bf8334Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
27484bf8334Smrg      # icc doesn't choke on unknown options, it will just issue warnings
27584bf8334Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
27684bf8334Smrg      # that says an option was ignored or not supported.
27784bf8334Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
27884bf8334Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
27984bf8334Smrg      # The diagnosis changed in icc 8.0:
28084bf8334Smrg      #   icc: Command line remark: option '-MP' not supported
28184bf8334Smrg      if (grep 'ignoring option' conftest.err ||
28284bf8334Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
28384bf8334Smrg        am_cv_$1_dependencies_compiler_type=$depmode
28484bf8334Smrg        break
28584bf8334Smrg      fi
28684bf8334Smrg    fi
28784bf8334Smrg  done
288fc27e79cSmrg
28984bf8334Smrg  cd ..
29084bf8334Smrg  rm -rf conftest.dir
29184bf8334Smrgelse
29284bf8334Smrg  am_cv_$1_dependencies_compiler_type=none
29384bf8334Smrgfi
29484bf8334Smrg])
29584bf8334SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
29684bf8334SmrgAM_CONDITIONAL([am__fastdep$1], [
29784bf8334Smrg  test "x$enable_dependency_tracking" != xno \
29884bf8334Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
29984bf8334Smrg])
300659607e0Smrg
301659607e0Smrg
30284bf8334Smrg# AM_SET_DEPDIR
30384bf8334Smrg# -------------
30484bf8334Smrg# Choose a directory name for dependency files.
30584bf8334Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
30684bf8334SmrgAC_DEFUN([AM_SET_DEPDIR],
30784bf8334Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
30884bf8334SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
30984bf8334Smrg])
310659607e0Smrg
311659607e0Smrg
31284bf8334Smrg# AM_DEP_TRACK
31384bf8334Smrg# ------------
31484bf8334SmrgAC_DEFUN([AM_DEP_TRACK],
31584bf8334Smrg[AC_ARG_ENABLE([dependency-tracking], [dnl
31684bf8334SmrgAS_HELP_STRING(
31784bf8334Smrg  [--enable-dependency-tracking],
31884bf8334Smrg  [do not reject slow dependency extractors])
31984bf8334SmrgAS_HELP_STRING(
32084bf8334Smrg  [--disable-dependency-tracking],
32184bf8334Smrg  [speeds up one-time build])])
32284bf8334Smrgif test "x$enable_dependency_tracking" != xno; then
32384bf8334Smrg  am_depcomp="$ac_aux_dir/depcomp"
32484bf8334Smrg  AMDEPBACKSLASH='\'
32584bf8334Smrg  am__nodep='_no'
32684bf8334Smrgfi
32784bf8334SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
32884bf8334SmrgAC_SUBST([AMDEPBACKSLASH])dnl
32984bf8334Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
33084bf8334SmrgAC_SUBST([am__nodep])dnl
33184bf8334Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl
33284bf8334Smrg])
333659607e0Smrg
33484bf8334Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
335659607e0Smrg
33684bf8334Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
33784bf8334Smrg#
33884bf8334Smrg# This file is free software; the Free Software Foundation
33984bf8334Smrg# gives unlimited permission to copy and/or distribute it,
34084bf8334Smrg# with or without modifications, as long as this notice is preserved.
341659607e0Smrg
342659607e0Smrg
34384bf8334Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
34484bf8334Smrg# ------------------------------
34584bf8334SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
34684bf8334Smrg[{
34784bf8334Smrg  # Older Autoconf quotes --file arguments for eval, but not when files
34884bf8334Smrg  # are listed without --file.  Let's play safe and only enable the eval
34984bf8334Smrg  # if we detect the quoting.
35084bf8334Smrg  case $CONFIG_FILES in
35184bf8334Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
35284bf8334Smrg  *)   set x $CONFIG_FILES ;;
35384bf8334Smrg  esac
35484bf8334Smrg  shift
35584bf8334Smrg  for mf
35684bf8334Smrg  do
35784bf8334Smrg    # Strip MF so we end up with the name of the file.
35884bf8334Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
35984bf8334Smrg    # Check whether this is an Automake generated Makefile or not.
36084bf8334Smrg    # We used to match only the files named 'Makefile.in', but
36184bf8334Smrg    # some people rename them; so instead we look at the file content.
36284bf8334Smrg    # Grep'ing the first line is not enough: some people post-process
36384bf8334Smrg    # each Makefile.in and add a new line on top of each file to say so.
36484bf8334Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
36584bf8334Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
36684bf8334Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
36784bf8334Smrg      dirpart=`AS_DIRNAME("$mf")`
36884bf8334Smrg    else
36984bf8334Smrg      continue
37084bf8334Smrg    fi
37184bf8334Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
37284bf8334Smrg    # from the Makefile without running 'make'.
37384bf8334Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
37484bf8334Smrg    test -z "$DEPDIR" && continue
37584bf8334Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
37684bf8334Smrg    test -z "$am__include" && continue
37784bf8334Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
37884bf8334Smrg    # Find all dependency output files, they are included files with
37984bf8334Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
38084bf8334Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
38184bf8334Smrg    # expansion.
38284bf8334Smrg    for file in `sed -n "
38384bf8334Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
38484bf8334Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
38584bf8334Smrg      # Make sure the directory exists.
38684bf8334Smrg      test -f "$dirpart/$file" && continue
38784bf8334Smrg      fdir=`AS_DIRNAME(["$file"])`
38884bf8334Smrg      AS_MKDIR_P([$dirpart/$fdir])
38984bf8334Smrg      # echo "creating $dirpart/$file"
39084bf8334Smrg      echo '# dummy' > "$dirpart/$file"
39184bf8334Smrg    done
39284bf8334Smrg  done
39384bf8334Smrg}
39484bf8334Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
395fc27e79cSmrg
396659607e0Smrg
39784bf8334Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
39884bf8334Smrg# -----------------------------
39984bf8334Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
40084bf8334Smrg#
40184bf8334Smrg# This code is only required when automatic dependency tracking
40284bf8334Smrg# is enabled.  FIXME.  This creates each '.P' file that we will
40384bf8334Smrg# need in order to bootstrap the dependency handling code.
40484bf8334SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
40584bf8334Smrg[AC_CONFIG_COMMANDS([depfiles],
40684bf8334Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
40784bf8334Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
40884bf8334Smrg])
409659607e0Smrg
41084bf8334Smrg# Do all the work for Automake.                             -*- Autoconf -*-
411b73be646Smrg
41284bf8334Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
41384bf8334Smrg#
41484bf8334Smrg# This file is free software; the Free Software Foundation
41584bf8334Smrg# gives unlimited permission to copy and/or distribute it,
41684bf8334Smrg# with or without modifications, as long as this notice is preserved.
417659607e0Smrg
41884bf8334Smrg# This macro actually does too much.  Some checks are only needed if
41984bf8334Smrg# your package does certain things.  But this isn't really a big deal.
420659607e0Smrg
42184bf8334Smrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
42284bf8334Smrgm4_define([AC_PROG_CC],
42384bf8334Smrgm4_defn([AC_PROG_CC])
42484bf8334Smrg[_AM_PROG_CC_C_O
425b73be646Smrg])
426fc27e79cSmrg
42784bf8334Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
42884bf8334Smrg# AM_INIT_AUTOMAKE([OPTIONS])
42984bf8334Smrg# -----------------------------------------------
43084bf8334Smrg# The call with PACKAGE and VERSION arguments is the old style
43184bf8334Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
43284bf8334Smrg# and VERSION should now be passed to AC_INIT and removed from
43384bf8334Smrg# the call to AM_INIT_AUTOMAKE.
43484bf8334Smrg# We support both call styles for the transition.  After
43584bf8334Smrg# the next Automake release, Autoconf can make the AC_INIT
43684bf8334Smrg# arguments mandatory, and then we can depend on a new Autoconf
43784bf8334Smrg# release and drop the old call support.
43884bf8334SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
43984bf8334Smrg[AC_PREREQ([2.65])dnl
44084bf8334Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
44184bf8334Smrgdnl the ones we care about.
44284bf8334Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
44384bf8334SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
44484bf8334SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
44584bf8334Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
44684bf8334Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
44784bf8334Smrg  # is not polluted with repeated "-I."
44884bf8334Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
44984bf8334Smrg  # test to see if srcdir already configured
45084bf8334Smrg  if test -f $srcdir/config.status; then
45184bf8334Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
45284bf8334Smrg  fi
45384bf8334Smrgfi
454fc27e79cSmrg
45584bf8334Smrg# test whether we have cygpath
45684bf8334Smrgif test -z "$CYGPATH_W"; then
45784bf8334Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
45884bf8334Smrg    CYGPATH_W='cygpath -w'
45984bf8334Smrg  else
46084bf8334Smrg    CYGPATH_W=echo
46184bf8334Smrg  fi
46284bf8334Smrgfi
46384bf8334SmrgAC_SUBST([CYGPATH_W])
464fc27e79cSmrg
46584bf8334Smrg# Define the identity of the package.
46684bf8334Smrgdnl Distinguish between old-style and new-style calls.
46784bf8334Smrgm4_ifval([$2],
46884bf8334Smrg[AC_DIAGNOSE([obsolete],
46984bf8334Smrg             [$0: two- and three-arguments forms are deprecated.])
47084bf8334Smrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
47184bf8334Smrg AC_SUBST([PACKAGE], [$1])dnl
47284bf8334Smrg AC_SUBST([VERSION], [$2])],
47384bf8334Smrg[_AM_SET_OPTIONS([$1])dnl
47484bf8334Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
47584bf8334Smrgm4_if(
47684bf8334Smrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
47784bf8334Smrg  [ok:ok],,
47884bf8334Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
47984bf8334Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
48084bf8334Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
481fc27e79cSmrg
48284bf8334Smrg_AM_IF_OPTION([no-define],,
48384bf8334Smrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
48484bf8334Smrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
485fc27e79cSmrg
48684bf8334Smrg# Some tools Automake needs.
48784bf8334SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
48884bf8334SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
48984bf8334SmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
49084bf8334SmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
49184bf8334SmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
49284bf8334SmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
49384bf8334SmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
49484bf8334SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
49584bf8334SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
49684bf8334SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
49784bf8334Smrg# For better backward compatibility.  To be removed once Automake 1.9.x
49884bf8334Smrg# dies out for good.  For more background, see:
49984bf8334Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
50084bf8334Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
50184bf8334SmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
50284bf8334Smrg# We need awk for the "check" target.  The system "awk" is bad on
50384bf8334Smrg# some platforms.
50484bf8334SmrgAC_REQUIRE([AC_PROG_AWK])dnl
50584bf8334SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
50684bf8334SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
50784bf8334Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
50884bf8334Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
50984bf8334Smrg			     [_AM_PROG_TAR([v7])])])
51084bf8334Smrg_AM_IF_OPTION([no-dependencies],,
51184bf8334Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
51284bf8334Smrg		  [_AM_DEPENDENCIES([CC])],
51384bf8334Smrg		  [m4_define([AC_PROG_CC],
51484bf8334Smrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
51584bf8334SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
51684bf8334Smrg		  [_AM_DEPENDENCIES([CXX])],
51784bf8334Smrg		  [m4_define([AC_PROG_CXX],
51884bf8334Smrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
51984bf8334SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
52084bf8334Smrg		  [_AM_DEPENDENCIES([OBJC])],
52184bf8334Smrg		  [m4_define([AC_PROG_OBJC],
52284bf8334Smrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
52384bf8334SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
52484bf8334Smrg		  [_AM_DEPENDENCIES([OBJCXX])],
52584bf8334Smrg		  [m4_define([AC_PROG_OBJCXX],
52684bf8334Smrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
52784bf8334Smrg])
52884bf8334SmrgAC_REQUIRE([AM_SILENT_RULES])dnl
52984bf8334Smrgdnl The testsuite driver may need to know about EXEEXT, so add the
53084bf8334Smrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
53184bf8334Smrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
53284bf8334SmrgAC_CONFIG_COMMANDS_PRE(dnl
53384bf8334Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
53484bf8334Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
535fc27e79cSmrg
53684bf8334Smrg# POSIX will say in a future version that running "rm -f" with no argument
53784bf8334Smrg# is OK; and we want to be able to make that assumption in our Makefile
53884bf8334Smrg# recipes.  So use an aggressive probe to check that the usage we want is
53984bf8334Smrg# actually supported "in the wild" to an acceptable degree.
54084bf8334Smrg# See automake bug#10828.
54184bf8334Smrg# To make any issue more visible, cause the running configure to be aborted
54284bf8334Smrg# by default if the 'rm' program in use doesn't match our expectations; the
54384bf8334Smrg# user can still override this though.
54484bf8334Smrgif rm -f && rm -fr && rm -rf; then : OK; else
54584bf8334Smrg  cat >&2 <<'END'
54684bf8334SmrgOops!
54784bf8334Smrg
54884bf8334SmrgYour 'rm' program seems unable to run without file operands specified
54984bf8334Smrgon the command line, even when the '-f' option is present.  This is contrary
55084bf8334Smrgto the behaviour of most rm programs out there, and not conforming with
55184bf8334Smrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
55284bf8334Smrg
55384bf8334SmrgPlease tell bug-automake@gnu.org about your system, including the value
55484bf8334Smrgof your $PATH and any error possibly output before this message.  This
55584bf8334Smrgcan help us improve future automake versions.
556a73597f9Smrg
55784bf8334SmrgEND
55884bf8334Smrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
55984bf8334Smrg    echo 'Configuration will proceed anyway, since you have set the' >&2
56084bf8334Smrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
56184bf8334Smrg    echo >&2
56284bf8334Smrg  else
56384bf8334Smrg    cat >&2 <<'END'
56484bf8334SmrgAborting the configuration process, to ensure you take notice of the issue.
565fc27e79cSmrg
56684bf8334SmrgYou can download and install GNU coreutils to get an 'rm' implementation
56784bf8334Smrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
568fc27e79cSmrg
56984bf8334SmrgIf you want to complete the configuration process using your problematic
57084bf8334Smrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
57184bf8334Smrgto "yes", and re-run configure.
572659607e0Smrg
57384bf8334SmrgEND
57484bf8334Smrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
57584bf8334Smrg  fi
57684bf8334Smrgfi])
577659607e0Smrg
57884bf8334Smrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
57984bf8334Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
58084bf8334Smrgdnl mangled by Autoconf and run in a shell conditional statement.
58184bf8334Smrgm4_define([_AC_COMPILER_EXEEXT],
58284bf8334Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
583fc27e79cSmrg
58484bf8334Smrg# When config.status generates a header, we must update the stamp-h file.
58584bf8334Smrg# This file resides in the same directory as the config header
58684bf8334Smrg# that is generated.  The stamp files are numbered to have different names.
587fc27e79cSmrg
58884bf8334Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
58984bf8334Smrg# loop where config.status creates the headers, so we can generate
59084bf8334Smrg# our stamp files there.
59184bf8334SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
59284bf8334Smrg[# Compute $1's index in $config_headers.
59384bf8334Smrg_am_arg=$1
59484bf8334Smrg_am_stamp_count=1
59584bf8334Smrgfor _am_header in $config_headers :; do
59684bf8334Smrg  case $_am_header in
59784bf8334Smrg    $_am_arg | $_am_arg:* )
59884bf8334Smrg      break ;;
59984bf8334Smrg    * )
60084bf8334Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
60184bf8334Smrg  esac
60284bf8334Smrgdone
60384bf8334Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
604659607e0Smrg
60584bf8334Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
60684bf8334Smrg#
60784bf8334Smrg# This file is free software; the Free Software Foundation
60884bf8334Smrg# gives unlimited permission to copy and/or distribute it,
60984bf8334Smrg# with or without modifications, as long as this notice is preserved.
610659607e0Smrg
61184bf8334Smrg# AM_PROG_INSTALL_SH
61284bf8334Smrg# ------------------
61384bf8334Smrg# Define $install_sh.
61484bf8334SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
61584bf8334Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
61684bf8334Smrgif test x"${install_sh}" != xset; then
61784bf8334Smrg  case $am_aux_dir in
61884bf8334Smrg  *\ * | *\	*)
61984bf8334Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
62084bf8334Smrg  *)
62184bf8334Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
62284bf8334Smrg  esac
62384bf8334Smrgfi
62484bf8334SmrgAC_SUBST([install_sh])])
625659607e0Smrg
62684bf8334Smrg# Copyright (C) 2003-2013 Free Software Foundation, Inc.
62784bf8334Smrg#
62884bf8334Smrg# This file is free software; the Free Software Foundation
62984bf8334Smrg# gives unlimited permission to copy and/or distribute it,
63084bf8334Smrg# with or without modifications, as long as this notice is preserved.
631659607e0Smrg
63284bf8334Smrg# Check whether the underlying file-system supports filenames
63384bf8334Smrg# with a leading dot.  For instance MS-DOS doesn't.
63484bf8334SmrgAC_DEFUN([AM_SET_LEADING_DOT],
63584bf8334Smrg[rm -rf .tst 2>/dev/null
63684bf8334Smrgmkdir .tst 2>/dev/null
63784bf8334Smrgif test -d .tst; then
63884bf8334Smrg  am__leading_dot=.
63984bf8334Smrgelse
64084bf8334Smrg  am__leading_dot=_
64184bf8334Smrgfi
64284bf8334Smrgrmdir .tst 2>/dev/null
64384bf8334SmrgAC_SUBST([am__leading_dot])])
644659607e0Smrg
64584bf8334Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
646659607e0Smrg
64784bf8334Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
64884bf8334Smrg#
64984bf8334Smrg# This file is free software; the Free Software Foundation
65084bf8334Smrg# gives unlimited permission to copy and/or distribute it,
65184bf8334Smrg# with or without modifications, as long as this notice is preserved.
652fc27e79cSmrg
65384bf8334Smrg# AM_MAKE_INCLUDE()
65484bf8334Smrg# -----------------
65584bf8334Smrg# Check to see how make treats includes.
65684bf8334SmrgAC_DEFUN([AM_MAKE_INCLUDE],
65784bf8334Smrg[am_make=${MAKE-make}
65884bf8334Smrgcat > confinc << 'END'
65984bf8334Smrgam__doit:
66084bf8334Smrg	@echo this is the am__doit target
66184bf8334Smrg.PHONY: am__doit
66284bf8334SmrgEND
66384bf8334Smrg# If we don't find an include directive, just comment out the code.
66484bf8334SmrgAC_MSG_CHECKING([for style of include used by $am_make])
66584bf8334Smrgam__include="#"
66684bf8334Smrgam__quote=
66784bf8334Smrg_am_result=none
66884bf8334Smrg# First try GNU make style include.
66984bf8334Smrgecho "include confinc" > confmf
67084bf8334Smrg# Ignore all kinds of additional output from 'make'.
67184bf8334Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
67284bf8334Smrg*the\ am__doit\ target*)
67384bf8334Smrg  am__include=include
67484bf8334Smrg  am__quote=
67584bf8334Smrg  _am_result=GNU
67684bf8334Smrg  ;;
67784bf8334Smrgesac
67884bf8334Smrg# Now try BSD make style include.
67984bf8334Smrgif test "$am__include" = "#"; then
68084bf8334Smrg   echo '.include "confinc"' > confmf
68184bf8334Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
68284bf8334Smrg   *the\ am__doit\ target*)
68384bf8334Smrg     am__include=.include
68484bf8334Smrg     am__quote="\""
68584bf8334Smrg     _am_result=BSD
68684bf8334Smrg     ;;
68784bf8334Smrg   esac
68884bf8334Smrgfi
68984bf8334SmrgAC_SUBST([am__include])
69084bf8334SmrgAC_SUBST([am__quote])
69184bf8334SmrgAC_MSG_RESULT([$_am_result])
69284bf8334Smrgrm -f confinc confmf
693a73597f9Smrg])
694a73597f9Smrg
69584bf8334Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
696a73597f9Smrg
69784bf8334Smrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
698b73be646Smrg#
69984bf8334Smrg# This file is free software; the Free Software Foundation
70084bf8334Smrg# gives unlimited permission to copy and/or distribute it,
70184bf8334Smrg# with or without modifications, as long as this notice is preserved.
702fc27e79cSmrg
70384bf8334Smrg# AM_MISSING_PROG(NAME, PROGRAM)
70484bf8334Smrg# ------------------------------
70584bf8334SmrgAC_DEFUN([AM_MISSING_PROG],
70684bf8334Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
70784bf8334Smrg$1=${$1-"${am_missing_run}$2"}
70884bf8334SmrgAC_SUBST($1)])
709fc27e79cSmrg
71084bf8334Smrg# AM_MISSING_HAS_RUN
71184bf8334Smrg# ------------------
71284bf8334Smrg# Define MISSING if not defined so far and test if it is modern enough.
71384bf8334Smrg# If it is, set am_missing_run to use it, otherwise, to nothing.
71484bf8334SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
71584bf8334Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
71684bf8334SmrgAC_REQUIRE_AUX_FILE([missing])dnl
71784bf8334Smrgif test x"${MISSING+set}" != xset; then
71884bf8334Smrg  case $am_aux_dir in
71984bf8334Smrg  *\ * | *\	*)
72084bf8334Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
72184bf8334Smrg  *)
72284bf8334Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
72384bf8334Smrg  esac
72484bf8334Smrgfi
72584bf8334Smrg# Use eval to expand $SHELL
72684bf8334Smrgif eval "$MISSING --is-lightweight"; then
72784bf8334Smrg  am_missing_run="$MISSING "
72884bf8334Smrgelse
72984bf8334Smrg  am_missing_run=
73084bf8334Smrg  AC_MSG_WARN(['missing' script is too old or missing])
73184bf8334Smrgfi
732b73be646Smrg])
733b73be646Smrg
73484bf8334Smrg# Helper functions for option handling.                     -*- Autoconf -*-
735659607e0Smrg
73684bf8334Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
737b73be646Smrg#
73884bf8334Smrg# This file is free software; the Free Software Foundation
73984bf8334Smrg# gives unlimited permission to copy and/or distribute it,
74084bf8334Smrg# with or without modifications, as long as this notice is preserved.
741659607e0Smrg
74284bf8334Smrg# _AM_MANGLE_OPTION(NAME)
743a73597f9Smrg# -----------------------
74484bf8334SmrgAC_DEFUN([_AM_MANGLE_OPTION],
74584bf8334Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
746659607e0Smrg
74784bf8334Smrg# _AM_SET_OPTION(NAME)
74884bf8334Smrg# --------------------
74984bf8334Smrg# Set option NAME.  Presently that only means defining a flag for this option.
75084bf8334SmrgAC_DEFUN([_AM_SET_OPTION],
75184bf8334Smrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
752659607e0Smrg
75384bf8334Smrg# _AM_SET_OPTIONS(OPTIONS)
75484bf8334Smrg# ------------------------
75584bf8334Smrg# OPTIONS is a space-separated list of Automake options.
75684bf8334SmrgAC_DEFUN([_AM_SET_OPTIONS],
75784bf8334Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
758659607e0Smrg
75984bf8334Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
76084bf8334Smrg# -------------------------------------------
76184bf8334Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
76284bf8334SmrgAC_DEFUN([_AM_IF_OPTION],
76384bf8334Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
764fc27e79cSmrg
76584bf8334Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
76684bf8334Smrg#
76784bf8334Smrg# This file is free software; the Free Software Foundation
76884bf8334Smrg# gives unlimited permission to copy and/or distribute it,
76984bf8334Smrg# with or without modifications, as long as this notice is preserved.
770fc27e79cSmrg
77184bf8334Smrg# _AM_PROG_CC_C_O
77284bf8334Smrg# ---------------
77384bf8334Smrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
77484bf8334Smrg# to automatically call this.
77584bf8334SmrgAC_DEFUN([_AM_PROG_CC_C_O],
77684bf8334Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
77784bf8334SmrgAC_REQUIRE_AUX_FILE([compile])dnl
77884bf8334SmrgAC_LANG_PUSH([C])dnl
77984bf8334SmrgAC_CACHE_CHECK(
78084bf8334Smrg  [whether $CC understands -c and -o together],
78184bf8334Smrg  [am_cv_prog_cc_c_o],
78284bf8334Smrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
78384bf8334Smrg  # Make sure it works both with $CC and with simple cc.
78484bf8334Smrg  # Following AC_PROG_CC_C_O, we do the test twice because some
78584bf8334Smrg  # compilers refuse to overwrite an existing .o file with -o,
78684bf8334Smrg  # though they will create one.
78784bf8334Smrg  am_cv_prog_cc_c_o=yes
78884bf8334Smrg  for am_i in 1 2; do
78984bf8334Smrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
79084bf8334Smrg         && test -f conftest2.$ac_objext; then
79184bf8334Smrg      : OK
79284bf8334Smrg    else
79384bf8334Smrg      am_cv_prog_cc_c_o=no
79484bf8334Smrg      break
79584bf8334Smrg    fi
79684bf8334Smrg  done
79784bf8334Smrg  rm -f core conftest*
79884bf8334Smrg  unset am_i])
79984bf8334Smrgif test "$am_cv_prog_cc_c_o" != yes; then
80084bf8334Smrg   # Losing compiler, so override with the script.
80184bf8334Smrg   # FIXME: It is wrong to rewrite CC.
80284bf8334Smrg   # But if we don't then we get into trouble of one sort or another.
80384bf8334Smrg   # A longer-term fix would be to have automake use am__CC in this case,
80484bf8334Smrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
80584bf8334Smrg   CC="$am_aux_dir/compile $CC"
80684bf8334Smrgfi
80784bf8334SmrgAC_LANG_POP([C])])
808659607e0Smrg
80984bf8334Smrg# For backward compatibility.
81084bf8334SmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
811659607e0Smrg
81284bf8334Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
81384bf8334Smrg#
81484bf8334Smrg# This file is free software; the Free Software Foundation
81584bf8334Smrg# gives unlimited permission to copy and/or distribute it,
81684bf8334Smrg# with or without modifications, as long as this notice is preserved.
817659607e0Smrg
81884bf8334Smrg# AM_RUN_LOG(COMMAND)
81984bf8334Smrg# -------------------
82084bf8334Smrg# Run COMMAND, save the exit status in ac_status, and log it.
82184bf8334Smrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
82284bf8334SmrgAC_DEFUN([AM_RUN_LOG],
82384bf8334Smrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
82484bf8334Smrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
82584bf8334Smrg   ac_status=$?
82684bf8334Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
82784bf8334Smrg   (exit $ac_status); }])
828659607e0Smrg
82984bf8334Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
830659607e0Smrg
83184bf8334Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
83284bf8334Smrg#
83384bf8334Smrg# This file is free software; the Free Software Foundation
83484bf8334Smrg# gives unlimited permission to copy and/or distribute it,
83584bf8334Smrg# with or without modifications, as long as this notice is preserved.
836659607e0Smrg
83784bf8334Smrg# AM_SANITY_CHECK
83884bf8334Smrg# ---------------
83984bf8334SmrgAC_DEFUN([AM_SANITY_CHECK],
84084bf8334Smrg[AC_MSG_CHECKING([whether build environment is sane])
84184bf8334Smrg# Reject unsafe characters in $srcdir or the absolute working directory
84284bf8334Smrg# name.  Accept space and tab only in the latter.
84384bf8334Smrgam_lf='
84484bf8334Smrg'
84584bf8334Smrgcase `pwd` in
84684bf8334Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
84784bf8334Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
84884bf8334Smrgesac
84984bf8334Smrgcase $srcdir in
85084bf8334Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
85184bf8334Smrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
85284bf8334Smrgesac
8536aab59a7Smrg
85484bf8334Smrg# Do 'set' in a subshell so we don't clobber the current shell's
85584bf8334Smrg# arguments.  Must try -L first in case configure is actually a
85684bf8334Smrg# symlink; some systems play weird games with the mod time of symlinks
85784bf8334Smrg# (eg FreeBSD returns the mod time of the symlink's containing
85884bf8334Smrg# directory).
85984bf8334Smrgif (
86084bf8334Smrg   am_has_slept=no
86184bf8334Smrg   for am_try in 1 2; do
86284bf8334Smrg     echo "timestamp, slept: $am_has_slept" > conftest.file
86384bf8334Smrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
86484bf8334Smrg     if test "$[*]" = "X"; then
86584bf8334Smrg	# -L didn't work.
86684bf8334Smrg	set X `ls -t "$srcdir/configure" conftest.file`
86784bf8334Smrg     fi
86884bf8334Smrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
86984bf8334Smrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
870659607e0Smrg
87184bf8334Smrg	# If neither matched, then we have a broken ls.  This can happen
87284bf8334Smrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
87384bf8334Smrg	# broken ls alias from the environment.  This has actually
87484bf8334Smrg	# happened.  Such a system could not be considered "sane".
87584bf8334Smrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
87684bf8334Smrg  alias in your environment])
87784bf8334Smrg     fi
87884bf8334Smrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
87984bf8334Smrg       break
88084bf8334Smrg     fi
88184bf8334Smrg     # Just in case.
88284bf8334Smrg     sleep 1
88384bf8334Smrg     am_has_slept=yes
88484bf8334Smrg   done
88584bf8334Smrg   test "$[2]" = conftest.file
88684bf8334Smrg   )
88784bf8334Smrgthen
88884bf8334Smrg   # Ok.
88984bf8334Smrg   :
89084bf8334Smrgelse
89184bf8334Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
89284bf8334SmrgCheck your system clock])
89384bf8334Smrgfi
89484bf8334SmrgAC_MSG_RESULT([yes])
89584bf8334Smrg# If we didn't sleep, we still need to ensure time stamps of config.status and
89684bf8334Smrg# generated files are strictly newer.
89784bf8334Smrgam_sleep_pid=
89884bf8334Smrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
89984bf8334Smrg  ( sleep 1 ) &
90084bf8334Smrg  am_sleep_pid=$!
90184bf8334Smrgfi
90284bf8334SmrgAC_CONFIG_COMMANDS_PRE(
90384bf8334Smrg  [AC_MSG_CHECKING([that generated files are newer than configure])
90484bf8334Smrg   if test -n "$am_sleep_pid"; then
90584bf8334Smrg     # Hide warnings about reused PIDs.
90684bf8334Smrg     wait $am_sleep_pid 2>/dev/null
90784bf8334Smrg   fi
90884bf8334Smrg   AC_MSG_RESULT([done])])
90984bf8334Smrgrm -f conftest.file
910a73597f9Smrg])
911659607e0Smrg
91284bf8334Smrg# Copyright (C) 2009-2013 Free Software Foundation, Inc.
91384bf8334Smrg#
91484bf8334Smrg# This file is free software; the Free Software Foundation
91584bf8334Smrg# gives unlimited permission to copy and/or distribute it,
91684bf8334Smrg# with or without modifications, as long as this notice is preserved.
917659607e0Smrg
91884bf8334Smrg# AM_SILENT_RULES([DEFAULT])
91984bf8334Smrg# --------------------------
92084bf8334Smrg# Enable less verbose build rules; with the default set to DEFAULT
92184bf8334Smrg# ("yes" being less verbose, "no" or empty being verbose).
92284bf8334SmrgAC_DEFUN([AM_SILENT_RULES],
92384bf8334Smrg[AC_ARG_ENABLE([silent-rules], [dnl
92484bf8334SmrgAS_HELP_STRING(
92584bf8334Smrg  [--enable-silent-rules],
92684bf8334Smrg  [less verbose build output (undo: "make V=1")])
92784bf8334SmrgAS_HELP_STRING(
92884bf8334Smrg  [--disable-silent-rules],
92984bf8334Smrg  [verbose build output (undo: "make V=0")])dnl
93084bf8334Smrg])
93184bf8334Smrgcase $enable_silent_rules in @%:@ (((
93284bf8334Smrg  yes) AM_DEFAULT_VERBOSITY=0;;
93384bf8334Smrg   no) AM_DEFAULT_VERBOSITY=1;;
93484bf8334Smrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
93584bf8334Smrgesac
93684bf8334Smrgdnl
93784bf8334Smrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
93884bf8334Smrgdnl do not support nested variable expansions.
93984bf8334Smrgdnl See automake bug#9928 and bug#10237.
94084bf8334Smrgam_make=${MAKE-make}
94184bf8334SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
94284bf8334Smrg   [am_cv_make_support_nested_variables],
94384bf8334Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
94484bf8334SmrgBAR0=false
94584bf8334SmrgBAR1=true
94684bf8334SmrgV=1
94784bf8334Smrgam__doit:
94884bf8334Smrg	@$(TRUE)
94984bf8334Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
95084bf8334Smrg  am_cv_make_support_nested_variables=yes
95184bf8334Smrgelse
95284bf8334Smrg  am_cv_make_support_nested_variables=no
95384bf8334Smrgfi])
95484bf8334Smrgif test $am_cv_make_support_nested_variables = yes; then
95584bf8334Smrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
95684bf8334Smrg  AM_V='$(V)'
95784bf8334Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
95884bf8334Smrgelse
95984bf8334Smrg  AM_V=$AM_DEFAULT_VERBOSITY
96084bf8334Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
96184bf8334Smrgfi
96284bf8334SmrgAC_SUBST([AM_V])dnl
96384bf8334SmrgAM_SUBST_NOTMAKE([AM_V])dnl
96484bf8334SmrgAC_SUBST([AM_DEFAULT_V])dnl
96584bf8334SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
96684bf8334SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
96784bf8334SmrgAM_BACKSLASH='\'
96884bf8334SmrgAC_SUBST([AM_BACKSLASH])dnl
96984bf8334Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
97084bf8334Smrg])
971fc27e79cSmrg
97284bf8334Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
97384bf8334Smrg#
97484bf8334Smrg# This file is free software; the Free Software Foundation
97584bf8334Smrg# gives unlimited permission to copy and/or distribute it,
97684bf8334Smrg# with or without modifications, as long as this notice is preserved.
977fc27e79cSmrg
97884bf8334Smrg# AM_PROG_INSTALL_STRIP
97984bf8334Smrg# ---------------------
98084bf8334Smrg# One issue with vendor 'install' (even GNU) is that you can't
98184bf8334Smrg# specify the program used to strip binaries.  This is especially
98284bf8334Smrg# annoying in cross-compiling environments, where the build's strip
98384bf8334Smrg# is unlikely to handle the host's binaries.
98484bf8334Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
98584bf8334Smrg# always use install-sh in "make install-strip", and initialize
98684bf8334Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
98784bf8334SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
98884bf8334Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
98984bf8334Smrg# Installed binaries are usually stripped using 'strip' when the user
99084bf8334Smrg# run "make install-strip".  However 'strip' might not be the right
99184bf8334Smrg# tool to use in cross-compilation environments, therefore Automake
99284bf8334Smrg# will honor the 'STRIP' environment variable to overrule this program.
99384bf8334Smrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
99484bf8334Smrgif test "$cross_compiling" != no; then
99584bf8334Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
99684bf8334Smrgfi
99784bf8334SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
99884bf8334SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
999659607e0Smrg
100084bf8334Smrg# Copyright (C) 2006-2013 Free Software Foundation, Inc.
100184bf8334Smrg#
100284bf8334Smrg# This file is free software; the Free Software Foundation
100384bf8334Smrg# gives unlimited permission to copy and/or distribute it,
100484bf8334Smrg# with or without modifications, as long as this notice is preserved.
1005659607e0Smrg
100684bf8334Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
100784bf8334Smrg# ---------------------------
100884bf8334Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
100984bf8334Smrg# This macro is traced by Automake.
101084bf8334SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
1011fc27e79cSmrg
101284bf8334Smrg# AM_SUBST_NOTMAKE(VARIABLE)
101384bf8334Smrg# --------------------------
101484bf8334Smrg# Public sister of _AM_SUBST_NOTMAKE.
101584bf8334SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1016fc27e79cSmrg
101784bf8334Smrg# Check how to create a tarball.                            -*- Autoconf -*-
1018fc27e79cSmrg
101984bf8334Smrg# Copyright (C) 2004-2013 Free Software Foundation, Inc.
102084bf8334Smrg#
102184bf8334Smrg# This file is free software; the Free Software Foundation
102284bf8334Smrg# gives unlimited permission to copy and/or distribute it,
102384bf8334Smrg# with or without modifications, as long as this notice is preserved.
1024fc27e79cSmrg
102584bf8334Smrg# _AM_PROG_TAR(FORMAT)
102684bf8334Smrg# --------------------
102784bf8334Smrg# Check how to create a tarball in format FORMAT.
102884bf8334Smrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
102984bf8334Smrg#
103084bf8334Smrg# Substitute a variable $(am__tar) that is a command
103184bf8334Smrg# writing to stdout a FORMAT-tarball containing the directory
103284bf8334Smrg# $tardir.
103384bf8334Smrg#     tardir=directory && $(am__tar) > result.tar
103484bf8334Smrg#
103584bf8334Smrg# Substitute a variable $(am__untar) that extract such
103684bf8334Smrg# a tarball read from stdin.
103784bf8334Smrg#     $(am__untar) < result.tar
103884bf8334Smrg#
103984bf8334SmrgAC_DEFUN([_AM_PROG_TAR],
104084bf8334Smrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
104184bf8334Smrg# in the wild :-(  We should find a proper way to deprecate it ...
104284bf8334SmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
1043fc27e79cSmrg
104484bf8334Smrg# We'll loop over all known methods to create a tar archive until one works.
104584bf8334Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1046fc27e79cSmrg
104784bf8334Smrgm4_if([$1], [v7],
104884bf8334Smrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
104984bf8334Smrg
105084bf8334Smrg  [m4_case([$1],
105184bf8334Smrg    [ustar],
105284bf8334Smrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
105384bf8334Smrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
105484bf8334Smrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
105584bf8334Smrg      # and bug#13588).
105684bf8334Smrg      am_max_uid=2097151 # 2^21 - 1
105784bf8334Smrg      am_max_gid=$am_max_uid
105884bf8334Smrg      # The $UID and $GID variables are not portable, so we need to resort
105984bf8334Smrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
106084bf8334Smrg      # below are definitely unexpected, so allow the users to see them
106184bf8334Smrg      # (that is, avoid stderr redirection).
106284bf8334Smrg      am_uid=`id -u || echo unknown`
106384bf8334Smrg      am_gid=`id -g || echo unknown`
106484bf8334Smrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
106584bf8334Smrg      if test $am_uid -le $am_max_uid; then
106684bf8334Smrg         AC_MSG_RESULT([yes])
106784bf8334Smrg      else
106884bf8334Smrg         AC_MSG_RESULT([no])
106984bf8334Smrg         _am_tools=none
107084bf8334Smrg      fi
107184bf8334Smrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
107284bf8334Smrg      if test $am_gid -le $am_max_gid; then
107384bf8334Smrg         AC_MSG_RESULT([yes])
107484bf8334Smrg      else
107584bf8334Smrg        AC_MSG_RESULT([no])
107684bf8334Smrg        _am_tools=none
107784bf8334Smrg      fi],
1078fc27e79cSmrg
107984bf8334Smrg  [pax],
108084bf8334Smrg    [],
1081659607e0Smrg
108284bf8334Smrg  [m4_fatal([Unknown tar format])])
1083659607e0Smrg
108484bf8334Smrg  AC_MSG_CHECKING([how to create a $1 tar archive])
1085659607e0Smrg
108684bf8334Smrg  # Go ahead even if we have the value already cached.  We do so because we
108784bf8334Smrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
108884bf8334Smrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1089659607e0Smrg
109084bf8334Smrg  for _am_tool in $_am_tools; do
109184bf8334Smrg    case $_am_tool in
109284bf8334Smrg    gnutar)
109384bf8334Smrg      for _am_tar in tar gnutar gtar; do
109484bf8334Smrg        AM_RUN_LOG([$_am_tar --version]) && break
109584bf8334Smrg      done
109684bf8334Smrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
109784bf8334Smrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
109884bf8334Smrg      am__untar="$_am_tar -xf -"
109984bf8334Smrg      ;;
110084bf8334Smrg    plaintar)
110184bf8334Smrg      # Must skip GNU tar: if it does not support --format= it doesn't create
110284bf8334Smrg      # ustar tarball either.
110384bf8334Smrg      (tar --version) >/dev/null 2>&1 && continue
110484bf8334Smrg      am__tar='tar chf - "$$tardir"'
110584bf8334Smrg      am__tar_='tar chf - "$tardir"'
110684bf8334Smrg      am__untar='tar xf -'
110784bf8334Smrg      ;;
110884bf8334Smrg    pax)
110984bf8334Smrg      am__tar='pax -L -x $1 -w "$$tardir"'
111084bf8334Smrg      am__tar_='pax -L -x $1 -w "$tardir"'
111184bf8334Smrg      am__untar='pax -r'
111284bf8334Smrg      ;;
111384bf8334Smrg    cpio)
111484bf8334Smrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
111584bf8334Smrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
111684bf8334Smrg      am__untar='cpio -i -H $1 -d'
111784bf8334Smrg      ;;
111884bf8334Smrg    none)
111984bf8334Smrg      am__tar=false
112084bf8334Smrg      am__tar_=false
112184bf8334Smrg      am__untar=false
112284bf8334Smrg      ;;
112384bf8334Smrg    esac
112484bf8334Smrg
112584bf8334Smrg    # If the value was cached, stop now.  We just wanted to have am__tar
112684bf8334Smrg    # and am__untar set.
112784bf8334Smrg    test -n "${am_cv_prog_tar_$1}" && break
112884bf8334Smrg
112984bf8334Smrg    # tar/untar a dummy directory, and stop if the command works.
113084bf8334Smrg    rm -rf conftest.dir
113184bf8334Smrg    mkdir conftest.dir
113284bf8334Smrg    echo GrepMe > conftest.dir/file
113384bf8334Smrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
113484bf8334Smrg    rm -rf conftest.dir
113584bf8334Smrg    if test -s conftest.tar; then
113684bf8334Smrg      AM_RUN_LOG([$am__untar <conftest.tar])
113784bf8334Smrg      AM_RUN_LOG([cat conftest.dir/file])
113884bf8334Smrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1139a73597f9Smrg    fi
114084bf8334Smrg  done
114184bf8334Smrg  rm -rf conftest.dir
1142659607e0Smrg
114384bf8334Smrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
114484bf8334Smrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1145659607e0Smrg
114684bf8334SmrgAC_SUBST([am__tar])
114784bf8334SmrgAC_SUBST([am__untar])
114884bf8334Smrg]) # _AM_PROG_TAR
1149659607e0Smrg
115084bf8334Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
1151a73597f9Smrg#
115284bf8334Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
115384bf8334Smrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
115484bf8334Smrg#                 Foundation, Inc.
115584bf8334Smrg#   Written by Gordon Matzigkeit, 1996
115684bf8334Smrg#
115784bf8334Smrg# This file is free software; the Free Software Foundation gives
115884bf8334Smrg# unlimited permission to copy and/or distribute it, with or without
115984bf8334Smrg# modifications, as long as this notice is preserved.
1160a73597f9Smrg
116184bf8334Smrgm4_define([_LT_COPYING], [dnl
116284bf8334Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
116384bf8334Smrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
116484bf8334Smrg#                 Foundation, Inc.
116584bf8334Smrg#   Written by Gordon Matzigkeit, 1996
116684bf8334Smrg#
116784bf8334Smrg#   This file is part of GNU Libtool.
116884bf8334Smrg#
116984bf8334Smrg# GNU Libtool is free software; you can redistribute it and/or
117084bf8334Smrg# modify it under the terms of the GNU General Public License as
117184bf8334Smrg# published by the Free Software Foundation; either version 2 of
117284bf8334Smrg# the License, or (at your option) any later version.
117384bf8334Smrg#
117484bf8334Smrg# As a special exception to the GNU General Public License,
117584bf8334Smrg# if you distribute this file as part of a program or library that
117684bf8334Smrg# is built using GNU Libtool, you may include this file under the
117784bf8334Smrg# same distribution terms that you use for the rest of that program.
117884bf8334Smrg#
117984bf8334Smrg# GNU Libtool is distributed in the hope that it will be useful,
118084bf8334Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
118184bf8334Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
118284bf8334Smrg# GNU General Public License for more details.
118384bf8334Smrg#
118484bf8334Smrg# You should have received a copy of the GNU General Public License
118584bf8334Smrg# along with GNU Libtool; see the file COPYING.  If not, a copy
118684bf8334Smrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
118784bf8334Smrg# obtained by writing to the Free Software Foundation, Inc.,
118884bf8334Smrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
118984bf8334Smrg])
1190a73597f9Smrg
119184bf8334Smrg# serial 57 LT_INIT
1192a73597f9Smrg
11936aab59a7Smrg
119484bf8334Smrg# LT_PREREQ(VERSION)
119584bf8334Smrg# ------------------
119684bf8334Smrg# Complain and exit if this libtool version is less that VERSION.
119784bf8334Smrgm4_defun([LT_PREREQ],
119884bf8334Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
119984bf8334Smrg       [m4_default([$3],
120084bf8334Smrg		   [m4_fatal([Libtool version $1 or higher is required],
120184bf8334Smrg		             63)])],
120284bf8334Smrg       [$2])])
1203659607e0Smrg
1204659607e0Smrg
120584bf8334Smrg# _LT_CHECK_BUILDDIR
120684bf8334Smrg# ------------------
120784bf8334Smrg# Complain if the absolute build directory name contains unusual characters
120884bf8334Smrgm4_defun([_LT_CHECK_BUILDDIR],
120984bf8334Smrg[case `pwd` in
121084bf8334Smrg  *\ * | *\	*)
121184bf8334Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
121284bf8334Smrgesac
121384bf8334Smrg])
1214659607e0Smrg
1215659607e0Smrg
121684bf8334Smrg# LT_INIT([OPTIONS])
121784bf8334Smrg# ------------------
121884bf8334SmrgAC_DEFUN([LT_INIT],
121984bf8334Smrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
122084bf8334SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
122184bf8334SmrgAC_BEFORE([$0], [LT_LANG])dnl
122284bf8334SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
122384bf8334SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
122484bf8334Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
1225659607e0Smrg
122684bf8334Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
122784bf8334Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
122884bf8334Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
122984bf8334Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
123084bf8334Smrgdnl unless we require an AC_DEFUNed macro:
123184bf8334SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
123284bf8334SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
123384bf8334SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
123484bf8334SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
123584bf8334Smrgm4_require([_LT_PROG_LTMAIN])dnl
1236659607e0Smrg
123784bf8334Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
12386aab59a7Smrg
123984bf8334Smrgdnl Parse OPTIONS
124084bf8334Smrg_LT_SET_OPTIONS([$0], [$1])
1241fc27e79cSmrg
124284bf8334Smrg# This can be used to rebuild libtool when needed
124384bf8334SmrgLIBTOOL_DEPS="$ltmain"
1244659607e0Smrg
124584bf8334Smrg# Always use our own libtool.
124684bf8334SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
124784bf8334SmrgAC_SUBST(LIBTOOL)dnl
1248659607e0Smrg
124984bf8334Smrg_LT_SETUP
1250659607e0Smrg
125184bf8334Smrg# Only expand once:
125284bf8334Smrgm4_define([LT_INIT])
125384bf8334Smrg])# LT_INIT
1254659607e0Smrg
125584bf8334Smrg# Old names:
125684bf8334SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
125784bf8334SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
125884bf8334Smrgdnl aclocal-1.4 backwards compatibility:
125984bf8334Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
126084bf8334Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
1261659607e0Smrg
1262b73be646Smrg
126384bf8334Smrg# _LT_CC_BASENAME(CC)
126484bf8334Smrg# -------------------
126584bf8334Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
126684bf8334Smrgm4_defun([_LT_CC_BASENAME],
126784bf8334Smrg[for cc_temp in $1""; do
126884bf8334Smrg  case $cc_temp in
126984bf8334Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
127084bf8334Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
127184bf8334Smrg    \-*) ;;
127284bf8334Smrg    *) break;;
127384bf8334Smrg  esac
127484bf8334Smrgdone
127584bf8334Smrgcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
127684bf8334Smrg])
1277659607e0Smrg
1278659607e0Smrg
127984bf8334Smrg# _LT_FILEUTILS_DEFAULTS
128084bf8334Smrg# ----------------------
128184bf8334Smrg# It is okay to use these file commands and assume they have been set
128284bf8334Smrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
128384bf8334Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
128484bf8334Smrg[: ${CP="cp -f"}
128584bf8334Smrg: ${MV="mv -f"}
128684bf8334Smrg: ${RM="rm -f"}
128784bf8334Smrg])# _LT_FILEUTILS_DEFAULTS
1288b73be646Smrg
1289bd3a1963Smrg
129084bf8334Smrg# _LT_SETUP
129184bf8334Smrg# ---------
129284bf8334Smrgm4_defun([_LT_SETUP],
129384bf8334Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
129484bf8334SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
129584bf8334SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
129684bf8334SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1297bd3a1963Smrg
129884bf8334Smrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
129984bf8334Smrgdnl
130084bf8334Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
130184bf8334Smrg_LT_DECL([], [host], [0])dnl
130284bf8334Smrg_LT_DECL([], [host_os], [0])dnl
130384bf8334Smrgdnl
130484bf8334Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
130584bf8334Smrg_LT_DECL([], [build], [0])dnl
130684bf8334Smrg_LT_DECL([], [build_os], [0])dnl
130784bf8334Smrgdnl
130884bf8334SmrgAC_REQUIRE([AC_PROG_CC])dnl
130984bf8334SmrgAC_REQUIRE([LT_PATH_LD])dnl
131084bf8334SmrgAC_REQUIRE([LT_PATH_NM])dnl
131184bf8334Smrgdnl
131284bf8334SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
131384bf8334Smrgtest -z "$LN_S" && LN_S="ln -s"
131484bf8334Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
131584bf8334Smrgdnl
131684bf8334SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
131784bf8334Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
131884bf8334Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
131984bf8334Smrgdnl
132084bf8334Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
132184bf8334Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
132284bf8334Smrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
132384bf8334Smrgm4_require([_LT_CMD_RELOAD])dnl
132484bf8334Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
132584bf8334Smrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
132684bf8334Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
132784bf8334Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
132884bf8334Smrgm4_require([_LT_WITH_SYSROOT])dnl
1329bd3a1963Smrg
133084bf8334Smrg_LT_CONFIG_LIBTOOL_INIT([
133184bf8334Smrg# See if we are running on zsh, and set the options which allow our
133284bf8334Smrg# commands through without removal of \ escapes INIT.
133384bf8334Smrgif test -n "\${ZSH_VERSION+set}" ; then
133484bf8334Smrg   setopt NO_GLOB_SUBST
133584bf8334Smrgfi
133684bf8334Smrg])
133784bf8334Smrgif test -n "${ZSH_VERSION+set}" ; then
133884bf8334Smrg   setopt NO_GLOB_SUBST
133984bf8334Smrgfi
1340bd3a1963Smrg
134184bf8334Smrg_LT_CHECK_OBJDIR
1342bd3a1963Smrg
134384bf8334Smrgm4_require([_LT_TAG_COMPILER])dnl
1344bd3a1963Smrg
134584bf8334Smrgcase $host_os in
134684bf8334Smrgaix3*)
134784bf8334Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
134884bf8334Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
134984bf8334Smrg  # vanish in a puff of smoke.
135084bf8334Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
135184bf8334Smrg    COLLECT_NAMES=
135284bf8334Smrg    export COLLECT_NAMES
135384bf8334Smrg  fi
135484bf8334Smrg  ;;
135584bf8334Smrgesac
1356a73597f9Smrg
135784bf8334Smrg# Global variables:
135884bf8334Smrgofile=libtool
135984bf8334Smrgcan_build_shared=yes
1360b73be646Smrg
136184bf8334Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
136284bf8334Smrg# which needs '.lib').
136384bf8334Smrglibext=a
1364659607e0Smrg
136584bf8334Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
1366b73be646Smrg
136784bf8334Smrgold_CC="$CC"
136884bf8334Smrgold_CFLAGS="$CFLAGS"
1369b73be646Smrg
137084bf8334Smrg# Set sane defaults for various variables
137184bf8334Smrgtest -z "$CC" && CC=cc
137284bf8334Smrgtest -z "$LTCC" && LTCC=$CC
137384bf8334Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
137484bf8334Smrgtest -z "$LD" && LD=ld
137584bf8334Smrgtest -z "$ac_objext" && ac_objext=o
1376b73be646Smrg
137784bf8334Smrg_LT_CC_BASENAME([$compiler])
1378b73be646Smrg
137984bf8334Smrg# Only perform the check for file, if the check method requires it
138084bf8334Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
138184bf8334Smrgcase $deplibs_check_method in
138284bf8334Smrgfile_magic*)
138384bf8334Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
138484bf8334Smrg    _LT_PATH_MAGIC
138584bf8334Smrg  fi
138684bf8334Smrg  ;;
138784bf8334Smrgesac
1388659607e0Smrg
138984bf8334Smrg# Use C for the default configuration in the libtool script
139084bf8334SmrgLT_SUPPORTED_TAG([CC])
139184bf8334Smrg_LT_LANG_C_CONFIG
139284bf8334Smrg_LT_LANG_DEFAULT_CONFIG
139384bf8334Smrg_LT_CONFIG_COMMANDS
139484bf8334Smrg])# _LT_SETUP
1395659607e0Smrg
1396659607e0Smrg
139784bf8334Smrg# _LT_PREPARE_SED_QUOTE_VARS
139884bf8334Smrg# --------------------------
139984bf8334Smrg# Define a few sed substitution that help us do robust quoting.
140084bf8334Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
140184bf8334Smrg[# Backslashify metacharacters that are still active within
140284bf8334Smrg# double-quoted strings.
140384bf8334Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
1404b73be646Smrg
140584bf8334Smrg# Same as above, but do not quote variable references.
140684bf8334Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
1407659607e0Smrg
140884bf8334Smrg# Sed substitution to delay expansion of an escaped shell variable in a
140984bf8334Smrg# double_quote_subst'ed string.
141084bf8334Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1411659607e0Smrg
141284bf8334Smrg# Sed substitution to delay expansion of an escaped single quote.
141384bf8334Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
141484bf8334Smrg
141584bf8334Smrg# Sed substitution to avoid accidental globbing in evaled expressions
141684bf8334Smrgno_glob_subst='s/\*/\\\*/g'
14176aab59a7Smrg])
1418659607e0Smrg
141984bf8334Smrg# _LT_PROG_LTMAIN
142084bf8334Smrg# ---------------
142184bf8334Smrg# Note that this code is called both from `configure', and `config.status'
142284bf8334Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
142384bf8334Smrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
142484bf8334Smrg# so we pass a copy along to make sure it has a sensible value anyway.
142584bf8334Smrgm4_defun([_LT_PROG_LTMAIN],
142684bf8334Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
142784bf8334Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
142884bf8334Smrgltmain="$ac_aux_dir/ltmain.sh"
142984bf8334Smrg])# _LT_PROG_LTMAIN
1430659607e0Smrg
1431659607e0Smrg
1432659607e0Smrg
143384bf8334Smrg# So that we can recreate a full libtool script including additional
143484bf8334Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
143584bf8334Smrg# in macros and then make a single call at the end using the `libtool'
143684bf8334Smrg# label.
1437659607e0Smrg
1438659607e0Smrg
143984bf8334Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
144084bf8334Smrg# ----------------------------------------
144184bf8334Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
144284bf8334Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
144384bf8334Smrg[m4_ifval([$1],
144484bf8334Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
144584bf8334Smrg                     [$1
144684bf8334Smrg])])])
1447fc27e79cSmrg
144884bf8334Smrg# Initialize.
144984bf8334Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
1450659607e0Smrg
1451659607e0Smrg
145284bf8334Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
145384bf8334Smrg# ------------------------------
145484bf8334Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
145584bf8334Smrgm4_define([_LT_CONFIG_LIBTOOL],
145684bf8334Smrg[m4_ifval([$1],
145784bf8334Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
145884bf8334Smrg                     [$1
145984bf8334Smrg])])])
1460659607e0Smrg
146184bf8334Smrg# Initialize.
146284bf8334Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
1463659607e0Smrg
1464659607e0Smrg
146584bf8334Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
146684bf8334Smrg# -----------------------------------------------------
146784bf8334Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
146884bf8334Smrg[_LT_CONFIG_LIBTOOL([$1])
146984bf8334Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
147084bf8334Smrg])
1471fc27e79cSmrg
1472bd3a1963Smrg
147384bf8334Smrg# _LT_FORMAT_COMMENT([COMMENT])
147484bf8334Smrg# -----------------------------
147584bf8334Smrg# Add leading comment marks to the start of each line, and a trailing
147684bf8334Smrg# full-stop to the whole comment if one is not present already.
147784bf8334Smrgm4_define([_LT_FORMAT_COMMENT],
147884bf8334Smrg[m4_ifval([$1], [
147984bf8334Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
148084bf8334Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
148184bf8334Smrg)])
1482bd3a1963Smrg
1483bd3a1963Smrg
1484bd3a1963Smrg
1485bd3a1963Smrg
1486659607e0Smrg
148784bf8334Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
148884bf8334Smrg# -------------------------------------------------------------------
148984bf8334Smrg# CONFIGNAME is the name given to the value in the libtool script.
149084bf8334Smrg# VARNAME is the (base) name used in the configure script.
149184bf8334Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
149284bf8334Smrg# VARNAME.  Any other value will be used directly.
149384bf8334Smrgm4_define([_LT_DECL],
149484bf8334Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
149584bf8334Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
149684bf8334Smrg	[m4_ifval([$1], [$1], [$2])])
149784bf8334Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
149884bf8334Smrg    m4_ifval([$4],
149984bf8334Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
150084bf8334Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
150184bf8334Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
150284bf8334Smrg])
1503fc27e79cSmrg
1504fc27e79cSmrg
150584bf8334Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
150684bf8334Smrg# --------------------------------------------------------
150784bf8334Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
1508fc27e79cSmrg
1509659607e0Smrg
151084bf8334Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
151184bf8334Smrg# ------------------------------------------------
151284bf8334Smrgm4_define([lt_decl_tag_varnames],
151384bf8334Smrg[_lt_decl_filter([tagged?], [yes], $@)])
1514fc27e79cSmrg
1515fc27e79cSmrg
151684bf8334Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
151784bf8334Smrg# ---------------------------------------------------------
151884bf8334Smrgm4_define([_lt_decl_filter],
151984bf8334Smrg[m4_case([$#],
152084bf8334Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
152184bf8334Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
152284bf8334Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
152384bf8334Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
152484bf8334Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
152584bf8334Smrg])
1526fc27e79cSmrg
1527659607e0Smrg
152884bf8334Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
152984bf8334Smrg# --------------------------------------------------
153084bf8334Smrgm4_define([lt_decl_quote_varnames],
153184bf8334Smrg[_lt_decl_filter([value], [1], $@)])
1532659607e0Smrg
1533659607e0Smrg
153484bf8334Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
153584bf8334Smrg# ---------------------------------------------------
153684bf8334Smrgm4_define([lt_decl_dquote_varnames],
153784bf8334Smrg[_lt_decl_filter([value], [2], $@)])
15386aab59a7Smrg
15396aab59a7Smrg
154084bf8334Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
154184bf8334Smrg# ---------------------------------------------------
154284bf8334Smrgm4_define([lt_decl_varnames_tagged],
154384bf8334Smrg[m4_assert([$# <= 2])dnl
154484bf8334Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
154584bf8334Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
154684bf8334Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
154784bf8334Smrgm4_define([_lt_decl_varnames_tagged],
154884bf8334Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
15496aab59a7Smrg
1550659607e0Smrg
155184bf8334Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
155284bf8334Smrg# ------------------------------------------------
155384bf8334Smrgm4_define([lt_decl_all_varnames],
155484bf8334Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
155584bf8334Smrg     m4_if([$2], [],
155684bf8334Smrg	   m4_quote(lt_decl_varnames),
155784bf8334Smrg	m4_quote(m4_shift($@))))[]dnl
155884bf8334Smrg])
155984bf8334Smrgm4_define([_lt_decl_all_varnames],
156084bf8334Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
156184bf8334Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
156284bf8334Smrg])
1563659607e0Smrg
1564659607e0Smrg
156584bf8334Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
156684bf8334Smrg# ------------------------------------
156784bf8334Smrg# Quote a variable value, and forward it to `config.status' so that its
156884bf8334Smrg# declaration there will have the same value as in `configure'.  VARNAME
156984bf8334Smrg# must have a single quote delimited value for this to work.
157084bf8334Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
157184bf8334Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
1572659607e0Smrg
1573659607e0Smrg
157484bf8334Smrg# _LT_CONFIG_STATUS_DECLARATIONS
157584bf8334Smrg# ------------------------------
157684bf8334Smrg# We delimit libtool config variables with single quotes, so when
157784bf8334Smrg# we write them to config.status, we have to be sure to quote all
157884bf8334Smrg# embedded single quotes properly.  In configure, this macro expands
157984bf8334Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
158084bf8334Smrg#
158184bf8334Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
158284bf8334Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
158384bf8334Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
158484bf8334Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
1585659607e0Smrg
1586659607e0Smrg
158784bf8334Smrg# _LT_LIBTOOL_TAGS
158884bf8334Smrg# ----------------
158984bf8334Smrg# Output comment and list of tags supported by the script
159084bf8334Smrgm4_defun([_LT_LIBTOOL_TAGS],
159184bf8334Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
159284bf8334Smrgavailable_tags="_LT_TAGS"dnl
1593b73be646Smrg])
1594659607e0Smrg
1595659607e0Smrg
159684bf8334Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
159784bf8334Smrg# -----------------------------------
159884bf8334Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
159984bf8334Smrg# expand to a commented shell variable setting:
160084bf8334Smrg#
160184bf8334Smrg#    # Some comment about what VAR is for.
160284bf8334Smrg#    visible_name=$lt_internal_name
160384bf8334Smrgm4_define([_LT_LIBTOOL_DECLARE],
160484bf8334Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
160584bf8334Smrg					   [description])))[]dnl
160684bf8334Smrgm4_pushdef([_libtool_name],
160784bf8334Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
160884bf8334Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
160984bf8334Smrg    [0], [_libtool_name=[$]$1],
161084bf8334Smrg    [1], [_libtool_name=$lt_[]$1],
161184bf8334Smrg    [2], [_libtool_name=$lt_[]$1],
161284bf8334Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
161384bf8334Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
161484bf8334Smrg])
1615659607e0Smrg
1616659607e0Smrg
161784bf8334Smrg# _LT_LIBTOOL_CONFIG_VARS
161884bf8334Smrg# -----------------------
161984bf8334Smrg# Produce commented declarations of non-tagged libtool config variables
162084bf8334Smrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
162184bf8334Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
162284bf8334Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
162384bf8334Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
162484bf8334Smrg[m4_foreach([_lt_var],
162584bf8334Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
162684bf8334Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
1627659607e0Smrg
1628fc27e79cSmrg
162984bf8334Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
163084bf8334Smrg# -------------------------
163184bf8334Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
163284bf8334Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
163384bf8334Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
1634fc27e79cSmrg
1635659607e0Smrg
163684bf8334Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
163784bf8334Smrg# ------------------------------
163884bf8334Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
1639659607e0Smrg
1640659607e0Smrg
164184bf8334Smrg# _LT_CONFIG_COMMANDS
164284bf8334Smrg# -------------------
164384bf8334Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
164484bf8334Smrg# variables for single and double quote escaping we saved from calls
164584bf8334Smrg# to _LT_DECL, we can put quote escaped variables declarations
164684bf8334Smrg# into `config.status', and then the shell code to quote escape them in
164784bf8334Smrg# for loops in `config.status'.  Finally, any additional code accumulated
164884bf8334Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
164984bf8334Smrgm4_defun([_LT_CONFIG_COMMANDS],
165084bf8334Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
165184bf8334Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
165284bf8334Smrg	dnl instead of duplicating it all over again into config.status,
165384bf8334Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
165484bf8334Smrg	dnl needs to know what name is stored there:
165584bf8334Smrg        [AC_CONFIG_COMMANDS([libtool],
165684bf8334Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
165784bf8334Smrg    dnl If the libtool generation code is destined for config.status,
165884bf8334Smrg    dnl expand the accumulated commands and init code now:
165984bf8334Smrg    [AC_CONFIG_COMMANDS([libtool],
166084bf8334Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
166184bf8334Smrg])#_LT_CONFIG_COMMANDS
1662659607e0Smrg
1663659607e0Smrg
166484bf8334Smrg# Initialize.
166584bf8334Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
166684bf8334Smrg[
1667659607e0Smrg
166884bf8334Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
166984bf8334Smrg# if CDPATH is set.
167084bf8334Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1671659607e0Smrg
167284bf8334Smrgsed_quote_subst='$sed_quote_subst'
167384bf8334Smrgdouble_quote_subst='$double_quote_subst'
167484bf8334Smrgdelay_variable_subst='$delay_variable_subst'
167584bf8334Smrg_LT_CONFIG_STATUS_DECLARATIONS
167684bf8334SmrgLTCC='$LTCC'
167784bf8334SmrgLTCFLAGS='$LTCFLAGS'
167884bf8334Smrgcompiler='$compiler_DEFAULT'
1679659607e0Smrg
168084bf8334Smrg# A function that is used when there is no print builtin or printf.
168184bf8334Smrgfunc_fallback_echo ()
168284bf8334Smrg{
168384bf8334Smrg  eval 'cat <<_LTECHO_EOF
168484bf8334Smrg\$[]1
168584bf8334Smrg_LTECHO_EOF'
168684bf8334Smrg}
1687659607e0Smrg
168884bf8334Smrg# Quote evaled strings.
168984bf8334Smrgfor var in lt_decl_all_varnames([[ \
169084bf8334Smrg]], lt_decl_quote_varnames); do
169184bf8334Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
169284bf8334Smrg    *[[\\\\\\\`\\"\\\$]]*)
169384bf8334Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
169484bf8334Smrg      ;;
169584bf8334Smrg    *)
169684bf8334Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
169784bf8334Smrg      ;;
169884bf8334Smrg    esac
169984bf8334Smrgdone
1700659607e0Smrg
170184bf8334Smrg# Double-quote double-evaled strings.
170284bf8334Smrgfor var in lt_decl_all_varnames([[ \
170384bf8334Smrg]], lt_decl_dquote_varnames); do
170484bf8334Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
170584bf8334Smrg    *[[\\\\\\\`\\"\\\$]]*)
170684bf8334Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
170784bf8334Smrg      ;;
170884bf8334Smrg    *)
170984bf8334Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
171084bf8334Smrg      ;;
171184bf8334Smrg    esac
171284bf8334Smrgdone
1713659607e0Smrg
171484bf8334Smrg_LT_OUTPUT_LIBTOOL_INIT
171584bf8334Smrg])
1716659607e0Smrg
171784bf8334Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
171884bf8334Smrg# ------------------------------------
171984bf8334Smrg# Generate a child script FILE with all initialization necessary to
172084bf8334Smrg# reuse the environment learned by the parent script, and make the
172184bf8334Smrg# file executable.  If COMMENT is supplied, it is inserted after the
172284bf8334Smrg# `#!' sequence but before initialization text begins.  After this
172384bf8334Smrg# macro, additional text can be appended to FILE to form the body of
172484bf8334Smrg# the child script.  The macro ends with non-zero status if the
172584bf8334Smrg# file could not be fully written (such as if the disk is full).
172684bf8334Smrgm4_ifdef([AS_INIT_GENERATED],
172784bf8334Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
172884bf8334Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
172984bf8334Smrg[m4_require([AS_PREPARE])]dnl
173084bf8334Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
173184bf8334Smrg[lt_write_fail=0
173284bf8334Smrgcat >$1 <<_ASEOF || lt_write_fail=1
173384bf8334Smrg#! $SHELL
173484bf8334Smrg# Generated by $as_me.
173584bf8334Smrg$2
173684bf8334SmrgSHELL=\${CONFIG_SHELL-$SHELL}
173784bf8334Smrgexport SHELL
173884bf8334Smrg_ASEOF
173984bf8334Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
174084bf8334SmrgAS_SHELL_SANITIZE
174184bf8334Smrg_AS_PREPARE
174284bf8334Smrgexec AS_MESSAGE_FD>&1
174384bf8334Smrg_ASEOF
174484bf8334Smrgtest $lt_write_fail = 0 && chmod +x $1[]dnl
174584bf8334Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
1746659607e0Smrg
174784bf8334Smrg# LT_OUTPUT
174884bf8334Smrg# ---------
174984bf8334Smrg# This macro allows early generation of the libtool script (before
175084bf8334Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
175184bf8334Smrg# tests.
175284bf8334SmrgAC_DEFUN([LT_OUTPUT],
175384bf8334Smrg[: ${CONFIG_LT=./config.lt}
175484bf8334SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
175584bf8334Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
175684bf8334Smrg[# Run this file to recreate a libtool stub with the current configuration.])
1757a73597f9Smrg
175884bf8334Smrgcat >>"$CONFIG_LT" <<\_LTEOF
175984bf8334Smrglt_cl_silent=false
176084bf8334Smrgexec AS_MESSAGE_LOG_FD>>config.log
1761bd3a1963Smrg{
176284bf8334Smrg  echo
176384bf8334Smrg  AS_BOX([Running $as_me.])
176484bf8334Smrg} >&AS_MESSAGE_LOG_FD
1765bd3a1963Smrg
176684bf8334Smrglt_cl_help="\
176784bf8334Smrg\`$as_me' creates a local libtool stub from the current configuration,
176884bf8334Smrgfor use in further configure time tests before the real libtool is
176984bf8334Smrggenerated.
1770659607e0Smrg
177184bf8334SmrgUsage: $[0] [[OPTIONS]]
1772659607e0Smrg
177384bf8334Smrg  -h, --help      print this help, then exit
177484bf8334Smrg  -V, --version   print version number, then exit
177584bf8334Smrg  -q, --quiet     do not print progress messages
177684bf8334Smrg  -d, --debug     don't remove temporary files
17776aab59a7Smrg
177884bf8334SmrgReport bugs to <bug-libtool@gnu.org>."
1779659607e0Smrg
178084bf8334Smrglt_cl_version="\
178184bf8334Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
178284bf8334Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
178384bf8334Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
1784659607e0Smrg
178584bf8334SmrgCopyright (C) 2011 Free Software Foundation, Inc.
178684bf8334SmrgThis config.lt script is free software; the Free Software Foundation
178784bf8334Smrggives unlimited permision to copy, distribute and modify it."
1788659607e0Smrg
178984bf8334Smrgwhile test $[#] != 0
179084bf8334Smrgdo
179184bf8334Smrg  case $[1] in
179284bf8334Smrg    --version | --v* | -V )
179384bf8334Smrg      echo "$lt_cl_version"; exit 0 ;;
179484bf8334Smrg    --help | --h* | -h )
179584bf8334Smrg      echo "$lt_cl_help"; exit 0 ;;
179684bf8334Smrg    --debug | --d* | -d )
179784bf8334Smrg      debug=: ;;
179884bf8334Smrg    --quiet | --q* | --silent | --s* | -q )
179984bf8334Smrg      lt_cl_silent=: ;;
1800fc27e79cSmrg
180184bf8334Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
180284bf8334SmrgTry \`$[0] --help' for more information.]) ;;
1803659607e0Smrg
180484bf8334Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
180584bf8334SmrgTry \`$[0] --help' for more information.]) ;;
1806a73597f9Smrg  esac
180784bf8334Smrg  shift
180884bf8334Smrgdone
1809659607e0Smrg
181084bf8334Smrgif $lt_cl_silent; then
181184bf8334Smrg  exec AS_MESSAGE_FD>/dev/null
181284bf8334Smrgfi
181384bf8334Smrg_LTEOF
1814fc27e79cSmrg
181584bf8334Smrgcat >>"$CONFIG_LT" <<_LTEOF
181684bf8334Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
181784bf8334Smrg_LTEOF
1818a73597f9Smrg
181984bf8334Smrgcat >>"$CONFIG_LT" <<\_LTEOF
182084bf8334SmrgAC_MSG_NOTICE([creating $ofile])
182184bf8334Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
182284bf8334SmrgAS_EXIT(0)
182384bf8334Smrg_LTEOF
182484bf8334Smrgchmod +x "$CONFIG_LT"
1825a73597f9Smrg
182684bf8334Smrg# configure is writing to config.log, but config.lt does its own redirection,
182784bf8334Smrg# appending to config.log, which fails on DOS, as config.log is still kept
182884bf8334Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
182984bf8334Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
183084bf8334Smrglt_cl_success=:
183184bf8334Smrgtest "$silent" = yes &&
183284bf8334Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
183384bf8334Smrgexec AS_MESSAGE_LOG_FD>/dev/null
183484bf8334Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
183584bf8334Smrgexec AS_MESSAGE_LOG_FD>>config.log
183684bf8334Smrg$lt_cl_success || AS_EXIT(1)
183784bf8334Smrg])# LT_OUTPUT
1838659607e0Smrg
1839659607e0Smrg
184084bf8334Smrg# _LT_CONFIG(TAG)
184184bf8334Smrg# ---------------
184284bf8334Smrg# If TAG is the built-in tag, create an initial libtool script with a
184384bf8334Smrg# default configuration from the untagged config vars.  Otherwise add code
184484bf8334Smrg# to config.status for appending the configuration named by TAG from the
184584bf8334Smrg# matching tagged config vars.
184684bf8334Smrgm4_defun([_LT_CONFIG],
184784bf8334Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
184884bf8334Smrg_LT_CONFIG_SAVE_COMMANDS([
184984bf8334Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
185084bf8334Smrg  m4_if(_LT_TAG, [C], [
185184bf8334Smrg    # See if we are running on zsh, and set the options which allow our
185284bf8334Smrg    # commands through without removal of \ escapes.
185384bf8334Smrg    if test -n "${ZSH_VERSION+set}" ; then
185484bf8334Smrg      setopt NO_GLOB_SUBST
1855a73597f9Smrg    fi
1856659607e0Smrg
185784bf8334Smrg    cfgfile="${ofile}T"
185884bf8334Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
185984bf8334Smrg    $RM "$cfgfile"
186084bf8334Smrg
186184bf8334Smrg    cat <<_LT_EOF >> "$cfgfile"
186284bf8334Smrg#! $SHELL
186384bf8334Smrg
186484bf8334Smrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
186584bf8334Smrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
186684bf8334Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
186784bf8334Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
186884bf8334Smrg#
186984bf8334Smrg_LT_COPYING
187084bf8334Smrg_LT_LIBTOOL_TAGS
187184bf8334Smrg
187284bf8334Smrg# ### BEGIN LIBTOOL CONFIG
187384bf8334Smrg_LT_LIBTOOL_CONFIG_VARS
187484bf8334Smrg_LT_LIBTOOL_TAG_VARS
187584bf8334Smrg# ### END LIBTOOL CONFIG
187684bf8334Smrg
187784bf8334Smrg_LT_EOF
187884bf8334Smrg
187984bf8334Smrg  case $host_os in
188084bf8334Smrg  aix3*)
188184bf8334Smrg    cat <<\_LT_EOF >> "$cfgfile"
188284bf8334Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
188384bf8334Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
188484bf8334Smrg# vanish in a puff of smoke.
188584bf8334Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
188684bf8334Smrg  COLLECT_NAMES=
188784bf8334Smrg  export COLLECT_NAMES
188884bf8334Smrgfi
188984bf8334Smrg_LT_EOF
1890a73597f9Smrg    ;;
1891a73597f9Smrg  esac
1892659607e0Smrg
189384bf8334Smrg  _LT_PROG_LTMAIN
1894659607e0Smrg
189584bf8334Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
189684bf8334Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
189784bf8334Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
189884bf8334Smrg  # is reportedly fixed, but why not run on old versions too?
189984bf8334Smrg  sed '$q' "$ltmain" >> "$cfgfile" \
190084bf8334Smrg     || (rm -f "$cfgfile"; exit 1)
19016aab59a7Smrg
190284bf8334Smrg  _LT_PROG_REPLACE_SHELLFNS
1903659607e0Smrg
190484bf8334Smrg   mv -f "$cfgfile" "$ofile" ||
190584bf8334Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
190684bf8334Smrg  chmod +x "$ofile"
190784bf8334Smrg],
190884bf8334Smrg[cat <<_LT_EOF >> "$ofile"
1909659607e0Smrg
191084bf8334Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
191184bf8334Smrgdnl in a comment (ie after a #).
191284bf8334Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
191384bf8334Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
191484bf8334Smrg# ### END LIBTOOL TAG CONFIG: $1
191584bf8334Smrg_LT_EOF
191684bf8334Smrg])dnl /m4_if
191784bf8334Smrg],
191884bf8334Smrg[m4_if([$1], [], [
191984bf8334Smrg    PACKAGE='$PACKAGE'
192084bf8334Smrg    VERSION='$VERSION'
192184bf8334Smrg    TIMESTAMP='$TIMESTAMP'
192284bf8334Smrg    RM='$RM'
192384bf8334Smrg    ofile='$ofile'], [])
192484bf8334Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
192584bf8334Smrg])# _LT_CONFIG
1926659607e0Smrg
1927659607e0Smrg
192884bf8334Smrg# LT_SUPPORTED_TAG(TAG)
192984bf8334Smrg# ---------------------
193084bf8334Smrg# Trace this macro to discover what tags are supported by the libtool
193184bf8334Smrg# --tag option, using:
193284bf8334Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
193384bf8334SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
1934fc27e79cSmrg
19356aab59a7Smrg
193684bf8334Smrg# C support is built-in for now
193784bf8334Smrgm4_define([_LT_LANG_C_enabled], [])
193884bf8334Smrgm4_define([_LT_TAGS], [])
19396aab59a7Smrg
1940659607e0Smrg
194184bf8334Smrg# LT_LANG(LANG)
194284bf8334Smrg# -------------
194384bf8334Smrg# Enable libtool support for the given language if not already enabled.
194484bf8334SmrgAC_DEFUN([LT_LANG],
194584bf8334Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
194684bf8334Smrgm4_case([$1],
194784bf8334Smrg  [C],			[_LT_LANG(C)],
194884bf8334Smrg  [C++],		[_LT_LANG(CXX)],
194984bf8334Smrg  [Go],			[_LT_LANG(GO)],
195084bf8334Smrg  [Java],		[_LT_LANG(GCJ)],
195184bf8334Smrg  [Fortran 77],		[_LT_LANG(F77)],
195284bf8334Smrg  [Fortran],		[_LT_LANG(FC)],
195384bf8334Smrg  [Windows Resource],	[_LT_LANG(RC)],
195484bf8334Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
195584bf8334Smrg    [_LT_LANG($1)],
195684bf8334Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
195784bf8334Smrg])# LT_LANG
1958659607e0Smrg
1959659607e0Smrg
196084bf8334Smrg# _LT_LANG(LANGNAME)
196184bf8334Smrg# ------------------
196284bf8334Smrgm4_defun([_LT_LANG],
196384bf8334Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
196484bf8334Smrg  [LT_SUPPORTED_TAG([$1])dnl
196584bf8334Smrg  m4_append([_LT_TAGS], [$1 ])dnl
196684bf8334Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
196784bf8334Smrg  _LT_LANG_$1_CONFIG($1)])dnl
196884bf8334Smrg])# _LT_LANG
1969659607e0Smrg
197084bf8334Smrg
197184bf8334Smrgm4_ifndef([AC_PROG_GO], [
197284bf8334Smrg# NOTE: This macro has been submitted for inclusion into   #
197384bf8334Smrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
197484bf8334Smrg#  a released version of Autoconf we should remove this    #
197584bf8334Smrg#  macro and use it instead.                               #
197684bf8334Smrgm4_defun([AC_PROG_GO],
197784bf8334Smrg[AC_LANG_PUSH(Go)dnl
197884bf8334SmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
197984bf8334SmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
198084bf8334Smrg_AC_ARG_VAR_LDFLAGS()dnl
198184bf8334SmrgAC_CHECK_TOOL(GOC, gccgo)
198284bf8334Smrgif test -z "$GOC"; then
198384bf8334Smrg  if test -n "$ac_tool_prefix"; then
198484bf8334Smrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
1985a73597f9Smrg  fi
1986a73597f9Smrgfi
198784bf8334Smrgif test -z "$GOC"; then
198884bf8334Smrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
1989a73597f9Smrgfi
199084bf8334Smrg])#m4_defun
199184bf8334Smrg])#m4_ifndef
1992659607e0Smrg
1993659607e0Smrg
199484bf8334Smrg# _LT_LANG_DEFAULT_CONFIG
199584bf8334Smrg# -----------------------
199684bf8334Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
199784bf8334Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
199884bf8334Smrg  [LT_LANG(CXX)],
199984bf8334Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
2000fc27e79cSmrg
200184bf8334SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
200284bf8334Smrg  [LT_LANG(F77)],
200384bf8334Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
2004fc27e79cSmrg
200584bf8334SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
200684bf8334Smrg  [LT_LANG(FC)],
200784bf8334Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
2008fc27e79cSmrg
200984bf8334Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
201084bf8334Smrgdnl pulling things in needlessly.
201184bf8334SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
201284bf8334Smrg  [LT_LANG(GCJ)],
201384bf8334Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
201484bf8334Smrg    [LT_LANG(GCJ)],
201584bf8334Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
201684bf8334Smrg      [LT_LANG(GCJ)],
201784bf8334Smrg      [m4_ifdef([AC_PROG_GCJ],
201884bf8334Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
201984bf8334Smrg       m4_ifdef([A][M_PROG_GCJ],
202084bf8334Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
202184bf8334Smrg       m4_ifdef([LT_PROG_GCJ],
202284bf8334Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
2023fc27e79cSmrg
202484bf8334SmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
202584bf8334Smrg  [LT_LANG(GO)],
202684bf8334Smrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
2027659607e0Smrg
202884bf8334SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
202984bf8334Smrg  [LT_LANG(RC)],
203084bf8334Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
203184bf8334Smrg])# _LT_LANG_DEFAULT_CONFIG
2032659607e0Smrg
203384bf8334Smrg# Obsolete macros:
203484bf8334SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
203584bf8334SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
203684bf8334SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
203784bf8334SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
203884bf8334SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
203984bf8334Smrgdnl aclocal-1.4 backwards compatibility:
204084bf8334Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
204184bf8334Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
204284bf8334Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
204384bf8334Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
204484bf8334Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
2045659607e0Smrg
2046659607e0Smrg
204784bf8334Smrg# _LT_TAG_COMPILER
204884bf8334Smrg# ----------------
204984bf8334Smrgm4_defun([_LT_TAG_COMPILER],
205084bf8334Smrg[AC_REQUIRE([AC_PROG_CC])dnl
2051659607e0Smrg
205284bf8334Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
205384bf8334Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
205484bf8334Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
205584bf8334Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
20566aab59a7Smrg
205784bf8334Smrg# If no C compiler was specified, use CC.
205884bf8334SmrgLTCC=${LTCC-"$CC"}
2059659607e0Smrg
206084bf8334Smrg# If no C compiler flags were specified, use CFLAGS.
206184bf8334SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
20626aab59a7Smrg
206384bf8334Smrg# Allow CC to be a program name with arguments.
206484bf8334Smrgcompiler=$CC
206584bf8334Smrg])# _LT_TAG_COMPILER
20666aab59a7Smrg
2067659607e0Smrg
206884bf8334Smrg# _LT_COMPILER_BOILERPLATE
206984bf8334Smrg# ------------------------
207084bf8334Smrg# Check for compiler boilerplate output or warnings with
207184bf8334Smrg# the simple compiler test code.
207284bf8334Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
207384bf8334Smrg[m4_require([_LT_DECL_SED])dnl
207484bf8334Smrgac_outfile=conftest.$ac_objext
207584bf8334Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
207684bf8334Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
207784bf8334Smrg_lt_compiler_boilerplate=`cat conftest.err`
207884bf8334Smrg$RM conftest*
207984bf8334Smrg])# _LT_COMPILER_BOILERPLATE
20806aab59a7Smrg
20816aab59a7Smrg
208284bf8334Smrg# _LT_LINKER_BOILERPLATE
208384bf8334Smrg# ----------------------
208484bf8334Smrg# Check for linker boilerplate output or warnings with
208584bf8334Smrg# the simple link test code.
208684bf8334Smrgm4_defun([_LT_LINKER_BOILERPLATE],
208784bf8334Smrg[m4_require([_LT_DECL_SED])dnl
208884bf8334Smrgac_outfile=conftest.$ac_objext
208984bf8334Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
209084bf8334Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
209184bf8334Smrg_lt_linker_boilerplate=`cat conftest.err`
209284bf8334Smrg$RM -r conftest*
209384bf8334Smrg])# _LT_LINKER_BOILERPLATE
20946aab59a7Smrg
209584bf8334Smrg# _LT_REQUIRED_DARWIN_CHECKS
209684bf8334Smrg# -------------------------
209784bf8334Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
2098a73597f9Smrg  case $host_os in
209984bf8334Smrg    rhapsody* | darwin*)
210084bf8334Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
210184bf8334Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
210284bf8334Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
210384bf8334Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
210484bf8334Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
210584bf8334Smrg    _LT_DECL([], [DSYMUTIL], [1],
210684bf8334Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
210784bf8334Smrg    _LT_DECL([], [NMEDIT], [1],
210884bf8334Smrg      [Tool to change global to local symbols on Mac OS X])
210984bf8334Smrg    _LT_DECL([], [LIPO], [1],
211084bf8334Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
211184bf8334Smrg    _LT_DECL([], [OTOOL], [1],
211284bf8334Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
211384bf8334Smrg    _LT_DECL([], [OTOOL64], [1],
211484bf8334Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
2115659607e0Smrg
211684bf8334Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
211784bf8334Smrg      [lt_cv_apple_cc_single_mod=no
211884bf8334Smrg      if test -z "${LT_MULTI_MODULE}"; then
211984bf8334Smrg	# By default we will add the -single_module flag. You can override
212084bf8334Smrg	# by either setting the environment variable LT_MULTI_MODULE
212184bf8334Smrg	# non-empty at configure time, or by adding -multi_module to the
212284bf8334Smrg	# link flags.
212384bf8334Smrg	rm -rf libconftest.dylib*
212484bf8334Smrg	echo "int foo(void){return 1;}" > conftest.c
212584bf8334Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
212684bf8334Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
212784bf8334Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
212884bf8334Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
212984bf8334Smrg        _lt_result=$?
213084bf8334Smrg	# If there is a non-empty error log, and "single_module"
213184bf8334Smrg	# appears in it, assume the flag caused a linker warning
213284bf8334Smrg        if test -s conftest.err && $GREP single_module conftest.err; then
213384bf8334Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
213484bf8334Smrg	# Otherwise, if the output was created with a 0 exit code from
213584bf8334Smrg	# the compiler, it worked.
213684bf8334Smrg	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
213784bf8334Smrg	  lt_cv_apple_cc_single_mod=yes
213884bf8334Smrg	else
213984bf8334Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
214084bf8334Smrg	fi
214184bf8334Smrg	rm -rf libconftest.dylib*
214284bf8334Smrg	rm -f conftest.*
214384bf8334Smrg      fi])
2144659607e0Smrg
214584bf8334Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
214684bf8334Smrg      [lt_cv_ld_exported_symbols_list],
214784bf8334Smrg      [lt_cv_ld_exported_symbols_list=no
214884bf8334Smrg      save_LDFLAGS=$LDFLAGS
214984bf8334Smrg      echo "_main" > conftest.sym
215084bf8334Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
215184bf8334Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
215284bf8334Smrg	[lt_cv_ld_exported_symbols_list=yes],
215384bf8334Smrg	[lt_cv_ld_exported_symbols_list=no])
215484bf8334Smrg	LDFLAGS="$save_LDFLAGS"
215584bf8334Smrg    ])
2156659607e0Smrg
215784bf8334Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
215884bf8334Smrg      [lt_cv_ld_force_load=no
215984bf8334Smrg      cat > conftest.c << _LT_EOF
216084bf8334Smrgint forced_loaded() { return 2;}
216184bf8334Smrg_LT_EOF
216284bf8334Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
216384bf8334Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
216484bf8334Smrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
216584bf8334Smrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
216684bf8334Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
216784bf8334Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
216884bf8334Smrg      cat > conftest.c << _LT_EOF
216984bf8334Smrgint main() { return 0;}
217084bf8334Smrg_LT_EOF
217184bf8334Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
217284bf8334Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
217384bf8334Smrg      _lt_result=$?
217484bf8334Smrg      if test -s conftest.err && $GREP force_load conftest.err; then
217584bf8334Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
217684bf8334Smrg      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
217784bf8334Smrg	lt_cv_ld_force_load=yes
217884bf8334Smrg      else
217984bf8334Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
218084bf8334Smrg      fi
218184bf8334Smrg        rm -f conftest.err libconftest.a conftest conftest.c
218284bf8334Smrg        rm -rf conftest.dSYM
218384bf8334Smrg    ])
218484bf8334Smrg    case $host_os in
218584bf8334Smrg    rhapsody* | darwin1.[[012]])
218684bf8334Smrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
218784bf8334Smrg    darwin1.*)
218884bf8334Smrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
218984bf8334Smrg    darwin*) # darwin 5.x on
219084bf8334Smrg      # if running on 10.5 or later, the deployment target defaults
219184bf8334Smrg      # to the OS version, if on x86, and 10.4, the deployment
219284bf8334Smrg      # target defaults to 10.4. Don't you love it?
219384bf8334Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
219484bf8334Smrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
219584bf8334Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
219684bf8334Smrg	10.[[012]]*)
219784bf8334Smrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
219884bf8334Smrg	10.*)
219984bf8334Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
220084bf8334Smrg      esac
220184bf8334Smrg    ;;
220284bf8334Smrg  esac
220384bf8334Smrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
220484bf8334Smrg      _lt_dar_single_mod='$single_module'
220584bf8334Smrg    fi
220684bf8334Smrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
220784bf8334Smrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
2208a73597f9Smrg    else
220984bf8334Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
221084bf8334Smrg    fi
221184bf8334Smrg    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
221284bf8334Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
221384bf8334Smrg    else
221484bf8334Smrg      _lt_dsymutil=
2215a73597f9Smrg    fi
2216a73597f9Smrg    ;;
2217a73597f9Smrg  esac
221884bf8334Smrg])
2219659607e0Smrg
2220659607e0Smrg
222184bf8334Smrg# _LT_DARWIN_LINKER_FEATURES([TAG])
222284bf8334Smrg# ---------------------------------
222384bf8334Smrg# Checks for linker and compiler features on darwin
222484bf8334Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
222584bf8334Smrg[
222684bf8334Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
222784bf8334Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
222884bf8334Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
222984bf8334Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
223084bf8334Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
223184bf8334Smrg  if test "$lt_cv_ld_force_load" = "yes"; then
223284bf8334Smrg    _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\"`'
223384bf8334Smrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
223484bf8334Smrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
223584bf8334Smrg  else
223684bf8334Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
223784bf8334Smrg  fi
223884bf8334Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
223984bf8334Smrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
224084bf8334Smrg  case $cc_basename in
224184bf8334Smrg     ifort*) _lt_dar_can_shared=yes ;;
224284bf8334Smrg     *) _lt_dar_can_shared=$GCC ;;
2243b73be646Smrg  esac
224484bf8334Smrg  if test "$_lt_dar_can_shared" = "yes"; then
224584bf8334Smrg    output_verbose_link_cmd=func_echo_all
224684bf8334Smrg    _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}"
224784bf8334Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
224884bf8334Smrg    _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}"
224984bf8334Smrg    _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}"
225084bf8334Smrg    m4_if([$1], [CXX],
225184bf8334Smrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
225284bf8334Smrg      _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}"
225384bf8334Smrg      _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}"
225484bf8334Smrg    fi
225584bf8334Smrg],[])
225684bf8334Smrg  else
225784bf8334Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
225884bf8334Smrg  fi
225984bf8334Smrg])
2260a73597f9Smrg
226184bf8334Smrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
226284bf8334Smrg# ----------------------------------
226384bf8334Smrg# Links a minimal program and checks the executable
226484bf8334Smrg# for the system default hardcoded library path. In most cases,
226584bf8334Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
226684bf8334Smrg# the location of the communication and MPI libs are included too.
226784bf8334Smrg# If we don't find anything, use the default library path according
226884bf8334Smrg# to the aix ld manual.
226984bf8334Smrg# Store the results from the different compilers for each TAGNAME.
227084bf8334Smrg# Allow to override them for all tags through lt_cv_aix_libpath.
227184bf8334Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
227284bf8334Smrg[m4_require([_LT_DECL_SED])dnl
227384bf8334Smrgif test "${lt_cv_aix_libpath+set}" = set; then
227484bf8334Smrg  aix_libpath=$lt_cv_aix_libpath
227584bf8334Smrgelse
227684bf8334Smrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
227784bf8334Smrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
227884bf8334Smrg  lt_aix_libpath_sed='[
227984bf8334Smrg      /Import File Strings/,/^$/ {
228084bf8334Smrg	  /^0/ {
228184bf8334Smrg	      s/^0  *\([^ ]*\) *$/\1/
228284bf8334Smrg	      p
228384bf8334Smrg	  }
228484bf8334Smrg      }]'
228584bf8334Smrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
228684bf8334Smrg  # Check for a 64-bit object if we didn't find anything.
228784bf8334Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
228884bf8334Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
228984bf8334Smrg  fi],[])
229084bf8334Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
229184bf8334Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
229284bf8334Smrg  fi
229384bf8334Smrg  ])
229484bf8334Smrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
229584bf8334Smrgfi
229684bf8334Smrg])# _LT_SYS_MODULE_PATH_AIX
2297659607e0Smrg
2298b73be646Smrg
229984bf8334Smrg# _LT_SHELL_INIT(ARG)
230084bf8334Smrg# -------------------
230184bf8334Smrgm4_define([_LT_SHELL_INIT],
230284bf8334Smrg[m4_divert_text([M4SH-INIT], [$1
230384bf8334Smrg])])# _LT_SHELL_INIT
2304a73597f9Smrg
2305a73597f9Smrg
2306a73597f9Smrg
230784bf8334Smrg# _LT_PROG_ECHO_BACKSLASH
230884bf8334Smrg# -----------------------
230984bf8334Smrg# Find how we can fake an echo command that does not interpret backslash.
231084bf8334Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
231184bf8334Smrg# of the generated configure script which will find a shell with a builtin
231284bf8334Smrg# printf (which we can use as an echo command).
231384bf8334Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
231484bf8334Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
231584bf8334SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
231684bf8334SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2317a73597f9Smrg
231884bf8334SmrgAC_MSG_CHECKING([how to print strings])
231984bf8334Smrg# Test print first, because it will be a builtin if present.
232084bf8334Smrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
232184bf8334Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
232284bf8334Smrg  ECHO='print -r --'
232384bf8334Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
232484bf8334Smrg  ECHO='printf %s\n'
232584bf8334Smrgelse
232684bf8334Smrg  # Use this function as a fallback that always works.
232784bf8334Smrg  func_fallback_echo ()
232884bf8334Smrg  {
232984bf8334Smrg    eval 'cat <<_LTECHO_EOF
233084bf8334Smrg$[]1
233184bf8334Smrg_LTECHO_EOF'
233284bf8334Smrg  }
233384bf8334Smrg  ECHO='func_fallback_echo'
233484bf8334Smrgfi
2335a73597f9Smrg
233684bf8334Smrg# func_echo_all arg...
233784bf8334Smrg# Invoke $ECHO with all args, space-separated.
233884bf8334Smrgfunc_echo_all ()
233984bf8334Smrg{
234084bf8334Smrg    $ECHO "$*" 
234184bf8334Smrg}
2342a73597f9Smrg
234384bf8334Smrgcase "$ECHO" in
234484bf8334Smrg  printf*) AC_MSG_RESULT([printf]) ;;
234584bf8334Smrg  print*) AC_MSG_RESULT([print -r]) ;;
234684bf8334Smrg  *) AC_MSG_RESULT([cat]) ;;
234784bf8334Smrgesac
2348a73597f9Smrg
234984bf8334Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
235084bf8334Smrg[_AS_DETECT_SUGGESTED([
235184bf8334Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
235284bf8334Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
235384bf8334Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
235484bf8334Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
235584bf8334Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
235684bf8334Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
235784bf8334Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
2358b73be646Smrg
235984bf8334Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
236084bf8334Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
236184bf8334Smrg])# _LT_PROG_ECHO_BACKSLASH
2362a73597f9Smrg
2363a73597f9Smrg
236484bf8334Smrg# _LT_WITH_SYSROOT
236584bf8334Smrg# ----------------
236684bf8334SmrgAC_DEFUN([_LT_WITH_SYSROOT],
236784bf8334Smrg[AC_MSG_CHECKING([for sysroot])
236884bf8334SmrgAC_ARG_WITH([sysroot],
236984bf8334Smrg[  --with-sysroot[=DIR] Search for dependent libraries within DIR
237084bf8334Smrg                        (or the compiler's sysroot if not specified).],
237184bf8334Smrg[], [with_sysroot=no])
2372a73597f9Smrg
237384bf8334Smrgdnl lt_sysroot will always be passed unquoted.  We quote it here
237484bf8334Smrgdnl in case the user passed a directory name.
237584bf8334Smrglt_sysroot=
237684bf8334Smrgcase ${with_sysroot} in #(
237784bf8334Smrg yes)
237884bf8334Smrg   if test "$GCC" = yes; then
237984bf8334Smrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
238084bf8334Smrg   fi
238184bf8334Smrg   ;; #(
238284bf8334Smrg /*)
238384bf8334Smrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
238484bf8334Smrg   ;; #(
238584bf8334Smrg no|'')
238684bf8334Smrg   ;; #(
238784bf8334Smrg *)
238884bf8334Smrg   AC_MSG_RESULT([${with_sysroot}])
238984bf8334Smrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
239084bf8334Smrg   ;;
239184bf8334Smrgesac
2392a73597f9Smrg
239384bf8334Smrg AC_MSG_RESULT([${lt_sysroot:-no}])
239484bf8334Smrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
239584bf8334Smrg[dependent libraries, and in which our libraries should be installed.])])
2396a73597f9Smrg
239784bf8334Smrg# _LT_ENABLE_LOCK
239884bf8334Smrg# ---------------
239984bf8334Smrgm4_defun([_LT_ENABLE_LOCK],
240084bf8334Smrg[AC_ARG_ENABLE([libtool-lock],
240184bf8334Smrg  [AS_HELP_STRING([--disable-libtool-lock],
240284bf8334Smrg    [avoid locking (might break parallel builds)])])
240384bf8334Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
2404a73597f9Smrg
240584bf8334Smrg# Some flags need to be propagated to the compiler or linker for good
240684bf8334Smrg# libtool support.
240784bf8334Smrgcase $host in
240884bf8334Smrgia64-*-hpux*)
240984bf8334Smrg  # Find out which ABI we are using.
241084bf8334Smrg  echo 'int i;' > conftest.$ac_ext
241184bf8334Smrg  if AC_TRY_EVAL(ac_compile); then
241284bf8334Smrg    case `/usr/bin/file conftest.$ac_objext` in
241384bf8334Smrg      *ELF-32*)
241484bf8334Smrg	HPUX_IA64_MODE="32"
241584bf8334Smrg	;;
241684bf8334Smrg      *ELF-64*)
241784bf8334Smrg	HPUX_IA64_MODE="64"
241884bf8334Smrg	;;
241984bf8334Smrg    esac
2420a73597f9Smrg  fi
242184bf8334Smrg  rm -rf conftest*
2422a73597f9Smrg  ;;
242384bf8334Smrg*-*-irix6*)
242484bf8334Smrg  # Find out which ABI we are using.
242584bf8334Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
242684bf8334Smrg  if AC_TRY_EVAL(ac_compile); then
242784bf8334Smrg    if test "$lt_cv_prog_gnu_ld" = yes; then
242884bf8334Smrg      case `/usr/bin/file conftest.$ac_objext` in
242984bf8334Smrg	*32-bit*)
243084bf8334Smrg	  LD="${LD-ld} -melf32bsmip"
243184bf8334Smrg	  ;;
243284bf8334Smrg	*N32*)
243384bf8334Smrg	  LD="${LD-ld} -melf32bmipn32"
243484bf8334Smrg	  ;;
243584bf8334Smrg	*64-bit*)
243684bf8334Smrg	  LD="${LD-ld} -melf64bmip"
2437a73597f9Smrg	;;
243884bf8334Smrg      esac
243984bf8334Smrg    else
244084bf8334Smrg      case `/usr/bin/file conftest.$ac_objext` in
244184bf8334Smrg	*32-bit*)
244284bf8334Smrg	  LD="${LD-ld} -32"
244384bf8334Smrg	  ;;
244484bf8334Smrg	*N32*)
244584bf8334Smrg	  LD="${LD-ld} -n32"
244684bf8334Smrg	  ;;
244784bf8334Smrg	*64-bit*)
244884bf8334Smrg	  LD="${LD-ld} -64"
244984bf8334Smrg	  ;;
245084bf8334Smrg      esac
245184bf8334Smrg    fi
2452a73597f9Smrg  fi
245384bf8334Smrg  rm -rf conftest*
2454a73597f9Smrg  ;;
2455a73597f9Smrg
245684bf8334Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
245784bf8334Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
245884bf8334Smrg  # Find out which ABI we are using.
245984bf8334Smrg  echo 'int i;' > conftest.$ac_ext
246084bf8334Smrg  if AC_TRY_EVAL(ac_compile); then
246184bf8334Smrg    case `/usr/bin/file conftest.o` in
246284bf8334Smrg      *32-bit*)
246384bf8334Smrg	case $host in
246484bf8334Smrg	  x86_64-*kfreebsd*-gnu)
246584bf8334Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
246684bf8334Smrg	    ;;
246784bf8334Smrg	  x86_64-*linux*)
246884bf8334Smrg	    LD="${LD-ld} -m elf_i386"
246984bf8334Smrg	    ;;
247084bf8334Smrg	  ppc64-*linux*|powerpc64-*linux*)
247184bf8334Smrg	    LD="${LD-ld} -m elf32ppclinux"
247284bf8334Smrg	    ;;
247384bf8334Smrg	  s390x-*linux*)
247484bf8334Smrg	    LD="${LD-ld} -m elf_s390"
247584bf8334Smrg	    ;;
247684bf8334Smrg	  sparc64-*linux*)
247784bf8334Smrg	    LD="${LD-ld} -m elf32_sparc"
247884bf8334Smrg	    ;;
247984bf8334Smrg	esac
248084bf8334Smrg	;;
248184bf8334Smrg      *64-bit*)
248284bf8334Smrg	case $host in
248384bf8334Smrg	  x86_64-*kfreebsd*-gnu)
248484bf8334Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
248584bf8334Smrg	    ;;
248684bf8334Smrg	  x86_64-*linux*)
248784bf8334Smrg	    LD="${LD-ld} -m elf_x86_64"
248884bf8334Smrg	    ;;
248984bf8334Smrg	  ppc*-*linux*|powerpc*-*linux*)
249084bf8334Smrg	    LD="${LD-ld} -m elf64ppc"
249184bf8334Smrg	    ;;
249284bf8334Smrg	  s390*-*linux*|s390*-*tpf*)
249384bf8334Smrg	    LD="${LD-ld} -m elf64_s390"
249484bf8334Smrg	    ;;
249584bf8334Smrg	  sparc*-*linux*)
249684bf8334Smrg	    LD="${LD-ld} -m elf64_sparc"
249784bf8334Smrg	    ;;
249884bf8334Smrg	esac
249984bf8334Smrg	;;
250084bf8334Smrg    esac
250184bf8334Smrg  fi
250284bf8334Smrg  rm -rf conftest*
2503a73597f9Smrg  ;;
2504a73597f9Smrg
250584bf8334Smrg*-*-sco3.2v5*)
250684bf8334Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
250784bf8334Smrg  SAVE_CFLAGS="$CFLAGS"
250884bf8334Smrg  CFLAGS="$CFLAGS -belf"
250984bf8334Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
251084bf8334Smrg    [AC_LANG_PUSH(C)
251184bf8334Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
251284bf8334Smrg     AC_LANG_POP])
251384bf8334Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
251484bf8334Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
251584bf8334Smrg    CFLAGS="$SAVE_CFLAGS"
251684bf8334Smrg  fi
2517a73597f9Smrg  ;;
251884bf8334Smrg*-*solaris*)
251984bf8334Smrg  # Find out which ABI we are using.
252084bf8334Smrg  echo 'int i;' > conftest.$ac_ext
252184bf8334Smrg  if AC_TRY_EVAL(ac_compile); then
252284bf8334Smrg    case `/usr/bin/file conftest.o` in
252384bf8334Smrg    *64-bit*)
252484bf8334Smrg      case $lt_cv_prog_gnu_ld in
252584bf8334Smrg      yes*)
252684bf8334Smrg        case $host in
252784bf8334Smrg        i?86-*-solaris*)
252884bf8334Smrg          LD="${LD-ld} -m elf_x86_64"
252984bf8334Smrg          ;;
253084bf8334Smrg        sparc*-*-solaris*)
253184bf8334Smrg          LD="${LD-ld} -m elf64_sparc"
253284bf8334Smrg          ;;
253384bf8334Smrg        esac
253484bf8334Smrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
253584bf8334Smrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
253684bf8334Smrg          LD="${LD-ld}_sol2"
253784bf8334Smrg        fi
253884bf8334Smrg        ;;
253984bf8334Smrg      *)
254084bf8334Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
254184bf8334Smrg	  LD="${LD-ld} -64"
254284bf8334Smrg	fi
254384bf8334Smrg	;;
254484bf8334Smrg      esac
254584bf8334Smrg      ;;
254684bf8334Smrg    esac
254784bf8334Smrg  fi
254884bf8334Smrg  rm -rf conftest*
2549a73597f9Smrg  ;;
2550a73597f9Smrgesac
2551a73597f9Smrg
255284bf8334Smrgneed_locks="$enable_libtool_lock"
255384bf8334Smrg])# _LT_ENABLE_LOCK
2554b73be646Smrg
2555b73be646Smrg
255684bf8334Smrg# _LT_PROG_AR
255784bf8334Smrg# -----------
255884bf8334Smrgm4_defun([_LT_PROG_AR],
255984bf8334Smrg[AC_CHECK_TOOLS(AR, [ar], false)
256084bf8334Smrg: ${AR=ar}
256184bf8334Smrg: ${AR_FLAGS=cru}
256284bf8334Smrg_LT_DECL([], [AR], [1], [The archiver])
256384bf8334Smrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
2564bd3a1963Smrg
256584bf8334SmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
256684bf8334Smrg  [lt_cv_ar_at_file=no
256784bf8334Smrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
256884bf8334Smrg     [echo conftest.$ac_objext > conftest.lst
256984bf8334Smrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
257084bf8334Smrg      AC_TRY_EVAL([lt_ar_try])
257184bf8334Smrg      if test "$ac_status" -eq 0; then
257284bf8334Smrg	# Ensure the archiver fails upon bogus file names.
257384bf8334Smrg	rm -f conftest.$ac_objext libconftest.a
257484bf8334Smrg	AC_TRY_EVAL([lt_ar_try])
257584bf8334Smrg	if test "$ac_status" -ne 0; then
257684bf8334Smrg          lt_cv_ar_at_file=@
257784bf8334Smrg        fi
2578a73597f9Smrg      fi
257984bf8334Smrg      rm -f conftest.* libconftest.a
258084bf8334Smrg     ])
258184bf8334Smrg  ])
258284bf8334Smrg
258384bf8334Smrgif test "x$lt_cv_ar_at_file" = xno; then
258484bf8334Smrg  archiver_list_spec=
2585b73be646Smrgelse
258684bf8334Smrg  archiver_list_spec=$lt_cv_ar_at_file
2587b73be646Smrgfi
258884bf8334Smrg_LT_DECL([], [archiver_list_spec], [1],
258984bf8334Smrg  [How to feed a file listing to the archiver])
259084bf8334Smrg])# _LT_PROG_AR
2591b73be646Smrg
2592b73be646Smrg
259384bf8334Smrg# _LT_CMD_OLD_ARCHIVE
259484bf8334Smrg# -------------------
259584bf8334Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
259684bf8334Smrg[_LT_PROG_AR
2597b73be646Smrg
259884bf8334SmrgAC_CHECK_TOOL(STRIP, strip, :)
259984bf8334Smrgtest -z "$STRIP" && STRIP=:
260084bf8334Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
2601b73be646Smrg
260284bf8334SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
260384bf8334Smrgtest -z "$RANLIB" && RANLIB=:
260484bf8334Smrg_LT_DECL([], [RANLIB], [1],
260584bf8334Smrg    [Commands used to install an old-style archive])
2606a73597f9Smrg
260784bf8334Smrg# Determine commands to create old-style static archives.
260884bf8334Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
260984bf8334Smrgold_postinstall_cmds='chmod 644 $oldlib'
261084bf8334Smrgold_postuninstall_cmds=
2611a73597f9Smrg
261284bf8334Smrgif test -n "$RANLIB"; then
261384bf8334Smrg  case $host_os in
261484bf8334Smrg  openbsd*)
261584bf8334Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
2616a73597f9Smrg    ;;
2617a73597f9Smrg  *)
261884bf8334Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
2619a73597f9Smrg    ;;
2620a73597f9Smrg  esac
262184bf8334Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
2622a73597f9Smrgfi
2623bd3a1963Smrg
2624a73597f9Smrgcase $host_os in
2625a73597f9Smrg  darwin*)
262684bf8334Smrg    lock_old_archive_extraction=yes ;;
262784bf8334Smrg  *)
262884bf8334Smrg    lock_old_archive_extraction=no ;;
2629a73597f9Smrgesac
263084bf8334Smrg_LT_DECL([], [old_postinstall_cmds], [2])
263184bf8334Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
263284bf8334Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
263384bf8334Smrg    [Commands used to build an old-style archive])
263484bf8334Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
263584bf8334Smrg    [Whether to use a lock for old archive extraction])
263684bf8334Smrg])# _LT_CMD_OLD_ARCHIVE
2637b73be646Smrg
2638b73be646Smrg
263984bf8334Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
264084bf8334Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
264184bf8334Smrg# ----------------------------------------------------------------
264284bf8334Smrg# Check whether the given compiler option works
264384bf8334SmrgAC_DEFUN([_LT_COMPILER_OPTION],
264484bf8334Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
264584bf8334Smrgm4_require([_LT_DECL_SED])dnl
264684bf8334SmrgAC_CACHE_CHECK([$1], [$2],
264784bf8334Smrg  [$2=no
264884bf8334Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
264984bf8334Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
265084bf8334Smrg   lt_compiler_flag="$3"
265184bf8334Smrg   # Insert the option either (1) after the last *FLAGS variable, or
265284bf8334Smrg   # (2) before a word containing "conftest.", or (3) at the end.
265384bf8334Smrg   # Note that $ac_compile itself does not contain backslashes and begins
265484bf8334Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
265584bf8334Smrg   # The option is referenced via a variable to avoid confusing sed.
265684bf8334Smrg   lt_compile=`echo "$ac_compile" | $SED \
265784bf8334Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
265884bf8334Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
265984bf8334Smrg   -e 's:$: $lt_compiler_flag:'`
266084bf8334Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
266184bf8334Smrg   (eval "$lt_compile" 2>conftest.err)
266284bf8334Smrg   ac_status=$?
266384bf8334Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
266484bf8334Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
266584bf8334Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
266684bf8334Smrg     # The compiler can only warn and ignore the option if not recognized
266784bf8334Smrg     # So say no if there are warnings other than the usual output.
266884bf8334Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
266984bf8334Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
267084bf8334Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
267184bf8334Smrg       $2=yes
267284bf8334Smrg     fi
267384bf8334Smrg   fi
267484bf8334Smrg   $RM conftest*
267584bf8334Smrg])
2676b73be646Smrg
267784bf8334Smrgif test x"[$]$2" = xyes; then
267884bf8334Smrg    m4_if([$5], , :, [$5])
267984bf8334Smrgelse
268084bf8334Smrg    m4_if([$6], , :, [$6])
268184bf8334Smrgfi
268284bf8334Smrg])# _LT_COMPILER_OPTION
2683b73be646Smrg
268484bf8334Smrg# Old name:
268584bf8334SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
268684bf8334Smrgdnl aclocal-1.4 backwards compatibility:
268784bf8334Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
2688bd3a1963Smrg
2689bd3a1963Smrg
269084bf8334Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
269184bf8334Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
269284bf8334Smrg# ----------------------------------------------------
269384bf8334Smrg# Check whether the given linker option works
269484bf8334SmrgAC_DEFUN([_LT_LINKER_OPTION],
269584bf8334Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
269684bf8334Smrgm4_require([_LT_DECL_SED])dnl
269784bf8334SmrgAC_CACHE_CHECK([$1], [$2],
269884bf8334Smrg  [$2=no
269984bf8334Smrg   save_LDFLAGS="$LDFLAGS"
270084bf8334Smrg   LDFLAGS="$LDFLAGS $3"
270184bf8334Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
270284bf8334Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
270384bf8334Smrg     # The linker can only warn and ignore the option if not recognized
270484bf8334Smrg     # So say no if there are warnings
270584bf8334Smrg     if test -s conftest.err; then
270684bf8334Smrg       # Append any errors to the config.log.
270784bf8334Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
270884bf8334Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
270984bf8334Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
271084bf8334Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
271184bf8334Smrg         $2=yes
271284bf8334Smrg       fi
271384bf8334Smrg     else
271484bf8334Smrg       $2=yes
271584bf8334Smrg     fi
271684bf8334Smrg   fi
271784bf8334Smrg   $RM -r conftest*
271884bf8334Smrg   LDFLAGS="$save_LDFLAGS"
271984bf8334Smrg])
2720bd3a1963Smrg
272184bf8334Smrgif test x"[$]$2" = xyes; then
272284bf8334Smrg    m4_if([$4], , :, [$4])
272384bf8334Smrgelse
272484bf8334Smrg    m4_if([$5], , :, [$5])
272584bf8334Smrgfi
272684bf8334Smrg])# _LT_LINKER_OPTION
2727bd3a1963Smrg
272884bf8334Smrg# Old name:
272984bf8334SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
273084bf8334Smrgdnl aclocal-1.4 backwards compatibility:
273184bf8334Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
2732b73be646Smrg
2733b73be646Smrg
273484bf8334Smrg# LT_CMD_MAX_LEN
273584bf8334Smrg#---------------
273684bf8334SmrgAC_DEFUN([LT_CMD_MAX_LEN],
273784bf8334Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
273884bf8334Smrg# find the maximum length of command line arguments
273984bf8334SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
274084bf8334SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
274184bf8334Smrg  i=0
274284bf8334Smrg  teststring="ABCD"
2743b73be646Smrg
274484bf8334Smrg  case $build_os in
274584bf8334Smrg  msdosdjgpp*)
274684bf8334Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
274784bf8334Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
274884bf8334Smrg    # during glob expansion).  Even if it were fixed, the result of this
274984bf8334Smrg    # check would be larger than it should be.
275084bf8334Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
275184bf8334Smrg    ;;
2752b73be646Smrg
275384bf8334Smrg  gnu*)
275484bf8334Smrg    # Under GNU Hurd, this test is not required because there is
275584bf8334Smrg    # no limit to the length of command line arguments.
275684bf8334Smrg    # Libtool will interpret -1 as no limit whatsoever
275784bf8334Smrg    lt_cv_sys_max_cmd_len=-1;
2758a73597f9Smrg    ;;
2759b73be646Smrg
276084bf8334Smrg  cygwin* | mingw* | cegcc*)
276184bf8334Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
276284bf8334Smrg    # about 5 minutes as the teststring grows exponentially.
276384bf8334Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
276484bf8334Smrg    # you end up with a "frozen" computer, even though with patience
276584bf8334Smrg    # the test eventually succeeds (with a max line length of 256k).
276684bf8334Smrg    # Instead, let's just punt: use the minimum linelength reported by
276784bf8334Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
276884bf8334Smrg    lt_cv_sys_max_cmd_len=8192;
276984bf8334Smrg    ;;
2770b73be646Smrg
277184bf8334Smrg  mint*)
277284bf8334Smrg    # On MiNT this can take a long time and run out of memory.
277384bf8334Smrg    lt_cv_sys_max_cmd_len=8192;
277484bf8334Smrg    ;;
2775b73be646Smrg
277684bf8334Smrg  amigaos*)
277784bf8334Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
277884bf8334Smrg    # So we just punt and use a minimum line length of 8192.
277984bf8334Smrg    lt_cv_sys_max_cmd_len=8192;
278084bf8334Smrg    ;;
2781bd3a1963Smrg
278284bf8334Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
278384bf8334Smrg    # This has been around since 386BSD, at least.  Likely further.
278484bf8334Smrg    if test -x /sbin/sysctl; then
278584bf8334Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
278684bf8334Smrg    elif test -x /usr/sbin/sysctl; then
278784bf8334Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
278884bf8334Smrg    else
278984bf8334Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
279084bf8334Smrg    fi
279184bf8334Smrg    # And add a safety zone
279284bf8334Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
279384bf8334Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2794b73be646Smrg    ;;
279584bf8334Smrg
279684bf8334Smrg  interix*)
279784bf8334Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
279884bf8334Smrg    lt_cv_sys_max_cmd_len=196608
2799b73be646Smrg    ;;
280084bf8334Smrg
280184bf8334Smrg  os2*)
280284bf8334Smrg    # The test takes a long time on OS/2.
280384bf8334Smrg    lt_cv_sys_max_cmd_len=8192
2804b73be646Smrg    ;;
280584bf8334Smrg
280684bf8334Smrg  osf*)
280784bf8334Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
280884bf8334Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
280984bf8334Smrg    # nice to cause kernel panics so lets avoid the loop below.
281084bf8334Smrg    # First set a reasonable default.
281184bf8334Smrg    lt_cv_sys_max_cmd_len=16384
281284bf8334Smrg    #
281384bf8334Smrg    if test -x /sbin/sysconfig; then
281484bf8334Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
281584bf8334Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
281684bf8334Smrg      esac
281784bf8334Smrg    fi
2818b73be646Smrg    ;;
281984bf8334Smrg  sco3.2v5*)
282084bf8334Smrg    lt_cv_sys_max_cmd_len=102400
2821b73be646Smrg    ;;
282284bf8334Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
282384bf8334Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
282484bf8334Smrg    if test -n "$kargmax"; then
282584bf8334Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
282684bf8334Smrg    else
282784bf8334Smrg      lt_cv_sys_max_cmd_len=32768
282884bf8334Smrg    fi
2829b73be646Smrg    ;;
283084bf8334Smrg  *)
283184bf8334Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
283284bf8334Smrg    if test -n "$lt_cv_sys_max_cmd_len"; then
283384bf8334Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
283484bf8334Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
2835b73be646Smrg    else
283684bf8334Smrg      # Make teststring a little bigger before we do anything with it.
283784bf8334Smrg      # a 1K string should be a reasonable start.
283884bf8334Smrg      for i in 1 2 3 4 5 6 7 8 ; do
283984bf8334Smrg        teststring=$teststring$teststring
284084bf8334Smrg      done
284184bf8334Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
284284bf8334Smrg      # If test is not a shell built-in, we'll probably end up computing a
284384bf8334Smrg      # maximum length that is only half of the actual maximum length, but
284484bf8334Smrg      # we can't tell.
284584bf8334Smrg      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
284684bf8334Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
284784bf8334Smrg	      test $i != 17 # 1/2 MB should be enough
284884bf8334Smrg      do
284984bf8334Smrg        i=`expr $i + 1`
285084bf8334Smrg        teststring=$teststring$teststring
285184bf8334Smrg      done
285284bf8334Smrg      # Only check the string length outside the loop.
285384bf8334Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
285484bf8334Smrg      teststring=
285584bf8334Smrg      # Add a significant safety factor because C++ compilers can tack on
285684bf8334Smrg      # massive amounts of additional arguments before passing them to the
285784bf8334Smrg      # linker.  It appears as though 1/2 is a usable value.
285884bf8334Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
2859b73be646Smrg    fi
2860b73be646Smrg    ;;
2861b73be646Smrg  esac
286284bf8334Smrg])
286384bf8334Smrgif test -n $lt_cv_sys_max_cmd_len ; then
286484bf8334Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
286584bf8334Smrgelse
286684bf8334Smrg  AC_MSG_RESULT(none)
2867b73be646Smrgfi
286884bf8334Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
286984bf8334Smrg_LT_DECL([], [max_cmd_len], [0],
287084bf8334Smrg    [What is the maximum length of a command?])
287184bf8334Smrg])# LT_CMD_MAX_LEN
2872659607e0Smrg
287384bf8334Smrg# Old name:
287484bf8334SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
287584bf8334Smrgdnl aclocal-1.4 backwards compatibility:
287684bf8334Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
2877bd3a1963Smrg
2878659607e0Smrg
287984bf8334Smrg# _LT_HEADER_DLFCN
288084bf8334Smrg# ----------------
288184bf8334Smrgm4_defun([_LT_HEADER_DLFCN],
288284bf8334Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
288384bf8334Smrg])# _LT_HEADER_DLFCN
2884b73be646Smrg
288584bf8334Smrg
288684bf8334Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
288784bf8334Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
288884bf8334Smrg# ----------------------------------------------------------------
288984bf8334Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
289084bf8334Smrg[m4_require([_LT_HEADER_DLFCN])dnl
289184bf8334Smrgif test "$cross_compiling" = yes; then :
289284bf8334Smrg  [$4]
2893a73597f9Smrgelse
289484bf8334Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
289584bf8334Smrg  lt_status=$lt_dlunknown
289684bf8334Smrg  cat > conftest.$ac_ext <<_LT_EOF
289784bf8334Smrg[#line $LINENO "configure"
289884bf8334Smrg#include "confdefs.h"
2899b73be646Smrg
290084bf8334Smrg#if HAVE_DLFCN_H
290184bf8334Smrg#include <dlfcn.h>
290284bf8334Smrg#endif
2903b73be646Smrg
290484bf8334Smrg#include <stdio.h>
2905b73be646Smrg
290684bf8334Smrg#ifdef RTLD_GLOBAL
290784bf8334Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
290884bf8334Smrg#else
290984bf8334Smrg#  ifdef DL_GLOBAL
291084bf8334Smrg#    define LT_DLGLOBAL		DL_GLOBAL
291184bf8334Smrg#  else
291284bf8334Smrg#    define LT_DLGLOBAL		0
291384bf8334Smrg#  endif
291484bf8334Smrg#endif
2915b73be646Smrg
291684bf8334Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
291784bf8334Smrg   find out it does not work in some platform. */
291884bf8334Smrg#ifndef LT_DLLAZY_OR_NOW
291984bf8334Smrg#  ifdef RTLD_LAZY
292084bf8334Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
292184bf8334Smrg#  else
292284bf8334Smrg#    ifdef DL_LAZY
292384bf8334Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
292484bf8334Smrg#    else
292584bf8334Smrg#      ifdef RTLD_NOW
292684bf8334Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
292784bf8334Smrg#      else
292884bf8334Smrg#        ifdef DL_NOW
292984bf8334Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
293084bf8334Smrg#        else
293184bf8334Smrg#          define LT_DLLAZY_OR_NOW	0
293284bf8334Smrg#        endif
293384bf8334Smrg#      endif
293484bf8334Smrg#    endif
293584bf8334Smrg#  endif
293684bf8334Smrg#endif
2937b73be646Smrg
293884bf8334Smrg/* When -fvisbility=hidden is used, assume the code has been annotated
293984bf8334Smrg   correspondingly for the symbols needed.  */
294084bf8334Smrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
294184bf8334Smrgint fnord () __attribute__((visibility("default")));
294284bf8334Smrg#endif
2943a73597f9Smrg
294484bf8334Smrgint fnord () { return 42; }
294584bf8334Smrgint main ()
294684bf8334Smrg{
294784bf8334Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
294884bf8334Smrg  int status = $lt_dlunknown;
2949a73597f9Smrg
295084bf8334Smrg  if (self)
295184bf8334Smrg    {
295284bf8334Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
295384bf8334Smrg      else
295484bf8334Smrg        {
295584bf8334Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
295684bf8334Smrg          else puts (dlerror ());
295784bf8334Smrg	}
295884bf8334Smrg      /* dlclose (self); */
295984bf8334Smrg    }
296084bf8334Smrg  else
296184bf8334Smrg    puts (dlerror ());
296284bf8334Smrg
296384bf8334Smrg  return status;
296484bf8334Smrg}]
296584bf8334Smrg_LT_EOF
296684bf8334Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
296784bf8334Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
296884bf8334Smrg    lt_status=$?
296984bf8334Smrg    case x$lt_status in
297084bf8334Smrg      x$lt_dlno_uscore) $1 ;;
297184bf8334Smrg      x$lt_dlneed_uscore) $2 ;;
297284bf8334Smrg      x$lt_dlunknown|x*) $3 ;;
297384bf8334Smrg    esac
297484bf8334Smrg  else :
297584bf8334Smrg    # compilation failed
297684bf8334Smrg    $3
2977b73be646Smrg  fi
2978a73597f9Smrgfi
297984bf8334Smrgrm -fr conftest*
298084bf8334Smrg])# _LT_TRY_DLOPEN_SELF
2981b73be646Smrg
2982659607e0Smrg
298384bf8334Smrg# LT_SYS_DLOPEN_SELF
298484bf8334Smrg# ------------------
298584bf8334SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
298684bf8334Smrg[m4_require([_LT_HEADER_DLFCN])dnl
298784bf8334Smrgif test "x$enable_dlopen" != xyes; then
298884bf8334Smrg  enable_dlopen=unknown
298984bf8334Smrg  enable_dlopen_self=unknown
299084bf8334Smrg  enable_dlopen_self_static=unknown
299184bf8334Smrgelse
299284bf8334Smrg  lt_cv_dlopen=no
299384bf8334Smrg  lt_cv_dlopen_libs=
2994659607e0Smrg
299584bf8334Smrg  case $host_os in
299684bf8334Smrg  beos*)
299784bf8334Smrg    lt_cv_dlopen="load_add_on"
299884bf8334Smrg    lt_cv_dlopen_libs=
299984bf8334Smrg    lt_cv_dlopen_self=yes
300084bf8334Smrg    ;;
3001659607e0Smrg
300284bf8334Smrg  mingw* | pw32* | cegcc*)
300384bf8334Smrg    lt_cv_dlopen="LoadLibrary"
300484bf8334Smrg    lt_cv_dlopen_libs=
300584bf8334Smrg    ;;
3006659607e0Smrg
300784bf8334Smrg  cygwin*)
300884bf8334Smrg    lt_cv_dlopen="dlopen"
300984bf8334Smrg    lt_cv_dlopen_libs=
301084bf8334Smrg    ;;
301184bf8334Smrg
301284bf8334Smrg  darwin*)
301384bf8334Smrg  # if libdl is installed we need to link against it
301484bf8334Smrg    AC_CHECK_LIB([dl], [dlopen],
301584bf8334Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
301684bf8334Smrg    lt_cv_dlopen="dyld"
301784bf8334Smrg    lt_cv_dlopen_libs=
301884bf8334Smrg    lt_cv_dlopen_self=yes
301984bf8334Smrg    ])
302084bf8334Smrg    ;;
3021659607e0Smrg
3022a73597f9Smrg  *)
302384bf8334Smrg    AC_CHECK_FUNC([shl_load],
302484bf8334Smrg	  [lt_cv_dlopen="shl_load"],
302584bf8334Smrg      [AC_CHECK_LIB([dld], [shl_load],
302684bf8334Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
302784bf8334Smrg	[AC_CHECK_FUNC([dlopen],
302884bf8334Smrg	      [lt_cv_dlopen="dlopen"],
302984bf8334Smrg	  [AC_CHECK_LIB([dl], [dlopen],
303084bf8334Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
303184bf8334Smrg	    [AC_CHECK_LIB([svld], [dlopen],
303284bf8334Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
303384bf8334Smrg	      [AC_CHECK_LIB([dld], [dld_link],
303484bf8334Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
303584bf8334Smrg	      ])
303684bf8334Smrg	    ])
303784bf8334Smrg	  ])
303884bf8334Smrg	])
303984bf8334Smrg      ])
304084bf8334Smrg    ;;
3041b73be646Smrg  esac
3042659607e0Smrg
304384bf8334Smrg  if test "x$lt_cv_dlopen" != xno; then
304484bf8334Smrg    enable_dlopen=yes
304584bf8334Smrg  else
304684bf8334Smrg    enable_dlopen=no
304784bf8334Smrg  fi
3048659607e0Smrg
304984bf8334Smrg  case $lt_cv_dlopen in
305084bf8334Smrg  dlopen)
305184bf8334Smrg    save_CPPFLAGS="$CPPFLAGS"
305284bf8334Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
3053659607e0Smrg
305484bf8334Smrg    save_LDFLAGS="$LDFLAGS"
305584bf8334Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
3056659607e0Smrg
305784bf8334Smrg    save_LIBS="$LIBS"
305884bf8334Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
3059659607e0Smrg
306084bf8334Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
306184bf8334Smrg	  lt_cv_dlopen_self, [dnl
306284bf8334Smrg	  _LT_TRY_DLOPEN_SELF(
306384bf8334Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
306484bf8334Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
306584bf8334Smrg    ])
3066659607e0Smrg
306784bf8334Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
306884bf8334Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
306984bf8334Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
307084bf8334Smrg	  lt_cv_dlopen_self_static, [dnl
307184bf8334Smrg	  _LT_TRY_DLOPEN_SELF(
307284bf8334Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
307384bf8334Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
307484bf8334Smrg      ])
307584bf8334Smrg    fi
3076b73be646Smrg
307784bf8334Smrg    CPPFLAGS="$save_CPPFLAGS"
307884bf8334Smrg    LDFLAGS="$save_LDFLAGS"
307984bf8334Smrg    LIBS="$save_LIBS"
308084bf8334Smrg    ;;
308184bf8334Smrg  esac
3082fc27e79cSmrg
308384bf8334Smrg  case $lt_cv_dlopen_self in
308484bf8334Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
308584bf8334Smrg  *) enable_dlopen_self=unknown ;;
308684bf8334Smrg  esac
3087fc27e79cSmrg
308884bf8334Smrg  case $lt_cv_dlopen_self_static in
308984bf8334Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
309084bf8334Smrg  *) enable_dlopen_self_static=unknown ;;
309184bf8334Smrg  esac
309284bf8334Smrgfi
309384bf8334Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
309484bf8334Smrg	 [Whether dlopen is supported])
309584bf8334Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
309684bf8334Smrg	 [Whether dlopen of programs is supported])
309784bf8334Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
309884bf8334Smrg	 [Whether dlopen of statically linked programs is supported])
309984bf8334Smrg])# LT_SYS_DLOPEN_SELF
3100fc27e79cSmrg
310184bf8334Smrg# Old name:
310284bf8334SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
310384bf8334Smrgdnl aclocal-1.4 backwards compatibility:
310484bf8334Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
3105fc27e79cSmrg
3106659607e0Smrg
310784bf8334Smrg# _LT_COMPILER_C_O([TAGNAME])
310884bf8334Smrg# ---------------------------
310984bf8334Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
311084bf8334Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
311184bf8334Smrgm4_defun([_LT_COMPILER_C_O],
311284bf8334Smrg[m4_require([_LT_DECL_SED])dnl
311384bf8334Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
311484bf8334Smrgm4_require([_LT_TAG_COMPILER])dnl
311584bf8334SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
311684bf8334Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
311784bf8334Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
311884bf8334Smrg   $RM -r conftest 2>/dev/null
311984bf8334Smrg   mkdir conftest
312084bf8334Smrg   cd conftest
312184bf8334Smrg   mkdir out
312284bf8334Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
3123a73597f9Smrg
312484bf8334Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
312584bf8334Smrg   # Insert the option either (1) after the last *FLAGS variable, or
312684bf8334Smrg   # (2) before a word containing "conftest.", or (3) at the end.
312784bf8334Smrg   # Note that $ac_compile itself does not contain backslashes and begins
312884bf8334Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
312984bf8334Smrg   lt_compile=`echo "$ac_compile" | $SED \
313084bf8334Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
313184bf8334Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
313284bf8334Smrg   -e 's:$: $lt_compiler_flag:'`
313384bf8334Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
313484bf8334Smrg   (eval "$lt_compile" 2>out/conftest.err)
313584bf8334Smrg   ac_status=$?
313684bf8334Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
313784bf8334Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
313884bf8334Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
313984bf8334Smrg   then
314084bf8334Smrg     # The compiler can only warn and ignore the option if not recognized
314184bf8334Smrg     # So say no if there are warnings
314284bf8334Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
314384bf8334Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
314484bf8334Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
314584bf8334Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
314684bf8334Smrg     fi
314784bf8334Smrg   fi
314884bf8334Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
314984bf8334Smrg   $RM conftest*
315084bf8334Smrg   # SGI C++ compiler will create directory out/ii_files/ for
315184bf8334Smrg   # template instantiation
315284bf8334Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
315384bf8334Smrg   $RM out/* && rmdir out
315484bf8334Smrg   cd ..
315584bf8334Smrg   $RM -r conftest
315684bf8334Smrg   $RM conftest*
315784bf8334Smrg])
315884bf8334Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
315984bf8334Smrg	[Does compiler simultaneously support -c and -o options?])
316084bf8334Smrg])# _LT_COMPILER_C_O
3161a73597f9Smrg
3162659607e0Smrg
316384bf8334Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
316484bf8334Smrg# ----------------------------------
316584bf8334Smrg# Check to see if we can do hard links to lock some files if needed
316684bf8334Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
316784bf8334Smrg[m4_require([_LT_ENABLE_LOCK])dnl
316884bf8334Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
316984bf8334Smrg_LT_COMPILER_C_O([$1])
3170659607e0Smrg
317184bf8334Smrghard_links="nottested"
317284bf8334Smrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
317384bf8334Smrg  # do not overwrite the value of need_locks provided by the user
317484bf8334Smrg  AC_MSG_CHECKING([if we can lock with hard links])
317584bf8334Smrg  hard_links=yes
317684bf8334Smrg  $RM conftest*
317784bf8334Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
317884bf8334Smrg  touch conftest.a
317984bf8334Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
318084bf8334Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
318184bf8334Smrg  AC_MSG_RESULT([$hard_links])
318284bf8334Smrg  if test "$hard_links" = no; then
318384bf8334Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
318484bf8334Smrg    need_locks=warn
318584bf8334Smrg  fi
318684bf8334Smrgelse
318784bf8334Smrg  need_locks=no
318884bf8334Smrgfi
318984bf8334Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
319084bf8334Smrg])# _LT_COMPILER_FILE_LOCKS
3191659607e0Smrg
3192659607e0Smrg
319384bf8334Smrg# _LT_CHECK_OBJDIR
319484bf8334Smrg# ----------------
319584bf8334Smrgm4_defun([_LT_CHECK_OBJDIR],
319684bf8334Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
319784bf8334Smrg[rm -f .libs 2>/dev/null
319884bf8334Smrgmkdir .libs 2>/dev/null
319984bf8334Smrgif test -d .libs; then
320084bf8334Smrg  lt_cv_objdir=.libs
320184bf8334Smrgelse
320284bf8334Smrg  # MS-DOS does not allow filenames that begin with a dot.
320384bf8334Smrg  lt_cv_objdir=_libs
320484bf8334Smrgfi
320584bf8334Smrgrmdir .libs 2>/dev/null])
320684bf8334Smrgobjdir=$lt_cv_objdir
320784bf8334Smrg_LT_DECL([], [objdir], [0],
320884bf8334Smrg         [The name of the directory that contains temporary libtool files])dnl
320984bf8334Smrgm4_pattern_allow([LT_OBJDIR])dnl
321084bf8334SmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
321184bf8334Smrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
321284bf8334Smrg])# _LT_CHECK_OBJDIR
3213a73597f9Smrg
3214a73597f9Smrg
321584bf8334Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
321684bf8334Smrg# --------------------------------------
321784bf8334Smrg# Check hardcoding attributes.
321884bf8334Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
321984bf8334Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
322084bf8334Smrg_LT_TAGVAR(hardcode_action, $1)=
322184bf8334Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
322284bf8334Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
322384bf8334Smrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
3224659607e0Smrg
322584bf8334Smrg  # We can hardcode non-existent directories.
322684bf8334Smrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
322784bf8334Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
322884bf8334Smrg     # have to relink, otherwise we might link with an installed library
322984bf8334Smrg     # when we should be linking with a yet-to-be-installed one
323084bf8334Smrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
323184bf8334Smrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
323284bf8334Smrg    # Linking always hardcodes the temporary library directory.
323384bf8334Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
3234a73597f9Smrg  else
323584bf8334Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
323684bf8334Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
3237a73597f9Smrg  fi
3238a73597f9Smrgelse
323984bf8334Smrg  # We cannot hardcode anything, or else we can only hardcode existing
324084bf8334Smrg  # directories.
324184bf8334Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
3242a73597f9Smrgfi
324384bf8334SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
3244659607e0Smrg
324584bf8334Smrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
324684bf8334Smrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
324784bf8334Smrg  # Fast installation is not supported
324884bf8334Smrg  enable_fast_install=no
324984bf8334Smrgelif test "$shlibpath_overrides_runpath" = yes ||
325084bf8334Smrg     test "$enable_shared" = no; then
325184bf8334Smrg  # Fast installation is not necessary
325284bf8334Smrg  enable_fast_install=needless
3253a73597f9Smrgfi
325484bf8334Smrg_LT_TAGDECL([], [hardcode_action], [0],
325584bf8334Smrg    [How to hardcode a shared library path into an executable])
325684bf8334Smrg])# _LT_LINKER_HARDCODE_LIBPATH
3257659607e0Smrg
3258a73597f9Smrg
325984bf8334Smrg# _LT_CMD_STRIPLIB
326084bf8334Smrg# ----------------
326184bf8334Smrgm4_defun([_LT_CMD_STRIPLIB],
326284bf8334Smrg[m4_require([_LT_DECL_EGREP])
326384bf8334Smrgstriplib=
326484bf8334Smrgold_striplib=
326584bf8334SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
326684bf8334Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
326784bf8334Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
326884bf8334Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
326984bf8334Smrg  AC_MSG_RESULT([yes])
327084bf8334Smrgelse
327184bf8334Smrg# FIXME - insert some real tests, host_os isn't really good enough
327284bf8334Smrg  case $host_os in
327384bf8334Smrg  darwin*)
327484bf8334Smrg    if test -n "$STRIP" ; then
327584bf8334Smrg      striplib="$STRIP -x"
327684bf8334Smrg      old_striplib="$STRIP -S"
327784bf8334Smrg      AC_MSG_RESULT([yes])
327884bf8334Smrg    else
327984bf8334Smrg      AC_MSG_RESULT([no])
328084bf8334Smrg    fi
328184bf8334Smrg    ;;
328284bf8334Smrg  *)
328384bf8334Smrg    AC_MSG_RESULT([no])
328484bf8334Smrg    ;;
328584bf8334Smrg  esac
328684bf8334Smrgfi
328784bf8334Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
328884bf8334Smrg_LT_DECL([], [striplib], [1])
328984bf8334Smrg])# _LT_CMD_STRIPLIB
3290659607e0Smrg
3291659607e0Smrg
329284bf8334Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
329384bf8334Smrg# -----------------------------
329484bf8334Smrg# PORTME Fill in your ld.so characteristics
329584bf8334Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
329684bf8334Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
329784bf8334Smrgm4_require([_LT_DECL_EGREP])dnl
329884bf8334Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
329984bf8334Smrgm4_require([_LT_DECL_OBJDUMP])dnl
330084bf8334Smrgm4_require([_LT_DECL_SED])dnl
330184bf8334Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
330284bf8334SmrgAC_MSG_CHECKING([dynamic linker characteristics])
330384bf8334Smrgm4_if([$1],
330484bf8334Smrg	[], [
330584bf8334Smrgif test "$GCC" = yes; then
330684bf8334Smrg  case $host_os in
330784bf8334Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
330884bf8334Smrg    *) lt_awk_arg="/^libraries:/" ;;
330984bf8334Smrg  esac
331084bf8334Smrg  case $host_os in
331184bf8334Smrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
331284bf8334Smrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
331384bf8334Smrg  esac
331484bf8334Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
331584bf8334Smrg  case $lt_search_path_spec in
331684bf8334Smrg  *\;*)
331784bf8334Smrg    # if the path contains ";" then we assume it to be the separator
331884bf8334Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
331984bf8334Smrg    # assumed that no part of a normal pathname contains ";" but that should
332084bf8334Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
332184bf8334Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
332284bf8334Smrg    ;;
332384bf8334Smrg  *)
332484bf8334Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
332584bf8334Smrg    ;;
332684bf8334Smrg  esac
332784bf8334Smrg  # Ok, now we have the path, separated by spaces, we can step through it
332884bf8334Smrg  # and add multilib dir if necessary.
332984bf8334Smrg  lt_tmp_lt_search_path_spec=
333084bf8334Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
333184bf8334Smrg  for lt_sys_path in $lt_search_path_spec; do
333284bf8334Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
333384bf8334Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
333484bf8334Smrg    else
333584bf8334Smrg      test -d "$lt_sys_path" && \
333684bf8334Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
333784bf8334Smrg    fi
333884bf8334Smrg  done
333984bf8334Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
334084bf8334SmrgBEGIN {RS=" "; FS="/|\n";} {
334184bf8334Smrg  lt_foo="";
334284bf8334Smrg  lt_count=0;
334384bf8334Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
334484bf8334Smrg    if ($lt_i != "" && $lt_i != ".") {
334584bf8334Smrg      if ($lt_i == "..") {
334684bf8334Smrg        lt_count++;
334784bf8334Smrg      } else {
334884bf8334Smrg        if (lt_count == 0) {
334984bf8334Smrg          lt_foo="/" $lt_i lt_foo;
335084bf8334Smrg        } else {
335184bf8334Smrg          lt_count--;
335284bf8334Smrg        }
335384bf8334Smrg      }
335484bf8334Smrg    }
335584bf8334Smrg  }
335684bf8334Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
335784bf8334Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
335884bf8334Smrg}'`
335984bf8334Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
336084bf8334Smrg  # for these hosts.
336184bf8334Smrg  case $host_os in
336284bf8334Smrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
336384bf8334Smrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
336484bf8334Smrg  esac
336584bf8334Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
336684bf8334Smrgelse
336784bf8334Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
336884bf8334Smrgfi])
336984bf8334Smrglibrary_names_spec=
337084bf8334Smrglibname_spec='lib$name'
337184bf8334Smrgsoname_spec=
337284bf8334Smrgshrext_cmds=".so"
337384bf8334Smrgpostinstall_cmds=
337484bf8334Smrgpostuninstall_cmds=
337584bf8334Smrgfinish_cmds=
337684bf8334Smrgfinish_eval=
337784bf8334Smrgshlibpath_var=
337884bf8334Smrgshlibpath_overrides_runpath=unknown
337984bf8334Smrgversion_type=none
338084bf8334Smrgdynamic_linker="$host_os ld.so"
338184bf8334Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
338284bf8334Smrgneed_lib_prefix=unknown
338384bf8334Smrghardcode_into_libs=no
3384bd3a1963Smrg
338584bf8334Smrg# when you set need_version to no, make sure it does not cause -set_version
338684bf8334Smrg# flags to be left without arguments
338784bf8334Smrgneed_version=unknown
338884bf8334Smrg
338984bf8334Smrgcase $host_os in
339084bf8334Smrgaix3*)
339184bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
339284bf8334Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
339384bf8334Smrg  shlibpath_var=LIBPATH
339484bf8334Smrg
339584bf8334Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
339684bf8334Smrg  soname_spec='${libname}${release}${shared_ext}$major'
339784bf8334Smrg  ;;
339884bf8334Smrg
339984bf8334Smrgaix[[4-9]]*)
340084bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
340184bf8334Smrg  need_lib_prefix=no
340284bf8334Smrg  need_version=no
340384bf8334Smrg  hardcode_into_libs=yes
340484bf8334Smrg  if test "$host_cpu" = ia64; then
340584bf8334Smrg    # AIX 5 supports IA64
340684bf8334Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
340784bf8334Smrg    shlibpath_var=LD_LIBRARY_PATH
340884bf8334Smrg  else
340984bf8334Smrg    # With GCC up to 2.95.x, collect2 would create an import file
341084bf8334Smrg    # for dependence libraries.  The import file would start with
341184bf8334Smrg    # the line `#! .'.  This would cause the generated library to
341284bf8334Smrg    # depend on `.', always an invalid library.  This was fixed in
341384bf8334Smrg    # development snapshots of GCC prior to 3.0.
341484bf8334Smrg    case $host_os in
341584bf8334Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
341684bf8334Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
341784bf8334Smrg	   echo ' yes '
341884bf8334Smrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
341984bf8334Smrg	:
342084bf8334Smrg      else
342184bf8334Smrg	can_build_shared=no
342284bf8334Smrg      fi
3423a73597f9Smrg      ;;
342484bf8334Smrg    esac
342584bf8334Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
342684bf8334Smrg    # soname into executable. Probably we can add versioning support to
342784bf8334Smrg    # collect2, so additional links can be useful in future.
342884bf8334Smrg    if test "$aix_use_runtimelinking" = yes; then
342984bf8334Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
343084bf8334Smrg      # instead of lib<name>.a to let people know that these are not
343184bf8334Smrg      # typical AIX shared libraries.
343284bf8334Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
343384bf8334Smrg    else
343484bf8334Smrg      # We preserve .a as extension for shared libraries through AIX4.2
343584bf8334Smrg      # and later when we are not doing run time linking.
343684bf8334Smrg      library_names_spec='${libname}${release}.a $libname.a'
343784bf8334Smrg      soname_spec='${libname}${release}${shared_ext}$major'
343884bf8334Smrg    fi
343984bf8334Smrg    shlibpath_var=LIBPATH
344084bf8334Smrg  fi
344184bf8334Smrg  ;;
344284bf8334Smrg
344384bf8334Smrgamigaos*)
344484bf8334Smrg  case $host_cpu in
344584bf8334Smrg  powerpc)
344684bf8334Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
344784bf8334Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
344884bf8334Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
344984bf8334Smrg    ;;
345084bf8334Smrg  m68k)
345184bf8334Smrg    library_names_spec='$libname.ixlibrary $libname.a'
345284bf8334Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
345384bf8334Smrg    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'
345484bf8334Smrg    ;;
345584bf8334Smrg  esac
345684bf8334Smrg  ;;
345784bf8334Smrg
345884bf8334Smrgbeos*)
345984bf8334Smrg  library_names_spec='${libname}${shared_ext}'
346084bf8334Smrg  dynamic_linker="$host_os ld.so"
346184bf8334Smrg  shlibpath_var=LIBRARY_PATH
346284bf8334Smrg  ;;
346384bf8334Smrg
346484bf8334Smrgbsdi[[45]]*)
346584bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
346684bf8334Smrg  need_version=no
346784bf8334Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
346884bf8334Smrg  soname_spec='${libname}${release}${shared_ext}$major'
346984bf8334Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
347084bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
347184bf8334Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
347284bf8334Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
347384bf8334Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
347484bf8334Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
347584bf8334Smrg  # libtool to hard-code these into programs
347684bf8334Smrg  ;;
347784bf8334Smrg
347884bf8334Smrgcygwin* | mingw* | pw32* | cegcc*)
347984bf8334Smrg  version_type=windows
348084bf8334Smrg  shrext_cmds=".dll"
348184bf8334Smrg  need_version=no
348284bf8334Smrg  need_lib_prefix=no
348384bf8334Smrg
348484bf8334Smrg  case $GCC,$cc_basename in
348584bf8334Smrg  yes,*)
348684bf8334Smrg    # gcc
348784bf8334Smrg    library_names_spec='$libname.dll.a'
348884bf8334Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
348984bf8334Smrg    postinstall_cmds='base_file=`basename \${file}`~
349084bf8334Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
349184bf8334Smrg      dldir=$destdir/`dirname \$dlpath`~
349284bf8334Smrg      test -d \$dldir || mkdir -p \$dldir~
349384bf8334Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
349484bf8334Smrg      chmod a+x \$dldir/$dlname~
349584bf8334Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
349684bf8334Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
349784bf8334Smrg      fi'
349884bf8334Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
349984bf8334Smrg      dlpath=$dir/\$dldll~
350084bf8334Smrg       $RM \$dlpath'
350184bf8334Smrg    shlibpath_overrides_runpath=yes
350284bf8334Smrg
350384bf8334Smrg    case $host_os in
350484bf8334Smrg    cygwin*)
350584bf8334Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
350684bf8334Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
350784bf8334Smrgm4_if([$1], [],[
350884bf8334Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
3509a73597f9Smrg      ;;
351084bf8334Smrg    mingw* | cegcc*)
351184bf8334Smrg      # MinGW DLLs use traditional 'lib' prefix
351284bf8334Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3513a73597f9Smrg      ;;
351484bf8334Smrg    pw32*)
351584bf8334Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
351684bf8334Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
3517a73597f9Smrg      ;;
351884bf8334Smrg    esac
351984bf8334Smrg    dynamic_linker='Win32 ld.exe'
352084bf8334Smrg    ;;
352184bf8334Smrg
352284bf8334Smrg  *,cl*)
352384bf8334Smrg    # Native MSVC
352484bf8334Smrg    libname_spec='$name'
352584bf8334Smrg    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
352684bf8334Smrg    library_names_spec='${libname}.dll.lib'
352784bf8334Smrg
352884bf8334Smrg    case $build_os in
352984bf8334Smrg    mingw*)
353084bf8334Smrg      sys_lib_search_path_spec=
353184bf8334Smrg      lt_save_ifs=$IFS
353284bf8334Smrg      IFS=';'
353384bf8334Smrg      for lt_path in $LIB
353484bf8334Smrg      do
353584bf8334Smrg        IFS=$lt_save_ifs
353684bf8334Smrg        # Let DOS variable expansion print the short 8.3 style file name.
353784bf8334Smrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
353884bf8334Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
353984bf8334Smrg      done
354084bf8334Smrg      IFS=$lt_save_ifs
354184bf8334Smrg      # Convert to MSYS style.
354284bf8334Smrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
3543a73597f9Smrg      ;;
354484bf8334Smrg    cygwin*)
354584bf8334Smrg      # Convert to unix form, then to dos form, then back to unix form
354684bf8334Smrg      # but this time dos style (no spaces!) so that the unix form looks
354784bf8334Smrg      # like /cygdrive/c/PROGRA~1:/cygdr...
354884bf8334Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
354984bf8334Smrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
355084bf8334Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
3551bd3a1963Smrg      ;;
3552bd3a1963Smrg    *)
355384bf8334Smrg      sys_lib_search_path_spec="$LIB"
355484bf8334Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
355584bf8334Smrg        # It is most probably a Windows format PATH.
355684bf8334Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
355784bf8334Smrg      else
355884bf8334Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
355984bf8334Smrg      fi
356084bf8334Smrg      # FIXME: find the short name or the path components, as spaces are
356184bf8334Smrg      # common. (e.g. "Program Files" -> "PROGRA~1")
3562bd3a1963Smrg      ;;
3563bd3a1963Smrg    esac
356484bf8334Smrg
356584bf8334Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
356684bf8334Smrg    postinstall_cmds='base_file=`basename \${file}`~
356784bf8334Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
356884bf8334Smrg      dldir=$destdir/`dirname \$dlpath`~
356984bf8334Smrg      test -d \$dldir || mkdir -p \$dldir~
357084bf8334Smrg      $install_prog $dir/$dlname \$dldir/$dlname'
357184bf8334Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
357284bf8334Smrg      dlpath=$dir/\$dldll~
357384bf8334Smrg       $RM \$dlpath'
357484bf8334Smrg    shlibpath_overrides_runpath=yes
357584bf8334Smrg    dynamic_linker='Win32 link.exe'
357684bf8334Smrg    ;;
357784bf8334Smrg
357884bf8334Smrg  *)
357984bf8334Smrg    # Assume MSVC wrapper
358084bf8334Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
358184bf8334Smrg    dynamic_linker='Win32 ld.exe'
358284bf8334Smrg    ;;
358384bf8334Smrg  esac
358484bf8334Smrg  # FIXME: first we should search . and the directory the executable is in
358584bf8334Smrg  shlibpath_var=PATH
358684bf8334Smrg  ;;
358784bf8334Smrg
358884bf8334Smrgdarwin* | rhapsody*)
358984bf8334Smrg  dynamic_linker="$host_os dyld"
359084bf8334Smrg  version_type=darwin
359184bf8334Smrg  need_lib_prefix=no
359284bf8334Smrg  need_version=no
359384bf8334Smrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
359484bf8334Smrg  soname_spec='${libname}${release}${major}$shared_ext'
359584bf8334Smrg  shlibpath_overrides_runpath=yes
359684bf8334Smrg  shlibpath_var=DYLD_LIBRARY_PATH
359784bf8334Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
359884bf8334Smrgm4_if([$1], [],[
359984bf8334Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
360084bf8334Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
360184bf8334Smrg  ;;
360284bf8334Smrg
360384bf8334Smrgdgux*)
360484bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
360584bf8334Smrg  need_lib_prefix=no
360684bf8334Smrg  need_version=no
360784bf8334Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
360884bf8334Smrg  soname_spec='${libname}${release}${shared_ext}$major'
360984bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
361084bf8334Smrg  ;;
361184bf8334Smrg
361284bf8334Smrgfreebsd* | dragonfly*)
361384bf8334Smrg  # DragonFly does not have aout.  When/if they implement a new
361484bf8334Smrg  # versioning mechanism, adjust this.
361584bf8334Smrg  if test -x /usr/bin/objformat; then
361684bf8334Smrg    objformat=`/usr/bin/objformat`
3617b73be646Smrg  else
3618b73be646Smrg    case $host_os in
361984bf8334Smrg    freebsd[[23]].*) objformat=aout ;;
362084bf8334Smrg    *) objformat=elf ;;
362184bf8334Smrg    esac
362284bf8334Smrg  fi
362384bf8334Smrg  version_type=freebsd-$objformat
362484bf8334Smrg  case $version_type in
362584bf8334Smrg    freebsd-elf*)
362684bf8334Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
362784bf8334Smrg      need_version=no
362884bf8334Smrg      need_lib_prefix=no
362984bf8334Smrg      ;;
363084bf8334Smrg    freebsd-*)
363184bf8334Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
363284bf8334Smrg      need_version=yes
363384bf8334Smrg      ;;
363484bf8334Smrg  esac
363584bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
363684bf8334Smrg  case $host_os in
363784bf8334Smrg  freebsd2.*)
363884bf8334Smrg    shlibpath_overrides_runpath=yes
363984bf8334Smrg    ;;
364084bf8334Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
364184bf8334Smrg    shlibpath_overrides_runpath=yes
364284bf8334Smrg    hardcode_into_libs=yes
364384bf8334Smrg    ;;
364484bf8334Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
364584bf8334Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
364684bf8334Smrg    shlibpath_overrides_runpath=no
364784bf8334Smrg    hardcode_into_libs=yes
364884bf8334Smrg    ;;
364984bf8334Smrg  *) # from 4.6 on, and DragonFly
365084bf8334Smrg    shlibpath_overrides_runpath=yes
365184bf8334Smrg    hardcode_into_libs=yes
365284bf8334Smrg    ;;
365384bf8334Smrg  esac
365484bf8334Smrg  ;;
365584bf8334Smrg
365684bf8334Smrggnu*)
365784bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
365884bf8334Smrg  need_lib_prefix=no
365984bf8334Smrg  need_version=no
366084bf8334Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
366184bf8334Smrg  soname_spec='${libname}${release}${shared_ext}$major'
366284bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
366384bf8334Smrg  shlibpath_overrides_runpath=no
366484bf8334Smrg  hardcode_into_libs=yes
366584bf8334Smrg  ;;
366684bf8334Smrg
366784bf8334Smrghaiku*)
366884bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
366984bf8334Smrg  need_lib_prefix=no
367084bf8334Smrg  need_version=no
367184bf8334Smrg  dynamic_linker="$host_os runtime_loader"
367284bf8334Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
367384bf8334Smrg  soname_spec='${libname}${release}${shared_ext}$major'
367484bf8334Smrg  shlibpath_var=LIBRARY_PATH
367584bf8334Smrg  shlibpath_overrides_runpath=yes
367684bf8334Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
367784bf8334Smrg  hardcode_into_libs=yes
367884bf8334Smrg  ;;
367984bf8334Smrg
368084bf8334Smrghpux9* | hpux10* | hpux11*)
368184bf8334Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
368284bf8334Smrg  # link against other versions.
368384bf8334Smrg  version_type=sunos
368484bf8334Smrg  need_lib_prefix=no
368584bf8334Smrg  need_version=no
368684bf8334Smrg  case $host_cpu in
368784bf8334Smrg  ia64*)
368884bf8334Smrg    shrext_cmds='.so'
368984bf8334Smrg    hardcode_into_libs=yes
369084bf8334Smrg    dynamic_linker="$host_os dld.so"
369184bf8334Smrg    shlibpath_var=LD_LIBRARY_PATH
369284bf8334Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
369384bf8334Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
369484bf8334Smrg    soname_spec='${libname}${release}${shared_ext}$major'
369584bf8334Smrg    if test "X$HPUX_IA64_MODE" = X32; then
369684bf8334Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
369784bf8334Smrg    else
369884bf8334Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
369984bf8334Smrg    fi
370084bf8334Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
370184bf8334Smrg    ;;
370284bf8334Smrg  hppa*64*)
370384bf8334Smrg    shrext_cmds='.sl'
370484bf8334Smrg    hardcode_into_libs=yes
370584bf8334Smrg    dynamic_linker="$host_os dld.sl"
370684bf8334Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
370784bf8334Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
370884bf8334Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
370984bf8334Smrg    soname_spec='${libname}${release}${shared_ext}$major'
371084bf8334Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
371184bf8334Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
371284bf8334Smrg    ;;
371384bf8334Smrg  *)
371484bf8334Smrg    shrext_cmds='.sl'
371584bf8334Smrg    dynamic_linker="$host_os dld.sl"
371684bf8334Smrg    shlibpath_var=SHLIB_PATH
371784bf8334Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
371884bf8334Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
371984bf8334Smrg    soname_spec='${libname}${release}${shared_ext}$major'
372084bf8334Smrg    ;;
372184bf8334Smrg  esac
372284bf8334Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
372384bf8334Smrg  postinstall_cmds='chmod 555 $lib'
372484bf8334Smrg  # or fails outright, so override atomically:
372584bf8334Smrg  install_override_mode=555
372684bf8334Smrg  ;;
372784bf8334Smrg
372884bf8334Smrginterix[[3-9]]*)
372984bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
373084bf8334Smrg  need_lib_prefix=no
373184bf8334Smrg  need_version=no
373284bf8334Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
373384bf8334Smrg  soname_spec='${libname}${release}${shared_ext}$major'
373484bf8334Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
373584bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
373684bf8334Smrg  shlibpath_overrides_runpath=no
373784bf8334Smrg  hardcode_into_libs=yes
373884bf8334Smrg  ;;
373984bf8334Smrg
374084bf8334Smrgirix5* | irix6* | nonstopux*)
374184bf8334Smrg  case $host_os in
374284bf8334Smrg    nonstopux*) version_type=nonstopux ;;
374384bf8334Smrg    *)
374484bf8334Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
374584bf8334Smrg		version_type=linux # correct to gnu/linux during the next big refactor
3746a73597f9Smrg	else
374784bf8334Smrg		version_type=irix
374884bf8334Smrg	fi ;;
374984bf8334Smrg  esac
375084bf8334Smrg  need_lib_prefix=no
375184bf8334Smrg  need_version=no
375284bf8334Smrg  soname_spec='${libname}${release}${shared_ext}$major'
375384bf8334Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
375484bf8334Smrg  case $host_os in
375584bf8334Smrg  irix5* | nonstopux*)
375684bf8334Smrg    libsuff= shlibsuff=
375784bf8334Smrg    ;;
375884bf8334Smrg  *)
375984bf8334Smrg    case $LD in # libtool.m4 will add one of these switches to LD
376084bf8334Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
376184bf8334Smrg      libsuff= shlibsuff= libmagic=32-bit;;
376284bf8334Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
376384bf8334Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
376484bf8334Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
376584bf8334Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
376684bf8334Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
3767b73be646Smrg    esac
376884bf8334Smrg    ;;
376984bf8334Smrg  esac
377084bf8334Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
377184bf8334Smrg  shlibpath_overrides_runpath=no
377284bf8334Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
377384bf8334Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
377484bf8334Smrg  hardcode_into_libs=yes
377584bf8334Smrg  ;;
3776b73be646Smrg
377784bf8334Smrg# No shared lib support for Linux oldld, aout, or coff.
377884bf8334Smrglinux*oldld* | linux*aout* | linux*coff*)
377984bf8334Smrg  dynamic_linker=no
378084bf8334Smrg  ;;
3781b73be646Smrg
378284bf8334Smrg# This must be glibc/ELF.
378384bf8334Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
378484bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
378584bf8334Smrg  need_lib_prefix=no
378684bf8334Smrg  need_version=no
378784bf8334Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
378884bf8334Smrg  soname_spec='${libname}${release}${shared_ext}$major'
378984bf8334Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
379084bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
379184bf8334Smrg  shlibpath_overrides_runpath=no
3792bd3a1963Smrg
379384bf8334Smrg  # Some binutils ld are patched to set DT_RUNPATH
379484bf8334Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
379584bf8334Smrg    [lt_cv_shlibpath_overrides_runpath=no
379684bf8334Smrg    save_LDFLAGS=$LDFLAGS
379784bf8334Smrg    save_libdir=$libdir
379884bf8334Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
379984bf8334Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
380084bf8334Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
380184bf8334Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
380284bf8334Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
380384bf8334Smrg    LDFLAGS=$save_LDFLAGS
380484bf8334Smrg    libdir=$save_libdir
380584bf8334Smrg    ])
380684bf8334Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
3807659607e0Smrg
380884bf8334Smrg  # This implies no fast_install, which is unacceptable.
380984bf8334Smrg  # Some rework will be needed to allow for fast_install
381084bf8334Smrg  # before this can be enabled.
381184bf8334Smrg  hardcode_into_libs=yes
3812659607e0Smrg
381384bf8334Smrg  # Append ld.so.conf contents to the search path
381484bf8334Smrg  if test -f /etc/ld.so.conf; then
381584bf8334Smrg    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' ' '`
381684bf8334Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
381784bf8334Smrg  fi
3818659607e0Smrg
381984bf8334Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
382084bf8334Smrg  # powerpc, because MkLinux only supported shared libraries with the
382184bf8334Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
382284bf8334Smrg  # most powerpc-linux boxes support dynamic linking these days and
382384bf8334Smrg  # people can always --disable-shared, the test was removed, and we
382484bf8334Smrg  # assume the GNU/Linux dynamic linker is in use.
382584bf8334Smrg  dynamic_linker='GNU/Linux ld.so'
382684bf8334Smrg  ;;
3827659607e0Smrg
382884bf8334Smrgnetbsd*)
382984bf8334Smrg  version_type=sunos
383084bf8334Smrg  need_lib_prefix=no
383184bf8334Smrg  need_version=no
383284bf8334Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
383384bf8334Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
383484bf8334Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
383584bf8334Smrg    dynamic_linker='NetBSD (a.out) ld.so'
383684bf8334Smrg  else
383784bf8334Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
383884bf8334Smrg    soname_spec='${libname}${release}${shared_ext}$major'
383984bf8334Smrg    dynamic_linker='NetBSD ld.elf_so'
384084bf8334Smrg  fi
384184bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
384284bf8334Smrg  shlibpath_overrides_runpath=yes
384384bf8334Smrg  hardcode_into_libs=yes
384484bf8334Smrg  ;;
384584bf8334Smrg
384684bf8334Smrgnewsos6)
384784bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
384884bf8334Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
384984bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
385084bf8334Smrg  shlibpath_overrides_runpath=yes
385184bf8334Smrg  ;;
385284bf8334Smrg
385384bf8334Smrg*nto* | *qnx*)
385484bf8334Smrg  version_type=qnx
385584bf8334Smrg  need_lib_prefix=no
385684bf8334Smrg  need_version=no
385784bf8334Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
385884bf8334Smrg  soname_spec='${libname}${release}${shared_ext}$major'
385984bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
386084bf8334Smrg  shlibpath_overrides_runpath=no
386184bf8334Smrg  hardcode_into_libs=yes
386284bf8334Smrg  dynamic_linker='ldqnx.so'
386384bf8334Smrg  ;;
386484bf8334Smrg
386584bf8334Smrgopenbsd*)
386684bf8334Smrg  version_type=sunos
386784bf8334Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
386884bf8334Smrg  need_lib_prefix=no
386984bf8334Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
387084bf8334Smrg  case $host_os in
387184bf8334Smrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
387284bf8334Smrg    *)				need_version=no  ;;
387384bf8334Smrg  esac
387484bf8334Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
387584bf8334Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
387684bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
387784bf8334Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
387884bf8334Smrg    case $host_os in
387984bf8334Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
388084bf8334Smrg	shlibpath_overrides_runpath=no
3881a73597f9Smrg	;;
3882a73597f9Smrg      *)
388384bf8334Smrg	shlibpath_overrides_runpath=yes
3884a73597f9Smrg	;;
3885a73597f9Smrg      esac
388684bf8334Smrg  else
388784bf8334Smrg    shlibpath_overrides_runpath=yes
388884bf8334Smrg  fi
388984bf8334Smrg  ;;
3890bd3a1963Smrg
389184bf8334Smrgos2*)
389284bf8334Smrg  libname_spec='$name'
389384bf8334Smrg  shrext_cmds=".dll"
389484bf8334Smrg  need_lib_prefix=no
389584bf8334Smrg  library_names_spec='$libname${shared_ext} $libname.a'
389684bf8334Smrg  dynamic_linker='OS/2 ld.exe'
389784bf8334Smrg  shlibpath_var=LIBPATH
389884bf8334Smrg  ;;
3899659607e0Smrg
390084bf8334Smrgosf3* | osf4* | osf5*)
390184bf8334Smrg  version_type=osf
390284bf8334Smrg  need_lib_prefix=no
390384bf8334Smrg  need_version=no
390484bf8334Smrg  soname_spec='${libname}${release}${shared_ext}$major'
390584bf8334Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
390684bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
390784bf8334Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
390884bf8334Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
390984bf8334Smrg  ;;
3910659607e0Smrg
391184bf8334Smrgrdos*)
391284bf8334Smrg  dynamic_linker=no
391384bf8334Smrg  ;;
3914659607e0Smrg
391584bf8334Smrgsolaris*)
391684bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
391784bf8334Smrg  need_lib_prefix=no
391884bf8334Smrg  need_version=no
391984bf8334Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
392084bf8334Smrg  soname_spec='${libname}${release}${shared_ext}$major'
392184bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
392284bf8334Smrg  shlibpath_overrides_runpath=yes
392384bf8334Smrg  hardcode_into_libs=yes
392484bf8334Smrg  # ldd complains unless libraries are executable
392584bf8334Smrg  postinstall_cmds='chmod +x $lib'
392684bf8334Smrg  ;;
3927659607e0Smrg
392884bf8334Smrgsunos4*)
392984bf8334Smrg  version_type=sunos
393084bf8334Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
393184bf8334Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
393284bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
393384bf8334Smrg  shlibpath_overrides_runpath=yes
393484bf8334Smrg  if test "$with_gnu_ld" = yes; then
393584bf8334Smrg    need_lib_prefix=no
393684bf8334Smrg  fi
393784bf8334Smrg  need_version=yes
393884bf8334Smrg  ;;
3939a73597f9Smrg
394084bf8334Smrgsysv4 | sysv4.3*)
394184bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
394284bf8334Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
394384bf8334Smrg  soname_spec='${libname}${release}${shared_ext}$major'
394484bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
394584bf8334Smrg  case $host_vendor in
394684bf8334Smrg    sni)
394784bf8334Smrg      shlibpath_overrides_runpath=no
394884bf8334Smrg      need_lib_prefix=no
394984bf8334Smrg      runpath_var=LD_RUN_PATH
3950a73597f9Smrg      ;;
395184bf8334Smrg    siemens)
395284bf8334Smrg      need_lib_prefix=no
3953a73597f9Smrg      ;;
395484bf8334Smrg    motorola)
395584bf8334Smrg      need_lib_prefix=no
395684bf8334Smrg      need_version=no
395784bf8334Smrg      shlibpath_overrides_runpath=no
395884bf8334Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3959a73597f9Smrg      ;;
396084bf8334Smrg  esac
396184bf8334Smrg  ;;
3962b73be646Smrg
396384bf8334Smrgsysv4*MP*)
396484bf8334Smrg  if test -d /usr/nec ;then
396584bf8334Smrg    version_type=linux # correct to gnu/linux during the next big refactor
396684bf8334Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
396784bf8334Smrg    soname_spec='$libname${shared_ext}.$major'
396884bf8334Smrg    shlibpath_var=LD_LIBRARY_PATH
396984bf8334Smrg  fi
397084bf8334Smrg  ;;
3971a73597f9Smrg
397284bf8334Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
397384bf8334Smrg  version_type=freebsd-elf
397484bf8334Smrg  need_lib_prefix=no
397584bf8334Smrg  need_version=no
397684bf8334Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
397784bf8334Smrg  soname_spec='${libname}${release}${shared_ext}$major'
397884bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
397984bf8334Smrg  shlibpath_overrides_runpath=yes
398084bf8334Smrg  hardcode_into_libs=yes
398184bf8334Smrg  if test "$with_gnu_ld" = yes; then
398284bf8334Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
398384bf8334Smrg  else
398484bf8334Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
398584bf8334Smrg    case $host_os in
398684bf8334Smrg      sco3.2v5*)
398784bf8334Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3988b73be646Smrg	;;
398984bf8334Smrg    esac
399084bf8334Smrg  fi
399184bf8334Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
399284bf8334Smrg  ;;
3993fc27e79cSmrg
399484bf8334Smrgtpf*)
399584bf8334Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
399684bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
399784bf8334Smrg  need_lib_prefix=no
399884bf8334Smrg  need_version=no
399984bf8334Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
400084bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
400184bf8334Smrg  shlibpath_overrides_runpath=no
400284bf8334Smrg  hardcode_into_libs=yes
400384bf8334Smrg  ;;
4004659607e0Smrg
400584bf8334Smrguts4*)
400684bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
400784bf8334Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
400884bf8334Smrg  soname_spec='${libname}${release}${shared_ext}$major'
400984bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
401084bf8334Smrg  ;;
4011a73597f9Smrg
401284bf8334Smrg*)
401384bf8334Smrg  dynamic_linker=no
401484bf8334Smrg  ;;
4015a73597f9Smrgesac
401684bf8334SmrgAC_MSG_RESULT([$dynamic_linker])
401784bf8334Smrgtest "$dynamic_linker" = no && can_build_shared=no
4018a73597f9Smrg
401984bf8334Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
402084bf8334Smrgif test "$GCC" = yes; then
402184bf8334Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
402284bf8334Smrgfi
4023a73597f9Smrg
402484bf8334Smrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
402584bf8334Smrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
402684bf8334Smrgfi
402784bf8334Smrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
402884bf8334Smrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
4029a73597f9Smrgfi
4030a73597f9Smrg
403184bf8334Smrg_LT_DECL([], [variables_saved_for_relink], [1],
403284bf8334Smrg    [Variables whose values should be saved in libtool wrapper scripts and
403384bf8334Smrg    restored at link time])
403484bf8334Smrg_LT_DECL([], [need_lib_prefix], [0],
403584bf8334Smrg    [Do we need the "lib" prefix for modules?])
403684bf8334Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
403784bf8334Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
403884bf8334Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
403984bf8334Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
404084bf8334Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
404184bf8334Smrg    [Is shlibpath searched before the hard-coded library search path?])
404284bf8334Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
404384bf8334Smrg_LT_DECL([], [library_names_spec], [1],
404484bf8334Smrg    [[List of archive names.  First name is the real one, the rest are links.
404584bf8334Smrg    The last name is the one that the linker finds with -lNAME]])
404684bf8334Smrg_LT_DECL([], [soname_spec], [1],
404784bf8334Smrg    [[The coded name of the library, if different from the real name]])
404884bf8334Smrg_LT_DECL([], [install_override_mode], [1],
404984bf8334Smrg    [Permission mode override for installation of shared libraries])
405084bf8334Smrg_LT_DECL([], [postinstall_cmds], [2],
405184bf8334Smrg    [Command to use after installation of a shared archive])
405284bf8334Smrg_LT_DECL([], [postuninstall_cmds], [2],
405384bf8334Smrg    [Command to use after uninstallation of a shared archive])
405484bf8334Smrg_LT_DECL([], [finish_cmds], [2],
405584bf8334Smrg    [Commands used to finish a libtool library installation in a directory])
405684bf8334Smrg_LT_DECL([], [finish_eval], [1],
405784bf8334Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
405884bf8334Smrg    not shown]])
405984bf8334Smrg_LT_DECL([], [hardcode_into_libs], [0],
406084bf8334Smrg    [Whether we should hardcode library paths into libraries])
406184bf8334Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
406284bf8334Smrg    [Compile-time system search path for libraries])
406384bf8334Smrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
406484bf8334Smrg    [Run-time system search path for libraries])
406584bf8334Smrg])# _LT_SYS_DYNAMIC_LINKER
4066a73597f9Smrg
4067a73597f9Smrg
406884bf8334Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
406984bf8334Smrg# --------------------------
407084bf8334Smrg# find a file program which can recognize shared library
407184bf8334SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
407284bf8334Smrg[m4_require([_LT_DECL_EGREP])dnl
407384bf8334SmrgAC_MSG_CHECKING([for $1])
407484bf8334SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
407584bf8334Smrg[case $MAGIC_CMD in
407684bf8334Smrg[[\\/*] |  ?:[\\/]*])
407784bf8334Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
407884bf8334Smrg  ;;
407984bf8334Smrg*)
408084bf8334Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
408184bf8334Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
408284bf8334Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
408384bf8334Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
408484bf8334Smrgdnl not every word.  This closes a longstanding sh security hole.
408584bf8334Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
408684bf8334Smrg  for ac_dir in $ac_dummy; do
408784bf8334Smrg    IFS="$lt_save_ifs"
408884bf8334Smrg    test -z "$ac_dir" && ac_dir=.
408984bf8334Smrg    if test -f $ac_dir/$1; then
409084bf8334Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
409184bf8334Smrg      if test -n "$file_magic_test_file"; then
409284bf8334Smrg	case $deplibs_check_method in
409384bf8334Smrg	"file_magic "*)
409484bf8334Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
409584bf8334Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
409684bf8334Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
409784bf8334Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
409884bf8334Smrg	    :
409984bf8334Smrg	  else
410084bf8334Smrg	    cat <<_LT_EOF 1>&2
4101fc27e79cSmrg
410284bf8334Smrg*** Warning: the command libtool uses to detect shared libraries,
410384bf8334Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
410484bf8334Smrg*** The result is that libtool may fail to recognize shared libraries
410584bf8334Smrg*** as such.  This will affect the creation of libtool libraries that
410684bf8334Smrg*** depend on shared libraries, but programs linked with such libtool
410784bf8334Smrg*** libraries will work regardless of this problem.  Nevertheless, you
410884bf8334Smrg*** may want to report the problem to your system manager and/or to
410984bf8334Smrg*** bug-libtool@gnu.org
411084bf8334Smrg
411184bf8334Smrg_LT_EOF
411284bf8334Smrg	  fi ;;
411384bf8334Smrg	esac
411484bf8334Smrg      fi
411584bf8334Smrg      break
4116a73597f9Smrg    fi
411784bf8334Smrg  done
411884bf8334Smrg  IFS="$lt_save_ifs"
411984bf8334Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
412084bf8334Smrg  ;;
412184bf8334Smrgesac])
412284bf8334SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
412384bf8334Smrgif test -n "$MAGIC_CMD"; then
412484bf8334Smrg  AC_MSG_RESULT($MAGIC_CMD)
412584bf8334Smrgelse
412684bf8334Smrg  AC_MSG_RESULT(no)
412784bf8334Smrgfi
412884bf8334Smrg_LT_DECL([], [MAGIC_CMD], [0],
412984bf8334Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
413084bf8334Smrg])# _LT_PATH_TOOL_PREFIX
4131a73597f9Smrg
413284bf8334Smrg# Old name:
413384bf8334SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
413484bf8334Smrgdnl aclocal-1.4 backwards compatibility:
413584bf8334Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
4136a73597f9Smrg
413784bf8334Smrg
413884bf8334Smrg# _LT_PATH_MAGIC
413984bf8334Smrg# --------------
414084bf8334Smrg# find a file program which can recognize a shared library
414184bf8334Smrgm4_defun([_LT_PATH_MAGIC],
414284bf8334Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
414384bf8334Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
414484bf8334Smrg  if test -n "$ac_tool_prefix"; then
414584bf8334Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
414684bf8334Smrg  else
414784bf8334Smrg    MAGIC_CMD=:
4148b73be646Smrg  fi
414984bf8334Smrgfi
415084bf8334Smrg])# _LT_PATH_MAGIC
4151fc27e79cSmrg
4152659607e0Smrg
415384bf8334Smrg# LT_PATH_LD
415484bf8334Smrg# ----------
415584bf8334Smrg# find the pathname to the GNU or non-GNU linker
415684bf8334SmrgAC_DEFUN([LT_PATH_LD],
415784bf8334Smrg[AC_REQUIRE([AC_PROG_CC])dnl
415884bf8334SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
415984bf8334SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
416084bf8334Smrgm4_require([_LT_DECL_SED])dnl
416184bf8334Smrgm4_require([_LT_DECL_EGREP])dnl
416284bf8334Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
4163659607e0Smrg
416484bf8334SmrgAC_ARG_WITH([gnu-ld],
416584bf8334Smrg    [AS_HELP_STRING([--with-gnu-ld],
416684bf8334Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
416784bf8334Smrg    [test "$withval" = no || with_gnu_ld=yes],
416884bf8334Smrg    [with_gnu_ld=no])dnl
4169659607e0Smrg
417084bf8334Smrgac_prog=ld
417184bf8334Smrgif test "$GCC" = yes; then
417284bf8334Smrg  # Check if gcc -print-prog-name=ld gives a path.
417384bf8334Smrg  AC_MSG_CHECKING([for ld used by $CC])
417484bf8334Smrg  case $host in
417584bf8334Smrg  *-*-mingw*)
417684bf8334Smrg    # gcc leaves a trailing carriage return which upsets mingw
417784bf8334Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
417884bf8334Smrg  *)
417984bf8334Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
418084bf8334Smrg  esac
418184bf8334Smrg  case $ac_prog in
418284bf8334Smrg    # Accept absolute paths.
418384bf8334Smrg    [[\\/]]* | ?:[[\\/]]*)
418484bf8334Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
418584bf8334Smrg      # Canonicalize the pathname of ld
418684bf8334Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
418784bf8334Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
418884bf8334Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
418984bf8334Smrg      done
419084bf8334Smrg      test -z "$LD" && LD="$ac_prog"
4191a73597f9Smrg      ;;
419284bf8334Smrg  "")
419384bf8334Smrg    # If it fails, then pretend we aren't using GCC.
419484bf8334Smrg    ac_prog=ld
419584bf8334Smrg    ;;
419684bf8334Smrg  *)
419784bf8334Smrg    # If it is relative, then search for the first ld in PATH.
419884bf8334Smrg    with_gnu_ld=unknown
419984bf8334Smrg    ;;
420084bf8334Smrg  esac
420184bf8334Smrgelif test "$with_gnu_ld" = yes; then
420284bf8334Smrg  AC_MSG_CHECKING([for GNU ld])
420384bf8334Smrgelse
420484bf8334Smrg  AC_MSG_CHECKING([for non-GNU ld])
420584bf8334Smrgfi
420684bf8334SmrgAC_CACHE_VAL(lt_cv_path_LD,
420784bf8334Smrg[if test -z "$LD"; then
420884bf8334Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
420984bf8334Smrg  for ac_dir in $PATH; do
421084bf8334Smrg    IFS="$lt_save_ifs"
421184bf8334Smrg    test -z "$ac_dir" && ac_dir=.
421284bf8334Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
421384bf8334Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
421484bf8334Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
421584bf8334Smrg      # but apparently some variants of GNU ld only accept -v.
421684bf8334Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
421784bf8334Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
421884bf8334Smrg      *GNU* | *'with BFD'*)
421984bf8334Smrg	test "$with_gnu_ld" != no && break
422084bf8334Smrg	;;
422184bf8334Smrg      *)
422284bf8334Smrg	test "$with_gnu_ld" != yes && break
422384bf8334Smrg	;;
4224a73597f9Smrg      esac
422584bf8334Smrg    fi
422684bf8334Smrg  done
422784bf8334Smrg  IFS="$lt_save_ifs"
422884bf8334Smrgelse
422984bf8334Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
423084bf8334Smrgfi])
423184bf8334SmrgLD="$lt_cv_path_LD"
423284bf8334Smrgif test -n "$LD"; then
423384bf8334Smrg  AC_MSG_RESULT($LD)
423484bf8334Smrgelse
423584bf8334Smrg  AC_MSG_RESULT(no)
423684bf8334Smrgfi
423784bf8334Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
423884bf8334Smrg_LT_PATH_LD_GNU
423984bf8334SmrgAC_SUBST([LD])
4240659607e0Smrg
424184bf8334Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
424284bf8334Smrg])# LT_PATH_LD
4243659607e0Smrg
424484bf8334Smrg# Old names:
424584bf8334SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
424684bf8334SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
424784bf8334Smrgdnl aclocal-1.4 backwards compatibility:
424884bf8334Smrgdnl AC_DEFUN([AM_PROG_LD], [])
424984bf8334Smrgdnl AC_DEFUN([AC_PROG_LD], [])
4250a73597f9Smrg
4251a73597f9Smrg
425284bf8334Smrg# _LT_PATH_LD_GNU
425384bf8334Smrg#- --------------
425484bf8334Smrgm4_defun([_LT_PATH_LD_GNU],
425584bf8334Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
425684bf8334Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
425784bf8334Smrgcase `$LD -v 2>&1 </dev/null` in
425884bf8334Smrg*GNU* | *'with BFD'*)
425984bf8334Smrg  lt_cv_prog_gnu_ld=yes
426084bf8334Smrg  ;;
426184bf8334Smrg*)
426284bf8334Smrg  lt_cv_prog_gnu_ld=no
426384bf8334Smrg  ;;
426484bf8334Smrgesac])
426584bf8334Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
426684bf8334Smrg])# _LT_PATH_LD_GNU
4267a73597f9Smrg
4268a73597f9Smrg
426984bf8334Smrg# _LT_CMD_RELOAD
427084bf8334Smrg# --------------
427184bf8334Smrg# find reload flag for linker
427284bf8334Smrg#   -- PORTME Some linkers may need a different reload flag.
427384bf8334Smrgm4_defun([_LT_CMD_RELOAD],
427484bf8334Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
427584bf8334Smrg  lt_cv_ld_reload_flag,
427684bf8334Smrg  [lt_cv_ld_reload_flag='-r'])
427784bf8334Smrgreload_flag=$lt_cv_ld_reload_flag
427884bf8334Smrgcase $reload_flag in
427984bf8334Smrg"" | " "*) ;;
428084bf8334Smrg*) reload_flag=" $reload_flag" ;;
428184bf8334Smrgesac
428284bf8334Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
428384bf8334Smrgcase $host_os in
428484bf8334Smrg  cygwin* | mingw* | pw32* | cegcc*)
428584bf8334Smrg    if test "$GCC" != yes; then
428684bf8334Smrg      reload_cmds=false
428784bf8334Smrg    fi
428884bf8334Smrg    ;;
428984bf8334Smrg  darwin*)
429084bf8334Smrg    if test "$GCC" = yes; then
429184bf8334Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
429284bf8334Smrg    else
429384bf8334Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
429484bf8334Smrg    fi
429584bf8334Smrg    ;;
429684bf8334Smrgesac
429784bf8334Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
429884bf8334Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
429984bf8334Smrg])# _LT_CMD_RELOAD
4300b73be646Smrg
4301fc27e79cSmrg
430284bf8334Smrg# _LT_CHECK_MAGIC_METHOD
430384bf8334Smrg# ----------------------
430484bf8334Smrg# how to check for library dependencies
430584bf8334Smrg#  -- PORTME fill in with the dynamic library characteristics
430684bf8334Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
430784bf8334Smrg[m4_require([_LT_DECL_EGREP])
430884bf8334Smrgm4_require([_LT_DECL_OBJDUMP])
430984bf8334SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
431084bf8334Smrglt_cv_deplibs_check_method,
431184bf8334Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
431284bf8334Smrglt_cv_file_magic_test_file=
431384bf8334Smrglt_cv_deplibs_check_method='unknown'
431484bf8334Smrg# Need to set the preceding variable on all platforms that support
431584bf8334Smrg# interlibrary dependencies.
431684bf8334Smrg# 'none' -- dependencies not supported.
431784bf8334Smrg# `unknown' -- same as none, but documents that we really don't know.
431884bf8334Smrg# 'pass_all' -- all dependencies passed with no checks.
431984bf8334Smrg# 'test_compile' -- check by making test program.
432084bf8334Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
432184bf8334Smrg# which responds to the $file_magic_cmd with a given extended regex.
432284bf8334Smrg# If you have `file' or equivalent on your system and you're not sure
432384bf8334Smrg# whether `pass_all' will *always* work, you probably want this one.
4324fc27e79cSmrg
432584bf8334Smrgcase $host_os in
432684bf8334Smrgaix[[4-9]]*)
432784bf8334Smrg  lt_cv_deplibs_check_method=pass_all
432884bf8334Smrg  ;;
4329659607e0Smrg
433084bf8334Smrgbeos*)
433184bf8334Smrg  lt_cv_deplibs_check_method=pass_all
433284bf8334Smrg  ;;
4333b73be646Smrg
433484bf8334Smrgbsdi[[45]]*)
433584bf8334Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
433684bf8334Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
433784bf8334Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
433884bf8334Smrg  ;;
4339659607e0Smrg
434084bf8334Smrgcygwin*)
434184bf8334Smrg  # func_win32_libid is a shell function defined in ltmain.sh
434284bf8334Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
434384bf8334Smrg  lt_cv_file_magic_cmd='func_win32_libid'
434484bf8334Smrg  ;;
4345659607e0Smrg
434684bf8334Smrgmingw* | pw32*)
434784bf8334Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
434884bf8334Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
434984bf8334Smrg  # unless we find 'file', for example because we are cross-compiling.
435084bf8334Smrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
435184bf8334Smrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
435284bf8334Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
435384bf8334Smrg    lt_cv_file_magic_cmd='func_win32_libid'
435484bf8334Smrg  else
435584bf8334Smrg    # Keep this pattern in sync with the one in func_win32_libid.
435684bf8334Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
435784bf8334Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
435884bf8334Smrg  fi
435984bf8334Smrg  ;;
4360fc27e79cSmrg
436184bf8334Smrgcegcc*)
436284bf8334Smrg  # use the weaker test based on 'objdump'. See mingw*.
436384bf8334Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
436484bf8334Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
436584bf8334Smrg  ;;
4366a73597f9Smrg
436784bf8334Smrgdarwin* | rhapsody*)
436884bf8334Smrg  lt_cv_deplibs_check_method=pass_all
436984bf8334Smrg  ;;
4370a73597f9Smrg
437184bf8334Smrgfreebsd* | dragonfly*)
437284bf8334Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
437384bf8334Smrg    case $host_cpu in
437484bf8334Smrg    i*86 )
437584bf8334Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
437684bf8334Smrg      # Let's accept both of them until this is cleared up.
437784bf8334Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
437884bf8334Smrg      lt_cv_file_magic_cmd=/usr/bin/file
437984bf8334Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
4380a73597f9Smrg      ;;
4381a73597f9Smrg    esac
4382a73597f9Smrg  else
438384bf8334Smrg    lt_cv_deplibs_check_method=pass_all
438484bf8334Smrg  fi
438584bf8334Smrg  ;;
4386659607e0Smrg
438784bf8334Smrggnu*)
438884bf8334Smrg  lt_cv_deplibs_check_method=pass_all
438984bf8334Smrg  ;;
4390659607e0Smrg
439184bf8334Smrghaiku*)
439284bf8334Smrg  lt_cv_deplibs_check_method=pass_all
439384bf8334Smrg  ;;
43946aab59a7Smrg
439584bf8334Smrghpux10.20* | hpux11*)
439684bf8334Smrg  lt_cv_file_magic_cmd=/usr/bin/file
439784bf8334Smrg  case $host_cpu in
439884bf8334Smrg  ia64*)
439984bf8334Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
440084bf8334Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
440184bf8334Smrg    ;;
440284bf8334Smrg  hppa*64*)
440384bf8334Smrg    [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]']
440484bf8334Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
440584bf8334Smrg    ;;
440684bf8334Smrg  *)
440784bf8334Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
440884bf8334Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
440984bf8334Smrg    ;;
441084bf8334Smrg  esac
441184bf8334Smrg  ;;
44126aab59a7Smrg
441384bf8334Smrginterix[[3-9]]*)
441484bf8334Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
441584bf8334Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
441684bf8334Smrg  ;;
4417b73be646Smrg
441884bf8334Smrgirix5* | irix6* | nonstopux*)
441984bf8334Smrg  case $LD in
442084bf8334Smrg  *-32|*"-32 ") libmagic=32-bit;;
442184bf8334Smrg  *-n32|*"-n32 ") libmagic=N32;;
442284bf8334Smrg  *-64|*"-64 ") libmagic=64-bit;;
442384bf8334Smrg  *) libmagic=never-match;;
442484bf8334Smrg  esac
442584bf8334Smrg  lt_cv_deplibs_check_method=pass_all
442684bf8334Smrg  ;;
4427fc27e79cSmrg
442884bf8334Smrg# This must be glibc/ELF.
442984bf8334Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
443084bf8334Smrg  lt_cv_deplibs_check_method=pass_all
443184bf8334Smrg  ;;
4432fc27e79cSmrg
443384bf8334Smrgnetbsd*)
443484bf8334Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
443584bf8334Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
443684bf8334Smrg  else
443784bf8334Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
443884bf8334Smrg  fi
443984bf8334Smrg  ;;
4440a73597f9Smrg
444184bf8334Smrgnewos6*)
444284bf8334Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
444384bf8334Smrg  lt_cv_file_magic_cmd=/usr/bin/file
444484bf8334Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
444584bf8334Smrg  ;;
4446659607e0Smrg
444784bf8334Smrg*nto* | *qnx*)
444884bf8334Smrg  lt_cv_deplibs_check_method=pass_all
444984bf8334Smrg  ;;
4450659607e0Smrg
445184bf8334Smrgopenbsd*)
445284bf8334Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
445384bf8334Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
445484bf8334Smrg  else
445584bf8334Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
445684bf8334Smrg  fi
445784bf8334Smrg  ;;
4458659607e0Smrg
445984bf8334Smrgosf3* | osf4* | osf5*)
446084bf8334Smrg  lt_cv_deplibs_check_method=pass_all
446184bf8334Smrg  ;;
4462659607e0Smrg
446384bf8334Smrgrdos*)
446484bf8334Smrg  lt_cv_deplibs_check_method=pass_all
446584bf8334Smrg  ;;
4466659607e0Smrg
446784bf8334Smrgsolaris*)
446884bf8334Smrg  lt_cv_deplibs_check_method=pass_all
446984bf8334Smrg  ;;
4470659607e0Smrg
447184bf8334Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
447284bf8334Smrg  lt_cv_deplibs_check_method=pass_all
447384bf8334Smrg  ;;
4474b73be646Smrg
447584bf8334Smrgsysv4 | sysv4.3*)
447684bf8334Smrg  case $host_vendor in
447784bf8334Smrg  motorola)
447884bf8334Smrg    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]]'
447984bf8334Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
448084bf8334Smrg    ;;
448184bf8334Smrg  ncr)
448284bf8334Smrg    lt_cv_deplibs_check_method=pass_all
448384bf8334Smrg    ;;
448484bf8334Smrg  sequent)
448584bf8334Smrg    lt_cv_file_magic_cmd='/bin/file'
448684bf8334Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
448784bf8334Smrg    ;;
448884bf8334Smrg  sni)
448984bf8334Smrg    lt_cv_file_magic_cmd='/bin/file'
449084bf8334Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
449184bf8334Smrg    lt_cv_file_magic_test_file=/lib/libc.so
449284bf8334Smrg    ;;
449384bf8334Smrg  siemens)
449484bf8334Smrg    lt_cv_deplibs_check_method=pass_all
449584bf8334Smrg    ;;
449684bf8334Smrg  pc)
449784bf8334Smrg    lt_cv_deplibs_check_method=pass_all
449884bf8334Smrg    ;;
449984bf8334Smrg  esac
450084bf8334Smrg  ;;
4501b73be646Smrg
450284bf8334Smrgtpf*)
450384bf8334Smrg  lt_cv_deplibs_check_method=pass_all
450484bf8334Smrg  ;;
450584bf8334Smrgesac
450684bf8334Smrg])
4507bd3a1963Smrg
450884bf8334Smrgfile_magic_glob=
450984bf8334Smrgwant_nocaseglob=no
451084bf8334Smrgif test "$build" = "$host"; then
451184bf8334Smrg  case $host_os in
451284bf8334Smrg  mingw* | pw32*)
451384bf8334Smrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
451484bf8334Smrg      want_nocaseglob=yes
451584bf8334Smrg    else
451684bf8334Smrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
451784bf8334Smrg    fi
451884bf8334Smrg    ;;
451984bf8334Smrg  esac
452084bf8334Smrgfi
4521fc27e79cSmrg
452284bf8334Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
452384bf8334Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
452484bf8334Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
452584bf8334Smrg
452684bf8334Smrg_LT_DECL([], [deplibs_check_method], [1],
452784bf8334Smrg    [Method to check whether dependent libraries are shared objects])
452884bf8334Smrg_LT_DECL([], [file_magic_cmd], [1],
452984bf8334Smrg    [Command to use when deplibs_check_method = "file_magic"])
453084bf8334Smrg_LT_DECL([], [file_magic_glob], [1],
453184bf8334Smrg    [How to find potential files when deplibs_check_method = "file_magic"])
453284bf8334Smrg_LT_DECL([], [want_nocaseglob], [1],
453384bf8334Smrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
453484bf8334Smrg])# _LT_CHECK_MAGIC_METHOD
453584bf8334Smrg
453684bf8334Smrg
453784bf8334Smrg# LT_PATH_NM
453884bf8334Smrg# ----------
453984bf8334Smrg# find the pathname to a BSD- or MS-compatible name lister
454084bf8334SmrgAC_DEFUN([LT_PATH_NM],
454184bf8334Smrg[AC_REQUIRE([AC_PROG_CC])dnl
454284bf8334SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
454384bf8334Smrg[if test -n "$NM"; then
454484bf8334Smrg  # Let the user override the test.
454584bf8334Smrg  lt_cv_path_NM="$NM"
454684bf8334Smrgelse
454784bf8334Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
454884bf8334Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
454984bf8334Smrg    lt_nm_to_check="$lt_nm_to_check nm"
455084bf8334Smrg  fi
455184bf8334Smrg  for lt_tmp_nm in $lt_nm_to_check; do
455284bf8334Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
455384bf8334Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
455484bf8334Smrg      IFS="$lt_save_ifs"
455584bf8334Smrg      test -z "$ac_dir" && ac_dir=.
455684bf8334Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
455784bf8334Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
455884bf8334Smrg	# Check to see if the nm accepts a BSD-compat flag.
455984bf8334Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
456084bf8334Smrg	#   nm: unknown option "B" ignored
456184bf8334Smrg	# Tru64's nm complains that /dev/null is an invalid object file
456284bf8334Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
456384bf8334Smrg	*/dev/null* | *'Invalid file or object type'*)
456484bf8334Smrg	  lt_cv_path_NM="$tmp_nm -B"
456584bf8334Smrg	  break
4566a73597f9Smrg	  ;;
4567a73597f9Smrg	*)
456884bf8334Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
456984bf8334Smrg	  */dev/null*)
457084bf8334Smrg	    lt_cv_path_NM="$tmp_nm -p"
457184bf8334Smrg	    break
457284bf8334Smrg	    ;;
457384bf8334Smrg	  *)
457484bf8334Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
457584bf8334Smrg	    continue # so that we can try to find one that supports BSD flags
457684bf8334Smrg	    ;;
457784bf8334Smrg	  esac
4578a73597f9Smrg	  ;;
4579a73597f9Smrg	esac
4580a73597f9Smrg      fi
458184bf8334Smrg    done
458284bf8334Smrg    IFS="$lt_save_ifs"
458384bf8334Smrg  done
458484bf8334Smrg  : ${lt_cv_path_NM=no}
458584bf8334Smrgfi])
458684bf8334Smrgif test "$lt_cv_path_NM" != "no"; then
458784bf8334Smrg  NM="$lt_cv_path_NM"
458884bf8334Smrgelse
458984bf8334Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
459084bf8334Smrg  if test -n "$DUMPBIN"; then :
459184bf8334Smrg    # Let the user override the test.
459284bf8334Smrg  else
459384bf8334Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
459484bf8334Smrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
459584bf8334Smrg    *COFF*)
459684bf8334Smrg      DUMPBIN="$DUMPBIN -symbols"
4597a73597f9Smrg      ;;
459884bf8334Smrg    *)
459984bf8334Smrg      DUMPBIN=:
4600a73597f9Smrg      ;;
460184bf8334Smrg    esac
460284bf8334Smrg  fi
460384bf8334Smrg  AC_SUBST([DUMPBIN])
460484bf8334Smrg  if test "$DUMPBIN" != ":"; then
460584bf8334Smrg    NM="$DUMPBIN"
460684bf8334Smrg  fi
460784bf8334Smrgfi
460884bf8334Smrgtest -z "$NM" && NM=nm
460984bf8334SmrgAC_SUBST([NM])
461084bf8334Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
4611659607e0Smrg
461284bf8334SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
461384bf8334Smrg  [lt_cv_nm_interface="BSD nm"
461484bf8334Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
461584bf8334Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
461684bf8334Smrg  (eval "$ac_compile" 2>conftest.err)
461784bf8334Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
461884bf8334Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
461984bf8334Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
462084bf8334Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
462184bf8334Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
462284bf8334Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
462384bf8334Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
462484bf8334Smrg    lt_cv_nm_interface="MS dumpbin"
462584bf8334Smrg  fi
462684bf8334Smrg  rm -f conftest*])
462784bf8334Smrg])# LT_PATH_NM
4628659607e0Smrg
462984bf8334Smrg# Old names:
463084bf8334SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
463184bf8334SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
463284bf8334Smrgdnl aclocal-1.4 backwards compatibility:
463384bf8334Smrgdnl AC_DEFUN([AM_PROG_NM], [])
463484bf8334Smrgdnl AC_DEFUN([AC_PROG_NM], [])
4635659607e0Smrg
463684bf8334Smrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
463784bf8334Smrg# --------------------------------
463884bf8334Smrg# how to determine the name of the shared library
463984bf8334Smrg# associated with a specific link library.
464084bf8334Smrg#  -- PORTME fill in with the dynamic library characteristics
464184bf8334Smrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
464284bf8334Smrg[m4_require([_LT_DECL_EGREP])
464384bf8334Smrgm4_require([_LT_DECL_OBJDUMP])
464484bf8334Smrgm4_require([_LT_DECL_DLLTOOL])
464584bf8334SmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
464684bf8334Smrglt_cv_sharedlib_from_linklib_cmd,
464784bf8334Smrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
4648659607e0Smrg
464984bf8334Smrgcase $host_os in
465084bf8334Smrgcygwin* | mingw* | pw32* | cegcc*)
465184bf8334Smrg  # two different shell functions defined in ltmain.sh
465284bf8334Smrg  # decide which to use based on capabilities of $DLLTOOL
465384bf8334Smrg  case `$DLLTOOL --help 2>&1` in
465484bf8334Smrg  *--identify-strict*)
465584bf8334Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
465684bf8334Smrg    ;;
465784bf8334Smrg  *)
465884bf8334Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
465984bf8334Smrg    ;;
466084bf8334Smrg  esac
466184bf8334Smrg  ;;
466284bf8334Smrg*)
466384bf8334Smrg  # fallback: assume linklib IS sharedlib
466484bf8334Smrg  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
466584bf8334Smrg  ;;
466684bf8334Smrgesac
466784bf8334Smrg])
466884bf8334Smrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
466984bf8334Smrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
4670659607e0Smrg
467184bf8334Smrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
467284bf8334Smrg    [Command to associate shared and link libraries])
467384bf8334Smrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4674fc27e79cSmrg
4675fc27e79cSmrg
467684bf8334Smrg# _LT_PATH_MANIFEST_TOOL
467784bf8334Smrg# ----------------------
467884bf8334Smrg# locate the manifest tool
467984bf8334Smrgm4_defun([_LT_PATH_MANIFEST_TOOL],
468084bf8334Smrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
468184bf8334Smrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
468284bf8334SmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
468384bf8334Smrg  [lt_cv_path_mainfest_tool=no
468484bf8334Smrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
468584bf8334Smrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
468684bf8334Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
468784bf8334Smrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
468884bf8334Smrg    lt_cv_path_mainfest_tool=yes
468984bf8334Smrg  fi
469084bf8334Smrg  rm -f conftest*])
469184bf8334Smrgif test "x$lt_cv_path_mainfest_tool" != xyes; then
469284bf8334Smrg  MANIFEST_TOOL=:
469384bf8334Smrgfi
469484bf8334Smrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
469584bf8334Smrg])# _LT_PATH_MANIFEST_TOOL
4696fc27e79cSmrg
4697b73be646Smrg
469884bf8334Smrg# LT_LIB_M
469984bf8334Smrg# --------
470084bf8334Smrg# check for math library
470184bf8334SmrgAC_DEFUN([LT_LIB_M],
470284bf8334Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
470384bf8334SmrgLIBM=
470484bf8334Smrgcase $host in
470584bf8334Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
470684bf8334Smrg  # These system don't have libm, or don't need it
470784bf8334Smrg  ;;
470884bf8334Smrg*-ncr-sysv4.3*)
470984bf8334Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
471084bf8334Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
471184bf8334Smrg  ;;
471284bf8334Smrg*)
471384bf8334Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
471484bf8334Smrg  ;;
471584bf8334Smrgesac
471684bf8334SmrgAC_SUBST([LIBM])
471784bf8334Smrg])# LT_LIB_M
4718bd3a1963Smrg
471984bf8334Smrg# Old name:
472084bf8334SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
472184bf8334Smrgdnl aclocal-1.4 backwards compatibility:
472284bf8334Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
4723bd3a1963Smrg
4724b73be646Smrg
472584bf8334Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
472684bf8334Smrg# -------------------------------
472784bf8334Smrgm4_defun([_LT_COMPILER_NO_RTTI],
472884bf8334Smrg[m4_require([_LT_TAG_COMPILER])dnl
4729b73be646Smrg
473084bf8334Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
4731b73be646Smrg
473284bf8334Smrgif test "$GCC" = yes; then
473384bf8334Smrg  case $cc_basename in
473484bf8334Smrg  nvcc*)
473584bf8334Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
473684bf8334Smrg  *)
473784bf8334Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
473884bf8334Smrg  esac
4739a73597f9Smrg
474084bf8334Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
474184bf8334Smrg    lt_cv_prog_compiler_rtti_exceptions,
474284bf8334Smrg    [-fno-rtti -fno-exceptions], [],
474384bf8334Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
474484bf8334Smrgfi
474584bf8334Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
474684bf8334Smrg	[Compiler flag to turn off builtin functions])
474784bf8334Smrg])# _LT_COMPILER_NO_RTTI
4748a73597f9Smrg
4749a73597f9Smrg
475084bf8334Smrg# _LT_CMD_GLOBAL_SYMBOLS
475184bf8334Smrg# ----------------------
475284bf8334Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
475384bf8334Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
475484bf8334SmrgAC_REQUIRE([AC_PROG_CC])dnl
475584bf8334SmrgAC_REQUIRE([AC_PROG_AWK])dnl
475684bf8334SmrgAC_REQUIRE([LT_PATH_NM])dnl
475784bf8334SmrgAC_REQUIRE([LT_PATH_LD])dnl
475884bf8334Smrgm4_require([_LT_DECL_SED])dnl
475984bf8334Smrgm4_require([_LT_DECL_EGREP])dnl
476084bf8334Smrgm4_require([_LT_TAG_COMPILER])dnl
4761a73597f9Smrg
476284bf8334Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
476384bf8334SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
476484bf8334SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
476584bf8334Smrg[
476684bf8334Smrg# These are sane defaults that work on at least a few old systems.
476784bf8334Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4768b73be646Smrg
476984bf8334Smrg# Character class describing NM global symbol codes.
477084bf8334Smrgsymcode='[[BCDEGRST]]'
4771b73be646Smrg
477284bf8334Smrg# Regexp to match symbols that can be accessed directly from C.
477384bf8334Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
4774b73be646Smrg
477584bf8334Smrg# Define system-specific variables.
477684bf8334Smrgcase $host_os in
477784bf8334Smrgaix*)
477884bf8334Smrg  symcode='[[BCDT]]'
477984bf8334Smrg  ;;
478084bf8334Smrgcygwin* | mingw* | pw32* | cegcc*)
478184bf8334Smrg  symcode='[[ABCDGISTW]]'
478284bf8334Smrg  ;;
478384bf8334Smrghpux*)
478484bf8334Smrg  if test "$host_cpu" = ia64; then
478584bf8334Smrg    symcode='[[ABCDEGRST]]'
478684bf8334Smrg  fi
478784bf8334Smrg  ;;
478884bf8334Smrgirix* | nonstopux*)
478984bf8334Smrg  symcode='[[BCDEGRST]]'
479084bf8334Smrg  ;;
479184bf8334Smrgosf*)
479284bf8334Smrg  symcode='[[BCDEGQRST]]'
479384bf8334Smrg  ;;
479484bf8334Smrgsolaris*)
479584bf8334Smrg  symcode='[[BDRT]]'
479684bf8334Smrg  ;;
479784bf8334Smrgsco3.2v5*)
479884bf8334Smrg  symcode='[[DT]]'
479984bf8334Smrg  ;;
480084bf8334Smrgsysv4.2uw2*)
480184bf8334Smrg  symcode='[[DT]]'
480284bf8334Smrg  ;;
480384bf8334Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
480484bf8334Smrg  symcode='[[ABDT]]'
480584bf8334Smrg  ;;
480684bf8334Smrgsysv4)
480784bf8334Smrg  symcode='[[DFNSTU]]'
480884bf8334Smrg  ;;
480984bf8334Smrgesac
4810bd3a1963Smrg
481184bf8334Smrg# If we're using GNU nm, then use its standard symbol codes.
481284bf8334Smrgcase `$NM -V 2>&1` in
481384bf8334Smrg*GNU* | *'with BFD'*)
481484bf8334Smrg  symcode='[[ABCDGIRSTW]]' ;;
481584bf8334Smrgesac
4816a73597f9Smrg
481784bf8334Smrg# Transform an extracted symbol line into a proper C declaration.
481884bf8334Smrg# Some systems (esp. on ia64) link data and code symbols differently,
481984bf8334Smrg# so use this general approach.
482084bf8334Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4821a73597f9Smrg
482284bf8334Smrg# Transform an extracted symbol line into symbol name and symbol address
482384bf8334Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
482484bf8334Smrglt_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'"
482584bf8334Smrg
482684bf8334Smrg# Handle CRLF in mingw tool chain
482784bf8334Smrgopt_cr=
482884bf8334Smrgcase $build_os in
482984bf8334Smrgmingw*)
483084bf8334Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4831bd3a1963Smrg  ;;
4832bd3a1963Smrgesac
4833bd3a1963Smrg
483484bf8334Smrg# Try without a prefix underscore, then with it.
483584bf8334Smrgfor ac_symprfx in "" "_"; do
4836b73be646Smrg
483784bf8334Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
483884bf8334Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
4839b73be646Smrg
484084bf8334Smrg  # Write the raw and C identifiers.
484184bf8334Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
484284bf8334Smrg    # Fake it for dumpbin and say T for any non-static function
484384bf8334Smrg    # and D for any global variable.
484484bf8334Smrg    # Also find C++ and __fastcall symbols from MSVC++,
484584bf8334Smrg    # which start with @ or ?.
484684bf8334Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
484784bf8334Smrg"     {last_section=section; section=\$ 3};"\
484884bf8334Smrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
484984bf8334Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
485084bf8334Smrg"     \$ 0!~/External *\|/{next};"\
485184bf8334Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
485284bf8334Smrg"     {if(hide[section]) next};"\
485384bf8334Smrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
485484bf8334Smrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
485584bf8334Smrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
485684bf8334Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
485784bf8334Smrg"     ' prfx=^$ac_symprfx]"
485884bf8334Smrg  else
485984bf8334Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
486084bf8334Smrg  fi
486184bf8334Smrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4862659607e0Smrg
486384bf8334Smrg  # Check to see that the pipe works correctly.
486484bf8334Smrg  pipe_works=no
4865659607e0Smrg
486684bf8334Smrg  rm -f conftest*
486784bf8334Smrg  cat > conftest.$ac_ext <<_LT_EOF
486884bf8334Smrg#ifdef __cplusplus
486984bf8334Smrgextern "C" {
487084bf8334Smrg#endif
487184bf8334Smrgchar nm_test_var;
487284bf8334Smrgvoid nm_test_func(void);
487384bf8334Smrgvoid nm_test_func(void){}
487484bf8334Smrg#ifdef __cplusplus
487584bf8334Smrg}
487684bf8334Smrg#endif
487784bf8334Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
487884bf8334Smrg_LT_EOF
4879659607e0Smrg
488084bf8334Smrg  if AC_TRY_EVAL(ac_compile); then
488184bf8334Smrg    # Now try to grab the symbols.
488284bf8334Smrg    nlist=conftest.nm
488384bf8334Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
488484bf8334Smrg      # Try sorting and uniquifying the output.
488584bf8334Smrg      if sort "$nlist" | uniq > "$nlist"T; then
488684bf8334Smrg	mv -f "$nlist"T "$nlist"
488784bf8334Smrg      else
488884bf8334Smrg	rm -f "$nlist"T
488984bf8334Smrg      fi
4890659607e0Smrg
489184bf8334Smrg      # Make sure that we snagged all the symbols we need.
489284bf8334Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
489384bf8334Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
489484bf8334Smrg	  cat <<_LT_EOF > conftest.$ac_ext
489584bf8334Smrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
489684bf8334Smrg#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
489784bf8334Smrg/* DATA imports from DLLs on WIN32 con't be const, because runtime
489884bf8334Smrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
489984bf8334Smrg# define LT@&t@_DLSYM_CONST
490084bf8334Smrg#elif defined(__osf__)
490184bf8334Smrg/* This system does not cope well with relocations in const data.  */
490284bf8334Smrg# define LT@&t@_DLSYM_CONST
490384bf8334Smrg#else
490484bf8334Smrg# define LT@&t@_DLSYM_CONST const
490584bf8334Smrg#endif
4906659607e0Smrg
490784bf8334Smrg#ifdef __cplusplus
490884bf8334Smrgextern "C" {
490984bf8334Smrg#endif
4910659607e0Smrg
491184bf8334Smrg_LT_EOF
491284bf8334Smrg	  # Now generate the symbol file.
491384bf8334Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4914659607e0Smrg
491584bf8334Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
4916fc27e79cSmrg
491784bf8334Smrg/* The mapping between symbol names and symbols.  */
491884bf8334SmrgLT@&t@_DLSYM_CONST struct {
491984bf8334Smrg  const char *name;
492084bf8334Smrg  void       *address;
492184bf8334Smrg}
492284bf8334Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
492384bf8334Smrg{
492484bf8334Smrg  { "@PROGRAM@", (void *) 0 },
492584bf8334Smrg_LT_EOF
492684bf8334Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
492784bf8334Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
492884bf8334Smrg  {0, (void *) 0}
492984bf8334Smrg};
4930659607e0Smrg
493184bf8334Smrg/* This works around a problem in FreeBSD linker */
493284bf8334Smrg#ifdef FREEBSD_WORKAROUND
493384bf8334Smrgstatic const void *lt_preloaded_setup() {
493484bf8334Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
493584bf8334Smrg}
493684bf8334Smrg#endif
4937659607e0Smrg
493884bf8334Smrg#ifdef __cplusplus
493984bf8334Smrg}
494084bf8334Smrg#endif
494184bf8334Smrg_LT_EOF
494284bf8334Smrg	  # Now try linking the two files.
494384bf8334Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
494484bf8334Smrg	  lt_globsym_save_LIBS=$LIBS
494584bf8334Smrg	  lt_globsym_save_CFLAGS=$CFLAGS
494684bf8334Smrg	  LIBS="conftstm.$ac_objext"
494784bf8334Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
494884bf8334Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
494984bf8334Smrg	    pipe_works=yes
495084bf8334Smrg	  fi
495184bf8334Smrg	  LIBS=$lt_globsym_save_LIBS
495284bf8334Smrg	  CFLAGS=$lt_globsym_save_CFLAGS
495384bf8334Smrg	else
495484bf8334Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
495584bf8334Smrg	fi
495684bf8334Smrg      else
495784bf8334Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
495884bf8334Smrg      fi
495984bf8334Smrg    else
496084bf8334Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4961a73597f9Smrg    fi
496284bf8334Smrg  else
496384bf8334Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
496484bf8334Smrg    cat conftest.$ac_ext >&5
496584bf8334Smrg  fi
496684bf8334Smrg  rm -rf conftest* conftst*
496784bf8334Smrg
496884bf8334Smrg  # Do not use the global_symbol_pipe unless it works.
496984bf8334Smrg  if test "$pipe_works" = yes; then
497084bf8334Smrg    break
497184bf8334Smrg  else
497284bf8334Smrg    lt_cv_sys_global_symbol_pipe=
497384bf8334Smrg  fi
497484bf8334Smrgdone
497584bf8334Smrg])
497684bf8334Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
497784bf8334Smrg  lt_cv_sys_global_symbol_to_cdecl=
497884bf8334Smrgfi
497984bf8334Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
498084bf8334Smrg  AC_MSG_RESULT(failed)
498184bf8334Smrgelse
498284bf8334Smrg  AC_MSG_RESULT(ok)
498384bf8334Smrgfi
498484bf8334Smrg
498584bf8334Smrg# Response file support.
498684bf8334Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
498784bf8334Smrg  nm_file_list_spec='@'
498884bf8334Smrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
498984bf8334Smrg  nm_file_list_spec='@'
499084bf8334Smrgfi
499184bf8334Smrg
499284bf8334Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
499384bf8334Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
499484bf8334Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
499584bf8334Smrg    [Transform the output of nm in a proper C declaration])
499684bf8334Smrg_LT_DECL([global_symbol_to_c_name_address],
499784bf8334Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
499884bf8334Smrg    [Transform the output of nm in a C name address pair])
499984bf8334Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
500084bf8334Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
500184bf8334Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
500284bf8334Smrg_LT_DECL([], [nm_file_list_spec], [1],
500384bf8334Smrg    [Specify filename containing input files for $NM])
500484bf8334Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
500584bf8334Smrg
500684bf8334Smrg
500784bf8334Smrg# _LT_COMPILER_PIC([TAGNAME])
500884bf8334Smrg# ---------------------------
500984bf8334Smrgm4_defun([_LT_COMPILER_PIC],
501084bf8334Smrg[m4_require([_LT_TAG_COMPILER])dnl
501184bf8334Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
501284bf8334Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
501384bf8334Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
501484bf8334Smrg
501584bf8334Smrgm4_if([$1], [CXX], [
501684bf8334Smrg  # C++ specific cases for pic, static, wl, etc.
501784bf8334Smrg  if test "$GXX" = yes; then
501884bf8334Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
501984bf8334Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
502084bf8334Smrg
502184bf8334Smrg    case $host_os in
502284bf8334Smrg    aix*)
502384bf8334Smrg      # All AIX code is PIC.
502484bf8334Smrg      if test "$host_cpu" = ia64; then
502584bf8334Smrg	# AIX 5 now supports IA64 processor
502684bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
502784bf8334Smrg      fi
502884bf8334Smrg      ;;
502984bf8334Smrg
503084bf8334Smrg    amigaos*)
503184bf8334Smrg      case $host_cpu in
503284bf8334Smrg      powerpc)
503384bf8334Smrg            # see comment about AmigaOS4 .so support
503484bf8334Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
503584bf8334Smrg        ;;
503684bf8334Smrg      m68k)
503784bf8334Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
503884bf8334Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
503984bf8334Smrg            # like `-m68040'.
504084bf8334Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
504184bf8334Smrg        ;;
504284bf8334Smrg      esac
504384bf8334Smrg      ;;
504484bf8334Smrg
504584bf8334Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
504684bf8334Smrg      # PIC is the default for these OSes.
504784bf8334Smrg      ;;
504884bf8334Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
504984bf8334Smrg      # This hack is so that the source file can tell whether it is being
505084bf8334Smrg      # built for inclusion in a dll (and should export symbols for example).
505184bf8334Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
505284bf8334Smrg      # (--disable-auto-import) libraries
505384bf8334Smrg      m4_if([$1], [GCJ], [],
505484bf8334Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
505584bf8334Smrg      ;;
505684bf8334Smrg    darwin* | rhapsody*)
505784bf8334Smrg      # PIC is the default on this platform
505884bf8334Smrg      # Common symbols not allowed in MH_DYLIB files
505984bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
506084bf8334Smrg      ;;
506184bf8334Smrg    *djgpp*)
506284bf8334Smrg      # DJGPP does not support shared libraries at all
506384bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
506484bf8334Smrg      ;;
506584bf8334Smrg    haiku*)
506684bf8334Smrg      # PIC is the default for Haiku.
506784bf8334Smrg      # The "-static" flag exists, but is broken.
506884bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
506984bf8334Smrg      ;;
507084bf8334Smrg    interix[[3-9]]*)
507184bf8334Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
507284bf8334Smrg      # Instead, we relocate shared libraries at runtime.
507384bf8334Smrg      ;;
507484bf8334Smrg    sysv4*MP*)
507584bf8334Smrg      if test -d /usr/nec; then
507684bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
507784bf8334Smrg      fi
507884bf8334Smrg      ;;
507984bf8334Smrg    hpux*)
508084bf8334Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
508184bf8334Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
508284bf8334Smrg      # sets the default TLS model and affects inlining.
508384bf8334Smrg      case $host_cpu in
508484bf8334Smrg      hppa*64*)
508584bf8334Smrg	;;
508684bf8334Smrg      *)
508784bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
508884bf8334Smrg	;;
508984bf8334Smrg      esac
509084bf8334Smrg      ;;
509184bf8334Smrg    *qnx* | *nto*)
509284bf8334Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
509384bf8334Smrg      # it will coredump.
509484bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
509584bf8334Smrg      ;;
509684bf8334Smrg    *)
509784bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
509884bf8334Smrg      ;;
509984bf8334Smrg    esac
510084bf8334Smrg  else
510184bf8334Smrg    case $host_os in
510284bf8334Smrg      aix[[4-9]]*)
510384bf8334Smrg	# All AIX code is PIC.
510484bf8334Smrg	if test "$host_cpu" = ia64; then
510584bf8334Smrg	  # AIX 5 now supports IA64 processor
510684bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
510784bf8334Smrg	else
510884bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
510984bf8334Smrg	fi
511084bf8334Smrg	;;
511184bf8334Smrg      chorus*)
511284bf8334Smrg	case $cc_basename in
511384bf8334Smrg	cxch68*)
511484bf8334Smrg	  # Green Hills C++ Compiler
511584bf8334Smrg	  # _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"
511684bf8334Smrg	  ;;
511784bf8334Smrg	esac
511884bf8334Smrg	;;
511984bf8334Smrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
512084bf8334Smrg	# This hack is so that the source file can tell whether it is being
512184bf8334Smrg	# built for inclusion in a dll (and should export symbols for example).
512284bf8334Smrg	m4_if([$1], [GCJ], [],
512384bf8334Smrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
512484bf8334Smrg	;;
512584bf8334Smrg      dgux*)
512684bf8334Smrg	case $cc_basename in
512784bf8334Smrg	  ec++*)
512884bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
512984bf8334Smrg	    ;;
513084bf8334Smrg	  ghcx*)
513184bf8334Smrg	    # Green Hills C++ Compiler
513284bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
513384bf8334Smrg	    ;;
513484bf8334Smrg	  *)
513584bf8334Smrg	    ;;
513684bf8334Smrg	esac
513784bf8334Smrg	;;
513884bf8334Smrg      freebsd* | dragonfly*)
513984bf8334Smrg	# FreeBSD uses GNU C++
514084bf8334Smrg	;;
514184bf8334Smrg      hpux9* | hpux10* | hpux11*)
514284bf8334Smrg	case $cc_basename in
514384bf8334Smrg	  CC*)
514484bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
514584bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
514684bf8334Smrg	    if test "$host_cpu" != ia64; then
514784bf8334Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
514884bf8334Smrg	    fi
514984bf8334Smrg	    ;;
515084bf8334Smrg	  aCC*)
515184bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
515284bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
515384bf8334Smrg	    case $host_cpu in
515484bf8334Smrg	    hppa*64*|ia64*)
515584bf8334Smrg	      # +Z the default
515684bf8334Smrg	      ;;
515784bf8334Smrg	    *)
515884bf8334Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
515984bf8334Smrg	      ;;
516084bf8334Smrg	    esac
516184bf8334Smrg	    ;;
516284bf8334Smrg	  *)
516384bf8334Smrg	    ;;
516484bf8334Smrg	esac
516584bf8334Smrg	;;
516684bf8334Smrg      interix*)
516784bf8334Smrg	# This is c89, which is MS Visual C++ (no shared libs)
516884bf8334Smrg	# Anyone wants to do a port?
516984bf8334Smrg	;;
517084bf8334Smrg      irix5* | irix6* | nonstopux*)
517184bf8334Smrg	case $cc_basename in
517284bf8334Smrg	  CC*)
517384bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
517484bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
517584bf8334Smrg	    # CC pic flag -KPIC is the default.
517684bf8334Smrg	    ;;
517784bf8334Smrg	  *)
517884bf8334Smrg	    ;;
517984bf8334Smrg	esac
518084bf8334Smrg	;;
518184bf8334Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
518284bf8334Smrg	case $cc_basename in
518384bf8334Smrg	  KCC*)
518484bf8334Smrg	    # KAI C++ Compiler
518584bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
518684bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
518784bf8334Smrg	    ;;
518884bf8334Smrg	  ecpc* )
518984bf8334Smrg	    # old Intel C++ for x86_64 which still supported -KPIC.
519084bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
519184bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
519284bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
519384bf8334Smrg	    ;;
519484bf8334Smrg	  icpc* )
519584bf8334Smrg	    # Intel C++, used to be incompatible with GCC.
519684bf8334Smrg	    # ICC 10 doesn't accept -KPIC any more.
519784bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
519884bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
519984bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
520084bf8334Smrg	    ;;
520184bf8334Smrg	  pgCC* | pgcpp*)
520284bf8334Smrg	    # Portland Group C++ compiler
520384bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
520484bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
520584bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
520684bf8334Smrg	    ;;
520784bf8334Smrg	  cxx*)
520884bf8334Smrg	    # Compaq C++
520984bf8334Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
521084bf8334Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
521184bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
521284bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
521384bf8334Smrg	    ;;
521484bf8334Smrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
521584bf8334Smrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
521684bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
521784bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
521884bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
521984bf8334Smrg	    ;;
522084bf8334Smrg	  *)
522184bf8334Smrg	    case `$CC -V 2>&1 | sed 5q` in
522284bf8334Smrg	    *Sun\ C*)
522384bf8334Smrg	      # Sun C++ 5.9
522484bf8334Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
522584bf8334Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
522684bf8334Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
522784bf8334Smrg	      ;;
522884bf8334Smrg	    esac
522984bf8334Smrg	    ;;
523084bf8334Smrg	esac
523184bf8334Smrg	;;
523284bf8334Smrg      lynxos*)
523384bf8334Smrg	;;
523484bf8334Smrg      m88k*)
523584bf8334Smrg	;;
523684bf8334Smrg      mvs*)
523784bf8334Smrg	case $cc_basename in
523884bf8334Smrg	  cxx*)
523984bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
524084bf8334Smrg	    ;;
524184bf8334Smrg	  *)
524284bf8334Smrg	    ;;
524384bf8334Smrg	esac
524484bf8334Smrg	;;
524584bf8334Smrg      netbsd*)
524684bf8334Smrg	;;
524784bf8334Smrg      *qnx* | *nto*)
524884bf8334Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
524984bf8334Smrg        # it will coredump.
525084bf8334Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
525184bf8334Smrg        ;;
525284bf8334Smrg      osf3* | osf4* | osf5*)
525384bf8334Smrg	case $cc_basename in
525484bf8334Smrg	  KCC*)
525584bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
525684bf8334Smrg	    ;;
525784bf8334Smrg	  RCC*)
525884bf8334Smrg	    # Rational C++ 2.4.1
525984bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
526084bf8334Smrg	    ;;
526184bf8334Smrg	  cxx*)
526284bf8334Smrg	    # Digital/Compaq C++
526384bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
526484bf8334Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
526584bf8334Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
526684bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
526784bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
526884bf8334Smrg	    ;;
526984bf8334Smrg	  *)
527084bf8334Smrg	    ;;
527184bf8334Smrg	esac
527284bf8334Smrg	;;
527384bf8334Smrg      psos*)
527484bf8334Smrg	;;
527584bf8334Smrg      solaris*)
527684bf8334Smrg	case $cc_basename in
527784bf8334Smrg	  CC* | sunCC*)
527884bf8334Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
527984bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
528084bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
528184bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
528284bf8334Smrg	    ;;
528384bf8334Smrg	  gcx*)
528484bf8334Smrg	    # Green Hills C++ Compiler
528584bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
528684bf8334Smrg	    ;;
528784bf8334Smrg	  *)
528884bf8334Smrg	    ;;
528984bf8334Smrg	esac
529084bf8334Smrg	;;
529184bf8334Smrg      sunos4*)
529284bf8334Smrg	case $cc_basename in
529384bf8334Smrg	  CC*)
529484bf8334Smrg	    # Sun C++ 4.x
529584bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
529684bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
529784bf8334Smrg	    ;;
529884bf8334Smrg	  lcc*)
529984bf8334Smrg	    # Lucid
530084bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
530184bf8334Smrg	    ;;
530284bf8334Smrg	  *)
530384bf8334Smrg	    ;;
530484bf8334Smrg	esac
530584bf8334Smrg	;;
530684bf8334Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
530784bf8334Smrg	case $cc_basename in
530884bf8334Smrg	  CC*)
530984bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
531084bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
531184bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
531284bf8334Smrg	    ;;
531384bf8334Smrg	esac
531484bf8334Smrg	;;
531584bf8334Smrg      tandem*)
531684bf8334Smrg	case $cc_basename in
531784bf8334Smrg	  NCC*)
531884bf8334Smrg	    # NonStop-UX NCC 3.20
531984bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
532084bf8334Smrg	    ;;
532184bf8334Smrg	  *)
532284bf8334Smrg	    ;;
532384bf8334Smrg	esac
532484bf8334Smrg	;;
532584bf8334Smrg      vxworks*)
532684bf8334Smrg	;;
532784bf8334Smrg      *)
532884bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
532984bf8334Smrg	;;
533084bf8334Smrg    esac
533184bf8334Smrg  fi
533284bf8334Smrg],
533384bf8334Smrg[
533484bf8334Smrg  if test "$GCC" = yes; then
533584bf8334Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
533684bf8334Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5337fc27e79cSmrg
533884bf8334Smrg    case $host_os in
533984bf8334Smrg      aix*)
534084bf8334Smrg      # All AIX code is PIC.
534184bf8334Smrg      if test "$host_cpu" = ia64; then
534284bf8334Smrg	# AIX 5 now supports IA64 processor
534384bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
534484bf8334Smrg      fi
534584bf8334Smrg      ;;
5346fc27e79cSmrg
534784bf8334Smrg    amigaos*)
534884bf8334Smrg      case $host_cpu in
534984bf8334Smrg      powerpc)
535084bf8334Smrg            # see comment about AmigaOS4 .so support
535184bf8334Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
535284bf8334Smrg        ;;
535384bf8334Smrg      m68k)
535484bf8334Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
535584bf8334Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
535684bf8334Smrg            # like `-m68040'.
535784bf8334Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
535884bf8334Smrg        ;;
535984bf8334Smrg      esac
536084bf8334Smrg      ;;
5361fc27e79cSmrg
536284bf8334Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
536384bf8334Smrg      # PIC is the default for these OSes.
536484bf8334Smrg      ;;
5365fc27e79cSmrg
536684bf8334Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
536784bf8334Smrg      # This hack is so that the source file can tell whether it is being
536884bf8334Smrg      # built for inclusion in a dll (and should export symbols for example).
536984bf8334Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
537084bf8334Smrg      # (--disable-auto-import) libraries
537184bf8334Smrg      m4_if([$1], [GCJ], [],
537284bf8334Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
537384bf8334Smrg      ;;
5374fc27e79cSmrg
537584bf8334Smrg    darwin* | rhapsody*)
537684bf8334Smrg      # PIC is the default on this platform
537784bf8334Smrg      # Common symbols not allowed in MH_DYLIB files
537884bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
537984bf8334Smrg      ;;
5380b73be646Smrg
538184bf8334Smrg    haiku*)
538284bf8334Smrg      # PIC is the default for Haiku.
538384bf8334Smrg      # The "-static" flag exists, but is broken.
538484bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
538584bf8334Smrg      ;;
5386b73be646Smrg
538784bf8334Smrg    hpux*)
538884bf8334Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
538984bf8334Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
539084bf8334Smrg      # sets the default TLS model and affects inlining.
539184bf8334Smrg      case $host_cpu in
539284bf8334Smrg      hppa*64*)
539384bf8334Smrg	# +Z the default
539484bf8334Smrg	;;
539584bf8334Smrg      *)
539684bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
539784bf8334Smrg	;;
539884bf8334Smrg      esac
539984bf8334Smrg      ;;
5400b73be646Smrg
540184bf8334Smrg    interix[[3-9]]*)
540284bf8334Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
540384bf8334Smrg      # Instead, we relocate shared libraries at runtime.
540484bf8334Smrg      ;;
5405659607e0Smrg
540684bf8334Smrg    msdosdjgpp*)
540784bf8334Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
540884bf8334Smrg      # on systems that don't support them.
540984bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
541084bf8334Smrg      enable_shared=no
541184bf8334Smrg      ;;
5412659607e0Smrg
541384bf8334Smrg    *nto* | *qnx*)
541484bf8334Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
541584bf8334Smrg      # it will coredump.
541684bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
541784bf8334Smrg      ;;
5418b73be646Smrg
541984bf8334Smrg    sysv4*MP*)
542084bf8334Smrg      if test -d /usr/nec; then
542184bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
542284bf8334Smrg      fi
542384bf8334Smrg      ;;
5424659607e0Smrg
542584bf8334Smrg    *)
542684bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
542784bf8334Smrg      ;;
542884bf8334Smrg    esac
5429bd3a1963Smrg
543084bf8334Smrg    case $cc_basename in
543184bf8334Smrg    nvcc*) # Cuda Compiler Driver 2.2
543284bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
543384bf8334Smrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
543484bf8334Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
543584bf8334Smrg      fi
543684bf8334Smrg      ;;
543784bf8334Smrg    esac
5438a73597f9Smrg  else
543984bf8334Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
544084bf8334Smrg    case $host_os in
544184bf8334Smrg    aix*)
544284bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
544384bf8334Smrg      if test "$host_cpu" = ia64; then
544484bf8334Smrg	# AIX 5 now supports IA64 processor
544584bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
544684bf8334Smrg      else
544784bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
544884bf8334Smrg      fi
544984bf8334Smrg      ;;
5450659607e0Smrg
545184bf8334Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
545284bf8334Smrg      # This hack is so that the source file can tell whether it is being
545384bf8334Smrg      # built for inclusion in a dll (and should export symbols for example).
545484bf8334Smrg      m4_if([$1], [GCJ], [],
545584bf8334Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
545684bf8334Smrg      ;;
5457659607e0Smrg
545884bf8334Smrg    hpux9* | hpux10* | hpux11*)
545984bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
546084bf8334Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
546184bf8334Smrg      # not for PA HP-UX.
546284bf8334Smrg      case $host_cpu in
546384bf8334Smrg      hppa*64*|ia64*)
546484bf8334Smrg	# +Z the default
546584bf8334Smrg	;;
546684bf8334Smrg      *)
546784bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
546884bf8334Smrg	;;
546984bf8334Smrg      esac
547084bf8334Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
547184bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
547284bf8334Smrg      ;;
5473fc27e79cSmrg
547484bf8334Smrg    irix5* | irix6* | nonstopux*)
547584bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
547684bf8334Smrg      # PIC (with -KPIC) is the default.
547784bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
547884bf8334Smrg      ;;
5479a73597f9Smrg
548084bf8334Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu)
548184bf8334Smrg      case $cc_basename in
548284bf8334Smrg      # old Intel for x86_64 which still supported -KPIC.
548384bf8334Smrg      ecc*)
548484bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
548584bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
548684bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
548784bf8334Smrg        ;;
548884bf8334Smrg      # icc used to be incompatible with GCC.
548984bf8334Smrg      # ICC 10 doesn't accept -KPIC any more.
549084bf8334Smrg      icc* | ifort*)
549184bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
549284bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
549384bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
549484bf8334Smrg        ;;
549584bf8334Smrg      # Lahey Fortran 8.1.
549684bf8334Smrg      lf95*)
549784bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
549884bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
549984bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
550084bf8334Smrg	;;
550184bf8334Smrg      nagfor*)
550284bf8334Smrg	# NAG Fortran compiler
550384bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
550484bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
550584bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
550684bf8334Smrg	;;
550784bf8334Smrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
550884bf8334Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
550984bf8334Smrg	# which looks to be a dead project)
551084bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
551184bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
551284bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
551384bf8334Smrg        ;;
551484bf8334Smrg      ccc*)
551584bf8334Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
551684bf8334Smrg        # All Alpha code is PIC.
551784bf8334Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
551884bf8334Smrg        ;;
551984bf8334Smrg      xl* | bgxl* | bgf* | mpixl*)
552084bf8334Smrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
552184bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
552284bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
552384bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
552484bf8334Smrg	;;
552584bf8334Smrg      *)
552684bf8334Smrg	case `$CC -V 2>&1 | sed 5q` in
552784bf8334Smrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
552884bf8334Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
552984bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
553084bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
553184bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
553284bf8334Smrg	  ;;
553384bf8334Smrg	*Sun\ F* | *Sun*Fortran*)
553484bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
553584bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
553684bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
553784bf8334Smrg	  ;;
553884bf8334Smrg	*Sun\ C*)
553984bf8334Smrg	  # Sun C 5.9
554084bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
554184bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
554284bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
554384bf8334Smrg	  ;;
554484bf8334Smrg        *Intel*\ [[CF]]*Compiler*)
554584bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
554684bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
554784bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
554884bf8334Smrg	  ;;
554984bf8334Smrg	*Portland\ Group*)
555084bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
555184bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
555284bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
555384bf8334Smrg	  ;;
555484bf8334Smrg	esac
555584bf8334Smrg	;;
555684bf8334Smrg      esac
555784bf8334Smrg      ;;
5558a73597f9Smrg
555984bf8334Smrg    newsos6)
556084bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
556184bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
556284bf8334Smrg      ;;
5563a73597f9Smrg
556484bf8334Smrg    *nto* | *qnx*)
556584bf8334Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
556684bf8334Smrg      # it will coredump.
556784bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
556884bf8334Smrg      ;;
5569a73597f9Smrg
557084bf8334Smrg    osf3* | osf4* | osf5*)
557184bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
557284bf8334Smrg      # All OSF/1 code is PIC.
557384bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
557484bf8334Smrg      ;;
5575a73597f9Smrg
557684bf8334Smrg    rdos*)
557784bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
557884bf8334Smrg      ;;
5579fc27e79cSmrg
558084bf8334Smrg    solaris*)
558184bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
558284bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
558384bf8334Smrg      case $cc_basename in
558484bf8334Smrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
558584bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
558684bf8334Smrg      *)
558784bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
558884bf8334Smrg      esac
558984bf8334Smrg      ;;
5590bd3a1963Smrg
559184bf8334Smrg    sunos4*)
559284bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
559384bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
559484bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
559584bf8334Smrg      ;;
5596fc27e79cSmrg
559784bf8334Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
559884bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
559984bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
560084bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
560184bf8334Smrg      ;;
5602659607e0Smrg
560384bf8334Smrg    sysv4*MP*)
560484bf8334Smrg      if test -d /usr/nec ;then
560584bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
560684bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
560784bf8334Smrg      fi
560884bf8334Smrg      ;;
5609fc27e79cSmrg
561084bf8334Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
561184bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
561284bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
561384bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
561484bf8334Smrg      ;;
5615b73be646Smrg
561684bf8334Smrg    unicos*)
561784bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
561884bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
561984bf8334Smrg      ;;
5620b73be646Smrg
562184bf8334Smrg    uts4*)
562284bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
562384bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
562484bf8334Smrg      ;;
5625659607e0Smrg
562684bf8334Smrg    *)
562784bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
562884bf8334Smrg      ;;
562984bf8334Smrg    esac
563084bf8334Smrg  fi
563184bf8334Smrg])
563284bf8334Smrgcase $host_os in
563384bf8334Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
563484bf8334Smrg  *djgpp*)
563584bf8334Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
563684bf8334Smrg    ;;
563784bf8334Smrg  *)
563884bf8334Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
563984bf8334Smrg    ;;
564084bf8334Smrgesac
5641a73597f9Smrg
564284bf8334SmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
564384bf8334Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
564484bf8334Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
564584bf8334Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
5646a73597f9Smrg
564784bf8334Smrg#
564884bf8334Smrg# Check to make sure the PIC flag actually works.
564984bf8334Smrg#
565084bf8334Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
565184bf8334Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
565284bf8334Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
565384bf8334Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
565484bf8334Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
565584bf8334Smrg     "" | " "*) ;;
565684bf8334Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
565784bf8334Smrg     esac],
565884bf8334Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
565984bf8334Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
566084bf8334Smrgfi
566184bf8334Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
566284bf8334Smrg	[Additional compiler flags for building library objects])
5663a73597f9Smrg
566484bf8334Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
566584bf8334Smrg	[How to pass a linker flag through the compiler])
566684bf8334Smrg#
566784bf8334Smrg# Check to make sure the static flag actually works.
566884bf8334Smrg#
566984bf8334Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
567084bf8334Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
567184bf8334Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
567284bf8334Smrg  $lt_tmp_static_flag,
567384bf8334Smrg  [],
567484bf8334Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
567584bf8334Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
567684bf8334Smrg	[Compiler flag to prevent dynamic linking])
567784bf8334Smrg])# _LT_COMPILER_PIC
567884bf8334Smrg
567984bf8334Smrg
568084bf8334Smrg# _LT_LINKER_SHLIBS([TAGNAME])
568184bf8334Smrg# ----------------------------
568284bf8334Smrg# See if the linker supports building shared libraries.
568384bf8334Smrgm4_defun([_LT_LINKER_SHLIBS],
568484bf8334Smrg[AC_REQUIRE([LT_PATH_LD])dnl
568584bf8334SmrgAC_REQUIRE([LT_PATH_NM])dnl
568684bf8334Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
568784bf8334Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
568884bf8334Smrgm4_require([_LT_DECL_EGREP])dnl
568984bf8334Smrgm4_require([_LT_DECL_SED])dnl
569084bf8334Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
569184bf8334Smrgm4_require([_LT_TAG_COMPILER])dnl
569284bf8334SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
569384bf8334Smrgm4_if([$1], [CXX], [
569484bf8334Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
569584bf8334Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
569684bf8334Smrg  case $host_os in
569784bf8334Smrg  aix[[4-9]]*)
569884bf8334Smrg    # If we're using GNU nm, then we don't want the "-C" option.
569984bf8334Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
570084bf8334Smrg    # Also, AIX nm treats weak defined symbols like other global defined
570184bf8334Smrg    # symbols, whereas GNU nm marks them as "W".
570284bf8334Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
570384bf8334Smrg      _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'
570484bf8334Smrg    else
570584bf8334Smrg      _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'
570684bf8334Smrg    fi
570784bf8334Smrg    ;;
570884bf8334Smrg  pw32*)
570984bf8334Smrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
571084bf8334Smrg    ;;
571184bf8334Smrg  cygwin* | mingw* | cegcc*)
571284bf8334Smrg    case $cc_basename in
571384bf8334Smrg    cl*)
571484bf8334Smrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
571584bf8334Smrg      ;;
571684bf8334Smrg    *)
571784bf8334Smrg      _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'
571884bf8334Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
571984bf8334Smrg      ;;
572084bf8334Smrg    esac
572184bf8334Smrg    ;;
572284bf8334Smrg  *)
572384bf8334Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
572484bf8334Smrg    ;;
572584bf8334Smrg  esac
572684bf8334Smrg], [
572784bf8334Smrg  runpath_var=
572884bf8334Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
572984bf8334Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
573084bf8334Smrg  _LT_TAGVAR(archive_cmds, $1)=
573184bf8334Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
573284bf8334Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
573384bf8334Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
573484bf8334Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
573584bf8334Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
573684bf8334Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
573784bf8334Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
573884bf8334Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
573984bf8334Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
574084bf8334Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
574184bf8334Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
574284bf8334Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
574384bf8334Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
574484bf8334Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
574584bf8334Smrg  _LT_TAGVAR(module_cmds, $1)=
574684bf8334Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
574784bf8334Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
574884bf8334Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
574984bf8334Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
575084bf8334Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
575184bf8334Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
575284bf8334Smrg  # included in the symbol list
575384bf8334Smrg  _LT_TAGVAR(include_expsyms, $1)=
575484bf8334Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
575584bf8334Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
575684bf8334Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
575784bf8334Smrg  # as well as any symbol that contains `d'.
575884bf8334Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
575984bf8334Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
576084bf8334Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
576184bf8334Smrg  # the symbol is explicitly referenced.  Since portable code cannot
576284bf8334Smrg  # rely on this symbol name, it's probably fine to never include it in
576384bf8334Smrg  # preloaded symbol tables.
576484bf8334Smrg  # Exclude shared library initialization/finalization symbols.
576584bf8334Smrgdnl Note also adjust exclude_expsyms for C++ above.
576684bf8334Smrg  extract_expsyms_cmds=
576784bf8334Smrg
576884bf8334Smrg  case $host_os in
576984bf8334Smrg  cygwin* | mingw* | pw32* | cegcc*)
577084bf8334Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
577184bf8334Smrg    # When not using gcc, we currently assume that we are using
577284bf8334Smrg    # Microsoft Visual C++.
577384bf8334Smrg    if test "$GCC" != yes; then
577484bf8334Smrg      with_gnu_ld=no
577584bf8334Smrg    fi
577684bf8334Smrg    ;;
577784bf8334Smrg  interix*)
577884bf8334Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
577984bf8334Smrg    with_gnu_ld=yes
578084bf8334Smrg    ;;
578184bf8334Smrg  openbsd*)
578284bf8334Smrg    with_gnu_ld=no
578384bf8334Smrg    ;;
578484bf8334Smrg  esac
5785a73597f9Smrg
578684bf8334Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
578784bf8334Smrg
578884bf8334Smrg  # On some targets, GNU ld is compatible enough with the native linker
578984bf8334Smrg  # that we're better off using the native interface for both.
579084bf8334Smrg  lt_use_gnu_ld_interface=no
579184bf8334Smrg  if test "$with_gnu_ld" = yes; then
579284bf8334Smrg    case $host_os in
579384bf8334Smrg      aix*)
579484bf8334Smrg	# The AIX port of GNU ld has always aspired to compatibility
579584bf8334Smrg	# with the native linker.  However, as the warning in the GNU ld
579684bf8334Smrg	# block says, versions before 2.19.5* couldn't really create working
579784bf8334Smrg	# shared libraries, regardless of the interface used.
579884bf8334Smrg	case `$LD -v 2>&1` in
579984bf8334Smrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
580084bf8334Smrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
580184bf8334Smrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
580284bf8334Smrg	  *)
580384bf8334Smrg	    lt_use_gnu_ld_interface=yes
580484bf8334Smrg	    ;;
5805b73be646Smrg	esac
5806fc27e79cSmrg	;;
580784bf8334Smrg      *)
580884bf8334Smrg	lt_use_gnu_ld_interface=yes
5809bd3a1963Smrg	;;
581084bf8334Smrg    esac
581184bf8334Smrg  fi
5812a73597f9Smrg
581384bf8334Smrg  if test "$lt_use_gnu_ld_interface" = yes; then
581484bf8334Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
581584bf8334Smrg    wlarc='${wl}'
5816a73597f9Smrg
581784bf8334Smrg    # Set some defaults for GNU ld with shared library support. These
581884bf8334Smrg    # are reset later if shared libraries are not supported. Putting them
581984bf8334Smrg    # here allows them to be overridden if necessary.
582084bf8334Smrg    runpath_var=LD_RUN_PATH
582184bf8334Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
582284bf8334Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
582384bf8334Smrg    # ancient GNU ld didn't support --whole-archive et. al.
582484bf8334Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
582584bf8334Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
582684bf8334Smrg    else
582784bf8334Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
582884bf8334Smrg    fi
582984bf8334Smrg    supports_anon_versioning=no
583084bf8334Smrg    case `$LD -v 2>&1` in
583184bf8334Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
583284bf8334Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
583384bf8334Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
583484bf8334Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
583584bf8334Smrg      *\ 2.11.*) ;; # other 2.11 versions
583684bf8334Smrg      *) supports_anon_versioning=yes ;;
583784bf8334Smrg    esac
5838a73597f9Smrg
583984bf8334Smrg    # See if GNU ld supports shared libraries.
584084bf8334Smrg    case $host_os in
584184bf8334Smrg    aix[[3-9]]*)
584284bf8334Smrg      # On AIX/PPC, the GNU linker is very broken
584384bf8334Smrg      if test "$host_cpu" != ia64; then
584484bf8334Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
584584bf8334Smrg	cat <<_LT_EOF 1>&2
5846a73597f9Smrg
584784bf8334Smrg*** Warning: the GNU linker, at least up to release 2.19, is reported
584884bf8334Smrg*** to be unable to reliably create shared libraries on AIX.
584984bf8334Smrg*** Therefore, libtool is disabling shared libraries support.  If you
585084bf8334Smrg*** really care for shared libraries, you may want to install binutils
585184bf8334Smrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
585284bf8334Smrg*** You will then need to restart the configuration process.
5853a73597f9Smrg
585484bf8334Smrg_LT_EOF
585584bf8334Smrg      fi
585684bf8334Smrg      ;;
5857a73597f9Smrg
585884bf8334Smrg    amigaos*)
585984bf8334Smrg      case $host_cpu in
586084bf8334Smrg      powerpc)
586184bf8334Smrg            # see comment about AmigaOS4 .so support
586284bf8334Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
586384bf8334Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
586484bf8334Smrg        ;;
586584bf8334Smrg      m68k)
586684bf8334Smrg            _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)'
586784bf8334Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
586884bf8334Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
586984bf8334Smrg        ;;
587084bf8334Smrg      esac
587184bf8334Smrg      ;;
5872a73597f9Smrg
587384bf8334Smrg    beos*)
587484bf8334Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
587584bf8334Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
587684bf8334Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
587784bf8334Smrg	# support --undefined.  This deserves some investigation.  FIXME
587884bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
587984bf8334Smrg      else
588084bf8334Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
588184bf8334Smrg      fi
588284bf8334Smrg      ;;
5883a73597f9Smrg
588484bf8334Smrg    cygwin* | mingw* | pw32* | cegcc*)
588584bf8334Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
588684bf8334Smrg      # as there is no search path for DLLs.
588784bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
588884bf8334Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
588984bf8334Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
589084bf8334Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
589184bf8334Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
589284bf8334Smrg      _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'
589384bf8334Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5894a73597f9Smrg
589584bf8334Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
589684bf8334Smrg        _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'
589784bf8334Smrg	# If the export-symbols file already is a .def file (1st line
589884bf8334Smrg	# is EXPORTS), use it as is; otherwise, prepend...
589984bf8334Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
590084bf8334Smrg	  cp $export_symbols $output_objdir/$soname.def;
590184bf8334Smrg	else
590284bf8334Smrg	  echo EXPORTS > $output_objdir/$soname.def;
590384bf8334Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
590484bf8334Smrg	fi~
590584bf8334Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
590684bf8334Smrg      else
590784bf8334Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
590884bf8334Smrg      fi
590984bf8334Smrg      ;;
5910a73597f9Smrg
591184bf8334Smrg    haiku*)
591284bf8334Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
591384bf8334Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
591484bf8334Smrg      ;;
5915a73597f9Smrg
591684bf8334Smrg    interix[[3-9]]*)
591784bf8334Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
591884bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
591984bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
592084bf8334Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
592184bf8334Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
592284bf8334Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
592384bf8334Smrg      # default) and relocated if they conflict, which is a slow very memory
592484bf8334Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
592584bf8334Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
592684bf8334Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
592784bf8334Smrg      _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'
592884bf8334Smrg      _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'
592984bf8334Smrg      ;;
593084bf8334Smrg
593184bf8334Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
593284bf8334Smrg      tmp_diet=no
593384bf8334Smrg      if test "$host_os" = linux-dietlibc; then
593484bf8334Smrg	case $cc_basename in
593584bf8334Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
593684bf8334Smrg	esac
593784bf8334Smrg      fi
593884bf8334Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
593984bf8334Smrg	 && test "$tmp_diet" = no
594084bf8334Smrg      then
594184bf8334Smrg	tmp_addflag=' $pic_flag'
594284bf8334Smrg	tmp_sharedflag='-shared'
594384bf8334Smrg	case $cc_basename,$host_cpu in
594484bf8334Smrg        pgcc*)				# Portland Group C compiler
594584bf8334Smrg	  _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'
594684bf8334Smrg	  tmp_addflag=' $pic_flag'
594784bf8334Smrg	  ;;
594884bf8334Smrg	pgf77* | pgf90* | pgf95* | pgfortran*)
594984bf8334Smrg					# Portland Group f77 and f90 compilers
595084bf8334Smrg	  _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'
595184bf8334Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
595284bf8334Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
595384bf8334Smrg	  tmp_addflag=' -i_dynamic' ;;
595484bf8334Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
595584bf8334Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
595684bf8334Smrg	ifc* | ifort*)			# Intel Fortran compiler
595784bf8334Smrg	  tmp_addflag=' -nofor_main' ;;
595884bf8334Smrg	lf95*)				# Lahey Fortran 8.1
595984bf8334Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
596084bf8334Smrg	  tmp_sharedflag='--shared' ;;
596184bf8334Smrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
596284bf8334Smrg	  tmp_sharedflag='-qmkshrobj'
596384bf8334Smrg	  tmp_addflag= ;;
596484bf8334Smrg	nvcc*)	# Cuda Compiler Driver 2.2
596584bf8334Smrg	  _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'
596684bf8334Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
596784bf8334Smrg	  ;;
596884bf8334Smrg	esac
596984bf8334Smrg	case `$CC -V 2>&1 | sed 5q` in
597084bf8334Smrg	*Sun\ C*)			# Sun C 5.9
597184bf8334Smrg	  _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'
597284bf8334Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
597384bf8334Smrg	  tmp_sharedflag='-G' ;;
597484bf8334Smrg	*Sun\ F*)			# Sun Fortran 8.3
597584bf8334Smrg	  tmp_sharedflag='-G' ;;
597684bf8334Smrg	esac
597784bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5978a73597f9Smrg
597984bf8334Smrg        if test "x$supports_anon_versioning" = xyes; then
598084bf8334Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
598184bf8334Smrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
598284bf8334Smrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
598384bf8334Smrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
598484bf8334Smrg        fi
5985a73597f9Smrg
598684bf8334Smrg	case $cc_basename in
598784bf8334Smrg	xlf* | bgf* | bgxlf* | mpixlf*)
598884bf8334Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
598984bf8334Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
599084bf8334Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
599184bf8334Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
599284bf8334Smrg	  if test "x$supports_anon_versioning" = xyes; then
599384bf8334Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
599484bf8334Smrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
599584bf8334Smrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
599684bf8334Smrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
599784bf8334Smrg	  fi
599884bf8334Smrg	  ;;
5999fc27e79cSmrg	esac
600084bf8334Smrg      else
600184bf8334Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
600284bf8334Smrg      fi
600384bf8334Smrg      ;;
6004a73597f9Smrg
600584bf8334Smrg    netbsd*)
600684bf8334Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
600784bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
600884bf8334Smrg	wlarc=
600984bf8334Smrg      else
601084bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
601184bf8334Smrg	_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'
601284bf8334Smrg      fi
601384bf8334Smrg      ;;
601484bf8334Smrg
601584bf8334Smrg    solaris*)
601684bf8334Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
6017a73597f9Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
601884bf8334Smrg	cat <<_LT_EOF 1>&2
6019a73597f9Smrg
602084bf8334Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
602184bf8334Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
602284bf8334Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
602384bf8334Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
602484bf8334Smrg*** your PATH or compiler configuration so that the native linker is
602584bf8334Smrg*** used, and then restart.
6026a73597f9Smrg
602784bf8334Smrg_LT_EOF
602884bf8334Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
602984bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
603084bf8334Smrg	_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'
603184bf8334Smrg      else
603284bf8334Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
603384bf8334Smrg      fi
603484bf8334Smrg      ;;
6035a73597f9Smrg
603684bf8334Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
603784bf8334Smrg      case `$LD -v 2>&1` in
603884bf8334Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
603984bf8334Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
604084bf8334Smrg	cat <<_LT_EOF 1>&2
6041a73597f9Smrg
604284bf8334Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
604384bf8334Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
604484bf8334Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
604584bf8334Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
604684bf8334Smrg*** your PATH or compiler configuration so that the native linker is
604784bf8334Smrg*** used, and then restart.
6048a73597f9Smrg
604984bf8334Smrg_LT_EOF
6050a73597f9Smrg	;;
605184bf8334Smrg	*)
605284bf8334Smrg	  # For security reasons, it is highly recommended that you always
605384bf8334Smrg	  # use absolute paths for naming shared libraries, and exclude the
605484bf8334Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
605584bf8334Smrg	  # requires that you compile everything twice, which is a pain.
605684bf8334Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
605784bf8334Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
605884bf8334Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
605984bf8334Smrg	    _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'
606084bf8334Smrg	  else
606184bf8334Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6062a73597f9Smrg	  fi
6063a73597f9Smrg	;;
606484bf8334Smrg      esac
606584bf8334Smrg      ;;
6066a73597f9Smrg
606784bf8334Smrg    sunos4*)
606884bf8334Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
606984bf8334Smrg      wlarc=
607084bf8334Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
607184bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
607284bf8334Smrg      ;;
6073a73597f9Smrg
607484bf8334Smrg    *)
607584bf8334Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
607684bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
607784bf8334Smrg	_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'
607884bf8334Smrg      else
607984bf8334Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
608084bf8334Smrg      fi
608184bf8334Smrg      ;;
608284bf8334Smrg    esac
6083a73597f9Smrg
608484bf8334Smrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
608584bf8334Smrg      runpath_var=
608684bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
608784bf8334Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
608884bf8334Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
608984bf8334Smrg    fi
609084bf8334Smrg  else
609184bf8334Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
609284bf8334Smrg    case $host_os in
609384bf8334Smrg    aix3*)
609484bf8334Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
609584bf8334Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
609684bf8334Smrg      _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'
609784bf8334Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
609884bf8334Smrg      # are no directories specified by -L.
609984bf8334Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
610084bf8334Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
610184bf8334Smrg	# Neither direct hardcoding nor static linking is supported with a
610284bf8334Smrg	# broken collect2.
610384bf8334Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
610484bf8334Smrg      fi
610584bf8334Smrg      ;;
6106a73597f9Smrg
610784bf8334Smrg    aix[[4-9]]*)
610884bf8334Smrg      if test "$host_cpu" = ia64; then
610984bf8334Smrg	# On IA64, the linker does run time linking by default, so we don't
611084bf8334Smrg	# have to do anything special.
611184bf8334Smrg	aix_use_runtimelinking=no
611284bf8334Smrg	exp_sym_flag='-Bexport'
611384bf8334Smrg	no_entry_flag=""
611484bf8334Smrg      else
611584bf8334Smrg	# If we're using GNU nm, then we don't want the "-C" option.
611684bf8334Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
611784bf8334Smrg	# Also, AIX nm treats weak defined symbols like other global
611884bf8334Smrg	# defined symbols, whereas GNU nm marks them as "W".
611984bf8334Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
612084bf8334Smrg	  _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'
612184bf8334Smrg	else
612284bf8334Smrg	  _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'
612384bf8334Smrg	fi
612484bf8334Smrg	aix_use_runtimelinking=no
612584bf8334Smrg
612684bf8334Smrg	# Test if we are trying to use run time linking or normal
612784bf8334Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
612884bf8334Smrg	# need to do runtime linking.
612984bf8334Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
613084bf8334Smrg	  for ld_flag in $LDFLAGS; do
613184bf8334Smrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
613284bf8334Smrg	    aix_use_runtimelinking=yes
613384bf8334Smrg	    break
613484bf8334Smrg	  fi
613584bf8334Smrg	  done
613684bf8334Smrg	  ;;
613784bf8334Smrg	esac
6138a73597f9Smrg
613984bf8334Smrg	exp_sym_flag='-bexport'
614084bf8334Smrg	no_entry_flag='-bnoentry'
614184bf8334Smrg      fi
6142a73597f9Smrg
614384bf8334Smrg      # When large executables or shared objects are built, AIX ld can
614484bf8334Smrg      # have problems creating the table of contents.  If linking a library
614584bf8334Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
614684bf8334Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
614784bf8334Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6148a73597f9Smrg
614984bf8334Smrg      _LT_TAGVAR(archive_cmds, $1)=''
615084bf8334Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
615184bf8334Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
615284bf8334Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
615384bf8334Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
615484bf8334Smrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6155a73597f9Smrg
615684bf8334Smrg      if test "$GCC" = yes; then
615784bf8334Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
615884bf8334Smrg	# We only want to do this on AIX 4.2 and lower, the check
615984bf8334Smrg	# below for broken collect2 doesn't work under 4.3+
616084bf8334Smrg	  collect2name=`${CC} -print-prog-name=collect2`
616184bf8334Smrg	  if test -f "$collect2name" &&
616284bf8334Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
616384bf8334Smrg	  then
616484bf8334Smrg	  # We have reworked collect2
616584bf8334Smrg	  :
616684bf8334Smrg	  else
616784bf8334Smrg	  # We have old collect2
616884bf8334Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
616984bf8334Smrg	  # It fails to find uninstalled libraries when the uninstalled
617084bf8334Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
617184bf8334Smrg	  # to unsupported forces relinking
617284bf8334Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
617384bf8334Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
617484bf8334Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
617584bf8334Smrg	  fi
617684bf8334Smrg	  ;;
617784bf8334Smrg	esac
617884bf8334Smrg	shared_flag='-shared'
617984bf8334Smrg	if test "$aix_use_runtimelinking" = yes; then
618084bf8334Smrg	  shared_flag="$shared_flag "'${wl}-G'
618184bf8334Smrg	fi
618284bf8334Smrg      else
618384bf8334Smrg	# not using gcc
618484bf8334Smrg	if test "$host_cpu" = ia64; then
618584bf8334Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
618684bf8334Smrg	# chokes on -Wl,-G. The following line is correct:
618784bf8334Smrg	  shared_flag='-G'
618884bf8334Smrg	else
618984bf8334Smrg	  if test "$aix_use_runtimelinking" = yes; then
619084bf8334Smrg	    shared_flag='${wl}-G'
619184bf8334Smrg	  else
619284bf8334Smrg	    shared_flag='${wl}-bM:SRE'
619384bf8334Smrg	  fi
619484bf8334Smrg	fi
619584bf8334Smrg      fi
6196a73597f9Smrg
619784bf8334Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
619884bf8334Smrg      # It seems that -bexpall does not export symbols beginning with
619984bf8334Smrg      # underscore (_), so it is better to generate a list of symbols to export.
620084bf8334Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
620184bf8334Smrg      if test "$aix_use_runtimelinking" = yes; then
620284bf8334Smrg	# Warning - without using the other runtime loading flags (-brtl),
620384bf8334Smrg	# -berok will link without error, but may produce a broken library.
620484bf8334Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
620584bf8334Smrg        # Determine the default libpath from the value encoded in an
620684bf8334Smrg        # empty executable.
620784bf8334Smrg        _LT_SYS_MODULE_PATH_AIX([$1])
620884bf8334Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
620984bf8334Smrg        _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"
621084bf8334Smrg      else
621184bf8334Smrg	if test "$host_cpu" = ia64; then
621284bf8334Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
621384bf8334Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
621484bf8334Smrg	  _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"
621584bf8334Smrg	else
621684bf8334Smrg	 # Determine the default libpath from the value encoded in an
621784bf8334Smrg	 # empty executable.
621884bf8334Smrg	 _LT_SYS_MODULE_PATH_AIX([$1])
621984bf8334Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
622084bf8334Smrg	  # Warning - without using the other run time loading flags,
622184bf8334Smrg	  # -berok will link without error, but may produce a broken library.
622284bf8334Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
622384bf8334Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
622484bf8334Smrg	  if test "$with_gnu_ld" = yes; then
622584bf8334Smrg	    # We only use this code for GNU lds that support --whole-archive.
622684bf8334Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
622784bf8334Smrg	  else
622884bf8334Smrg	    # Exported symbols can be pulled into shared objects from archives
622984bf8334Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
623084bf8334Smrg	  fi
623184bf8334Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
623284bf8334Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
623384bf8334Smrg	  _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'
623484bf8334Smrg	fi
623584bf8334Smrg      fi
623684bf8334Smrg      ;;
6237a73597f9Smrg
623884bf8334Smrg    amigaos*)
623984bf8334Smrg      case $host_cpu in
624084bf8334Smrg      powerpc)
624184bf8334Smrg            # see comment about AmigaOS4 .so support
624284bf8334Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
624384bf8334Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
6244a73597f9Smrg        ;;
624584bf8334Smrg      m68k)
624684bf8334Smrg            _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)'
624784bf8334Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
624884bf8334Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
6249a73597f9Smrg        ;;
625084bf8334Smrg      esac
625184bf8334Smrg      ;;
6252a73597f9Smrg
625384bf8334Smrg    bsdi[[45]]*)
625484bf8334Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
625584bf8334Smrg      ;;
6256a73597f9Smrg
625784bf8334Smrg    cygwin* | mingw* | pw32* | cegcc*)
625884bf8334Smrg      # When not using gcc, we currently assume that we are using
625984bf8334Smrg      # Microsoft Visual C++.
626084bf8334Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
626184bf8334Smrg      # no search path for DLLs.
626284bf8334Smrg      case $cc_basename in
626384bf8334Smrg      cl*)
626484bf8334Smrg	# Native MSVC
626584bf8334Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
626684bf8334Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
626784bf8334Smrg	_LT_TAGVAR(always_export_symbols, $1)=yes
626884bf8334Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
626984bf8334Smrg	# Tell ltmain to make .lib files, not .a files.
627084bf8334Smrg	libext=lib
627184bf8334Smrg	# Tell ltmain to make .dll files, not .so files.
627284bf8334Smrg	shrext_cmds=".dll"
627384bf8334Smrg	# FIXME: Setting linknames here is a bad hack.
627484bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
627584bf8334Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
627684bf8334Smrg	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
627784bf8334Smrg	  else
627884bf8334Smrg	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
627984bf8334Smrg	  fi~
628084bf8334Smrg	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
628184bf8334Smrg	  linknames='
628284bf8334Smrg	# The linker will not automatically build a static lib if we build a DLL.
628384bf8334Smrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
628484bf8334Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
628584bf8334Smrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
628684bf8334Smrg	_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'
628784bf8334Smrg	# Don't use ranlib
628884bf8334Smrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
628984bf8334Smrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
629084bf8334Smrg	  lt_tool_outputfile="@TOOL_OUTPUT@"~
629184bf8334Smrg	  case $lt_outputfile in
629284bf8334Smrg	    *.exe|*.EXE) ;;
629384bf8334Smrg	    *)
629484bf8334Smrg	      lt_outputfile="$lt_outputfile.exe"
629584bf8334Smrg	      lt_tool_outputfile="$lt_tool_outputfile.exe"
629684bf8334Smrg	      ;;
629784bf8334Smrg	  esac~
629884bf8334Smrg	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
629984bf8334Smrg	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
630084bf8334Smrg	    $RM "$lt_outputfile.manifest";
630184bf8334Smrg	  fi'
630284bf8334Smrg	;;
630384bf8334Smrg      *)
630484bf8334Smrg	# Assume MSVC wrapper
630584bf8334Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
630684bf8334Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
630784bf8334Smrg	# Tell ltmain to make .lib files, not .a files.
630884bf8334Smrg	libext=lib
630984bf8334Smrg	# Tell ltmain to make .dll files, not .so files.
631084bf8334Smrg	shrext_cmds=".dll"
631184bf8334Smrg	# FIXME: Setting linknames here is a bad hack.
631284bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
631384bf8334Smrg	# The linker will automatically build a .lib file if we build a DLL.
631484bf8334Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
631584bf8334Smrg	# FIXME: Should let the user specify the lib program.
631684bf8334Smrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
631784bf8334Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
631884bf8334Smrg	;;
631984bf8334Smrg      esac
632084bf8334Smrg      ;;
632184bf8334Smrg
632284bf8334Smrg    darwin* | rhapsody*)
632384bf8334Smrg      _LT_DARWIN_LINKER_FEATURES($1)
632484bf8334Smrg      ;;
6325a73597f9Smrg
632684bf8334Smrg    dgux*)
632784bf8334Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
632884bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
632984bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
633084bf8334Smrg      ;;
6331a73597f9Smrg
633284bf8334Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
633384bf8334Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
633484bf8334Smrg    # does not break anything, and helps significantly (at the cost of a little
633584bf8334Smrg    # extra space).
633684bf8334Smrg    freebsd2.2*)
633784bf8334Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
633884bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
633984bf8334Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
634084bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
634184bf8334Smrg      ;;
6342a73597f9Smrg
634384bf8334Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
634484bf8334Smrg    freebsd2.*)
634584bf8334Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
634684bf8334Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
634784bf8334Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
634884bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
634984bf8334Smrg      ;;
6350a73597f9Smrg
635184bf8334Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
635284bf8334Smrg    freebsd* | dragonfly*)
635384bf8334Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
635484bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
635584bf8334Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
635684bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
635784bf8334Smrg      ;;
6358a73597f9Smrg
635984bf8334Smrg    hpux9*)
636084bf8334Smrg      if test "$GCC" = yes; then
636184bf8334Smrg	_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'
636284bf8334Smrg      else
636384bf8334Smrg	_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'
636484bf8334Smrg      fi
636584bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
636684bf8334Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
636784bf8334Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6368a73597f9Smrg
636984bf8334Smrg      # hardcode_minus_L: Not really in the search PATH,
637084bf8334Smrg      # but as the default location of the library.
637184bf8334Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
637284bf8334Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
637384bf8334Smrg      ;;
6374a73597f9Smrg
637584bf8334Smrg    hpux10*)
637684bf8334Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
637784bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
637884bf8334Smrg      else
637984bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
638084bf8334Smrg      fi
638184bf8334Smrg      if test "$with_gnu_ld" = no; then
638284bf8334Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
638384bf8334Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
638484bf8334Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
638584bf8334Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
638684bf8334Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
638784bf8334Smrg	# hardcode_minus_L: Not really in the search PATH,
638884bf8334Smrg	# but as the default location of the library.
638984bf8334Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
639084bf8334Smrg      fi
639184bf8334Smrg      ;;
6392a73597f9Smrg
639384bf8334Smrg    hpux11*)
639484bf8334Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
639584bf8334Smrg	case $host_cpu in
639684bf8334Smrg	hppa*64*)
639784bf8334Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
639884bf8334Smrg	  ;;
639984bf8334Smrg	ia64*)
640084bf8334Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6401a73597f9Smrg	  ;;
6402a73597f9Smrg	*)
640384bf8334Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6404a73597f9Smrg	  ;;
640584bf8334Smrg	esac
640684bf8334Smrg      else
640784bf8334Smrg	case $host_cpu in
640884bf8334Smrg	hppa*64*)
640984bf8334Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
641084bf8334Smrg	  ;;
641184bf8334Smrg	ia64*)
641284bf8334Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
641384bf8334Smrg	  ;;
641484bf8334Smrg	*)
641584bf8334Smrg	m4_if($1, [], [
641684bf8334Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
641784bf8334Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
641884bf8334Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
641984bf8334Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
642084bf8334Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
642184bf8334Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
642284bf8334Smrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
642384bf8334Smrg	  ;;
642484bf8334Smrg	esac
642584bf8334Smrg      fi
642684bf8334Smrg      if test "$with_gnu_ld" = no; then
642784bf8334Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
642884bf8334Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
6429a73597f9Smrg
643084bf8334Smrg	case $host_cpu in
643184bf8334Smrg	hppa*64*|ia64*)
643284bf8334Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
643384bf8334Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
643484bf8334Smrg	  ;;
643584bf8334Smrg	*)
643684bf8334Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
643784bf8334Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
643884bf8334Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6439a73597f9Smrg
644084bf8334Smrg	  # hardcode_minus_L: Not really in the search PATH,
644184bf8334Smrg	  # but as the default location of the library.
644284bf8334Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
644384bf8334Smrg	  ;;
6444b73be646Smrg	esac
644584bf8334Smrg      fi
6446a73597f9Smrg      ;;
6447a73597f9Smrg
644884bf8334Smrg    irix5* | irix6* | nonstopux*)
644984bf8334Smrg      if test "$GCC" = yes; then
645084bf8334Smrg	_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'
645184bf8334Smrg	# Try to use the -exported_symbol ld option, if it does not
645284bf8334Smrg	# work, assume that -exports_file does not work either and
645384bf8334Smrg	# implicitly export all symbols.
645484bf8334Smrg	# This should be the same for all languages, so no per-tag cache variable.
645584bf8334Smrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
645684bf8334Smrg	  [lt_cv_irix_exported_symbol],
645784bf8334Smrg	  [save_LDFLAGS="$LDFLAGS"
645884bf8334Smrg	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
645984bf8334Smrg	   AC_LINK_IFELSE(
646084bf8334Smrg	     [AC_LANG_SOURCE(
646184bf8334Smrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
646284bf8334Smrg			      [C++], [[int foo (void) { return 0; }]],
646384bf8334Smrg			      [Fortran 77], [[
646484bf8334Smrg      subroutine foo
646584bf8334Smrg      end]],
646684bf8334Smrg			      [Fortran], [[
646784bf8334Smrg      subroutine foo
646884bf8334Smrg      end]])])],
646984bf8334Smrg	      [lt_cv_irix_exported_symbol=yes],
647084bf8334Smrg	      [lt_cv_irix_exported_symbol=no])
647184bf8334Smrg           LDFLAGS="$save_LDFLAGS"])
647284bf8334Smrg	if test "$lt_cv_irix_exported_symbol" = yes; then
647384bf8334Smrg          _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'
647484bf8334Smrg	fi
647584bf8334Smrg      else
647684bf8334Smrg	_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'
647784bf8334Smrg	_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'
647884bf8334Smrg      fi
647984bf8334Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
648084bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
648184bf8334Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
648284bf8334Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
648384bf8334Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
648484bf8334Smrg      ;;
6485659607e0Smrg
648684bf8334Smrg    netbsd*)
648784bf8334Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
648884bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
648984bf8334Smrg      else
649084bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
649184bf8334Smrg      fi
649284bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
649384bf8334Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
649484bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
649584bf8334Smrg      ;;
6496659607e0Smrg
649784bf8334Smrg    newsos6)
649884bf8334Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
649984bf8334Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
650084bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
650184bf8334Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
650284bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
650384bf8334Smrg      ;;
6504659607e0Smrg
650584bf8334Smrg    *nto* | *qnx*)
650684bf8334Smrg      ;;
6507bd3a1963Smrg
650884bf8334Smrg    openbsd*)
650984bf8334Smrg      if test -f /usr/libexec/ld.so; then
651084bf8334Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
651184bf8334Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
651284bf8334Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
651384bf8334Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
651484bf8334Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
651584bf8334Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
651684bf8334Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
651784bf8334Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
651884bf8334Smrg	else
651984bf8334Smrg	  case $host_os in
652084bf8334Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
652184bf8334Smrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
652284bf8334Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
652384bf8334Smrg	     ;;
652484bf8334Smrg	   *)
652584bf8334Smrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
652684bf8334Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
652784bf8334Smrg	     ;;
652884bf8334Smrg	  esac
652984bf8334Smrg	fi
653084bf8334Smrg      else
653184bf8334Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
653284bf8334Smrg      fi
653384bf8334Smrg      ;;
6534659607e0Smrg
653584bf8334Smrg    os2*)
653684bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
653784bf8334Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
653884bf8334Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
653984bf8334Smrg      _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'
654084bf8334Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
654184bf8334Smrg      ;;
6542659607e0Smrg
654384bf8334Smrg    osf3*)
654484bf8334Smrg      if test "$GCC" = yes; then
654584bf8334Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
654684bf8334Smrg	_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'
654784bf8334Smrg      else
654884bf8334Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
654984bf8334Smrg	_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'
655084bf8334Smrg      fi
655184bf8334Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
655284bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
655384bf8334Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
655484bf8334Smrg      ;;
6555659607e0Smrg
655684bf8334Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
655784bf8334Smrg      if test "$GCC" = yes; then
655884bf8334Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
655984bf8334Smrg	_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'
656084bf8334Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
656184bf8334Smrg      else
656284bf8334Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
656384bf8334Smrg	_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'
656484bf8334Smrg	_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~
656584bf8334Smrg	$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'
6566659607e0Smrg
656784bf8334Smrg	# Both c and cxx compiler support -rpath directly
656884bf8334Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
656984bf8334Smrg      fi
657084bf8334Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
657184bf8334Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
657284bf8334Smrg      ;;
6573659607e0Smrg
657484bf8334Smrg    solaris*)
657584bf8334Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
657684bf8334Smrg      if test "$GCC" = yes; then
657784bf8334Smrg	wlarc='${wl}'
657884bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
657984bf8334Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
658084bf8334Smrg	  $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'
658184bf8334Smrg      else
658284bf8334Smrg	case `$CC -V 2>&1` in
658384bf8334Smrg	*"Compilers 5.0"*)
658484bf8334Smrg	  wlarc=''
658584bf8334Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
658684bf8334Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
658784bf8334Smrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
658884bf8334Smrg	  ;;
658984bf8334Smrg	*)
659084bf8334Smrg	  wlarc='${wl}'
659184bf8334Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
659284bf8334Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
659384bf8334Smrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
659484bf8334Smrg	  ;;
659584bf8334Smrg	esac
659684bf8334Smrg      fi
659784bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
659884bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
659984bf8334Smrg      case $host_os in
660084bf8334Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
660184bf8334Smrg      *)
660284bf8334Smrg	# The compiler driver will combine and reorder linker options,
660384bf8334Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
660484bf8334Smrg	# but is careful enough not to reorder.
660584bf8334Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
660684bf8334Smrg	if test "$GCC" = yes; then
660784bf8334Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
660884bf8334Smrg	else
660984bf8334Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
661084bf8334Smrg	fi
661184bf8334Smrg	;;
661284bf8334Smrg      esac
661384bf8334Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
661484bf8334Smrg      ;;
6615bd3a1963Smrg
661684bf8334Smrg    sunos4*)
661784bf8334Smrg      if test "x$host_vendor" = xsequent; then
661884bf8334Smrg	# Use $CC to link under sequent, because it throws in some extra .o
661984bf8334Smrg	# files that make .init and .fini sections work.
662084bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
662184bf8334Smrg      else
662284bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
662384bf8334Smrg      fi
662484bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
662584bf8334Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
662684bf8334Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
662784bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
662884bf8334Smrg      ;;
6629659607e0Smrg
663084bf8334Smrg    sysv4)
663184bf8334Smrg      case $host_vendor in
663284bf8334Smrg	sni)
663384bf8334Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
663484bf8334Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
663584bf8334Smrg	;;
663684bf8334Smrg	siemens)
663784bf8334Smrg	  ## LD is ld it makes a PLAMLIB
663884bf8334Smrg	  ## CC just makes a GrossModule.
663984bf8334Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
664084bf8334Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
664184bf8334Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
664284bf8334Smrg        ;;
664384bf8334Smrg	motorola)
664484bf8334Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
664584bf8334Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
664684bf8334Smrg	;;
664784bf8334Smrg      esac
664884bf8334Smrg      runpath_var='LD_RUN_PATH'
664984bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
665084bf8334Smrg      ;;
6651659607e0Smrg
665284bf8334Smrg    sysv4.3*)
665384bf8334Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
665484bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
665584bf8334Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
665684bf8334Smrg      ;;
66576aab59a7Smrg
665884bf8334Smrg    sysv4*MP*)
665984bf8334Smrg      if test -d /usr/nec; then
666084bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
666184bf8334Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
666284bf8334Smrg	runpath_var=LD_RUN_PATH
666384bf8334Smrg	hardcode_runpath_var=yes
666484bf8334Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
666584bf8334Smrg      fi
666684bf8334Smrg      ;;
66676aab59a7Smrg
666884bf8334Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
666984bf8334Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
667084bf8334Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
667184bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
667284bf8334Smrg      runpath_var='LD_RUN_PATH'
66736aab59a7Smrg
667484bf8334Smrg      if test "$GCC" = yes; then
667584bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
667684bf8334Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
667784bf8334Smrg      else
667884bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
667984bf8334Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
668084bf8334Smrg      fi
668184bf8334Smrg      ;;
66826aab59a7Smrg
668384bf8334Smrg    sysv5* | sco3.2v5* | sco5v6*)
668484bf8334Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
668584bf8334Smrg      # link with -lc, and that would cause any symbols used from libc to
668684bf8334Smrg      # always be unresolved, which means just about no library would
668784bf8334Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
668884bf8334Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
668984bf8334Smrg      # as -z defs.
669084bf8334Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
669184bf8334Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
669284bf8334Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
669384bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
669484bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
669584bf8334Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
669684bf8334Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
669784bf8334Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
669884bf8334Smrg      runpath_var='LD_RUN_PATH'
66996aab59a7Smrg
670084bf8334Smrg      if test "$GCC" = yes; then
670184bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
670284bf8334Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
670384bf8334Smrg      else
670484bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
670584bf8334Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
670684bf8334Smrg      fi
670784bf8334Smrg      ;;
6708b73be646Smrg
670984bf8334Smrg    uts4*)
671084bf8334Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
671184bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
671284bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
671384bf8334Smrg      ;;
6714b73be646Smrg
671584bf8334Smrg    *)
671684bf8334Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
671784bf8334Smrg      ;;
6718a73597f9Smrg    esac
6719b73be646Smrg
672084bf8334Smrg    if test x$host_vendor = xsni; then
672184bf8334Smrg      case $host in
672284bf8334Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
672384bf8334Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
672484bf8334Smrg	;;
672584bf8334Smrg      esac
672684bf8334Smrg    fi
672784bf8334Smrg  fi
672884bf8334Smrg])
672984bf8334SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
673084bf8334Smrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6731b73be646Smrg
673284bf8334Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
6733b73be646Smrg
673484bf8334Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
673584bf8334Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
673684bf8334Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
673784bf8334Smrg    [The commands to extract the exported symbol list from a shared archive])
6738fc27e79cSmrg
673984bf8334Smrg#
674084bf8334Smrg# Do we need to explicitly link libc?
674184bf8334Smrg#
674284bf8334Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
674384bf8334Smrgx|xyes)
674484bf8334Smrg  # Assume -lc should be added
674584bf8334Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
67466aab59a7Smrg
674784bf8334Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
674884bf8334Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
674984bf8334Smrg    *'~'*)
675084bf8334Smrg      # FIXME: we may have to deal with multi-command sequences.
6751b73be646Smrg      ;;
675284bf8334Smrg    '$CC '*)
675384bf8334Smrg      # Test whether the compiler implicitly links with -lc since on some
675484bf8334Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
675584bf8334Smrg      # to ld, don't add -lc before -lgcc.
675684bf8334Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
675784bf8334Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
675884bf8334Smrg	[$RM conftest*
675984bf8334Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
67606aab59a7Smrg
676184bf8334Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
676284bf8334Smrg	  soname=conftest
676384bf8334Smrg	  lib=conftest
676484bf8334Smrg	  libobjs=conftest.$ac_objext
676584bf8334Smrg	  deplibs=
676684bf8334Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
676784bf8334Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
676884bf8334Smrg	  compiler_flags=-v
676984bf8334Smrg	  linker_flags=-v
677084bf8334Smrg	  verstring=
677184bf8334Smrg	  output_objdir=.
677284bf8334Smrg	  libname=conftest
677384bf8334Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
677484bf8334Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
677584bf8334Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
677684bf8334Smrg	  then
677784bf8334Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
677884bf8334Smrg	  else
677984bf8334Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
678084bf8334Smrg	  fi
678184bf8334Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
678284bf8334Smrg	else
678384bf8334Smrg	  cat conftest.err 1>&5
678484bf8334Smrg	fi
678584bf8334Smrg	$RM conftest*
678684bf8334Smrg	])
678784bf8334Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
6788b73be646Smrg      ;;
6789b73be646Smrg    esac
679084bf8334Smrg  fi
6791a73597f9Smrg  ;;
6792fc27e79cSmrgesac
6793fc27e79cSmrg
679484bf8334Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
679584bf8334Smrg    [Whether or not to add -lc for building shared libraries])
679684bf8334Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
679784bf8334Smrg    [enable_shared_with_static_runtimes], [0],
679884bf8334Smrg    [Whether or not to disallow shared libs when runtime libs are static])
679984bf8334Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
680084bf8334Smrg    [Compiler flag to allow reflexive dlopens])
680184bf8334Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
680284bf8334Smrg    [Compiler flag to generate shared objects directly from archives])
680384bf8334Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
680484bf8334Smrg    [Whether the compiler copes with passing no objects directly])
680584bf8334Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
680684bf8334Smrg    [Create an old-style archive from a shared archive])
680784bf8334Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
680884bf8334Smrg    [Create a temporary old-style archive to link instead of a shared archive])
680984bf8334Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
681084bf8334Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
681184bf8334Smrg_LT_TAGDECL([], [module_cmds], [2],
681284bf8334Smrg    [Commands used to build a loadable module if different from building
681384bf8334Smrg    a shared archive.])
681484bf8334Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
681584bf8334Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
681684bf8334Smrg    [Whether we are building with GNU ld or not])
681784bf8334Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
681884bf8334Smrg    [Flag that allows shared libraries with undefined symbols to be built])
681984bf8334Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
682084bf8334Smrg    [Flag that enforces no undefined symbols])
682184bf8334Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
682284bf8334Smrg    [Flag to hardcode $libdir into a binary during linking.
682384bf8334Smrg    This must work even if $libdir does not exist])
682484bf8334Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
682584bf8334Smrg    [Whether we need a single "-rpath" flag with a separated argument])
682684bf8334Smrg_LT_TAGDECL([], [hardcode_direct], [0],
682784bf8334Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
682884bf8334Smrg    DIR into the resulting binary])
682984bf8334Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
683084bf8334Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
683184bf8334Smrg    DIR into the resulting binary and the resulting library dependency is
683284bf8334Smrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
683384bf8334Smrg    library is relocated])
683484bf8334Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
683584bf8334Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
683684bf8334Smrg    into the resulting binary])
683784bf8334Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
683884bf8334Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
683984bf8334Smrg    into the resulting binary])
684084bf8334Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
684184bf8334Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
684284bf8334Smrg    into the library and all subsequent libraries and executables linked
684384bf8334Smrg    against it])
684484bf8334Smrg_LT_TAGDECL([], [inherit_rpath], [0],
684584bf8334Smrg    [Set to yes if linker adds runtime paths of dependent libraries
684684bf8334Smrg    to runtime path list])
684784bf8334Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
684884bf8334Smrg    [Whether libtool must link a program against all its dependency libraries])
684984bf8334Smrg_LT_TAGDECL([], [always_export_symbols], [0],
685084bf8334Smrg    [Set to "yes" if exported symbols are required])
685184bf8334Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
685284bf8334Smrg    [The commands to list exported symbols])
685384bf8334Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
685484bf8334Smrg    [Symbols that should not be listed in the preloaded symbols])
685584bf8334Smrg_LT_TAGDECL([], [include_expsyms], [1],
685684bf8334Smrg    [Symbols that must always be exported])
685784bf8334Smrg_LT_TAGDECL([], [prelink_cmds], [2],
685884bf8334Smrg    [Commands necessary for linking programs (against libraries) with templates])
685984bf8334Smrg_LT_TAGDECL([], [postlink_cmds], [2],
686084bf8334Smrg    [Commands necessary for finishing linking programs])
686184bf8334Smrg_LT_TAGDECL([], [file_list_spec], [1],
686284bf8334Smrg    [Specify filename containing input files])
686384bf8334Smrgdnl FIXME: Not yet implemented
686484bf8334Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
686584bf8334Smrgdnl    [Compiler flag to generate thread safe objects])
686684bf8334Smrg])# _LT_LINKER_SHLIBS
6867a73597f9Smrg
68686aab59a7Smrg
686984bf8334Smrg# _LT_LANG_C_CONFIG([TAG])
687084bf8334Smrg# ------------------------
687184bf8334Smrg# Ensure that the configuration variables for a C compiler are suitably
687284bf8334Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
687384bf8334Smrg# the compiler configuration to `libtool'.
687484bf8334Smrgm4_defun([_LT_LANG_C_CONFIG],
687584bf8334Smrg[m4_require([_LT_DECL_EGREP])dnl
687684bf8334Smrglt_save_CC="$CC"
687784bf8334SmrgAC_LANG_PUSH(C)
68786aab59a7Smrg
687984bf8334Smrg# Source file extension for C test sources.
688084bf8334Smrgac_ext=c
68816aab59a7Smrg
688284bf8334Smrg# Object file extension for compiled C test sources.
6883a73597f9Smrgobjext=o
6884a73597f9Smrg_LT_TAGVAR(objext, $1)=$objext
6885fc27e79cSmrg
688684bf8334Smrg# Code to be used in simple compile tests
688784bf8334Smrglt_simple_compile_test_code="int some_variable = 0;"
6888a73597f9Smrg
688984bf8334Smrg# Code to be used in simple link tests
689084bf8334Smrglt_simple_link_test_code='int main(){return(0);}'
6891a73597f9Smrg
689284bf8334Smrg_LT_TAG_COMPILER
689384bf8334Smrg# Save the default compiler, since it gets overwritten when the other
689484bf8334Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
689584bf8334Smrgcompiler_DEFAULT=$CC
6896bd3a1963Smrg
689784bf8334Smrg# save warnings/boilerplate of simple test code
689884bf8334Smrg_LT_COMPILER_BOILERPLATE
689984bf8334Smrg_LT_LINKER_BOILERPLATE
69006aab59a7Smrg
690184bf8334Smrgif test -n "$compiler"; then
690284bf8334Smrg  _LT_COMPILER_NO_RTTI($1)
690384bf8334Smrg  _LT_COMPILER_PIC($1)
690484bf8334Smrg  _LT_COMPILER_C_O($1)
690584bf8334Smrg  _LT_COMPILER_FILE_LOCKS($1)
690684bf8334Smrg  _LT_LINKER_SHLIBS($1)
690784bf8334Smrg  _LT_SYS_DYNAMIC_LINKER($1)
690884bf8334Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
690984bf8334Smrg  LT_SYS_DLOPEN_SELF
691084bf8334Smrg  _LT_CMD_STRIPLIB
69116aab59a7Smrg
691284bf8334Smrg  # Report which library types will actually be built
691384bf8334Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
691484bf8334Smrg  AC_MSG_RESULT([$can_build_shared])
69156aab59a7Smrg
691684bf8334Smrg  AC_MSG_CHECKING([whether to build shared libraries])
691784bf8334Smrg  test "$can_build_shared" = "no" && enable_shared=no
69186aab59a7Smrg
691984bf8334Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
692084bf8334Smrg  # are all built from PIC.
692184bf8334Smrg  case $host_os in
692284bf8334Smrg  aix3*)
692384bf8334Smrg    test "$enable_shared" = yes && enable_static=no
692484bf8334Smrg    if test -n "$RANLIB"; then
692584bf8334Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
692684bf8334Smrg      postinstall_cmds='$RANLIB $lib'
692784bf8334Smrg    fi
692884bf8334Smrg    ;;
69296aab59a7Smrg
693084bf8334Smrg  aix[[4-9]]*)
693184bf8334Smrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
693284bf8334Smrg      test "$enable_shared" = yes && enable_static=no
693384bf8334Smrg    fi
693484bf8334Smrg    ;;
693584bf8334Smrg  esac
693684bf8334Smrg  AC_MSG_RESULT([$enable_shared])
693784bf8334Smrg
693884bf8334Smrg  AC_MSG_CHECKING([whether to build static libraries])
693984bf8334Smrg  # Make sure either enable_shared or enable_static is yes.
694084bf8334Smrg  test "$enable_shared" = yes || enable_static=yes
694184bf8334Smrg  AC_MSG_RESULT([$enable_static])
6942fc27e79cSmrg
694384bf8334Smrg  _LT_CONFIG($1)
694484bf8334Smrgfi
694584bf8334SmrgAC_LANG_POP
694684bf8334SmrgCC="$lt_save_CC"
694784bf8334Smrg])# _LT_LANG_C_CONFIG
6948fc27e79cSmrg
6949fc27e79cSmrg
695084bf8334Smrg# _LT_LANG_CXX_CONFIG([TAG])
695184bf8334Smrg# --------------------------
695284bf8334Smrg# Ensure that the configuration variables for a C++ compiler are suitably
695384bf8334Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
695484bf8334Smrg# the compiler configuration to `libtool'.
695584bf8334Smrgm4_defun([_LT_LANG_CXX_CONFIG],
695684bf8334Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
695784bf8334Smrgm4_require([_LT_DECL_EGREP])dnl
695884bf8334Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
695984bf8334Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
696084bf8334Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
696184bf8334Smrg    (test "X$CXX" != "Xg++"))) ; then
696284bf8334Smrg  AC_PROG_CXXCPP
696384bf8334Smrgelse
696484bf8334Smrg  _lt_caught_CXX_error=yes
6965a73597f9Smrgfi
6966a73597f9Smrg
696784bf8334SmrgAC_LANG_PUSH(C++)
6968a73597f9Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6969a73597f9Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
6970a73597f9Smrg_LT_TAGVAR(always_export_symbols, $1)=no
6971a73597f9Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
697284bf8334Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
6973a73597f9Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6974a73597f9Smrg_LT_TAGVAR(hardcode_direct, $1)=no
6975a73597f9Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6976a73597f9Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6977a73597f9Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
6978a73597f9Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
697984bf8334Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6980a73597f9Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
6981a73597f9Smrg_LT_TAGVAR(inherit_rpath, $1)=no
6982a73597f9Smrg_LT_TAGVAR(module_cmds, $1)=
6983a73597f9Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
6984a73597f9Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
6985a73597f9Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6986a73597f9Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
6987a73597f9Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6988a73597f9Smrg_LT_TAGVAR(no_undefined_flag, $1)=
6989a73597f9Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
6990a73597f9Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6991a73597f9Smrg
699284bf8334Smrg# Source file extension for C++ test sources.
699384bf8334Smrgac_ext=cpp
6994a73597f9Smrg
699584bf8334Smrg# Object file extension for compiled C++ test sources.
6996a73597f9Smrgobjext=o
6997a73597f9Smrg_LT_TAGVAR(objext, $1)=$objext
6998a73597f9Smrg
6999a73597f9Smrg# No sense in running all these tests if we already determined that
700084bf8334Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
7001a73597f9Smrg# are currently assumed to apply to all compilers on this platform,
7002a73597f9Smrg# and will be corrupted by setting them based on a non-working compiler.
700384bf8334Smrgif test "$_lt_caught_CXX_error" != yes; then
7004a73597f9Smrg  # Code to be used in simple compile tests
700584bf8334Smrg  lt_simple_compile_test_code="int some_variable = 0;"
7006fc27e79cSmrg
7007a73597f9Smrg  # Code to be used in simple link tests
700884bf8334Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
7009bd3a1963Smrg
7010a73597f9Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7011a73597f9Smrg  _LT_TAG_COMPILER
7012fc27e79cSmrg
7013a73597f9Smrg  # save warnings/boilerplate of simple test code
7014a73597f9Smrg  _LT_COMPILER_BOILERPLATE
7015a73597f9Smrg  _LT_LINKER_BOILERPLATE
70166aab59a7Smrg
7017a73597f9Smrg  # Allow CC to be a program name with arguments.
701884bf8334Smrg  lt_save_CC=$CC
7019a73597f9Smrg  lt_save_CFLAGS=$CFLAGS
702084bf8334Smrg  lt_save_LD=$LD
702184bf8334Smrg  lt_save_GCC=$GCC
702284bf8334Smrg  GCC=$GXX
702384bf8334Smrg  lt_save_with_gnu_ld=$with_gnu_ld
702484bf8334Smrg  lt_save_path_LD=$lt_cv_path_LD
702584bf8334Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
702684bf8334Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
702784bf8334Smrg  else
702884bf8334Smrg    $as_unset lt_cv_prog_gnu_ld
702984bf8334Smrg  fi
703084bf8334Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
703184bf8334Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
703284bf8334Smrg  else
703384bf8334Smrg    $as_unset lt_cv_path_LD
703484bf8334Smrg  fi
703584bf8334Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
703684bf8334Smrg  CC=${CXX-"c++"}
703784bf8334Smrg  CFLAGS=$CXXFLAGS
7038a73597f9Smrg  compiler=$CC
7039a73597f9Smrg  _LT_TAGVAR(compiler, $1)=$CC
7040a73597f9Smrg  _LT_CC_BASENAME([$compiler])
70416aab59a7Smrg
7042a73597f9Smrg  if test -n "$compiler"; then
704384bf8334Smrg    # We don't want -fno-exception when compiling C++ code, so set the
704484bf8334Smrg    # no_builtin_flag separately
704584bf8334Smrg    if test "$GXX" = yes; then
704684bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
704784bf8334Smrg    else
704884bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
704984bf8334Smrg    fi
70506aab59a7Smrg
705184bf8334Smrg    if test "$GXX" = yes; then
705284bf8334Smrg      # Set up default GNU C++ configuration
70536aab59a7Smrg
705484bf8334Smrg      LT_PATH_LD
7055659607e0Smrg
705684bf8334Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
705784bf8334Smrg      # archiving commands below assume that GNU ld is being used.
705884bf8334Smrg      if test "$with_gnu_ld" = yes; then
705984bf8334Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
706084bf8334Smrg        _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'
7061fc27e79cSmrg
706284bf8334Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
706384bf8334Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
7064fc27e79cSmrg
706584bf8334Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
706684bf8334Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
706784bf8334Smrg        #     investigate it a little bit more. (MM)
706884bf8334Smrg        wlarc='${wl}'
7069fc27e79cSmrg
707084bf8334Smrg        # ancient GNU ld didn't support --whole-archive et. al.
707184bf8334Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
707284bf8334Smrg	  $GREP 'no-whole-archive' > /dev/null; then
707384bf8334Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
707484bf8334Smrg        else
707584bf8334Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
707684bf8334Smrg        fi
707784bf8334Smrg      else
707884bf8334Smrg        with_gnu_ld=no
707984bf8334Smrg        wlarc=
7080fc27e79cSmrg
708184bf8334Smrg        # A generic and very simple default shared library creation
708284bf8334Smrg        # command for GNU C++ for the case where it uses the native
708384bf8334Smrg        # linker, instead of GNU ld.  If possible, this setting should
708484bf8334Smrg        # overridden to take advantage of the native linker features on
708584bf8334Smrg        # the platform it is being used on.
708684bf8334Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
708784bf8334Smrg      fi
7088659607e0Smrg
708984bf8334Smrg      # Commands to make compiler produce verbose output that lists
709084bf8334Smrg      # what "hidden" libraries, object files and flags are used when
709184bf8334Smrg      # linking a shared library.
709284bf8334Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7093659607e0Smrg
709484bf8334Smrg    else
709584bf8334Smrg      GXX=no
709684bf8334Smrg      with_gnu_ld=no
709784bf8334Smrg      wlarc=
709884bf8334Smrg    fi
7099659607e0Smrg
710084bf8334Smrg    # PORTME: fill in a description of your system's C++ link characteristics
710184bf8334Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
710284bf8334Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
710384bf8334Smrg    case $host_os in
710484bf8334Smrg      aix3*)
710584bf8334Smrg        # FIXME: insert proper C++ library support
710684bf8334Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
710784bf8334Smrg        ;;
710884bf8334Smrg      aix[[4-9]]*)
710984bf8334Smrg        if test "$host_cpu" = ia64; then
711084bf8334Smrg          # On IA64, the linker does run time linking by default, so we don't
711184bf8334Smrg          # have to do anything special.
711284bf8334Smrg          aix_use_runtimelinking=no
711384bf8334Smrg          exp_sym_flag='-Bexport'
711484bf8334Smrg          no_entry_flag=""
711584bf8334Smrg        else
711684bf8334Smrg          aix_use_runtimelinking=no
7117a73597f9Smrg
711884bf8334Smrg          # Test if we are trying to use run time linking or normal
711984bf8334Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
712084bf8334Smrg          # need to do runtime linking.
712184bf8334Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
712284bf8334Smrg	    for ld_flag in $LDFLAGS; do
712384bf8334Smrg	      case $ld_flag in
712484bf8334Smrg	      *-brtl*)
712584bf8334Smrg	        aix_use_runtimelinking=yes
712684bf8334Smrg	        break
712784bf8334Smrg	        ;;
712884bf8334Smrg	      esac
712984bf8334Smrg	    done
713084bf8334Smrg	    ;;
713184bf8334Smrg          esac
71326aab59a7Smrg
713384bf8334Smrg          exp_sym_flag='-bexport'
713484bf8334Smrg          no_entry_flag='-bnoentry'
713584bf8334Smrg        fi
7136659607e0Smrg
713784bf8334Smrg        # When large executables or shared objects are built, AIX ld can
713884bf8334Smrg        # have problems creating the table of contents.  If linking a library
713984bf8334Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
714084bf8334Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
714184bf8334Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
7142659607e0Smrg
714384bf8334Smrg        _LT_TAGVAR(archive_cmds, $1)=''
714484bf8334Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
714584bf8334Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
714684bf8334Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
714784bf8334Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
714884bf8334Smrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
7149659607e0Smrg
715084bf8334Smrg        if test "$GXX" = yes; then
715184bf8334Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
715284bf8334Smrg          # We only want to do this on AIX 4.2 and lower, the check
715384bf8334Smrg          # below for broken collect2 doesn't work under 4.3+
715484bf8334Smrg	  collect2name=`${CC} -print-prog-name=collect2`
715584bf8334Smrg	  if test -f "$collect2name" &&
715684bf8334Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
715784bf8334Smrg	  then
715884bf8334Smrg	    # We have reworked collect2
715984bf8334Smrg	    :
716084bf8334Smrg	  else
716184bf8334Smrg	    # We have old collect2
716284bf8334Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
716384bf8334Smrg	    # It fails to find uninstalled libraries when the uninstalled
716484bf8334Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
716584bf8334Smrg	    # to unsupported forces relinking
716684bf8334Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
716784bf8334Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
716884bf8334Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
716984bf8334Smrg	  fi
717084bf8334Smrg          esac
717184bf8334Smrg          shared_flag='-shared'
717284bf8334Smrg	  if test "$aix_use_runtimelinking" = yes; then
717384bf8334Smrg	    shared_flag="$shared_flag "'${wl}-G'
717484bf8334Smrg	  fi
717584bf8334Smrg        else
717684bf8334Smrg          # not using gcc
717784bf8334Smrg          if test "$host_cpu" = ia64; then
717884bf8334Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
717984bf8334Smrg	  # chokes on -Wl,-G. The following line is correct:
718084bf8334Smrg	  shared_flag='-G'
718184bf8334Smrg          else
718284bf8334Smrg	    if test "$aix_use_runtimelinking" = yes; then
718384bf8334Smrg	      shared_flag='${wl}-G'
718484bf8334Smrg	    else
718584bf8334Smrg	      shared_flag='${wl}-bM:SRE'
718684bf8334Smrg	    fi
718784bf8334Smrg          fi
718884bf8334Smrg        fi
7189b73be646Smrg
719084bf8334Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
719184bf8334Smrg        # It seems that -bexpall does not export symbols beginning with
719284bf8334Smrg        # underscore (_), so it is better to generate a list of symbols to
719384bf8334Smrg	# export.
719484bf8334Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
719584bf8334Smrg        if test "$aix_use_runtimelinking" = yes; then
719684bf8334Smrg          # Warning - without using the other runtime loading flags (-brtl),
719784bf8334Smrg          # -berok will link without error, but may produce a broken library.
719884bf8334Smrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
719984bf8334Smrg          # Determine the default libpath from the value encoded in an empty
720084bf8334Smrg          # executable.
720184bf8334Smrg          _LT_SYS_MODULE_PATH_AIX([$1])
720284bf8334Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
7203b73be646Smrg
720484bf8334Smrg          _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"
720584bf8334Smrg        else
720684bf8334Smrg          if test "$host_cpu" = ia64; then
720784bf8334Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
720884bf8334Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
720984bf8334Smrg	    _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"
721084bf8334Smrg          else
721184bf8334Smrg	    # Determine the default libpath from the value encoded in an
721284bf8334Smrg	    # empty executable.
721384bf8334Smrg	    _LT_SYS_MODULE_PATH_AIX([$1])
721484bf8334Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
721584bf8334Smrg	    # Warning - without using the other run time loading flags,
721684bf8334Smrg	    # -berok will link without error, but may produce a broken library.
721784bf8334Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
721884bf8334Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
721984bf8334Smrg	    if test "$with_gnu_ld" = yes; then
722084bf8334Smrg	      # We only use this code for GNU lds that support --whole-archive.
722184bf8334Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
722284bf8334Smrg	    else
722384bf8334Smrg	      # Exported symbols can be pulled into shared objects from archives
722484bf8334Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
722584bf8334Smrg	    fi
722684bf8334Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
722784bf8334Smrg	    # This is similar to how AIX traditionally builds its shared
722884bf8334Smrg	    # libraries.
722984bf8334Smrg	    _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'
723084bf8334Smrg          fi
723184bf8334Smrg        fi
723284bf8334Smrg        ;;
7233659607e0Smrg
723484bf8334Smrg      beos*)
723584bf8334Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
723684bf8334Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
723784bf8334Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
723884bf8334Smrg	  # support --undefined.  This deserves some investigation.  FIXME
723984bf8334Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
724084bf8334Smrg	else
724184bf8334Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
724284bf8334Smrg	fi
724384bf8334Smrg	;;
72446aab59a7Smrg
724584bf8334Smrg      chorus*)
724684bf8334Smrg        case $cc_basename in
724784bf8334Smrg          *)
724884bf8334Smrg	  # FIXME: insert proper C++ library support
724984bf8334Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
725084bf8334Smrg	  ;;
725184bf8334Smrg        esac
725284bf8334Smrg        ;;
72536aab59a7Smrg
725484bf8334Smrg      cygwin* | mingw* | pw32* | cegcc*)
725584bf8334Smrg	case $GXX,$cc_basename in
725684bf8334Smrg	,cl* | no,cl*)
725784bf8334Smrg	  # Native MSVC
725884bf8334Smrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
725984bf8334Smrg	  # no search path for DLLs.
726084bf8334Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
726184bf8334Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
726284bf8334Smrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
726384bf8334Smrg	  _LT_TAGVAR(file_list_spec, $1)='@'
726484bf8334Smrg	  # Tell ltmain to make .lib files, not .a files.
726584bf8334Smrg	  libext=lib
726684bf8334Smrg	  # Tell ltmain to make .dll files, not .so files.
726784bf8334Smrg	  shrext_cmds=".dll"
726884bf8334Smrg	  # FIXME: Setting linknames here is a bad hack.
726984bf8334Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
727084bf8334Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
727184bf8334Smrg	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
727284bf8334Smrg	    else
727384bf8334Smrg	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
727484bf8334Smrg	    fi~
727584bf8334Smrg	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
727684bf8334Smrg	    linknames='
727784bf8334Smrg	  # The linker will not automatically build a static lib if we build a DLL.
727884bf8334Smrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
727984bf8334Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
728084bf8334Smrg	  # Don't use ranlib
728184bf8334Smrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
728284bf8334Smrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
728384bf8334Smrg	    lt_tool_outputfile="@TOOL_OUTPUT@"~
728484bf8334Smrg	    case $lt_outputfile in
728584bf8334Smrg	      *.exe|*.EXE) ;;
728684bf8334Smrg	      *)
728784bf8334Smrg		lt_outputfile="$lt_outputfile.exe"
728884bf8334Smrg		lt_tool_outputfile="$lt_tool_outputfile.exe"
728984bf8334Smrg		;;
729084bf8334Smrg	    esac~
729184bf8334Smrg	    func_to_tool_file "$lt_outputfile"~
729284bf8334Smrg	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
729384bf8334Smrg	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
729484bf8334Smrg	      $RM "$lt_outputfile.manifest";
729584bf8334Smrg	    fi'
729684bf8334Smrg	  ;;
729784bf8334Smrg	*)
729884bf8334Smrg	  # g++
729984bf8334Smrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
730084bf8334Smrg	  # as there is no search path for DLLs.
730184bf8334Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
730284bf8334Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
730384bf8334Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
730484bf8334Smrg	  _LT_TAGVAR(always_export_symbols, $1)=no
730584bf8334Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
7306a73597f9Smrg
730784bf8334Smrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
730884bf8334Smrg	    _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'
730984bf8334Smrg	    # If the export-symbols file already is a .def file (1st line
731084bf8334Smrg	    # is EXPORTS), use it as is; otherwise, prepend...
731184bf8334Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
731284bf8334Smrg	      cp $export_symbols $output_objdir/$soname.def;
731384bf8334Smrg	    else
731484bf8334Smrg	      echo EXPORTS > $output_objdir/$soname.def;
731584bf8334Smrg	      cat $export_symbols >> $output_objdir/$soname.def;
731684bf8334Smrg	    fi~
731784bf8334Smrg	    $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'
731884bf8334Smrg	  else
731984bf8334Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
732084bf8334Smrg	  fi
732184bf8334Smrg	  ;;
732284bf8334Smrg	esac
732384bf8334Smrg	;;
732484bf8334Smrg      darwin* | rhapsody*)
732584bf8334Smrg        _LT_DARWIN_LINKER_FEATURES($1)
732684bf8334Smrg	;;
7327a73597f9Smrg
732884bf8334Smrg      dgux*)
732984bf8334Smrg        case $cc_basename in
733084bf8334Smrg          ec++*)
733184bf8334Smrg	    # FIXME: insert proper C++ library support
733284bf8334Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
733384bf8334Smrg	    ;;
733484bf8334Smrg          ghcx*)
733584bf8334Smrg	    # Green Hills C++ Compiler
733684bf8334Smrg	    # FIXME: insert proper C++ library support
733784bf8334Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
733884bf8334Smrg	    ;;
733984bf8334Smrg          *)
734084bf8334Smrg	    # FIXME: insert proper C++ library support
734184bf8334Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
734284bf8334Smrg	    ;;
734384bf8334Smrg        esac
734484bf8334Smrg        ;;
7345a73597f9Smrg
734684bf8334Smrg      freebsd2.*)
734784bf8334Smrg        # C++ shared libraries reported to be fairly broken before
734884bf8334Smrg	# switch to ELF
734984bf8334Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
735084bf8334Smrg        ;;
73516aab59a7Smrg
735284bf8334Smrg      freebsd-elf*)
735384bf8334Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
735484bf8334Smrg        ;;
73556aab59a7Smrg
735684bf8334Smrg      freebsd* | dragonfly*)
735784bf8334Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
735884bf8334Smrg        # conventions
735984bf8334Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
736084bf8334Smrg        ;;
73616aab59a7Smrg
736284bf8334Smrg      gnu*)
736384bf8334Smrg        ;;
73646aab59a7Smrg
736584bf8334Smrg      haiku*)
736684bf8334Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
736784bf8334Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
736884bf8334Smrg        ;;
73696aab59a7Smrg
737084bf8334Smrg      hpux9*)
737184bf8334Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
737284bf8334Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
737384bf8334Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
737484bf8334Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
737584bf8334Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
737684bf8334Smrg				             # but as the default
737784bf8334Smrg				             # location of the library.
73786aab59a7Smrg
737984bf8334Smrg        case $cc_basename in
738084bf8334Smrg          CC*)
738184bf8334Smrg            # FIXME: insert proper C++ library support
738284bf8334Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
738384bf8334Smrg            ;;
738484bf8334Smrg          aCC*)
738584bf8334Smrg            _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'
738684bf8334Smrg            # Commands to make compiler produce verbose output that lists
738784bf8334Smrg            # what "hidden" libraries, object files and flags are used when
738884bf8334Smrg            # linking a shared library.
738984bf8334Smrg            #
739084bf8334Smrg            # There doesn't appear to be a way to prevent this compiler from
739184bf8334Smrg            # explicitly linking system object files so we need to strip them
739284bf8334Smrg            # from the output so that they don't get included in the library
739384bf8334Smrg            # dependencies.
739484bf8334Smrg            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"'
739584bf8334Smrg            ;;
739684bf8334Smrg          *)
739784bf8334Smrg            if test "$GXX" = yes; then
739884bf8334Smrg              _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'
739984bf8334Smrg            else
740084bf8334Smrg              # FIXME: insert proper C++ library support
740184bf8334Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
740284bf8334Smrg            fi
740384bf8334Smrg            ;;
740484bf8334Smrg        esac
740584bf8334Smrg        ;;
74066aab59a7Smrg
740784bf8334Smrg      hpux10*|hpux11*)
740884bf8334Smrg        if test $with_gnu_ld = no; then
740984bf8334Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
741084bf8334Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
74116aab59a7Smrg
741284bf8334Smrg          case $host_cpu in
741384bf8334Smrg            hppa*64*|ia64*)
741484bf8334Smrg              ;;
741584bf8334Smrg            *)
741684bf8334Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
741784bf8334Smrg              ;;
741884bf8334Smrg          esac
741984bf8334Smrg        fi
742084bf8334Smrg        case $host_cpu in
742184bf8334Smrg          hppa*64*|ia64*)
742284bf8334Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
742384bf8334Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
742484bf8334Smrg            ;;
742584bf8334Smrg          *)
742684bf8334Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
742784bf8334Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
742884bf8334Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
742984bf8334Smrg					         # but as the default
743084bf8334Smrg					         # location of the library.
743184bf8334Smrg            ;;
743284bf8334Smrg        esac
74336aab59a7Smrg
743484bf8334Smrg        case $cc_basename in
743584bf8334Smrg          CC*)
743684bf8334Smrg	    # FIXME: insert proper C++ library support
743784bf8334Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
743884bf8334Smrg	    ;;
743984bf8334Smrg          aCC*)
744084bf8334Smrg	    case $host_cpu in
744184bf8334Smrg	      hppa*64*)
744284bf8334Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
744384bf8334Smrg	        ;;
744484bf8334Smrg	      ia64*)
744584bf8334Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
744684bf8334Smrg	        ;;
744784bf8334Smrg	      *)
744884bf8334Smrg	        _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'
744984bf8334Smrg	        ;;
745084bf8334Smrg	    esac
745184bf8334Smrg	    # Commands to make compiler produce verbose output that lists
745284bf8334Smrg	    # what "hidden" libraries, object files and flags are used when
745384bf8334Smrg	    # linking a shared library.
745484bf8334Smrg	    #
745584bf8334Smrg	    # There doesn't appear to be a way to prevent this compiler from
745684bf8334Smrg	    # explicitly linking system object files so we need to strip them
745784bf8334Smrg	    # from the output so that they don't get included in the library
745884bf8334Smrg	    # dependencies.
745984bf8334Smrg	    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"'
746084bf8334Smrg	    ;;
746184bf8334Smrg          *)
746284bf8334Smrg	    if test "$GXX" = yes; then
746384bf8334Smrg	      if test $with_gnu_ld = no; then
746484bf8334Smrg	        case $host_cpu in
746584bf8334Smrg	          hppa*64*)
746684bf8334Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
746784bf8334Smrg	            ;;
746884bf8334Smrg	          ia64*)
746984bf8334Smrg	            _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'
747084bf8334Smrg	            ;;
747184bf8334Smrg	          *)
747284bf8334Smrg	            _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'
747384bf8334Smrg	            ;;
747484bf8334Smrg	        esac
747584bf8334Smrg	      fi
747684bf8334Smrg	    else
747784bf8334Smrg	      # FIXME: insert proper C++ library support
747884bf8334Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
747984bf8334Smrg	    fi
748084bf8334Smrg	    ;;
748184bf8334Smrg        esac
748284bf8334Smrg        ;;
74836aab59a7Smrg
748484bf8334Smrg      interix[[3-9]]*)
748584bf8334Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
748684bf8334Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
748784bf8334Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
748884bf8334Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
748984bf8334Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
749084bf8334Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
749184bf8334Smrg	# default) and relocated if they conflict, which is a slow very memory
749284bf8334Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
749384bf8334Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
749484bf8334Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
749584bf8334Smrg	_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'
749684bf8334Smrg	_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'
749784bf8334Smrg	;;
749884bf8334Smrg      irix5* | irix6*)
749984bf8334Smrg        case $cc_basename in
750084bf8334Smrg          CC*)
750184bf8334Smrg	    # SGI C++
750284bf8334Smrg	    _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'
75036aab59a7Smrg
750484bf8334Smrg	    # Archives containing C++ object files must be created using
750584bf8334Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
750684bf8334Smrg	    # necessary to make sure instantiated templates are included
750784bf8334Smrg	    # in the archive.
750884bf8334Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
750984bf8334Smrg	    ;;
751084bf8334Smrg          *)
751184bf8334Smrg	    if test "$GXX" = yes; then
751284bf8334Smrg	      if test "$with_gnu_ld" = no; then
751384bf8334Smrg	        _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'
751484bf8334Smrg	      else
751584bf8334Smrg	        _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'
751684bf8334Smrg	      fi
751784bf8334Smrg	    fi
751884bf8334Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
751984bf8334Smrg	    ;;
752084bf8334Smrg        esac
752184bf8334Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
752284bf8334Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
752384bf8334Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
752484bf8334Smrg        ;;
75256aab59a7Smrg
752684bf8334Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
752784bf8334Smrg        case $cc_basename in
752884bf8334Smrg          KCC*)
752984bf8334Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
75306aab59a7Smrg
753184bf8334Smrg	    # KCC will only create a shared library if the output file
753284bf8334Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
753384bf8334Smrg	    # to its proper name (with version) after linking.
753484bf8334Smrg	    _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'
753584bf8334Smrg	    _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'
753684bf8334Smrg	    # Commands to make compiler produce verbose output that lists
753784bf8334Smrg	    # what "hidden" libraries, object files and flags are used when
753884bf8334Smrg	    # linking a shared library.
753984bf8334Smrg	    #
754084bf8334Smrg	    # There doesn't appear to be a way to prevent this compiler from
754184bf8334Smrg	    # explicitly linking system object files so we need to strip them
754284bf8334Smrg	    # from the output so that they don't get included in the library
754384bf8334Smrg	    # dependencies.
754484bf8334Smrg	    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"'
754584bf8334Smrg
754684bf8334Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
754784bf8334Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
754884bf8334Smrg
754984bf8334Smrg	    # Archives containing C++ object files must be created using
755084bf8334Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
755184bf8334Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
755284bf8334Smrg	    ;;
755384bf8334Smrg	  icpc* | ecpc* )
755484bf8334Smrg	    # Intel C++
755584bf8334Smrg	    with_gnu_ld=yes
755684bf8334Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
755784bf8334Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
755884bf8334Smrg	    # earlier do not add the objects themselves.
755984bf8334Smrg	    case `$CC -V 2>&1` in
756084bf8334Smrg	      *"Version 7."*)
756184bf8334Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
756284bf8334Smrg		_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'
756384bf8334Smrg		;;
756484bf8334Smrg	      *)  # Version 8.0 or newer
756584bf8334Smrg	        tmp_idyn=
756684bf8334Smrg	        case $host_cpu in
756784bf8334Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
756884bf8334Smrg		esac
756984bf8334Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
757084bf8334Smrg		_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'
757184bf8334Smrg		;;
757284bf8334Smrg	    esac
757384bf8334Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
757484bf8334Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
757584bf8334Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
757684bf8334Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
757784bf8334Smrg	    ;;
757884bf8334Smrg          pgCC* | pgcpp*)
757984bf8334Smrg            # Portland Group C++ compiler
758084bf8334Smrg	    case `$CC -V` in
758184bf8334Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
758284bf8334Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
758384bf8334Smrg		rm -rf $tpldir~
758484bf8334Smrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
758584bf8334Smrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
758684bf8334Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
758784bf8334Smrg		rm -rf $tpldir~
758884bf8334Smrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
758984bf8334Smrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
759084bf8334Smrg		$RANLIB $oldlib'
759184bf8334Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
759284bf8334Smrg		rm -rf $tpldir~
759384bf8334Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
759484bf8334Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
759584bf8334Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
759684bf8334Smrg		rm -rf $tpldir~
759784bf8334Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
759884bf8334Smrg		$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'
759984bf8334Smrg	      ;;
760084bf8334Smrg	    *) # Version 6 and above use weak symbols
760184bf8334Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
760284bf8334Smrg	      _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'
760384bf8334Smrg	      ;;
760484bf8334Smrg	    esac
7605fc27e79cSmrg
760684bf8334Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
760784bf8334Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
760884bf8334Smrg	    _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'
760984bf8334Smrg            ;;
761084bf8334Smrg	  cxx*)
761184bf8334Smrg	    # Compaq C++
761284bf8334Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
761384bf8334Smrg	    _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'
7614fc27e79cSmrg
761584bf8334Smrg	    runpath_var=LD_RUN_PATH
761684bf8334Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
761784bf8334Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7618fc27e79cSmrg
761984bf8334Smrg	    # Commands to make compiler produce verbose output that lists
762084bf8334Smrg	    # what "hidden" libraries, object files and flags are used when
762184bf8334Smrg	    # linking a shared library.
762284bf8334Smrg	    #
762384bf8334Smrg	    # There doesn't appear to be a way to prevent this compiler from
762484bf8334Smrg	    # explicitly linking system object files so we need to strip them
762584bf8334Smrg	    # from the output so that they don't get included in the library
762684bf8334Smrg	    # dependencies.
762784bf8334Smrg	    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'
762884bf8334Smrg	    ;;
762984bf8334Smrg	  xl* | mpixl* | bgxl*)
763084bf8334Smrg	    # IBM XL 8.0 on PPC, with GNU ld
763184bf8334Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
763284bf8334Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
763384bf8334Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
763484bf8334Smrg	    if test "x$supports_anon_versioning" = xyes; then
763584bf8334Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
763684bf8334Smrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
763784bf8334Smrg		echo "local: *; };" >> $output_objdir/$libname.ver~
763884bf8334Smrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
763984bf8334Smrg	    fi
764084bf8334Smrg	    ;;
764184bf8334Smrg	  *)
764284bf8334Smrg	    case `$CC -V 2>&1 | sed 5q` in
764384bf8334Smrg	    *Sun\ C*)
764484bf8334Smrg	      # Sun C++ 5.9
764584bf8334Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
764684bf8334Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
764784bf8334Smrg	      _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'
764884bf8334Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
764984bf8334Smrg	      _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'
765084bf8334Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
7651fc27e79cSmrg
765284bf8334Smrg	      # Not sure whether something based on
765384bf8334Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
765484bf8334Smrg	      # would be better.
765584bf8334Smrg	      output_verbose_link_cmd='func_echo_all'
7656a73597f9Smrg
765784bf8334Smrg	      # Archives containing C++ object files must be created using
765884bf8334Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
765984bf8334Smrg	      # necessary to make sure instantiated templates are included
766084bf8334Smrg	      # in the archive.
766184bf8334Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
766284bf8334Smrg	      ;;
766384bf8334Smrg	    esac
766484bf8334Smrg	    ;;
766584bf8334Smrg	esac
766684bf8334Smrg	;;
7667a73597f9Smrg
766884bf8334Smrg      lynxos*)
766984bf8334Smrg        # FIXME: insert proper C++ library support
767084bf8334Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
767184bf8334Smrg	;;
7672a73597f9Smrg
767384bf8334Smrg      m88k*)
767484bf8334Smrg        # FIXME: insert proper C++ library support
767584bf8334Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
767684bf8334Smrg	;;
7677a73597f9Smrg
767884bf8334Smrg      mvs*)
767984bf8334Smrg        case $cc_basename in
768084bf8334Smrg          cxx*)
768184bf8334Smrg	    # FIXME: insert proper C++ library support
768284bf8334Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
768384bf8334Smrg	    ;;
768484bf8334Smrg	  *)
768584bf8334Smrg	    # FIXME: insert proper C++ library support
768684bf8334Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
768784bf8334Smrg	    ;;
768884bf8334Smrg	esac
768984bf8334Smrg	;;
7690a73597f9Smrg
769184bf8334Smrg      netbsd*)
769284bf8334Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
769384bf8334Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
769484bf8334Smrg	  wlarc=
769584bf8334Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
769684bf8334Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
769784bf8334Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
769884bf8334Smrg	fi
769984bf8334Smrg	# Workaround some broken pre-1.5 toolchains
770084bf8334Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
770184bf8334Smrg	;;
7702a73597f9Smrg
770384bf8334Smrg      *nto* | *qnx*)
770484bf8334Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
770584bf8334Smrg	;;
7706a73597f9Smrg
770784bf8334Smrg      openbsd2*)
770884bf8334Smrg        # C++ shared libraries are fairly broken
770984bf8334Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
771084bf8334Smrg	;;
7711a73597f9Smrg
771284bf8334Smrg      openbsd*)
771384bf8334Smrg	if test -f /usr/libexec/ld.so; then
771484bf8334Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
771584bf8334Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
771684bf8334Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
771784bf8334Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
771884bf8334Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
771984bf8334Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
772084bf8334Smrg	    _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'
772184bf8334Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
772284bf8334Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
772384bf8334Smrg	  fi
772484bf8334Smrg	  output_verbose_link_cmd=func_echo_all
772584bf8334Smrg	else
772684bf8334Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
772784bf8334Smrg	fi
772884bf8334Smrg	;;
7729a73597f9Smrg
773084bf8334Smrg      osf3* | osf4* | osf5*)
773184bf8334Smrg        case $cc_basename in
773284bf8334Smrg          KCC*)
773384bf8334Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7734fc27e79cSmrg
773584bf8334Smrg	    # KCC will only create a shared library if the output file
773684bf8334Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
773784bf8334Smrg	    # to its proper name (with version) after linking.
773884bf8334Smrg	    _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'
7739fc27e79cSmrg
774084bf8334Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
774184bf8334Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7742fc27e79cSmrg
774384bf8334Smrg	    # Archives containing C++ object files must be created using
774484bf8334Smrg	    # the KAI C++ compiler.
774584bf8334Smrg	    case $host in
774684bf8334Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
774784bf8334Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
774884bf8334Smrg	    esac
774984bf8334Smrg	    ;;
775084bf8334Smrg          RCC*)
775184bf8334Smrg	    # Rational C++ 2.4.1
775284bf8334Smrg	    # FIXME: insert proper C++ library support
775384bf8334Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
775484bf8334Smrg	    ;;
775584bf8334Smrg          cxx*)
775684bf8334Smrg	    case $host in
775784bf8334Smrg	      osf3*)
775884bf8334Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
775984bf8334Smrg	        _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'
776084bf8334Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
776184bf8334Smrg		;;
776284bf8334Smrg	      *)
776384bf8334Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
776484bf8334Smrg	        _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'
776584bf8334Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
776684bf8334Smrg	          echo "-hidden">> $lib.exp~
776784bf8334Smrg	          $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~
776884bf8334Smrg	          $RM $lib.exp'
776984bf8334Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
777084bf8334Smrg		;;
777184bf8334Smrg	    esac
7772fc27e79cSmrg
777384bf8334Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7774fc27e79cSmrg
777584bf8334Smrg	    # Commands to make compiler produce verbose output that lists
777684bf8334Smrg	    # what "hidden" libraries, object files and flags are used when
777784bf8334Smrg	    # linking a shared library.
777884bf8334Smrg	    #
777984bf8334Smrg	    # There doesn't appear to be a way to prevent this compiler from
778084bf8334Smrg	    # explicitly linking system object files so we need to strip them
778184bf8334Smrg	    # from the output so that they don't get included in the library
778284bf8334Smrg	    # dependencies.
778384bf8334Smrg	    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"'
778484bf8334Smrg	    ;;
778584bf8334Smrg	  *)
778684bf8334Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
778784bf8334Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
778884bf8334Smrg	      case $host in
778984bf8334Smrg	        osf3*)
779084bf8334Smrg	          _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'
779184bf8334Smrg		  ;;
779284bf8334Smrg	        *)
779384bf8334Smrg	          _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'
779484bf8334Smrg		  ;;
779584bf8334Smrg	      esac
7796fc27e79cSmrg
779784bf8334Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
779884bf8334Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7799fc27e79cSmrg
780084bf8334Smrg	      # Commands to make compiler produce verbose output that lists
780184bf8334Smrg	      # what "hidden" libraries, object files and flags are used when
780284bf8334Smrg	      # linking a shared library.
780384bf8334Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7804fc27e79cSmrg
780584bf8334Smrg	    else
780684bf8334Smrg	      # FIXME: insert proper C++ library support
780784bf8334Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
780884bf8334Smrg	    fi
780984bf8334Smrg	    ;;
781084bf8334Smrg        esac
781184bf8334Smrg        ;;
7812fc27e79cSmrg
781384bf8334Smrg      psos*)
781484bf8334Smrg        # FIXME: insert proper C++ library support
781584bf8334Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
781684bf8334Smrg        ;;
7817fc27e79cSmrg
781884bf8334Smrg      sunos4*)
781984bf8334Smrg        case $cc_basename in
782084bf8334Smrg          CC*)
782184bf8334Smrg	    # Sun C++ 4.x
782284bf8334Smrg	    # FIXME: insert proper C++ library support
782384bf8334Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
782484bf8334Smrg	    ;;
782584bf8334Smrg          lcc*)
782684bf8334Smrg	    # Lucid
782784bf8334Smrg	    # FIXME: insert proper C++ library support
782884bf8334Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
782984bf8334Smrg	    ;;
783084bf8334Smrg          *)
783184bf8334Smrg	    # FIXME: insert proper C++ library support
783284bf8334Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
783384bf8334Smrg	    ;;
783484bf8334Smrg        esac
783584bf8334Smrg        ;;
7836fc27e79cSmrg
783784bf8334Smrg      solaris*)
783884bf8334Smrg        case $cc_basename in
783984bf8334Smrg          CC* | sunCC*)
784084bf8334Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
784184bf8334Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
784284bf8334Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
784384bf8334Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
784484bf8334Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
784584bf8334Smrg	      $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'
7846fc27e79cSmrg
784784bf8334Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
784884bf8334Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
784984bf8334Smrg	    case $host_os in
785084bf8334Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
785184bf8334Smrg	      *)
785284bf8334Smrg		# The compiler driver will combine and reorder linker options,
785384bf8334Smrg		# but understands `-z linker_flag'.
785484bf8334Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
785584bf8334Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
785684bf8334Smrg	        ;;
785784bf8334Smrg	    esac
785884bf8334Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7859fc27e79cSmrg
786084bf8334Smrg	    output_verbose_link_cmd='func_echo_all'
7861fc27e79cSmrg
786284bf8334Smrg	    # Archives containing C++ object files must be created using
786384bf8334Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
786484bf8334Smrg	    # necessary to make sure instantiated templates are included
786584bf8334Smrg	    # in the archive.
786684bf8334Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
786784bf8334Smrg	    ;;
786884bf8334Smrg          gcx*)
786984bf8334Smrg	    # Green Hills C++ Compiler
787084bf8334Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7871fc27e79cSmrg
787284bf8334Smrg	    # The C++ compiler must be used to create the archive.
787384bf8334Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
787484bf8334Smrg	    ;;
787584bf8334Smrg          *)
787684bf8334Smrg	    # GNU C++ compiler with Solaris linker
787784bf8334Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
787884bf8334Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
787984bf8334Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
788084bf8334Smrg	        _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'
788184bf8334Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
788284bf8334Smrg		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7883fc27e79cSmrg
788484bf8334Smrg	        # Commands to make compiler produce verbose output that lists
788584bf8334Smrg	        # what "hidden" libraries, object files and flags are used when
788684bf8334Smrg	        # linking a shared library.
788784bf8334Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
788884bf8334Smrg	      else
788984bf8334Smrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
789084bf8334Smrg	        # platform.
789184bf8334Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
789284bf8334Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
789384bf8334Smrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7894fc27e79cSmrg
789584bf8334Smrg	        # Commands to make compiler produce verbose output that lists
789684bf8334Smrg	        # what "hidden" libraries, object files and flags are used when
789784bf8334Smrg	        # linking a shared library.
789884bf8334Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
789984bf8334Smrg	      fi
7900fc27e79cSmrg
790184bf8334Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
790284bf8334Smrg	      case $host_os in
790384bf8334Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
790484bf8334Smrg		*)
790584bf8334Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
790684bf8334Smrg		  ;;
790784bf8334Smrg	      esac
790884bf8334Smrg	    fi
790984bf8334Smrg	    ;;
791084bf8334Smrg        esac
791184bf8334Smrg        ;;
7912fc27e79cSmrg
791384bf8334Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
791484bf8334Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
791584bf8334Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
791684bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
791784bf8334Smrg      runpath_var='LD_RUN_PATH'
7918fc27e79cSmrg
791984bf8334Smrg      case $cc_basename in
792084bf8334Smrg        CC*)
792184bf8334Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
792284bf8334Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
792384bf8334Smrg	  ;;
792484bf8334Smrg	*)
792584bf8334Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
792684bf8334Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
792784bf8334Smrg	  ;;
792884bf8334Smrg      esac
792984bf8334Smrg      ;;
7930bd3a1963Smrg
793184bf8334Smrg      sysv5* | sco3.2v5* | sco5v6*)
793284bf8334Smrg	# Note: We can NOT use -z defs as we might desire, because we do not
793384bf8334Smrg	# link with -lc, and that would cause any symbols used from libc to
793484bf8334Smrg	# always be unresolved, which means just about no library would
793584bf8334Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
793684bf8334Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
793784bf8334Smrg	# as -z defs.
793884bf8334Smrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
793984bf8334Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
794084bf8334Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
794184bf8334Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
794284bf8334Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
794384bf8334Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
794484bf8334Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
794584bf8334Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
794684bf8334Smrg	runpath_var='LD_RUN_PATH'
7947a73597f9Smrg
794884bf8334Smrg	case $cc_basename in
794984bf8334Smrg          CC*)
795084bf8334Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
795184bf8334Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
795284bf8334Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
795384bf8334Smrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
795484bf8334Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
795584bf8334Smrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
795684bf8334Smrg	    ;;
795784bf8334Smrg	  *)
795884bf8334Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
795984bf8334Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
796084bf8334Smrg	    ;;
796184bf8334Smrg	esac
796284bf8334Smrg      ;;
7963fc27e79cSmrg
796484bf8334Smrg      tandem*)
796584bf8334Smrg        case $cc_basename in
796684bf8334Smrg          NCC*)
796784bf8334Smrg	    # NonStop-UX NCC 3.20
796884bf8334Smrg	    # FIXME: insert proper C++ library support
796984bf8334Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
797084bf8334Smrg	    ;;
797184bf8334Smrg          *)
797284bf8334Smrg	    # FIXME: insert proper C++ library support
797384bf8334Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
797484bf8334Smrg	    ;;
797584bf8334Smrg        esac
797684bf8334Smrg        ;;
7977fc27e79cSmrg
797884bf8334Smrg      vxworks*)
797984bf8334Smrg        # FIXME: insert proper C++ library support
798084bf8334Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
798184bf8334Smrg        ;;
7982fc27e79cSmrg
798384bf8334Smrg      *)
798484bf8334Smrg        # FIXME: insert proper C++ library support
798584bf8334Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
798684bf8334Smrg        ;;
798784bf8334Smrg    esac
7988fc27e79cSmrg
798984bf8334Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
799084bf8334Smrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
7991fc27e79cSmrg
799284bf8334Smrg    _LT_TAGVAR(GCC, $1)="$GXX"
799384bf8334Smrg    _LT_TAGVAR(LD, $1)="$LD"
79946aab59a7Smrg
799584bf8334Smrg    ## CAVEAT EMPTOR:
799684bf8334Smrg    ## There is no encapsulation within the following macros, do not change
799784bf8334Smrg    ## the running order or otherwise move them around unless you know exactly
799884bf8334Smrg    ## what you are doing...
799984bf8334Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
800084bf8334Smrg    _LT_COMPILER_PIC($1)
800184bf8334Smrg    _LT_COMPILER_C_O($1)
800284bf8334Smrg    _LT_COMPILER_FILE_LOCKS($1)
800384bf8334Smrg    _LT_LINKER_SHLIBS($1)
800484bf8334Smrg    _LT_SYS_DYNAMIC_LINKER($1)
800584bf8334Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
80066aab59a7Smrg
800784bf8334Smrg    _LT_CONFIG($1)
800884bf8334Smrg  fi # test -n "$compiler"
8009fc27e79cSmrg
801084bf8334Smrg  CC=$lt_save_CC
801184bf8334Smrg  CFLAGS=$lt_save_CFLAGS
801284bf8334Smrg  LDCXX=$LD
801384bf8334Smrg  LD=$lt_save_LD
801484bf8334Smrg  GCC=$lt_save_GCC
801584bf8334Smrg  with_gnu_ld=$lt_save_with_gnu_ld
801684bf8334Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
801784bf8334Smrg  lt_cv_path_LD=$lt_save_path_LD
801884bf8334Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
801984bf8334Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
802084bf8334Smrgfi # test "$_lt_caught_CXX_error" != yes
80216aab59a7Smrg
802284bf8334SmrgAC_LANG_POP
802384bf8334Smrg])# _LT_LANG_CXX_CONFIG
80246aab59a7Smrg
8025fc27e79cSmrg
802684bf8334Smrg# _LT_FUNC_STRIPNAME_CNF
802784bf8334Smrg# ----------------------
802884bf8334Smrg# func_stripname_cnf prefix suffix name
802984bf8334Smrg# strip PREFIX and SUFFIX off of NAME.
803084bf8334Smrg# PREFIX and SUFFIX must not contain globbing or regex special
803184bf8334Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
803284bf8334Smrg# dot (in which case that matches only a dot).
803384bf8334Smrg#
803484bf8334Smrg# This function is identical to the (non-XSI) version of func_stripname,
803584bf8334Smrg# except this one can be used by m4 code that may be executed by configure,
803684bf8334Smrg# rather than the libtool script.
803784bf8334Smrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
803884bf8334SmrgAC_REQUIRE([_LT_DECL_SED])
803984bf8334SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
804084bf8334Smrgfunc_stripname_cnf ()
804184bf8334Smrg{
804284bf8334Smrg  case ${2} in
804384bf8334Smrg  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
804484bf8334Smrg  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
804584bf8334Smrg  esac
804684bf8334Smrg} # func_stripname_cnf
804784bf8334Smrg])# _LT_FUNC_STRIPNAME_CNF
8048fc27e79cSmrg
804984bf8334Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
805084bf8334Smrg# ---------------------------------
805184bf8334Smrg# Figure out "hidden" library dependencies from verbose
805284bf8334Smrg# compiler output when linking a shared library.
805384bf8334Smrg# Parse the compiler output and extract the necessary
805484bf8334Smrg# objects, libraries and library flags.
805584bf8334Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
805684bf8334Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
805784bf8334SmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
805884bf8334Smrg# Dependencies to place before and after the object being linked:
805984bf8334Smrg_LT_TAGVAR(predep_objects, $1)=
806084bf8334Smrg_LT_TAGVAR(postdep_objects, $1)=
806184bf8334Smrg_LT_TAGVAR(predeps, $1)=
806284bf8334Smrg_LT_TAGVAR(postdeps, $1)=
806384bf8334Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
8064a73597f9Smrg
806584bf8334Smrgdnl we can't use the lt_simple_compile_test_code here,
806684bf8334Smrgdnl because it contains code intended for an executable,
806784bf8334Smrgdnl not a library.  It's possible we should let each
806884bf8334Smrgdnl tag define a new lt_????_link_test_code variable,
806984bf8334Smrgdnl but it's only used here...
807084bf8334Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
807184bf8334Smrgint a;
807284bf8334Smrgvoid foo (void) { a = 0; }
807384bf8334Smrg_LT_EOF
807484bf8334Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
807584bf8334Smrgclass Foo
807684bf8334Smrg{
807784bf8334Smrgpublic:
807884bf8334Smrg  Foo (void) { a = 0; }
807984bf8334Smrgprivate:
808084bf8334Smrg  int a;
808184bf8334Smrg};
808284bf8334Smrg_LT_EOF
808384bf8334Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
808484bf8334Smrg      subroutine foo
808584bf8334Smrg      implicit none
808684bf8334Smrg      integer*4 a
808784bf8334Smrg      a=0
808884bf8334Smrg      return
808984bf8334Smrg      end
809084bf8334Smrg_LT_EOF
809184bf8334Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
809284bf8334Smrg      subroutine foo
809384bf8334Smrg      implicit none
809484bf8334Smrg      integer a
809584bf8334Smrg      a=0
809684bf8334Smrg      return
809784bf8334Smrg      end
809884bf8334Smrg_LT_EOF
809984bf8334Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
810084bf8334Smrgpublic class foo {
810184bf8334Smrg  private int a;
810284bf8334Smrg  public void bar (void) {
810384bf8334Smrg    a = 0;
810484bf8334Smrg  }
810584bf8334Smrg};
810684bf8334Smrg_LT_EOF
810784bf8334Smrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
810884bf8334Smrgpackage foo
810984bf8334Smrgfunc foo() {
811084bf8334Smrg}
811184bf8334Smrg_LT_EOF
811284bf8334Smrg])
8113a73597f9Smrg
811484bf8334Smrg_lt_libdeps_save_CFLAGS=$CFLAGS
811584bf8334Smrgcase "$CC $CFLAGS " in #(
811684bf8334Smrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
811784bf8334Smrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
811884bf8334Smrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
811984bf8334Smrgesac
812084bf8334Smrg
812184bf8334Smrgdnl Parse the compiler output and extract the necessary
812284bf8334Smrgdnl objects, libraries and library flags.
812384bf8334Smrgif AC_TRY_EVAL(ac_compile); then
812484bf8334Smrg  # Parse the compiler output and extract the necessary
812584bf8334Smrg  # objects, libraries and library flags.
8126a73597f9Smrg
812784bf8334Smrg  # Sentinel used to keep track of whether or not we are before
812884bf8334Smrg  # the conftest object file.
812984bf8334Smrg  pre_test_object_deps_done=no
8130a73597f9Smrg
813184bf8334Smrg  for p in `eval "$output_verbose_link_cmd"`; do
813284bf8334Smrg    case ${prev}${p} in
8133a73597f9Smrg
813484bf8334Smrg    -L* | -R* | -l*)
813584bf8334Smrg       # Some compilers place space between "-{L,R}" and the path.
813684bf8334Smrg       # Remove the space.
813784bf8334Smrg       if test $p = "-L" ||
813884bf8334Smrg          test $p = "-R"; then
813984bf8334Smrg	 prev=$p
814084bf8334Smrg	 continue
814184bf8334Smrg       fi
8142a73597f9Smrg
814384bf8334Smrg       # Expand the sysroot to ease extracting the directories later.
814484bf8334Smrg       if test -z "$prev"; then
814584bf8334Smrg         case $p in
814684bf8334Smrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
814784bf8334Smrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
814884bf8334Smrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
814984bf8334Smrg         esac
815084bf8334Smrg       fi
815184bf8334Smrg       case $p in
815284bf8334Smrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
815384bf8334Smrg       esac
815484bf8334Smrg       if test "$pre_test_object_deps_done" = no; then
815584bf8334Smrg	 case ${prev} in
815684bf8334Smrg	 -L | -R)
815784bf8334Smrg	   # Internal compiler library paths should come after those
815884bf8334Smrg	   # provided the user.  The postdeps already come after the
815984bf8334Smrg	   # user supplied libs so there is no need to process them.
816084bf8334Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
816184bf8334Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
816284bf8334Smrg	   else
816384bf8334Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
816484bf8334Smrg	   fi
816584bf8334Smrg	   ;;
816684bf8334Smrg	 # The "-l" case would never come before the object being
816784bf8334Smrg	 # linked, so don't bother handling this case.
816884bf8334Smrg	 esac
816984bf8334Smrg       else
817084bf8334Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
817184bf8334Smrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
817284bf8334Smrg	 else
817384bf8334Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
817484bf8334Smrg	 fi
817584bf8334Smrg       fi
817684bf8334Smrg       prev=
817784bf8334Smrg       ;;
8178fc27e79cSmrg
817984bf8334Smrg    *.lto.$objext) ;; # Ignore GCC LTO objects
818084bf8334Smrg    *.$objext)
818184bf8334Smrg       # This assumes that the test object file only shows up
818284bf8334Smrg       # once in the compiler output.
818384bf8334Smrg       if test "$p" = "conftest.$objext"; then
818484bf8334Smrg	 pre_test_object_deps_done=yes
818584bf8334Smrg	 continue
818684bf8334Smrg       fi
8187b73be646Smrg
818884bf8334Smrg       if test "$pre_test_object_deps_done" = no; then
818984bf8334Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
819084bf8334Smrg	   _LT_TAGVAR(predep_objects, $1)="$p"
819184bf8334Smrg	 else
819284bf8334Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
819384bf8334Smrg	 fi
819484bf8334Smrg       else
819584bf8334Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
819684bf8334Smrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
819784bf8334Smrg	 else
819884bf8334Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
819984bf8334Smrg	 fi
820084bf8334Smrg       fi
820184bf8334Smrg       ;;
8202a73597f9Smrg
820384bf8334Smrg    *) ;; # Ignore the rest.
8204a73597f9Smrg
820584bf8334Smrg    esac
820684bf8334Smrg  done
8207a73597f9Smrg
820884bf8334Smrg  # Clean up.
820984bf8334Smrg  rm -f a.out a.exe
821084bf8334Smrgelse
821184bf8334Smrg  echo "libtool.m4: error: problem compiling $1 test program"
821284bf8334Smrgfi
8213a73597f9Smrg
821484bf8334Smrg$RM -f confest.$objext
821584bf8334SmrgCFLAGS=$_lt_libdeps_save_CFLAGS
8216a73597f9Smrg
821784bf8334Smrg# PORTME: override above test on systems where it is broken
821884bf8334Smrgm4_if([$1], [CXX],
821984bf8334Smrg[case $host_os in
822084bf8334Smrginterix[[3-9]]*)
822184bf8334Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
822284bf8334Smrg  # hack all around it, let's just trust "g++" to DTRT.
822384bf8334Smrg  _LT_TAGVAR(predep_objects,$1)=
822484bf8334Smrg  _LT_TAGVAR(postdep_objects,$1)=
822584bf8334Smrg  _LT_TAGVAR(postdeps,$1)=
822684bf8334Smrg  ;;
8227a73597f9Smrg
822884bf8334Smrglinux*)
822984bf8334Smrg  case `$CC -V 2>&1 | sed 5q` in
823084bf8334Smrg  *Sun\ C*)
823184bf8334Smrg    # Sun C++ 5.9
8232a73597f9Smrg
823384bf8334Smrg    # The more standards-conforming stlport4 library is
823484bf8334Smrg    # incompatible with the Cstd library. Avoid specifying
823584bf8334Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
823684bf8334Smrg    # -library=stlport4 depends on it.
823784bf8334Smrg    case " $CXX $CXXFLAGS " in
823884bf8334Smrg    *" -library=stlport4 "*)
823984bf8334Smrg      solaris_use_stlport4=yes
824084bf8334Smrg      ;;
824184bf8334Smrg    esac
8242a73597f9Smrg
824384bf8334Smrg    if test "$solaris_use_stlport4" != yes; then
824484bf8334Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
824584bf8334Smrg    fi
824684bf8334Smrg    ;;
824784bf8334Smrg  esac
824884bf8334Smrg  ;;
8249a73597f9Smrg
825084bf8334Smrgsolaris*)
825184bf8334Smrg  case $cc_basename in
825284bf8334Smrg  CC* | sunCC*)
825384bf8334Smrg    # The more standards-conforming stlport4 library is
825484bf8334Smrg    # incompatible with the Cstd library. Avoid specifying
825584bf8334Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
825684bf8334Smrg    # -library=stlport4 depends on it.
825784bf8334Smrg    case " $CXX $CXXFLAGS " in
825884bf8334Smrg    *" -library=stlport4 "*)
825984bf8334Smrg      solaris_use_stlport4=yes
826084bf8334Smrg      ;;
826184bf8334Smrg    esac
8262a73597f9Smrg
826384bf8334Smrg    # Adding this requires a known-good setup of shared libraries for
826484bf8334Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
826584bf8334Smrg    # archive will be linked into the output, leading to subtle bugs.
826684bf8334Smrg    if test "$solaris_use_stlport4" != yes; then
826784bf8334Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
826884bf8334Smrg    fi
826984bf8334Smrg    ;;
827084bf8334Smrg  esac
827184bf8334Smrg  ;;
827284bf8334Smrgesac
8273a73597f9Smrg])
8274b73be646Smrg
827584bf8334Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
827684bf8334Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
827784bf8334Smrgesac
827884bf8334Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
827984bf8334Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
828084bf8334Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
828184bf8334Smrgfi
828284bf8334Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
828384bf8334Smrg    [The directories searched by this compiler when creating a shared library])
828484bf8334Smrg_LT_TAGDECL([], [predep_objects], [1],
828584bf8334Smrg    [Dependencies to place before and after the objects being linked to
828684bf8334Smrg    create a shared library])
828784bf8334Smrg_LT_TAGDECL([], [postdep_objects], [1])
828884bf8334Smrg_LT_TAGDECL([], [predeps], [1])
828984bf8334Smrg_LT_TAGDECL([], [postdeps], [1])
829084bf8334Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
829184bf8334Smrg    [The library search path used internally by the compiler when linking
829284bf8334Smrg    a shared library])
829384bf8334Smrg])# _LT_SYS_HIDDEN_LIBDEPS
8294b73be646Smrg
8295fc27e79cSmrg
829684bf8334Smrg# _LT_LANG_F77_CONFIG([TAG])
829784bf8334Smrg# --------------------------
829884bf8334Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
829984bf8334Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
830084bf8334Smrg# to write the compiler configuration to `libtool'.
830184bf8334Smrgm4_defun([_LT_LANG_F77_CONFIG],
830284bf8334Smrg[AC_LANG_PUSH(Fortran 77)
830384bf8334Smrgif test -z "$F77" || test "X$F77" = "Xno"; then
830484bf8334Smrg  _lt_disable_F77=yes
830584bf8334Smrgfi
8306fc27e79cSmrg
830784bf8334Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
830884bf8334Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
830984bf8334Smrg_LT_TAGVAR(always_export_symbols, $1)=no
831084bf8334Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
831184bf8334Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
831284bf8334Smrg_LT_TAGVAR(hardcode_direct, $1)=no
831384bf8334Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
831484bf8334Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
831584bf8334Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
831684bf8334Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
831784bf8334Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
831884bf8334Smrg_LT_TAGVAR(inherit_rpath, $1)=no
831984bf8334Smrg_LT_TAGVAR(module_cmds, $1)=
832084bf8334Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
832184bf8334Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
832284bf8334Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
832384bf8334Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
832484bf8334Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
832584bf8334Smrg_LT_TAGVAR(no_undefined_flag, $1)=
832684bf8334Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
832784bf8334Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8328fc27e79cSmrg
832984bf8334Smrg# Source file extension for f77 test sources.
833084bf8334Smrgac_ext=f
8331fc27e79cSmrg
833284bf8334Smrg# Object file extension for compiled f77 test sources.
833384bf8334Smrgobjext=o
833484bf8334Smrg_LT_TAGVAR(objext, $1)=$objext
8335fc27e79cSmrg
833684bf8334Smrg# No sense in running all these tests if we already determined that
833784bf8334Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
833884bf8334Smrg# are currently assumed to apply to all compilers on this platform,
833984bf8334Smrg# and will be corrupted by setting them based on a non-working compiler.
834084bf8334Smrgif test "$_lt_disable_F77" != yes; then
834184bf8334Smrg  # Code to be used in simple compile tests
834284bf8334Smrg  lt_simple_compile_test_code="\
834384bf8334Smrg      subroutine t
834484bf8334Smrg      return
834584bf8334Smrg      end
834684bf8334Smrg"
8347b73be646Smrg
834884bf8334Smrg  # Code to be used in simple link tests
834984bf8334Smrg  lt_simple_link_test_code="\
835084bf8334Smrg      program t
835184bf8334Smrg      end
835284bf8334Smrg"
8353b73be646Smrg
835484bf8334Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
835584bf8334Smrg  _LT_TAG_COMPILER
8356fc27e79cSmrg
835784bf8334Smrg  # save warnings/boilerplate of simple test code
835884bf8334Smrg  _LT_COMPILER_BOILERPLATE
835984bf8334Smrg  _LT_LINKER_BOILERPLATE
8360fc27e79cSmrg
836184bf8334Smrg  # Allow CC to be a program name with arguments.
836284bf8334Smrg  lt_save_CC="$CC"
836384bf8334Smrg  lt_save_GCC=$GCC
836484bf8334Smrg  lt_save_CFLAGS=$CFLAGS
836584bf8334Smrg  CC=${F77-"f77"}
836684bf8334Smrg  CFLAGS=$FFLAGS
836784bf8334Smrg  compiler=$CC
836884bf8334Smrg  _LT_TAGVAR(compiler, $1)=$CC
836984bf8334Smrg  _LT_CC_BASENAME([$compiler])
837084bf8334Smrg  GCC=$G77
837184bf8334Smrg  if test -n "$compiler"; then
837284bf8334Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
837384bf8334Smrg    AC_MSG_RESULT([$can_build_shared])
8374fc27e79cSmrg
837584bf8334Smrg    AC_MSG_CHECKING([whether to build shared libraries])
837684bf8334Smrg    test "$can_build_shared" = "no" && enable_shared=no
8377fc27e79cSmrg
837884bf8334Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
837984bf8334Smrg    # are all built from PIC.
838084bf8334Smrg    case $host_os in
838184bf8334Smrg      aix3*)
838284bf8334Smrg        test "$enable_shared" = yes && enable_static=no
838384bf8334Smrg        if test -n "$RANLIB"; then
838484bf8334Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
838584bf8334Smrg          postinstall_cmds='$RANLIB $lib'
838684bf8334Smrg        fi
838784bf8334Smrg        ;;
838884bf8334Smrg      aix[[4-9]]*)
838984bf8334Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
839084bf8334Smrg	  test "$enable_shared" = yes && enable_static=no
839184bf8334Smrg	fi
839284bf8334Smrg        ;;
839384bf8334Smrg    esac
839484bf8334Smrg    AC_MSG_RESULT([$enable_shared])
8395fc27e79cSmrg
839684bf8334Smrg    AC_MSG_CHECKING([whether to build static libraries])
839784bf8334Smrg    # Make sure either enable_shared or enable_static is yes.
839884bf8334Smrg    test "$enable_shared" = yes || enable_static=yes
839984bf8334Smrg    AC_MSG_RESULT([$enable_static])
8400fc27e79cSmrg
840184bf8334Smrg    _LT_TAGVAR(GCC, $1)="$G77"
840284bf8334Smrg    _LT_TAGVAR(LD, $1)="$LD"
8403fc27e79cSmrg
840484bf8334Smrg    ## CAVEAT EMPTOR:
840584bf8334Smrg    ## There is no encapsulation within the following macros, do not change
840684bf8334Smrg    ## the running order or otherwise move them around unless you know exactly
840784bf8334Smrg    ## what you are doing...
840884bf8334Smrg    _LT_COMPILER_PIC($1)
840984bf8334Smrg    _LT_COMPILER_C_O($1)
841084bf8334Smrg    _LT_COMPILER_FILE_LOCKS($1)
841184bf8334Smrg    _LT_LINKER_SHLIBS($1)
841284bf8334Smrg    _LT_SYS_DYNAMIC_LINKER($1)
841384bf8334Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
8414fc27e79cSmrg
841584bf8334Smrg    _LT_CONFIG($1)
841684bf8334Smrg  fi # test -n "$compiler"
8417fc27e79cSmrg
841884bf8334Smrg  GCC=$lt_save_GCC
841984bf8334Smrg  CC="$lt_save_CC"
842084bf8334Smrg  CFLAGS="$lt_save_CFLAGS"
842184bf8334Smrgfi # test "$_lt_disable_F77" != yes
8422fc27e79cSmrg
842384bf8334SmrgAC_LANG_POP
842484bf8334Smrg])# _LT_LANG_F77_CONFIG
8425fc27e79cSmrg
8426fc27e79cSmrg
842784bf8334Smrg# _LT_LANG_FC_CONFIG([TAG])
842884bf8334Smrg# -------------------------
842984bf8334Smrg# Ensure that the configuration variables for a Fortran compiler are
843084bf8334Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
843184bf8334Smrg# to write the compiler configuration to `libtool'.
843284bf8334Smrgm4_defun([_LT_LANG_FC_CONFIG],
843384bf8334Smrg[AC_LANG_PUSH(Fortran)
8434fc27e79cSmrg
843584bf8334Smrgif test -z "$FC" || test "X$FC" = "Xno"; then
843684bf8334Smrg  _lt_disable_FC=yes
843784bf8334Smrgfi
8438fc27e79cSmrg
843984bf8334Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
844084bf8334Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
844184bf8334Smrg_LT_TAGVAR(always_export_symbols, $1)=no
844284bf8334Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
844384bf8334Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
844484bf8334Smrg_LT_TAGVAR(hardcode_direct, $1)=no
844584bf8334Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
844684bf8334Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
844784bf8334Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
844884bf8334Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
844984bf8334Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
845084bf8334Smrg_LT_TAGVAR(inherit_rpath, $1)=no
845184bf8334Smrg_LT_TAGVAR(module_cmds, $1)=
845284bf8334Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
845384bf8334Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
845484bf8334Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
845584bf8334Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
845684bf8334Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
845784bf8334Smrg_LT_TAGVAR(no_undefined_flag, $1)=
845884bf8334Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
845984bf8334Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8460fc27e79cSmrg
846184bf8334Smrg# Source file extension for fc test sources.
846284bf8334Smrgac_ext=${ac_fc_srcext-f}
8463b73be646Smrg
846484bf8334Smrg# Object file extension for compiled fc test sources.
846584bf8334Smrgobjext=o
846684bf8334Smrg_LT_TAGVAR(objext, $1)=$objext
8467fc27e79cSmrg
846884bf8334Smrg# No sense in running all these tests if we already determined that
846984bf8334Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
847084bf8334Smrg# are currently assumed to apply to all compilers on this platform,
847184bf8334Smrg# and will be corrupted by setting them based on a non-working compiler.
847284bf8334Smrgif test "$_lt_disable_FC" != yes; then
847384bf8334Smrg  # Code to be used in simple compile tests
847484bf8334Smrg  lt_simple_compile_test_code="\
847584bf8334Smrg      subroutine t
847684bf8334Smrg      return
847784bf8334Smrg      end
847884bf8334Smrg"
8479fc27e79cSmrg
848084bf8334Smrg  # Code to be used in simple link tests
848184bf8334Smrg  lt_simple_link_test_code="\
848284bf8334Smrg      program t
848384bf8334Smrg      end
848484bf8334Smrg"
8485fc27e79cSmrg
848684bf8334Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
848784bf8334Smrg  _LT_TAG_COMPILER
8488fc27e79cSmrg
848984bf8334Smrg  # save warnings/boilerplate of simple test code
849084bf8334Smrg  _LT_COMPILER_BOILERPLATE
849184bf8334Smrg  _LT_LINKER_BOILERPLATE
8492fc27e79cSmrg
849384bf8334Smrg  # Allow CC to be a program name with arguments.
849484bf8334Smrg  lt_save_CC="$CC"
849584bf8334Smrg  lt_save_GCC=$GCC
849684bf8334Smrg  lt_save_CFLAGS=$CFLAGS
849784bf8334Smrg  CC=${FC-"f95"}
849884bf8334Smrg  CFLAGS=$FCFLAGS
849984bf8334Smrg  compiler=$CC
850084bf8334Smrg  GCC=$ac_cv_fc_compiler_gnu
8501bd3a1963Smrg
850284bf8334Smrg  _LT_TAGVAR(compiler, $1)=$CC
850384bf8334Smrg  _LT_CC_BASENAME([$compiler])
8504fc27e79cSmrg
850584bf8334Smrg  if test -n "$compiler"; then
850684bf8334Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
850784bf8334Smrg    AC_MSG_RESULT([$can_build_shared])
8508fc27e79cSmrg
850984bf8334Smrg    AC_MSG_CHECKING([whether to build shared libraries])
851084bf8334Smrg    test "$can_build_shared" = "no" && enable_shared=no
8511fc27e79cSmrg
851284bf8334Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
851384bf8334Smrg    # are all built from PIC.
851484bf8334Smrg    case $host_os in
851584bf8334Smrg      aix3*)
851684bf8334Smrg        test "$enable_shared" = yes && enable_static=no
851784bf8334Smrg        if test -n "$RANLIB"; then
851884bf8334Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
851984bf8334Smrg          postinstall_cmds='$RANLIB $lib'
852084bf8334Smrg        fi
852184bf8334Smrg        ;;
852284bf8334Smrg      aix[[4-9]]*)
852384bf8334Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
852484bf8334Smrg	  test "$enable_shared" = yes && enable_static=no
852584bf8334Smrg	fi
852684bf8334Smrg        ;;
852784bf8334Smrg    esac
852884bf8334Smrg    AC_MSG_RESULT([$enable_shared])
8529fc27e79cSmrg
853084bf8334Smrg    AC_MSG_CHECKING([whether to build static libraries])
853184bf8334Smrg    # Make sure either enable_shared or enable_static is yes.
853284bf8334Smrg    test "$enable_shared" = yes || enable_static=yes
853384bf8334Smrg    AC_MSG_RESULT([$enable_static])
8534fc27e79cSmrg
853584bf8334Smrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
853684bf8334Smrg    _LT_TAGVAR(LD, $1)="$LD"
8537fc27e79cSmrg
853884bf8334Smrg    ## CAVEAT EMPTOR:
853984bf8334Smrg    ## There is no encapsulation within the following macros, do not change
854084bf8334Smrg    ## the running order or otherwise move them around unless you know exactly
854184bf8334Smrg    ## what you are doing...
854284bf8334Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
854384bf8334Smrg    _LT_COMPILER_PIC($1)
854484bf8334Smrg    _LT_COMPILER_C_O($1)
854584bf8334Smrg    _LT_COMPILER_FILE_LOCKS($1)
854684bf8334Smrg    _LT_LINKER_SHLIBS($1)
854784bf8334Smrg    _LT_SYS_DYNAMIC_LINKER($1)
854884bf8334Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
8549bd3a1963Smrg
855084bf8334Smrg    _LT_CONFIG($1)
855184bf8334Smrg  fi # test -n "$compiler"
8552fc27e79cSmrg
855384bf8334Smrg  GCC=$lt_save_GCC
855484bf8334Smrg  CC=$lt_save_CC
855584bf8334Smrg  CFLAGS=$lt_save_CFLAGS
855684bf8334Smrgfi # test "$_lt_disable_FC" != yes
8557fc27e79cSmrg
855884bf8334SmrgAC_LANG_POP
855984bf8334Smrg])# _LT_LANG_FC_CONFIG
8560fc27e79cSmrg
8561fc27e79cSmrg
856284bf8334Smrg# _LT_LANG_GCJ_CONFIG([TAG])
856384bf8334Smrg# --------------------------
856484bf8334Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
856584bf8334Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
856684bf8334Smrg# to write the compiler configuration to `libtool'.
856784bf8334Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
856884bf8334Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
856984bf8334SmrgAC_LANG_SAVE
8570fc27e79cSmrg
857184bf8334Smrg# Source file extension for Java test sources.
857284bf8334Smrgac_ext=java
8573fc27e79cSmrg
857484bf8334Smrg# Object file extension for compiled Java test sources.
857584bf8334Smrgobjext=o
857684bf8334Smrg_LT_TAGVAR(objext, $1)=$objext
8577fc27e79cSmrg
857884bf8334Smrg# Code to be used in simple compile tests
857984bf8334Smrglt_simple_compile_test_code="class foo {}"
8580a73597f9Smrg
858184bf8334Smrg# Code to be used in simple link tests
858284bf8334Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
8583fc27e79cSmrg
858484bf8334Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
858584bf8334Smrg_LT_TAG_COMPILER
8586fc27e79cSmrg
858784bf8334Smrg# save warnings/boilerplate of simple test code
858884bf8334Smrg_LT_COMPILER_BOILERPLATE
858984bf8334Smrg_LT_LINKER_BOILERPLATE
8590fc27e79cSmrg
859184bf8334Smrg# Allow CC to be a program name with arguments.
859284bf8334Smrglt_save_CC=$CC
859384bf8334Smrglt_save_CFLAGS=$CFLAGS
859484bf8334Smrglt_save_GCC=$GCC
859584bf8334SmrgGCC=yes
859684bf8334SmrgCC=${GCJ-"gcj"}
859784bf8334SmrgCFLAGS=$GCJFLAGS
859884bf8334Smrgcompiler=$CC
859984bf8334Smrg_LT_TAGVAR(compiler, $1)=$CC
860084bf8334Smrg_LT_TAGVAR(LD, $1)="$LD"
860184bf8334Smrg_LT_CC_BASENAME([$compiler])
8602fc27e79cSmrg
860384bf8334Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
860484bf8334Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8605fc27e79cSmrg
860684bf8334Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
860784bf8334Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
860884bf8334Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8609fc27e79cSmrg
861084bf8334Smrgif test -n "$compiler"; then
861184bf8334Smrg  _LT_COMPILER_NO_RTTI($1)
861284bf8334Smrg  _LT_COMPILER_PIC($1)
861384bf8334Smrg  _LT_COMPILER_C_O($1)
861484bf8334Smrg  _LT_COMPILER_FILE_LOCKS($1)
861584bf8334Smrg  _LT_LINKER_SHLIBS($1)
861684bf8334Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8617fc27e79cSmrg
861884bf8334Smrg  _LT_CONFIG($1)
861984bf8334Smrgfi
8620fc27e79cSmrg
862184bf8334SmrgAC_LANG_RESTORE
8622fc27e79cSmrg
862384bf8334SmrgGCC=$lt_save_GCC
862484bf8334SmrgCC=$lt_save_CC
862584bf8334SmrgCFLAGS=$lt_save_CFLAGS
862684bf8334Smrg])# _LT_LANG_GCJ_CONFIG
8627fc27e79cSmrg
8628fc27e79cSmrg
862984bf8334Smrg# _LT_LANG_GO_CONFIG([TAG])
863084bf8334Smrg# --------------------------
863184bf8334Smrg# Ensure that the configuration variables for the GNU Go compiler
863284bf8334Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
863384bf8334Smrg# to write the compiler configuration to `libtool'.
863484bf8334Smrgm4_defun([_LT_LANG_GO_CONFIG],
863584bf8334Smrg[AC_REQUIRE([LT_PROG_GO])dnl
863684bf8334SmrgAC_LANG_SAVE
8637fc27e79cSmrg
863884bf8334Smrg# Source file extension for Go test sources.
863984bf8334Smrgac_ext=go
8640fc27e79cSmrg
864184bf8334Smrg# Object file extension for compiled Go test sources.
864284bf8334Smrgobjext=o
864384bf8334Smrg_LT_TAGVAR(objext, $1)=$objext
8644b73be646Smrg
864584bf8334Smrg# Code to be used in simple compile tests
864684bf8334Smrglt_simple_compile_test_code="package main; func main() { }"
8647a73597f9Smrg
864884bf8334Smrg# Code to be used in simple link tests
864984bf8334Smrglt_simple_link_test_code='package main; func main() { }'
8650a73597f9Smrg
865184bf8334Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
865284bf8334Smrg_LT_TAG_COMPILER
8653b73be646Smrg
865484bf8334Smrg# save warnings/boilerplate of simple test code
865584bf8334Smrg_LT_COMPILER_BOILERPLATE
865684bf8334Smrg_LT_LINKER_BOILERPLATE
8657fc27e79cSmrg
865884bf8334Smrg# Allow CC to be a program name with arguments.
865984bf8334Smrglt_save_CC=$CC
866084bf8334Smrglt_save_CFLAGS=$CFLAGS
866184bf8334Smrglt_save_GCC=$GCC
866284bf8334SmrgGCC=yes
866384bf8334SmrgCC=${GOC-"gccgo"}
866484bf8334SmrgCFLAGS=$GOFLAGS
866584bf8334Smrgcompiler=$CC
866684bf8334Smrg_LT_TAGVAR(compiler, $1)=$CC
866784bf8334Smrg_LT_TAGVAR(LD, $1)="$LD"
866884bf8334Smrg_LT_CC_BASENAME([$compiler])
8669fc27e79cSmrg
867084bf8334Smrg# Go did not exist at the time GCC didn't implicitly link libc in.
867184bf8334Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8672fc27e79cSmrg
867384bf8334Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
867484bf8334Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
867584bf8334Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8676fc27e79cSmrg
867784bf8334Smrgif test -n "$compiler"; then
867884bf8334Smrg  _LT_COMPILER_NO_RTTI($1)
867984bf8334Smrg  _LT_COMPILER_PIC($1)
868084bf8334Smrg  _LT_COMPILER_C_O($1)
868184bf8334Smrg  _LT_COMPILER_FILE_LOCKS($1)
868284bf8334Smrg  _LT_LINKER_SHLIBS($1)
868384bf8334Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8684fc27e79cSmrg
868584bf8334Smrg  _LT_CONFIG($1)
868684bf8334Smrgfi
8687fc27e79cSmrg
868884bf8334SmrgAC_LANG_RESTORE
868984bf8334Smrg
869084bf8334SmrgGCC=$lt_save_GCC
869184bf8334SmrgCC=$lt_save_CC
869284bf8334SmrgCFLAGS=$lt_save_CFLAGS
869384bf8334Smrg])# _LT_LANG_GO_CONFIG
8694fc27e79cSmrg
8695fc27e79cSmrg
869684bf8334Smrg# _LT_LANG_RC_CONFIG([TAG])
869784bf8334Smrg# -------------------------
869884bf8334Smrg# Ensure that the configuration variables for the Windows resource compiler
869984bf8334Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
870084bf8334Smrg# to write the compiler configuration to `libtool'.
870184bf8334Smrgm4_defun([_LT_LANG_RC_CONFIG],
870284bf8334Smrg[AC_REQUIRE([LT_PROG_RC])dnl
870384bf8334SmrgAC_LANG_SAVE
8704fc27e79cSmrg
870584bf8334Smrg# Source file extension for RC test sources.
870684bf8334Smrgac_ext=rc
8707fc27e79cSmrg
870884bf8334Smrg# Object file extension for compiled RC test sources.
870984bf8334Smrgobjext=o
871084bf8334Smrg_LT_TAGVAR(objext, $1)=$objext
8711fc27e79cSmrg
871284bf8334Smrg# Code to be used in simple compile tests
871384bf8334Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8714fc27e79cSmrg
871584bf8334Smrg# Code to be used in simple link tests
871684bf8334Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
8717fc27e79cSmrg
871884bf8334Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
871984bf8334Smrg_LT_TAG_COMPILER
8720fc27e79cSmrg
872184bf8334Smrg# save warnings/boilerplate of simple test code
872284bf8334Smrg_LT_COMPILER_BOILERPLATE
872384bf8334Smrg_LT_LINKER_BOILERPLATE
8724fc27e79cSmrg
872584bf8334Smrg# Allow CC to be a program name with arguments.
872684bf8334Smrglt_save_CC="$CC"
872784bf8334Smrglt_save_CFLAGS=$CFLAGS
872884bf8334Smrglt_save_GCC=$GCC
872984bf8334SmrgGCC=
873084bf8334SmrgCC=${RC-"windres"}
873184bf8334SmrgCFLAGS=
873284bf8334Smrgcompiler=$CC
873384bf8334Smrg_LT_TAGVAR(compiler, $1)=$CC
873484bf8334Smrg_LT_CC_BASENAME([$compiler])
873584bf8334Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8736fc27e79cSmrg
873784bf8334Smrgif test -n "$compiler"; then
873884bf8334Smrg  :
873984bf8334Smrg  _LT_CONFIG($1)
874084bf8334Smrgfi
8741fc27e79cSmrg
874284bf8334SmrgGCC=$lt_save_GCC
874384bf8334SmrgAC_LANG_RESTORE
874484bf8334SmrgCC=$lt_save_CC
874584bf8334SmrgCFLAGS=$lt_save_CFLAGS
874684bf8334Smrg])# _LT_LANG_RC_CONFIG
8747fc27e79cSmrg
8748fc27e79cSmrg
874984bf8334Smrg# LT_PROG_GCJ
875084bf8334Smrg# -----------
875184bf8334SmrgAC_DEFUN([LT_PROG_GCJ],
875284bf8334Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
875384bf8334Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
875484bf8334Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
875584bf8334Smrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
875684bf8334Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
8757a73597f9Smrg])
8758a73597f9Smrg
875984bf8334Smrg# Old name:
876084bf8334SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
876184bf8334Smrgdnl aclocal-1.4 backwards compatibility:
876284bf8334Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8763fc27e79cSmrg
8764fc27e79cSmrg
876584bf8334Smrg# LT_PROG_GO
876684bf8334Smrg# ----------
876784bf8334SmrgAC_DEFUN([LT_PROG_GO],
876884bf8334Smrg[AC_CHECK_TOOL(GOC, gccgo,)
876984bf8334Smrg])
8770fc27e79cSmrg
8771fc27e79cSmrg
877284bf8334Smrg# LT_PROG_RC
877384bf8334Smrg# ----------
877484bf8334SmrgAC_DEFUN([LT_PROG_RC],
877584bf8334Smrg[AC_CHECK_TOOL(RC, windres,)
877684bf8334Smrg])
8777fc27e79cSmrg
877884bf8334Smrg# Old name:
877984bf8334SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
878084bf8334Smrgdnl aclocal-1.4 backwards compatibility:
878184bf8334Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
8782fc27e79cSmrg
8783fc27e79cSmrg
878484bf8334Smrg# _LT_DECL_EGREP
878584bf8334Smrg# --------------
878684bf8334Smrg# If we don't have a new enough Autoconf to choose the best grep
878784bf8334Smrg# available, choose the one first in the user's PATH.
878884bf8334Smrgm4_defun([_LT_DECL_EGREP],
878984bf8334Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
879084bf8334SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
879184bf8334Smrgtest -z "$GREP" && GREP=grep
879284bf8334Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
879384bf8334Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
879484bf8334Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
879584bf8334Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
879684bf8334SmrgAC_SUBST([GREP])
879784bf8334Smrg])
8798fc27e79cSmrg
8799a73597f9Smrg
880084bf8334Smrg# _LT_DECL_OBJDUMP
880184bf8334Smrg# --------------
880284bf8334Smrg# If we don't have a new enough Autoconf to choose the best objdump
880384bf8334Smrg# available, choose the one first in the user's PATH.
880484bf8334Smrgm4_defun([_LT_DECL_OBJDUMP],
880584bf8334Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
880684bf8334Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
880784bf8334Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
880884bf8334SmrgAC_SUBST([OBJDUMP])
880984bf8334Smrg])
8810fc27e79cSmrg
881184bf8334Smrg# _LT_DECL_DLLTOOL
881284bf8334Smrg# ----------------
881384bf8334Smrg# Ensure DLLTOOL variable is set.
881484bf8334Smrgm4_defun([_LT_DECL_DLLTOOL],
881584bf8334Smrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
881684bf8334Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
881784bf8334Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
881884bf8334SmrgAC_SUBST([DLLTOOL])
881984bf8334Smrg])
8820fc27e79cSmrg
882184bf8334Smrg# _LT_DECL_SED
882284bf8334Smrg# ------------
882384bf8334Smrg# Check for a fully-functional sed program, that truncates
882484bf8334Smrg# as few characters as possible.  Prefer GNU sed if found.
882584bf8334Smrgm4_defun([_LT_DECL_SED],
882684bf8334Smrg[AC_PROG_SED
882784bf8334Smrgtest -z "$SED" && SED=sed
882884bf8334SmrgXsed="$SED -e 1s/^X//"
882984bf8334Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
883084bf8334Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
883184bf8334Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
883284bf8334Smrg])# _LT_DECL_SED
8833fc27e79cSmrg
883484bf8334Smrgm4_ifndef([AC_PROG_SED], [
883584bf8334Smrg# NOTE: This macro has been submitted for inclusion into   #
883684bf8334Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
883784bf8334Smrg#  a released version of Autoconf we should remove this    #
883884bf8334Smrg#  macro and use it instead.                               #
8839bd3a1963Smrg
884084bf8334Smrgm4_defun([AC_PROG_SED],
884184bf8334Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
884284bf8334SmrgAC_CACHE_VAL(lt_cv_path_SED,
884384bf8334Smrg[# Loop through the user's path and test for sed and gsed.
884484bf8334Smrg# Then use that list of sed's as ones to test for truncation.
884584bf8334Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
884684bf8334Smrgfor as_dir in $PATH
884784bf8334Smrgdo
884884bf8334Smrg  IFS=$as_save_IFS
884984bf8334Smrg  test -z "$as_dir" && as_dir=.
885084bf8334Smrg  for lt_ac_prog in sed gsed; do
885184bf8334Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
885284bf8334Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
885384bf8334Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
885484bf8334Smrg      fi
885584bf8334Smrg    done
885684bf8334Smrg  done
885784bf8334Smrgdone
885884bf8334SmrgIFS=$as_save_IFS
885984bf8334Smrglt_ac_max=0
886084bf8334Smrglt_ac_count=0
886184bf8334Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
886284bf8334Smrg# along with /bin/sed that truncates output.
886384bf8334Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
886484bf8334Smrg  test ! -f $lt_ac_sed && continue
886584bf8334Smrg  cat /dev/null > conftest.in
886684bf8334Smrg  lt_ac_count=0
886784bf8334Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
886884bf8334Smrg  # Check for GNU sed and select it if it is found.
886984bf8334Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
887084bf8334Smrg    lt_cv_path_SED=$lt_ac_sed
887184bf8334Smrg    break
887284bf8334Smrg  fi
887384bf8334Smrg  while true; do
887484bf8334Smrg    cat conftest.in conftest.in >conftest.tmp
887584bf8334Smrg    mv conftest.tmp conftest.in
887684bf8334Smrg    cp conftest.in conftest.nl
887784bf8334Smrg    echo >>conftest.nl
887884bf8334Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
887984bf8334Smrg    cmp -s conftest.out conftest.nl || break
888084bf8334Smrg    # 10000 chars as input seems more than enough
888184bf8334Smrg    test $lt_ac_count -gt 10 && break
888284bf8334Smrg    lt_ac_count=`expr $lt_ac_count + 1`
888384bf8334Smrg    if test $lt_ac_count -gt $lt_ac_max; then
888484bf8334Smrg      lt_ac_max=$lt_ac_count
888584bf8334Smrg      lt_cv_path_SED=$lt_ac_sed
888684bf8334Smrg    fi
888784bf8334Smrg  done
888884bf8334Smrgdone
888984bf8334Smrg])
889084bf8334SmrgSED=$lt_cv_path_SED
889184bf8334SmrgAC_SUBST([SED])
889284bf8334SmrgAC_MSG_RESULT([$SED])
889384bf8334Smrg])#AC_PROG_SED
889484bf8334Smrg])#m4_ifndef
8895fc27e79cSmrg
889684bf8334Smrg# Old name:
889784bf8334SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
889884bf8334Smrgdnl aclocal-1.4 backwards compatibility:
889984bf8334Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
8900bd3a1963Smrg
8901bd3a1963Smrg
890284bf8334Smrg# _LT_CHECK_SHELL_FEATURES
890384bf8334Smrg# ------------------------
890484bf8334Smrg# Find out whether the shell is Bourne or XSI compatible,
890584bf8334Smrg# or has some other useful features.
890684bf8334Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
890784bf8334Smrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
890884bf8334Smrg# Try some XSI features
890984bf8334Smrgxsi_shell=no
891084bf8334Smrg( _lt_dummy="a/b/c"
891184bf8334Smrg  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
891284bf8334Smrg      = c,a/b,b/c, \
891384bf8334Smrg    && eval 'test $(( 1 + 1 )) -eq 2 \
891484bf8334Smrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
891584bf8334Smrg  && xsi_shell=yes
891684bf8334SmrgAC_MSG_RESULT([$xsi_shell])
891784bf8334Smrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
8918fc27e79cSmrg
891984bf8334SmrgAC_MSG_CHECKING([whether the shell understands "+="])
892084bf8334Smrglt_shell_append=no
892184bf8334Smrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
892284bf8334Smrg    >/dev/null 2>&1 \
892384bf8334Smrg  && lt_shell_append=yes
892484bf8334SmrgAC_MSG_RESULT([$lt_shell_append])
892584bf8334Smrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
8926fc27e79cSmrg
892784bf8334Smrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
892884bf8334Smrg  lt_unset=unset
8929a73597f9Smrgelse
893084bf8334Smrg  lt_unset=false
893184bf8334Smrgfi
893284bf8334Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
893384bf8334Smrg
893484bf8334Smrg# test EBCDIC or ASCII
893584bf8334Smrgcase `echo X|tr X '\101'` in
893684bf8334Smrg A) # ASCII based system
893784bf8334Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
893884bf8334Smrg  lt_SP2NL='tr \040 \012'
893984bf8334Smrg  lt_NL2SP='tr \015\012 \040\040'
894084bf8334Smrg  ;;
894184bf8334Smrg *) # EBCDIC based system
894284bf8334Smrg  lt_SP2NL='tr \100 \n'
894384bf8334Smrg  lt_NL2SP='tr \r\n \100\100'
894484bf8334Smrg  ;;
894584bf8334Smrgesac
894684bf8334Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
894784bf8334Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
894884bf8334Smrg])# _LT_CHECK_SHELL_FEATURES
8949fc27e79cSmrg
8950b73be646Smrg
895184bf8334Smrg# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
895284bf8334Smrg# ------------------------------------------------------
895384bf8334Smrg# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
895484bf8334Smrg# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
895584bf8334Smrgm4_defun([_LT_PROG_FUNCTION_REPLACE],
895684bf8334Smrg[dnl {
895784bf8334Smrgsed -e '/^$1 ()$/,/^} # $1 /c\
895884bf8334Smrg$1 ()\
895984bf8334Smrg{\
896084bf8334Smrgm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
896184bf8334Smrg} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
896284bf8334Smrg  && mv -f "$cfgfile.tmp" "$cfgfile" \
896384bf8334Smrg    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
896484bf8334Smrgtest 0 -eq $? || _lt_function_replace_fail=:
896584bf8334Smrg])
896684bf8334Smrg
896784bf8334Smrg
896884bf8334Smrg# _LT_PROG_REPLACE_SHELLFNS
8969a73597f9Smrg# -------------------------
897084bf8334Smrg# Replace existing portable implementations of several shell functions with
897184bf8334Smrg# equivalent extended shell implementations where those features are available..
897284bf8334Smrgm4_defun([_LT_PROG_REPLACE_SHELLFNS],
897384bf8334Smrg[if test x"$xsi_shell" = xyes; then
897484bf8334Smrg  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
897584bf8334Smrg    case ${1} in
897684bf8334Smrg      */*) func_dirname_result="${1%/*}${2}" ;;
897784bf8334Smrg      *  ) func_dirname_result="${3}" ;;
897884bf8334Smrg    esac])
8979fc27e79cSmrg
898084bf8334Smrg  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
898184bf8334Smrg    func_basename_result="${1##*/}"])
8982fc27e79cSmrg
898384bf8334Smrg  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
898484bf8334Smrg    case ${1} in
898584bf8334Smrg      */*) func_dirname_result="${1%/*}${2}" ;;
898684bf8334Smrg      *  ) func_dirname_result="${3}" ;;
898784bf8334Smrg    esac
898884bf8334Smrg    func_basename_result="${1##*/}"])
8989fc27e79cSmrg
899084bf8334Smrg  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
899184bf8334Smrg    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
899284bf8334Smrg    # positional parameters, so assign one to ordinary parameter first.
899384bf8334Smrg    func_stripname_result=${3}
899484bf8334Smrg    func_stripname_result=${func_stripname_result#"${1}"}
899584bf8334Smrg    func_stripname_result=${func_stripname_result%"${2}"}])
8996fc27e79cSmrg
899784bf8334Smrg  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
899884bf8334Smrg    func_split_long_opt_name=${1%%=*}
899984bf8334Smrg    func_split_long_opt_arg=${1#*=}])
9000fc27e79cSmrg
900184bf8334Smrg  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
900284bf8334Smrg    func_split_short_opt_arg=${1#??}
900384bf8334Smrg    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
9004fc27e79cSmrg
900584bf8334Smrg  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
900684bf8334Smrg    case ${1} in
900784bf8334Smrg      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
900884bf8334Smrg      *)    func_lo2o_result=${1} ;;
900984bf8334Smrg    esac])
9010fc27e79cSmrg
901184bf8334Smrg  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
9012fc27e79cSmrg
901384bf8334Smrg  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
9014fc27e79cSmrg
901584bf8334Smrg  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
9016a73597f9Smrgfi
9017fc27e79cSmrg
901884bf8334Smrgif test x"$lt_shell_append" = xyes; then
901984bf8334Smrg  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
9020fc27e79cSmrg
902184bf8334Smrg  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
902284bf8334Smrg    func_quote_for_eval "${2}"
902384bf8334Smrgdnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
902484bf8334Smrg    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
9025fc27e79cSmrg
902684bf8334Smrg  # Save a `func_append' function call where possible by direct use of '+='
902784bf8334Smrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
902884bf8334Smrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
902984bf8334Smrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
903084bf8334Smrg  test 0 -eq $? || _lt_function_replace_fail=:
903184bf8334Smrgelse
903284bf8334Smrg  # Save a `func_append' function call even when '+=' is not available
903384bf8334Smrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
903484bf8334Smrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
903584bf8334Smrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
903684bf8334Smrg  test 0 -eq $? || _lt_function_replace_fail=:
9037a73597f9Smrgfi
9038fc27e79cSmrg
903984bf8334Smrgif test x"$_lt_function_replace_fail" = x":"; then
904084bf8334Smrg  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
9041b73be646Smrgfi
904284bf8334Smrg])
9043fc27e79cSmrg
904484bf8334Smrg# _LT_PATH_CONVERSION_FUNCTIONS
904584bf8334Smrg# -----------------------------
904684bf8334Smrg# Determine which file name conversion functions should be used by
904784bf8334Smrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
904884bf8334Smrg# for certain cross-compile configurations and native mingw.
904984bf8334Smrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
905084bf8334Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
905184bf8334SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
905284bf8334SmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
905384bf8334SmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
905484bf8334Smrg[case $host in
905584bf8334Smrg  *-*-mingw* )
905684bf8334Smrg    case $build in
905784bf8334Smrg      *-*-mingw* ) # actually msys
905884bf8334Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
905984bf8334Smrg        ;;
906084bf8334Smrg      *-*-cygwin* )
906184bf8334Smrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
906284bf8334Smrg        ;;
906384bf8334Smrg      * ) # otherwise, assume *nix
906484bf8334Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
906584bf8334Smrg        ;;
906684bf8334Smrg    esac
906784bf8334Smrg    ;;
906884bf8334Smrg  *-*-cygwin* )
906984bf8334Smrg    case $build in
907084bf8334Smrg      *-*-mingw* ) # actually msys
907184bf8334Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
907284bf8334Smrg        ;;
907384bf8334Smrg      *-*-cygwin* )
907484bf8334Smrg        lt_cv_to_host_file_cmd=func_convert_file_noop
907584bf8334Smrg        ;;
907684bf8334Smrg      * ) # otherwise, assume *nix
907784bf8334Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
907884bf8334Smrg        ;;
907984bf8334Smrg    esac
908084bf8334Smrg    ;;
908184bf8334Smrg  * ) # unhandled hosts (and "normal" native builds)
908284bf8334Smrg    lt_cv_to_host_file_cmd=func_convert_file_noop
908384bf8334Smrg    ;;
908484bf8334Smrgesac
908584bf8334Smrg])
908684bf8334Smrgto_host_file_cmd=$lt_cv_to_host_file_cmd
908784bf8334SmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
908884bf8334Smrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
908984bf8334Smrg         [0], [convert $build file names to $host format])dnl
9090fc27e79cSmrg
909184bf8334SmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
909284bf8334SmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
909384bf8334Smrg[#assume ordinary cross tools, or native build.
909484bf8334Smrglt_cv_to_tool_file_cmd=func_convert_file_noop
909584bf8334Smrgcase $host in
909684bf8334Smrg  *-*-mingw* )
909784bf8334Smrg    case $build in
909884bf8334Smrg      *-*-mingw* ) # actually msys
909984bf8334Smrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
910084bf8334Smrg        ;;
910184bf8334Smrg    esac
910284bf8334Smrg    ;;
910384bf8334Smrgesac
910484bf8334Smrg])
910584bf8334Smrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
910684bf8334SmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
910784bf8334Smrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
910884bf8334Smrg         [0], [convert $build files to toolchain format])dnl
910984bf8334Smrg])# _LT_PATH_CONVERSION_FUNCTIONS
9110a73597f9Smrg
911184bf8334Smrg# Helper functions for option handling.                    -*- Autoconf -*-
9112a73597f9Smrg#
911384bf8334Smrg#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
911484bf8334Smrg#   Inc.
911584bf8334Smrg#   Written by Gary V. Vaughan, 2004
911684bf8334Smrg#
911784bf8334Smrg# This file is free software; the Free Software Foundation gives
911884bf8334Smrg# unlimited permission to copy and/or distribute it, with or without
911984bf8334Smrg# modifications, as long as this notice is preserved.
9120fc27e79cSmrg
912184bf8334Smrg# serial 7 ltoptions.m4
9122fc27e79cSmrg
912384bf8334Smrg# This is to help aclocal find these macros, as it can't see m4_define.
912484bf8334SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
9125fc27e79cSmrg
9126fc27e79cSmrg
912784bf8334Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
912884bf8334Smrg# ------------------------------------------
912984bf8334Smrgm4_define([_LT_MANGLE_OPTION],
913084bf8334Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
9131fc27e79cSmrg
9132fc27e79cSmrg
913384bf8334Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
913484bf8334Smrg# ---------------------------------------
913584bf8334Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
913684bf8334Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
913784bf8334Smrg# saved as a flag.
913884bf8334Smrgm4_define([_LT_SET_OPTION],
913984bf8334Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
914084bf8334Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
914184bf8334Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
914284bf8334Smrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
914384bf8334Smrg])
9144fc27e79cSmrg
9145fc27e79cSmrg
914684bf8334Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
914784bf8334Smrg# ------------------------------------------------------------
914884bf8334Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
914984bf8334Smrgm4_define([_LT_IF_OPTION],
915084bf8334Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
9151fc27e79cSmrg
9152fc27e79cSmrg
915384bf8334Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
915484bf8334Smrg# -------------------------------------------------------
915584bf8334Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
915684bf8334Smrg# are set.
915784bf8334Smrgm4_define([_LT_UNLESS_OPTIONS],
915884bf8334Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
915984bf8334Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
916084bf8334Smrg		      [m4_define([$0_found])])])[]dnl
916184bf8334Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
916284bf8334Smrg])[]dnl
916384bf8334Smrg])
9164fc27e79cSmrg
9165b73be646Smrg
916684bf8334Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
916784bf8334Smrg# ----------------------------------------
916884bf8334Smrg# OPTION-LIST is a space-separated list of Libtool options associated
916984bf8334Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
917084bf8334Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
917184bf8334Smrg# the unknown option and exit.
917284bf8334Smrgm4_defun([_LT_SET_OPTIONS],
917384bf8334Smrg[# Set options
917484bf8334Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
917584bf8334Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
9176b73be646Smrg
917784bf8334Smrgm4_if([$1],[LT_INIT],[
917884bf8334Smrg  dnl
917984bf8334Smrg  dnl Simply set some default values (i.e off) if boolean options were not
918084bf8334Smrg  dnl specified:
918184bf8334Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
918284bf8334Smrg  ])
918384bf8334Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
918484bf8334Smrg  ])
918584bf8334Smrg  dnl
918684bf8334Smrg  dnl If no reference was made to various pairs of opposing options, then
918784bf8334Smrg  dnl we run the default mode handler for the pair.  For example, if neither
918884bf8334Smrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
918984bf8334Smrg  dnl archives by default:
919084bf8334Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
919184bf8334Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
919284bf8334Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
919384bf8334Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
919484bf8334Smrg  		   [_LT_ENABLE_FAST_INSTALL])
919584bf8334Smrg  ])
919684bf8334Smrg])# _LT_SET_OPTIONS
9197b73be646Smrg
9198b73be646Smrg
9199b73be646Smrg
920084bf8334Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
920184bf8334Smrg# -----------------------------------------
920284bf8334Smrgm4_define([_LT_MANGLE_DEFUN],
920384bf8334Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
9204bd3a1963Smrg
9205fc27e79cSmrg
920684bf8334Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
920784bf8334Smrg# -----------------------------------------------
920884bf8334Smrgm4_define([LT_OPTION_DEFINE],
920984bf8334Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
921084bf8334Smrg])# LT_OPTION_DEFINE
9211fc27e79cSmrg
9212fc27e79cSmrg
921384bf8334Smrg# dlopen
921484bf8334Smrg# ------
921584bf8334SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
921684bf8334Smrg])
9217fc27e79cSmrg
921884bf8334SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
921984bf8334Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
922084bf8334SmrgAC_DIAGNOSE([obsolete],
922184bf8334Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
922284bf8334Smrgput the `dlopen' option into LT_INIT's first parameter.])
922384bf8334Smrg])
9224fc27e79cSmrg
922584bf8334Smrgdnl aclocal-1.4 backwards compatibility:
922684bf8334Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
9227fc27e79cSmrg
9228fc27e79cSmrg
922984bf8334Smrg# win32-dll
923084bf8334Smrg# ---------
923184bf8334Smrg# Declare package support for building win32 dll's.
923284bf8334SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
923384bf8334Smrg[enable_win32_dll=yes
923484bf8334Smrg
923584bf8334Smrgcase $host in
923684bf8334Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
923784bf8334Smrg  AC_CHECK_TOOL(AS, as, false)
923884bf8334Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
923984bf8334Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
924084bf8334Smrg  ;;
924184bf8334Smrgesac
924284bf8334Smrg
924384bf8334Smrgtest -z "$AS" && AS=as
924484bf8334Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
924584bf8334Smrg
924684bf8334Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
924784bf8334Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
9248fc27e79cSmrg
924984bf8334Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
925084bf8334Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
925184bf8334Smrg])# win32-dll
9252b73be646Smrg
925384bf8334SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
925484bf8334Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
925584bf8334Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
925684bf8334SmrgAC_DIAGNOSE([obsolete],
925784bf8334Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
925884bf8334Smrgput the `win32-dll' option into LT_INIT's first parameter.])
925984bf8334Smrg])
9260b73be646Smrg
926184bf8334Smrgdnl aclocal-1.4 backwards compatibility:
926284bf8334Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
9263fc27e79cSmrg
9264fc27e79cSmrg
926584bf8334Smrg# _LT_ENABLE_SHARED([DEFAULT])
926684bf8334Smrg# ----------------------------
926784bf8334Smrg# implement the --enable-shared flag, and supports the `shared' and
926884bf8334Smrg# `disable-shared' LT_INIT options.
926984bf8334Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
927084bf8334Smrgm4_define([_LT_ENABLE_SHARED],
927184bf8334Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
927284bf8334SmrgAC_ARG_ENABLE([shared],
927384bf8334Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
927484bf8334Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
927584bf8334Smrg    [p=${PACKAGE-default}
927684bf8334Smrg    case $enableval in
927784bf8334Smrg    yes) enable_shared=yes ;;
927884bf8334Smrg    no) enable_shared=no ;;
927984bf8334Smrg    *)
928084bf8334Smrg      enable_shared=no
928184bf8334Smrg      # Look at the argument we got.  We use all the common list separators.
928284bf8334Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
928384bf8334Smrg      for pkg in $enableval; do
928484bf8334Smrg	IFS="$lt_save_ifs"
928584bf8334Smrg	if test "X$pkg" = "X$p"; then
928684bf8334Smrg	  enable_shared=yes
928784bf8334Smrg	fi
928884bf8334Smrg      done
928984bf8334Smrg      IFS="$lt_save_ifs"
929084bf8334Smrg      ;;
929184bf8334Smrg    esac],
929284bf8334Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
9293fc27e79cSmrg
929484bf8334Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
929584bf8334Smrg	[Whether or not to build shared libraries])
929684bf8334Smrg])# _LT_ENABLE_SHARED
9297fc27e79cSmrg
929884bf8334SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
929984bf8334SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
9300fc27e79cSmrg
930184bf8334Smrg# Old names:
930284bf8334SmrgAC_DEFUN([AC_ENABLE_SHARED],
930384bf8334Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
930484bf8334Smrg])
9305fc27e79cSmrg
930684bf8334SmrgAC_DEFUN([AC_DISABLE_SHARED],
930784bf8334Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
930884bf8334Smrg])
930984bf8334Smrg
931084bf8334SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
931184bf8334SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
931284bf8334Smrg
931384bf8334Smrgdnl aclocal-1.4 backwards compatibility:
931484bf8334Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
931584bf8334Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
931684bf8334Smrg
931784bf8334Smrg
931884bf8334Smrg
931984bf8334Smrg# _LT_ENABLE_STATIC([DEFAULT])
932084bf8334Smrg# ----------------------------
932184bf8334Smrg# implement the --enable-static flag, and support the `static' and
932284bf8334Smrg# `disable-static' LT_INIT options.
932384bf8334Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
932484bf8334Smrgm4_define([_LT_ENABLE_STATIC],
932584bf8334Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
932684bf8334SmrgAC_ARG_ENABLE([static],
932784bf8334Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
932884bf8334Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
932984bf8334Smrg    [p=${PACKAGE-default}
933084bf8334Smrg    case $enableval in
933184bf8334Smrg    yes) enable_static=yes ;;
933284bf8334Smrg    no) enable_static=no ;;
933384bf8334Smrg    *)
933484bf8334Smrg     enable_static=no
933584bf8334Smrg      # Look at the argument we got.  We use all the common list separators.
933684bf8334Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
933784bf8334Smrg      for pkg in $enableval; do
933884bf8334Smrg	IFS="$lt_save_ifs"
933984bf8334Smrg	if test "X$pkg" = "X$p"; then
934084bf8334Smrg	  enable_static=yes
934184bf8334Smrg	fi
934284bf8334Smrg      done
934384bf8334Smrg      IFS="$lt_save_ifs"
934484bf8334Smrg      ;;
934584bf8334Smrg    esac],
934684bf8334Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
9347fc27e79cSmrg
934884bf8334Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
934984bf8334Smrg	[Whether or not to build static libraries])
935084bf8334Smrg])# _LT_ENABLE_STATIC
9351fc27e79cSmrg
935284bf8334SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
935384bf8334SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
9354fc27e79cSmrg
935584bf8334Smrg# Old names:
935684bf8334SmrgAC_DEFUN([AC_ENABLE_STATIC],
935784bf8334Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
935884bf8334Smrg])
9359fc27e79cSmrg
936084bf8334SmrgAC_DEFUN([AC_DISABLE_STATIC],
936184bf8334Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
936284bf8334Smrg])
9363fc27e79cSmrg
936484bf8334SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
936584bf8334SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
9366fc27e79cSmrg
936784bf8334Smrgdnl aclocal-1.4 backwards compatibility:
936884bf8334Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
936984bf8334Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
937084bf8334Smrg
937184bf8334Smrg
937284bf8334Smrg
937384bf8334Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
937484bf8334Smrg# ----------------------------------
937584bf8334Smrg# implement the --enable-fast-install flag, and support the `fast-install'
937684bf8334Smrg# and `disable-fast-install' LT_INIT options.
937784bf8334Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
937884bf8334Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
937984bf8334Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
938084bf8334SmrgAC_ARG_ENABLE([fast-install],
938184bf8334Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
938284bf8334Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
938384bf8334Smrg    [p=${PACKAGE-default}
938484bf8334Smrg    case $enableval in
938584bf8334Smrg    yes) enable_fast_install=yes ;;
938684bf8334Smrg    no) enable_fast_install=no ;;
938784bf8334Smrg    *)
938884bf8334Smrg      enable_fast_install=no
938984bf8334Smrg      # Look at the argument we got.  We use all the common list separators.
939084bf8334Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
939184bf8334Smrg      for pkg in $enableval; do
939284bf8334Smrg	IFS="$lt_save_ifs"
939384bf8334Smrg	if test "X$pkg" = "X$p"; then
939484bf8334Smrg	  enable_fast_install=yes
939584bf8334Smrg	fi
939684bf8334Smrg      done
939784bf8334Smrg      IFS="$lt_save_ifs"
939884bf8334Smrg      ;;
939984bf8334Smrg    esac],
940084bf8334Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
940184bf8334Smrg
940284bf8334Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
940384bf8334Smrg	 [Whether or not to optimize for fast installation])dnl
940484bf8334Smrg])# _LT_ENABLE_FAST_INSTALL
940584bf8334Smrg
940684bf8334SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
940784bf8334SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
940884bf8334Smrg
940984bf8334Smrg# Old names:
941084bf8334SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
941184bf8334Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
941284bf8334SmrgAC_DIAGNOSE([obsolete],
941384bf8334Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
941484bf8334Smrgthe `fast-install' option into LT_INIT's first parameter.])
941584bf8334Smrg])
941684bf8334Smrg
941784bf8334SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
941884bf8334Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
941984bf8334SmrgAC_DIAGNOSE([obsolete],
942084bf8334Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
942184bf8334Smrgthe `disable-fast-install' option into LT_INIT's first parameter.])
942284bf8334Smrg])
9423fc27e79cSmrg
942484bf8334Smrgdnl aclocal-1.4 backwards compatibility:
942584bf8334Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
942684bf8334Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
9427fc27e79cSmrg
9428fc27e79cSmrg
942984bf8334Smrg# _LT_WITH_PIC([MODE])
943084bf8334Smrg# --------------------
943184bf8334Smrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
943284bf8334Smrg# LT_INIT options.
943384bf8334Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
943484bf8334Smrgm4_define([_LT_WITH_PIC],
943584bf8334Smrg[AC_ARG_WITH([pic],
943684bf8334Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
943784bf8334Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
943884bf8334Smrg    [lt_p=${PACKAGE-default}
943984bf8334Smrg    case $withval in
944084bf8334Smrg    yes|no) pic_mode=$withval ;;
944184bf8334Smrg    *)
944284bf8334Smrg      pic_mode=default
944384bf8334Smrg      # Look at the argument we got.  We use all the common list separators.
944484bf8334Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
944584bf8334Smrg      for lt_pkg in $withval; do
944684bf8334Smrg	IFS="$lt_save_ifs"
944784bf8334Smrg	if test "X$lt_pkg" = "X$lt_p"; then
944884bf8334Smrg	  pic_mode=yes
944984bf8334Smrg	fi
945084bf8334Smrg      done
945184bf8334Smrg      IFS="$lt_save_ifs"
945284bf8334Smrg      ;;
945384bf8334Smrg    esac],
945484bf8334Smrg    [pic_mode=default])
9455fc27e79cSmrg
945684bf8334Smrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
9457fc27e79cSmrg
945884bf8334Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
945984bf8334Smrg])# _LT_WITH_PIC
9460fc27e79cSmrg
946184bf8334SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
946284bf8334SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
9463a73597f9Smrg
946484bf8334Smrg# Old name:
946584bf8334SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
946684bf8334Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
946784bf8334SmrgAC_DIAGNOSE([obsolete],
946884bf8334Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
946984bf8334Smrgput the `pic-only' option into LT_INIT's first parameter.])
947084bf8334Smrg])
9471fc27e79cSmrg
947284bf8334Smrgdnl aclocal-1.4 backwards compatibility:
947384bf8334Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
9474fc27e79cSmrg
9475fc27e79cSmrg
947684bf8334Smrgm4_define([_LTDL_MODE], [])
947784bf8334SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
947884bf8334Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
947984bf8334SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
948084bf8334Smrg		 [m4_define([_LTDL_MODE], [recursive])])
948184bf8334SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
948284bf8334Smrg		 [m4_define([_LTDL_MODE], [subproject])])
948384bf8334Smrg
948484bf8334Smrgm4_define([_LTDL_TYPE], [])
948584bf8334SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
948684bf8334Smrg		 [m4_define([_LTDL_TYPE], [installable])])
948784bf8334SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
948884bf8334Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
9489fc27e79cSmrg
949084bf8334Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
9491a73597f9Smrg#
949284bf8334Smrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
949384bf8334Smrg# Written by Gary V. Vaughan, 2004
9494a73597f9Smrg#
949584bf8334Smrg# This file is free software; the Free Software Foundation gives
949684bf8334Smrg# unlimited permission to copy and/or distribute it, with or without
949784bf8334Smrg# modifications, as long as this notice is preserved.
94986aab59a7Smrg
949984bf8334Smrg# serial 6 ltsugar.m4
9500fc27e79cSmrg
950184bf8334Smrg# This is to help aclocal find these macros, as it can't see m4_define.
950284bf8334SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
950384bf8334Smrg
950484bf8334Smrg
950584bf8334Smrg# lt_join(SEP, ARG1, [ARG2...])
950684bf8334Smrg# -----------------------------
950784bf8334Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
950884bf8334Smrg# associated separator.
950984bf8334Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
951084bf8334Smrg# versions in m4sugar had bugs.
951184bf8334Smrgm4_define([lt_join],
951284bf8334Smrg[m4_if([$#], [1], [],
951384bf8334Smrg       [$#], [2], [[$2]],
951484bf8334Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
951584bf8334Smrgm4_define([_lt_join],
951684bf8334Smrg[m4_if([$#$2], [2], [],
951784bf8334Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
951884bf8334Smrg
951984bf8334Smrg
952084bf8334Smrg# lt_car(LIST)
952184bf8334Smrg# lt_cdr(LIST)
952284bf8334Smrg# ------------
952384bf8334Smrg# Manipulate m4 lists.
952484bf8334Smrg# These macros are necessary as long as will still need to support
952584bf8334Smrg# Autoconf-2.59 which quotes differently.
952684bf8334Smrgm4_define([lt_car], [[$1]])
952784bf8334Smrgm4_define([lt_cdr],
952884bf8334Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
952984bf8334Smrg       [$#], 1, [],
953084bf8334Smrg       [m4_dquote(m4_shift($@))])])
953184bf8334Smrgm4_define([lt_unquote], $1)
953284bf8334Smrg
953384bf8334Smrg
953484bf8334Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
953584bf8334Smrg# ------------------------------------------
953684bf8334Smrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
953784bf8334Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
953884bf8334Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
953984bf8334Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
954084bf8334Smrg# than defined and empty).
9541a73597f9Smrg#
954284bf8334Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
954384bf8334Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
954484bf8334Smrgm4_define([lt_append],
954584bf8334Smrg[m4_define([$1],
954684bf8334Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
9547659607e0Smrg
9548659607e0Smrg
9549659607e0Smrg
955084bf8334Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
955184bf8334Smrg# ----------------------------------------------------------
955284bf8334Smrg# Produce a SEP delimited list of all paired combinations of elements of
955384bf8334Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
955484bf8334Smrg# has the form PREFIXmINFIXSUFFIXn.
955584bf8334Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
955684bf8334Smrgm4_define([lt_combine],
955784bf8334Smrg[m4_if(m4_eval([$# > 3]), [1],
955884bf8334Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
955984bf8334Smrg[[m4_foreach([_Lt_prefix], [$2],
956084bf8334Smrg	     [m4_foreach([_Lt_suffix],
956184bf8334Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
956284bf8334Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
956384bf8334Smrg
956484bf8334Smrg
956584bf8334Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
956684bf8334Smrg# -----------------------------------------------------------------------
956784bf8334Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
956884bf8334Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
956984bf8334Smrgm4_define([lt_if_append_uniq],
957084bf8334Smrg[m4_ifdef([$1],
957184bf8334Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
957284bf8334Smrg		 [lt_append([$1], [$2], [$3])$4],
957384bf8334Smrg		 [$5])],
957484bf8334Smrg	  [lt_append([$1], [$2], [$3])$4])])
957584bf8334Smrg
957684bf8334Smrg
957784bf8334Smrg# lt_dict_add(DICT, KEY, VALUE)
957884bf8334Smrg# -----------------------------
957984bf8334Smrgm4_define([lt_dict_add],
958084bf8334Smrg[m4_define([$1($2)], [$3])])
958184bf8334Smrg
958284bf8334Smrg
958384bf8334Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
958484bf8334Smrg# --------------------------------------------
958584bf8334Smrgm4_define([lt_dict_add_subkey],
958684bf8334Smrg[m4_define([$1($2:$3)], [$4])])
958784bf8334Smrg
958884bf8334Smrg
958984bf8334Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
959084bf8334Smrg# ----------------------------------
959184bf8334Smrgm4_define([lt_dict_fetch],
959284bf8334Smrg[m4_ifval([$3],
959384bf8334Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
959484bf8334Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
959584bf8334Smrg
959684bf8334Smrg
959784bf8334Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
959884bf8334Smrg# -----------------------------------------------------------------
959984bf8334Smrgm4_define([lt_if_dict_fetch],
960084bf8334Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
960184bf8334Smrg	[$5],
960284bf8334Smrg    [$6])])
9603659607e0Smrg
9604659607e0Smrg
960584bf8334Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
960684bf8334Smrg# --------------------------------------------------------------
960784bf8334Smrgm4_define([lt_dict_filter],
960884bf8334Smrg[m4_if([$5], [], [],
960984bf8334Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
961084bf8334Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
961184bf8334Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
961284bf8334Smrg])
9613b73be646Smrg
961484bf8334Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
9615a73597f9Smrg#
961684bf8334Smrg#   Copyright (C) 2004 Free Software Foundation, Inc.
961784bf8334Smrg#   Written by Scott James Remnant, 2004
9618a73597f9Smrg#
961984bf8334Smrg# This file is free software; the Free Software Foundation gives
962084bf8334Smrg# unlimited permission to copy and/or distribute it, with or without
962184bf8334Smrg# modifications, as long as this notice is preserved.
9622659607e0Smrg
962384bf8334Smrg# @configure_input@
962484bf8334Smrg
962584bf8334Smrg# serial 3337 ltversion.m4
962684bf8334Smrg# This file is part of GNU Libtool
962784bf8334Smrg
962884bf8334Smrgm4_define([LT_PACKAGE_VERSION], [2.4.2])
962984bf8334Smrgm4_define([LT_PACKAGE_REVISION], [1.3337])
963084bf8334Smrg
963184bf8334SmrgAC_DEFUN([LTVERSION_VERSION],
963284bf8334Smrg[macro_version='2.4.2'
963384bf8334Smrgmacro_revision='1.3337'
963484bf8334Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
963584bf8334Smrg_LT_DECL(, macro_revision, 0)
963684bf8334Smrg])
963784bf8334Smrg
963884bf8334Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
9639a73597f9Smrg#
964084bf8334Smrg#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
964184bf8334Smrg#   Written by Scott James Remnant, 2004.
9642a73597f9Smrg#
964384bf8334Smrg# This file is free software; the Free Software Foundation gives
964484bf8334Smrg# unlimited permission to copy and/or distribute it, with or without
964584bf8334Smrg# modifications, as long as this notice is preserved.
964684bf8334Smrg
964784bf8334Smrg# serial 5 lt~obsolete.m4
964884bf8334Smrg
964984bf8334Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
9650a73597f9Smrg#
965184bf8334Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
965284bf8334Smrg# which have later been changed to m4_define as they aren't part of the
965384bf8334Smrg# exported API, or moved to Autoconf or Automake where they belong.
9654a73597f9Smrg#
965584bf8334Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
965684bf8334Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
965784bf8334Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
965884bf8334Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
965984bf8334Smrg# and doesn't know about Autoconf macros at all.)
9660a73597f9Smrg#
966184bf8334Smrg# So we provide this file, which has a silly filename so it's always
966284bf8334Smrg# included after everything else.  This provides aclocal with the
966384bf8334Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
966484bf8334Smrg# because those macros already exist, or will be overwritten later.
966584bf8334Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
9666a73597f9Smrg#
966784bf8334Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
966884bf8334Smrg# Yes, that means every name once taken will need to remain here until
966984bf8334Smrg# we give up compatibility with versions before 1.7, at which point
967084bf8334Smrg# we need to keep only those names which we still refer to.
967184bf8334Smrg
967284bf8334Smrg# This is to help aclocal find these macros, as it can't see m4_define.
967384bf8334SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
967484bf8334Smrg
967584bf8334Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
967684bf8334Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
967784bf8334Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
967884bf8334Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
967984bf8334Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
968084bf8334Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
968184bf8334Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
968284bf8334Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
968384bf8334Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
968484bf8334Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
968584bf8334Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
968684bf8334Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
968784bf8334Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
968884bf8334Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
968984bf8334Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
969084bf8334Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
969184bf8334Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
969284bf8334Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
969384bf8334Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
969484bf8334Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
969584bf8334Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
969684bf8334Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
969784bf8334Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
969884bf8334Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
969984bf8334Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
970084bf8334Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
970184bf8334Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
970284bf8334Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
970384bf8334Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
970484bf8334Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
970584bf8334Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
970684bf8334Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
970784bf8334Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
970884bf8334Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
970984bf8334Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
971084bf8334Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
971184bf8334Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
971284bf8334Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
971384bf8334Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
971484bf8334Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
971584bf8334Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
971684bf8334Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
971784bf8334Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
971884bf8334Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
971984bf8334Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
972084bf8334Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
972184bf8334Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
972284bf8334Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
972384bf8334Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
972484bf8334Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
972584bf8334Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
972684bf8334Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
972784bf8334Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
972884bf8334Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
972984bf8334Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
973084bf8334Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
973184bf8334Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
973284bf8334Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
973384bf8334Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
973484bf8334Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
973584bf8334Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
973684bf8334Smrg
973784bf8334Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
973884bf8334Smrg# 
973984bf8334Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
9740a73597f9Smrg#
974184bf8334Smrg# This program is free software; you can redistribute it and/or modify
974284bf8334Smrg# it under the terms of the GNU General Public License as published by
974384bf8334Smrg# the Free Software Foundation; either version 2 of the License, or
974484bf8334Smrg# (at your option) any later version.
9745a73597f9Smrg#
974684bf8334Smrg# This program is distributed in the hope that it will be useful, but
974784bf8334Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
974884bf8334Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
974984bf8334Smrg# General Public License for more details.
9750a73597f9Smrg#
975184bf8334Smrg# You should have received a copy of the GNU General Public License
975284bf8334Smrg# along with this program; if not, write to the Free Software
975384bf8334Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
9754a73597f9Smrg#
975584bf8334Smrg# As a special exception to the GNU General Public License, if you
975684bf8334Smrg# distribute this file as part of a program that contains a
975784bf8334Smrg# configuration script generated by Autoconf, you may include it under
975884bf8334Smrg# the same distribution terms that you use for the rest of that program.
975984bf8334Smrg
976084bf8334Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
976184bf8334Smrg# ----------------------------------
976284bf8334SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
976384bf8334Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
976484bf8334Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
976584bf8334SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
976684bf8334Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
976784bf8334Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
976884bf8334Smrgfi
976984bf8334Smrgif test -n "$PKG_CONFIG"; then
977084bf8334Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
977184bf8334Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
977284bf8334Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
977384bf8334Smrg		AC_MSG_RESULT([yes])
977484bf8334Smrg	else
977584bf8334Smrg		AC_MSG_RESULT([no])
977684bf8334Smrg		PKG_CONFIG=""
977784bf8334Smrg	fi
977884bf8334Smrg		
977984bf8334Smrgfi[]dnl
978084bf8334Smrg])# PKG_PROG_PKG_CONFIG
978184bf8334Smrg
978284bf8334Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
978384bf8334Smrg#
978484bf8334Smrg# Check to see whether a particular set of modules exists.  Similar
978584bf8334Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
978684bf8334Smrg#
978784bf8334Smrg#
978884bf8334Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
978984bf8334Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
979084bf8334Smrg# PKG_CHECK_EXISTS manually
979184bf8334Smrg# --------------------------------------------------------------
979284bf8334SmrgAC_DEFUN([PKG_CHECK_EXISTS],
979384bf8334Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
979484bf8334Smrgif test -n "$PKG_CONFIG" && \
979584bf8334Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
979684bf8334Smrg  m4_ifval([$2], [$2], [:])
979784bf8334Smrgm4_ifvaln([$3], [else
979884bf8334Smrg  $3])dnl
979984bf8334Smrgfi])
980084bf8334Smrg
980184bf8334Smrg
980284bf8334Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
980384bf8334Smrg# ---------------------------------------------
980484bf8334Smrgm4_define([_PKG_CONFIG],
980584bf8334Smrg[if test -n "$$1"; then
980684bf8334Smrg    pkg_cv_[]$1="$$1"
980784bf8334Smrg elif test -n "$PKG_CONFIG"; then
980884bf8334Smrg    PKG_CHECK_EXISTS([$3],
980984bf8334Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
981084bf8334Smrg		     [pkg_failed=yes])
981184bf8334Smrg else
981284bf8334Smrg    pkg_failed=untried
981384bf8334Smrgfi[]dnl
981484bf8334Smrg])# _PKG_CONFIG
981584bf8334Smrg
981684bf8334Smrg# _PKG_SHORT_ERRORS_SUPPORTED
981784bf8334Smrg# -----------------------------
981884bf8334SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
981984bf8334Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
982084bf8334Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
982184bf8334Smrg        _pkg_short_errors_supported=yes
9822a73597f9Smrgelse
982384bf8334Smrg        _pkg_short_errors_supported=no
982484bf8334Smrgfi[]dnl
982584bf8334Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
9826659607e0Smrg
982784bf8334Smrg
982884bf8334Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
982984bf8334Smrg# [ACTION-IF-NOT-FOUND])
9830a73597f9Smrg#
9831a73597f9Smrg#
983284bf8334Smrg# Note that if there is a possibility the first call to
983384bf8334Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
983484bf8334Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
9835a73597f9Smrg#
9836a73597f9Smrg#
983784bf8334Smrg# --------------------------------------------------------------
983884bf8334SmrgAC_DEFUN([PKG_CHECK_MODULES],
983984bf8334Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
984084bf8334SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
984184bf8334SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
9842fc27e79cSmrg
984384bf8334Smrgpkg_failed=no
984484bf8334SmrgAC_MSG_CHECKING([for $1])
9845fc27e79cSmrg
984684bf8334Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
984784bf8334Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
9848fc27e79cSmrg
984984bf8334Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
985084bf8334Smrgand $1[]_LIBS to avoid the need to call pkg-config.
985184bf8334SmrgSee the pkg-config man page for more details.])
9852fc27e79cSmrg
985384bf8334Smrgif test $pkg_failed = yes; then
985484bf8334Smrg        _PKG_SHORT_ERRORS_SUPPORTED
985584bf8334Smrg        if test $_pkg_short_errors_supported = yes; then
985684bf8334Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
985784bf8334Smrg        else 
985884bf8334Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
985984bf8334Smrg        fi
986084bf8334Smrg	# Put the nasty error message in config.log where it belongs
986184bf8334Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
9862b73be646Smrg
986384bf8334Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
986484bf8334Smrg[Package requirements ($2) were not met:
9865fc27e79cSmrg
986684bf8334Smrg$$1_PKG_ERRORS
986784bf8334Smrg
986884bf8334SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
986984bf8334Smrginstalled software in a non-standard prefix.
987084bf8334Smrg
987184bf8334Smrg_PKG_TEXT
9872a73597f9Smrg])],
987384bf8334Smrg		[AC_MSG_RESULT([no])
987484bf8334Smrg                $4])
987584bf8334Smrgelif test $pkg_failed = untried; then
987684bf8334Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
987784bf8334Smrg[The pkg-config script could not be found or is too old.  Make sure it
987884bf8334Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
987984bf8334Smrgpath to pkg-config.
9880fc27e79cSmrg
988184bf8334Smrg_PKG_TEXT
988284bf8334Smrg
988384bf8334SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
988484bf8334Smrg		[$4])
9885a73597f9Smrgelse
988684bf8334Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
988784bf8334Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
988884bf8334Smrg        AC_MSG_RESULT([yes])
988984bf8334Smrg	ifelse([$3], , :, [$3])
989084bf8334Smrgfi[]dnl
989184bf8334Smrg])# PKG_CHECK_MODULES
9892fc27e79cSmrg
989384bf8334Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
989484bf8334Smrgdnl
989584bf8334Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
989684bf8334Smrgdnl
989784bf8334Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
989884bf8334Smrgdnl copy of this software and associated documentation files (the "Software"),
989984bf8334Smrgdnl to deal in the Software without restriction, including without limitation
990084bf8334Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
990184bf8334Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
990284bf8334Smrgdnl Software is furnished to do so, subject to the following conditions:
990384bf8334Smrgdnl
990484bf8334Smrgdnl The above copyright notice and this permission notice (including the next
990584bf8334Smrgdnl paragraph) shall be included in all copies or substantial portions of the
990684bf8334Smrgdnl Software.
990784bf8334Smrgdnl
990884bf8334Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
990984bf8334Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
991084bf8334Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
991184bf8334Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
991284bf8334Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
991384bf8334Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
991484bf8334Smrgdnl DEALINGS IN THE SOFTWARE.
9915fc27e79cSmrg
991684bf8334Smrg# XORG_MACROS_VERSION(required-version)
991784bf8334Smrg# -------------------------------------
9918a73597f9Smrg# Minimum version: 1.1.0
9919a73597f9Smrg#
992084bf8334Smrg# If you're using a macro added in Version 1.1 or newer, include this in
992184bf8334Smrg# your configure.ac with the minimum required version, such as:
992284bf8334Smrg# XORG_MACROS_VERSION(1.1)
9923a73597f9Smrg#
992484bf8334Smrg# To ensure that this macro is defined, also add:
992584bf8334Smrg# m4_ifndef([XORG_MACROS_VERSION],
992684bf8334Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9927a73597f9Smrg#
9928a73597f9Smrg#
992984bf8334Smrg# See the "minimum version" comment for each macro you use to see what
993084bf8334Smrg# version you require.
993184bf8334Smrgm4_defun([XORG_MACROS_VERSION],[
993284bf8334Smrgm4_define([vers_have], [1.19.0])
993384bf8334Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
993484bf8334Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
993584bf8334Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
993684bf8334Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
993784bf8334Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
993884bf8334Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
993984bf8334Smrgm4_undefine([vers_have])
994084bf8334Smrgm4_undefine([maj_have])
994184bf8334Smrgm4_undefine([maj_needed])
994284bf8334Smrg]) # XORG_MACROS_VERSION
994384bf8334Smrg
994484bf8334Smrg# XORG_PROG_RAWCPP()
994584bf8334Smrg# ------------------
994684bf8334Smrg# Minimum version: 1.0.0
994784bf8334Smrg#
994884bf8334Smrg# Find cpp program and necessary flags for use in pre-processing text files
994984bf8334Smrg# such as man pages and config files
995084bf8334SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
995184bf8334SmrgAC_REQUIRE([AC_PROG_CPP])
995284bf8334SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
995384bf8334Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
995484bf8334Smrg
995584bf8334Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
995684bf8334Smrg# which is not the best choice for supporting other OS'es, but covers most
995784bf8334Smrg# of the ones we need for now.
995884bf8334SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
995984bf8334SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
996084bf8334Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
996184bf8334Smrg	AC_MSG_RESULT([no])
996284bf8334Smrgelse
996384bf8334Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
996484bf8334Smrg		RAWCPPFLAGS=-undef
996584bf8334Smrg		AC_MSG_RESULT([yes])
996684bf8334Smrg	# under Cygwin unix is still defined even with -undef
996784bf8334Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
996884bf8334Smrg		RAWCPPFLAGS="-undef -ansi"
996984bf8334Smrg		AC_MSG_RESULT([yes, with -ansi])
997084bf8334Smrg	else
997184bf8334Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
997284bf8334Smrg	fi
997384bf8334Smrgfi
997484bf8334Smrgrm -f conftest.$ac_ext
997584bf8334Smrg
997684bf8334SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
997784bf8334SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
997884bf8334Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
997984bf8334Smrg	AC_MSG_RESULT([no])
998084bf8334Smrgelse
998184bf8334Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
998284bf8334Smrg		TRADITIONALCPPFLAGS="-traditional"
998384bf8334Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
998484bf8334Smrg		AC_MSG_RESULT([yes])
998584bf8334Smrg	else
998684bf8334Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
998784bf8334Smrg	fi
998884bf8334Smrgfi
998984bf8334Smrgrm -f conftest.$ac_ext
999084bf8334SmrgAC_SUBST(RAWCPPFLAGS)
999184bf8334SmrgAC_SUBST(TRADITIONALCPPFLAGS)
999284bf8334Smrg]) # XORG_PROG_RAWCPP
999384bf8334Smrg
999484bf8334Smrg# XORG_MANPAGE_SECTIONS()
999584bf8334Smrg# -----------------------
999684bf8334Smrg# Minimum version: 1.0.0
9997a73597f9Smrg#
999884bf8334Smrg# Determine which sections man pages go in for the different man page types
999984bf8334Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1000084bf8334Smrg# Not sure if there's any better way than just hardcoding by OS name.
1000184bf8334Smrg# Override default settings by setting environment variables
1000284bf8334Smrg# Added MAN_SUBSTS in version 1.8
1000384bf8334Smrg# Added AC_PROG_SED in version 1.8
10004fc27e79cSmrg
1000584bf8334SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1000684bf8334SmrgAC_REQUIRE([AC_CANONICAL_HOST])
1000784bf8334SmrgAC_REQUIRE([AC_PROG_SED])
10008fc27e79cSmrg
1000984bf8334Smrgif test x$APP_MAN_SUFFIX = x    ; then
1001084bf8334Smrg    APP_MAN_SUFFIX=1
1001184bf8334Smrgfi
1001284bf8334Smrgif test x$APP_MAN_DIR = x    ; then
1001384bf8334Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1001484bf8334Smrgfi
10015fc27e79cSmrg
1001684bf8334Smrgif test x$LIB_MAN_SUFFIX = x    ; then
1001784bf8334Smrg    LIB_MAN_SUFFIX=3
1001884bf8334Smrgfi
1001984bf8334Smrgif test x$LIB_MAN_DIR = x    ; then
1002084bf8334Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
10021a73597f9Smrgfi
10022fc27e79cSmrg
1002384bf8334Smrgif test x$FILE_MAN_SUFFIX = x    ; then
1002484bf8334Smrg    case $host_os in
1002584bf8334Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
1002684bf8334Smrg	*)		FILE_MAN_SUFFIX=5  ;;
1002784bf8334Smrg    esac
1002884bf8334Smrgfi
1002984bf8334Smrgif test x$FILE_MAN_DIR = x    ; then
1003084bf8334Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
10031a73597f9Smrgfi
10032fc27e79cSmrg
1003384bf8334Smrgif test x$MISC_MAN_SUFFIX = x    ; then
1003484bf8334Smrg    case $host_os in
1003584bf8334Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
1003684bf8334Smrg	*)		MISC_MAN_SUFFIX=7  ;;
1003784bf8334Smrg    esac
1003884bf8334Smrgfi
1003984bf8334Smrgif test x$MISC_MAN_DIR = x    ; then
1004084bf8334Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1004184bf8334Smrgfi
10042fc27e79cSmrg
1004384bf8334Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1004484bf8334Smrg    case $host_os in
1004584bf8334Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
1004684bf8334Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
1004784bf8334Smrg    esac
1004884bf8334Smrgfi
1004984bf8334Smrgif test x$DRIVER_MAN_DIR = x    ; then
1005084bf8334Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1005184bf8334Smrgfi
10052fc27e79cSmrg
1005384bf8334Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1005484bf8334Smrg    case $host_os in
1005584bf8334Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
1005684bf8334Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
1005784bf8334Smrg    esac
1005884bf8334Smrgfi
1005984bf8334Smrgif test x$ADMIN_MAN_DIR = x    ; then
1006084bf8334Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1006184bf8334Smrgfi
10062fc27e79cSmrg
10063a73597f9Smrg
1006484bf8334SmrgAC_SUBST([APP_MAN_SUFFIX])
1006584bf8334SmrgAC_SUBST([LIB_MAN_SUFFIX])
1006684bf8334SmrgAC_SUBST([FILE_MAN_SUFFIX])
1006784bf8334SmrgAC_SUBST([MISC_MAN_SUFFIX])
1006884bf8334SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1006984bf8334SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1007084bf8334SmrgAC_SUBST([APP_MAN_DIR])
1007184bf8334SmrgAC_SUBST([LIB_MAN_DIR])
1007284bf8334SmrgAC_SUBST([FILE_MAN_DIR])
1007384bf8334SmrgAC_SUBST([MISC_MAN_DIR])
1007484bf8334SmrgAC_SUBST([DRIVER_MAN_DIR])
1007584bf8334SmrgAC_SUBST([ADMIN_MAN_DIR])
10076b73be646Smrg
1007784bf8334SmrgXORG_MAN_PAGE="X Version 11"
1007884bf8334SmrgAC_SUBST([XORG_MAN_PAGE])
1007984bf8334SmrgMAN_SUBSTS="\
1008084bf8334Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1008184bf8334Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1008284bf8334Smrg	-e 's|__xservername__|Xorg|g' \
1008384bf8334Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
1008484bf8334Smrg	-e 's|__projectroot__|\$(prefix)|g' \
1008584bf8334Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
1008684bf8334Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
1008784bf8334Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
1008884bf8334Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
1008984bf8334Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
1009084bf8334Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
1009184bf8334Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
1009284bf8334SmrgAC_SUBST([MAN_SUBSTS])
10093fc27e79cSmrg
1009484bf8334Smrg]) # XORG_MANPAGE_SECTIONS
10095fc27e79cSmrg
1009684bf8334Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
1009784bf8334Smrg# ------------------------
1009884bf8334Smrg# Minimum version: 1.7.0
10099a73597f9Smrg#
1010084bf8334Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
1010184bf8334Smrg# provided by xorg-sgml-doctools, if installed.
1010284bf8334SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
1010384bf8334SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
1010484bf8334SmrgXORG_SGML_PATH=
1010584bf8334SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
1010684bf8334Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
1010784bf8334Smrg    [m4_ifval([$1],[:],
1010884bf8334Smrg        [if test x"$cross_compiling" != x"yes" ; then
1010984bf8334Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1011084bf8334Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
1011184bf8334Smrg         fi])
1011284bf8334Smrg    ])
10113659607e0Smrg
1011484bf8334Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
1011584bf8334Smrg# the path and the name of the doc stylesheet
1011684bf8334Smrgif test "x$XORG_SGML_PATH" != "x" ; then
1011784bf8334Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
1011884bf8334Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
1011984bf8334Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1012084bf8334Smrgelse
1012184bf8334Smrg   AC_MSG_RESULT([no])
1012284bf8334Smrgfi
10123a73597f9Smrg
1012484bf8334SmrgAC_SUBST(XORG_SGML_PATH)
1012584bf8334SmrgAC_SUBST(STYLESHEET_SRCDIR)
1012684bf8334SmrgAC_SUBST(XSL_STYLESHEET)
1012784bf8334SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
1012884bf8334Smrg]) # XORG_CHECK_SGML_DOCTOOLS
10129a73597f9Smrg
1013084bf8334Smrg# XORG_CHECK_LINUXDOC
1013184bf8334Smrg# -------------------
1013284bf8334Smrg# Minimum version: 1.0.0
1013384bf8334Smrg#
1013484bf8334Smrg# Defines the variable MAKE_TEXT if the necessary tools and
1013584bf8334Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1013684bf8334Smrg# Whether or not the necessary tools and files are found can be checked
1013784bf8334Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1013884bf8334SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1013984bf8334SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1014084bf8334SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
10141659607e0Smrg
1014284bf8334SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
10143a73597f9Smrg
1014484bf8334SmrgAC_MSG_CHECKING([whether to build documentation])
10145bd3a1963Smrg
1014684bf8334Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
1014784bf8334Smrg   BUILDDOC=yes
1014884bf8334Smrgelse
1014984bf8334Smrg   BUILDDOC=no
10150a73597f9Smrgfi
10151bd3a1963Smrg
1015284bf8334SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
10153a73597f9Smrg
1015484bf8334SmrgAC_MSG_RESULT([$BUILDDOC])
10155a73597f9Smrg
1015684bf8334SmrgAC_MSG_CHECKING([whether to build pdf documentation])
10157a73597f9Smrg
1015884bf8334Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
1015984bf8334Smrg   BUILDPDFDOC=yes
1016084bf8334Smrgelse
1016184bf8334Smrg   BUILDPDFDOC=no
1016284bf8334Smrgfi
10163a73597f9Smrg
1016484bf8334SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10165a73597f9Smrg
1016684bf8334SmrgAC_MSG_RESULT([$BUILDPDFDOC])
10167659607e0Smrg
1016884bf8334SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1016984bf8334SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1017084bf8334SmrgMAKE_PDF="$PS2PDF"
1017184bf8334SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1017284bf8334Smrg
1017384bf8334SmrgAC_SUBST(MAKE_TEXT)
1017484bf8334SmrgAC_SUBST(MAKE_PS)
1017584bf8334SmrgAC_SUBST(MAKE_PDF)
1017684bf8334SmrgAC_SUBST(MAKE_HTML)
1017784bf8334Smrg]) # XORG_CHECK_LINUXDOC
1017884bf8334Smrg
1017984bf8334Smrg# XORG_CHECK_DOCBOOK
1018084bf8334Smrg# -------------------
1018184bf8334Smrg# Minimum version: 1.0.0
10182a73597f9Smrg#
1018384bf8334Smrg# Checks for the ability to build output formats from SGML DocBook source.
1018484bf8334Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1018584bf8334Smrg# indicates whether the necessary tools and files are found and, if set,
1018684bf8334Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1018784bf8334SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1018884bf8334SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10189659607e0Smrg
1019084bf8334SmrgBUILDTXTDOC=no
1019184bf8334SmrgBUILDPDFDOC=no
1019284bf8334SmrgBUILDPSDOC=no
1019384bf8334SmrgBUILDHTMLDOC=no
10194a73597f9Smrg
1019584bf8334SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1019684bf8334SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1019784bf8334SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1019884bf8334SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1019984bf8334Smrg
1020084bf8334SmrgAC_MSG_CHECKING([whether to build text documentation])
1020184bf8334Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1020284bf8334Smrg   test x$BUILD_TXTDOC != xno; then
1020384bf8334Smrg	BUILDTXTDOC=yes
10204a73597f9Smrgfi
1020584bf8334SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1020684bf8334SmrgAC_MSG_RESULT([$BUILDTXTDOC])
10207659607e0Smrg
1020884bf8334SmrgAC_MSG_CHECKING([whether to build PDF documentation])
1020984bf8334Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1021084bf8334Smrg   test x$BUILD_PDFDOC != xno; then
1021184bf8334Smrg	BUILDPDFDOC=yes
1021284bf8334Smrgfi
1021384bf8334SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1021484bf8334SmrgAC_MSG_RESULT([$BUILDPDFDOC])
10215a73597f9Smrg
1021684bf8334SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
1021784bf8334Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1021884bf8334Smrg   test x$BUILD_PSDOC != xno; then
1021984bf8334Smrg	BUILDPSDOC=yes
1022084bf8334Smrgfi
1022184bf8334SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1022284bf8334SmrgAC_MSG_RESULT([$BUILDPSDOC])
10223659607e0Smrg
1022484bf8334SmrgAC_MSG_CHECKING([whether to build HTML documentation])
1022584bf8334Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1022684bf8334Smrg   test x$BUILD_HTMLDOC != xno; then
1022784bf8334Smrg	BUILDHTMLDOC=yes
1022884bf8334Smrgfi
1022984bf8334SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1023084bf8334SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
10231a73597f9Smrg
1023284bf8334SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1023384bf8334SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1023484bf8334SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1023584bf8334SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
10236a73597f9Smrg
1023784bf8334SmrgAC_SUBST(MAKE_TEXT)
1023884bf8334SmrgAC_SUBST(MAKE_PS)
1023984bf8334SmrgAC_SUBST(MAKE_PDF)
1024084bf8334SmrgAC_SUBST(MAKE_HTML)
1024184bf8334Smrg]) # XORG_CHECK_DOCBOOK
10242a73597f9Smrg
1024384bf8334Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
1024484bf8334Smrg# ----------------
1024584bf8334Smrg# Minimum version: 1.5.0
1024684bf8334Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1024784bf8334Smrg#
1024884bf8334Smrg# Documentation tools are not always available on all platforms and sometimes
1024984bf8334Smrg# not at the appropriate level. This macro enables a module to test for the
1025084bf8334Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1025184bf8334Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
1025284bf8334Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
1025384bf8334Smrg# --with-xmlto assumes 'auto'.
1025484bf8334Smrg#
1025584bf8334Smrg# Interface to module:
1025684bf8334Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
1025784bf8334Smrg# XMLTO:	returns the path of the xmlto program found
1025884bf8334Smrg#		returns the path set by the user in the environment
1025984bf8334Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
1026084bf8334Smrg#		'no' user instructs the module not to use xmlto
1026184bf8334Smrg#
1026284bf8334Smrg# Added in version 1.10.0
1026384bf8334Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
1026484bf8334Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
1026584bf8334Smrg#
1026684bf8334Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
1026784bf8334Smrg#
1026884bf8334SmrgAC_DEFUN([XORG_WITH_XMLTO],[
1026984bf8334SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
1027084bf8334Smrgm4_define([_defopt], m4_default([$2], [auto]))
1027184bf8334SmrgAC_ARG_WITH(xmlto,
1027284bf8334Smrg	AS_HELP_STRING([--with-xmlto],
1027384bf8334Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
1027484bf8334Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
1027584bf8334Smrgm4_undefine([_defopt])
1027684bf8334Smrg
1027784bf8334Smrgif test "x$use_xmlto" = x"auto"; then
1027884bf8334Smrg   AC_PATH_PROG([XMLTO], [xmlto])
1027984bf8334Smrg   if test "x$XMLTO" = "x"; then
1028084bf8334Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
1028184bf8334Smrg	have_xmlto=no
1028284bf8334Smrg   else
1028384bf8334Smrg        have_xmlto=yes
1028484bf8334Smrg   fi
1028584bf8334Smrgelif test "x$use_xmlto" = x"yes" ; then
1028684bf8334Smrg   AC_PATH_PROG([XMLTO], [xmlto])
1028784bf8334Smrg   if test "x$XMLTO" = "x"; then
1028884bf8334Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
1028984bf8334Smrg   fi
1029084bf8334Smrg   have_xmlto=yes
1029184bf8334Smrgelif test "x$use_xmlto" = x"no" ; then
1029284bf8334Smrg   if test "x$XMLTO" != "x"; then
1029384bf8334Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
1029484bf8334Smrg   fi
1029584bf8334Smrg   have_xmlto=no
10296a73597f9Smrgelse
1029784bf8334Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
10298a73597f9Smrgfi
10299659607e0Smrg
1030084bf8334Smrg# Test for a minimum version of xmlto, if provided.
1030184bf8334Smrgm4_ifval([$1],
1030284bf8334Smrg[if test "$have_xmlto" = yes; then
1030384bf8334Smrg    # scrape the xmlto version
1030484bf8334Smrg    AC_MSG_CHECKING([the xmlto version])
1030584bf8334Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
1030684bf8334Smrg    AC_MSG_RESULT([$xmlto_version])
1030784bf8334Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
1030884bf8334Smrg        [if test "x$use_xmlto" = xauto; then
1030984bf8334Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
1031084bf8334Smrg            have_xmlto=no
1031184bf8334Smrg        else
1031284bf8334Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
1031384bf8334Smrg        fi])
1031484bf8334Smrgfi])
10315b73be646Smrg
1031684bf8334Smrg# Test for the ability of xmlto to generate a text target
1031784bf8334Smrghave_xmlto_text=no
1031884bf8334Smrgcat > conftest.xml << "EOF"
1031984bf8334SmrgEOF
1032084bf8334SmrgAS_IF([test "$have_xmlto" = yes],
1032184bf8334Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1032284bf8334Smrg             [have_xmlto_text=yes],
1032384bf8334Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
1032484bf8334Smrgrm -f conftest.xml
1032584bf8334SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
1032684bf8334SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
1032784bf8334Smrg]) # XORG_WITH_XMLTO
1032884bf8334Smrg
1032984bf8334Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
1033084bf8334Smrg# --------------------------------------------
1033184bf8334Smrg# Minimum version: 1.12.0
1033284bf8334Smrg# Minimum version for optional DEFAULT argument: 1.12.0
10333a73597f9Smrg#
1033484bf8334Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
1033584bf8334Smrg# XML-based language used for the transformation of XML documents.
1033684bf8334Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
1033784bf8334Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
1033884bf8334Smrg# The XSLT processor is often used as a standalone tool for transformations.
1033984bf8334Smrg# It should not be assumed that this tool is used only to work with documnetation.
1034084bf8334Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
10341a73597f9Smrg#
1034284bf8334Smrg# Interface to module:
1034384bf8334Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
1034484bf8334Smrg# XSLTPROC:	 returns the path of the xsltproc program found
1034584bf8334Smrg#		 returns the path set by the user in the environment
1034684bf8334Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
1034784bf8334Smrg#		  'no' user instructs the module not to use xsltproc
1034884bf8334Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
10349a73597f9Smrg#
1035084bf8334Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
10351a73597f9Smrg#
1035284bf8334SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
1035384bf8334SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
1035484bf8334Smrg# Preserves the interface, should it be implemented later
1035584bf8334Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
1035684bf8334Smrgm4_define([_defopt], m4_default([$2], [auto]))
1035784bf8334SmrgAC_ARG_WITH(xsltproc,
1035884bf8334Smrg	AS_HELP_STRING([--with-xsltproc],
1035984bf8334Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
1036084bf8334Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
1036184bf8334Smrgm4_undefine([_defopt])
10362a73597f9Smrg
1036384bf8334Smrgif test "x$use_xsltproc" = x"auto"; then
1036484bf8334Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
1036584bf8334Smrg   if test "x$XSLTPROC" = "x"; then
1036684bf8334Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
1036784bf8334Smrg	have_xsltproc=no
1036884bf8334Smrg   else
1036984bf8334Smrg        have_xsltproc=yes
1037084bf8334Smrg   fi
1037184bf8334Smrgelif test "x$use_xsltproc" = x"yes" ; then
1037284bf8334Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
1037384bf8334Smrg   if test "x$XSLTPROC" = "x"; then
1037484bf8334Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
1037584bf8334Smrg   fi
1037684bf8334Smrg   have_xsltproc=yes
1037784bf8334Smrgelif test "x$use_xsltproc" = x"no" ; then
1037884bf8334Smrg   if test "x$XSLTPROC" != "x"; then
1037984bf8334Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
1038084bf8334Smrg   fi
1038184bf8334Smrg   have_xsltproc=no
1038284bf8334Smrgelse
1038384bf8334Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
10384bd3a1963Smrgfi
10385fc27e79cSmrg
1038684bf8334SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
1038784bf8334Smrg]) # XORG_WITH_XSLTPROC
1038884bf8334Smrg
1038984bf8334Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
1039084bf8334Smrg# ----------------------------------------
1039184bf8334Smrg# Minimum version: 1.15.0
10392a73597f9Smrg#
1039384bf8334Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
1039484bf8334Smrg# scanning arbitrary text files, extracting information from those text files,
1039584bf8334Smrg# and printing reports based on that information.
10396a73597f9Smrg#
1039784bf8334Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
10398a73597f9Smrg#
1039984bf8334Smrg# Interface to module:
1040084bf8334Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
1040184bf8334Smrg# PERL:	     returns the path of the perl program found
1040284bf8334Smrg#	     returns the path set by the user in the environment
1040384bf8334Smrg# --with-perl: 'yes' user instructs the module to use perl
1040484bf8334Smrg#	       'no' user instructs the module not to use perl
1040584bf8334Smrg# have_perl: returns yes if perl found in PATH or no
10406a73597f9Smrg#
1040784bf8334Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
1040884bf8334Smrg#
1040984bf8334SmrgAC_DEFUN([XORG_WITH_PERL],[
1041084bf8334SmrgAC_ARG_VAR([PERL], [Path to perl command])
1041184bf8334Smrg# Preserves the interface, should it be implemented later
1041284bf8334Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
1041384bf8334Smrgm4_define([_defopt], m4_default([$2], [auto]))
1041484bf8334SmrgAC_ARG_WITH(perl,
1041584bf8334Smrg	AS_HELP_STRING([--with-perl],
1041684bf8334Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
1041784bf8334Smrg	   [use_perl=$withval], [use_perl=]_defopt)
1041884bf8334Smrgm4_undefine([_defopt])
1041984bf8334Smrg
1042084bf8334Smrgif test "x$use_perl" = x"auto"; then
1042184bf8334Smrg   AC_PATH_PROG([PERL], [perl])
1042284bf8334Smrg   if test "x$PERL" = "x"; then
1042384bf8334Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
1042484bf8334Smrg	have_perl=no
1042584bf8334Smrg   else
1042684bf8334Smrg        have_perl=yes
1042784bf8334Smrg   fi
1042884bf8334Smrgelif test "x$use_perl" = x"yes" ; then
1042984bf8334Smrg   AC_PATH_PROG([PERL], [perl])
1043084bf8334Smrg   if test "x$PERL" = "x"; then
1043184bf8334Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
1043284bf8334Smrg   fi
1043384bf8334Smrg   have_perl=yes
1043484bf8334Smrgelif test "x$use_perl" = x"no" ; then
1043584bf8334Smrg   if test "x$PERL" != "x"; then
1043684bf8334Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
1043784bf8334Smrg   fi
1043884bf8334Smrg   have_perl=no
1043984bf8334Smrgelse
1044084bf8334Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
1044184bf8334Smrgfi
10442bd3a1963Smrg
1044384bf8334SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
1044484bf8334Smrg]) # XORG_WITH_PERL
104456aab59a7Smrg
1044684bf8334Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
10447a73597f9Smrg# ----------------
1044884bf8334Smrg# Minimum version: 1.5.0
1044984bf8334Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10450fc27e79cSmrg#
1045184bf8334Smrg# Documentation tools are not always available on all platforms and sometimes
1045284bf8334Smrg# not at the appropriate level. This macro enables a module to test for the
1045384bf8334Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1045484bf8334Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
1045584bf8334Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
1045684bf8334Smrg# --with-asciidoc assumes 'auto'.
10457b73be646Smrg#
1045884bf8334Smrg# Interface to module:
1045984bf8334Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
1046084bf8334Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
1046184bf8334Smrg#		 returns the path set by the user in the environment
1046284bf8334Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
1046384bf8334Smrg#		  'no' user instructs the module not to use asciidoc
10464a73597f9Smrg#
1046584bf8334Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
10466a73597f9Smrg#
1046784bf8334SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
1046884bf8334SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
1046984bf8334Smrgm4_define([_defopt], m4_default([$2], [auto]))
1047084bf8334SmrgAC_ARG_WITH(asciidoc,
1047184bf8334Smrg	AS_HELP_STRING([--with-asciidoc],
1047284bf8334Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
1047384bf8334Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
1047484bf8334Smrgm4_undefine([_defopt])
10475659607e0Smrg
1047684bf8334Smrgif test "x$use_asciidoc" = x"auto"; then
1047784bf8334Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1047884bf8334Smrg   if test "x$ASCIIDOC" = "x"; then
1047984bf8334Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
1048084bf8334Smrg	have_asciidoc=no
1048184bf8334Smrg   else
1048284bf8334Smrg        have_asciidoc=yes
1048384bf8334Smrg   fi
1048484bf8334Smrgelif test "x$use_asciidoc" = x"yes" ; then
1048584bf8334Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1048684bf8334Smrg   if test "x$ASCIIDOC" = "x"; then
1048784bf8334Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
1048884bf8334Smrg   fi
1048984bf8334Smrg   have_asciidoc=yes
1049084bf8334Smrgelif test "x$use_asciidoc" = x"no" ; then
1049184bf8334Smrg   if test "x$ASCIIDOC" != "x"; then
1049284bf8334Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
1049384bf8334Smrg   fi
1049484bf8334Smrg   have_asciidoc=no
1049584bf8334Smrgelse
1049684bf8334Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
1049784bf8334Smrgfi
1049884bf8334Smrgm4_ifval([$1],
1049984bf8334Smrg[if test "$have_asciidoc" = yes; then
1050084bf8334Smrg    # scrape the asciidoc version
1050184bf8334Smrg    AC_MSG_CHECKING([the asciidoc version])
1050284bf8334Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
1050384bf8334Smrg    AC_MSG_RESULT([$asciidoc_version])
1050484bf8334Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
1050584bf8334Smrg        [if test "x$use_asciidoc" = xauto; then
1050684bf8334Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
1050784bf8334Smrg            have_asciidoc=no
1050884bf8334Smrg        else
1050984bf8334Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
1051084bf8334Smrg        fi])
1051184bf8334Smrgfi])
1051284bf8334SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
1051384bf8334Smrg]) # XORG_WITH_ASCIIDOC
10514659607e0Smrg
1051584bf8334Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
1051684bf8334Smrg# -------------------------------------------
1051784bf8334Smrg# Minimum version: 1.5.0
1051884bf8334Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1051984bf8334Smrg# Minimum version for optional DOT checking: 1.18.0
1052084bf8334Smrg#
1052184bf8334Smrg# Documentation tools are not always available on all platforms and sometimes
1052284bf8334Smrg# not at the appropriate level. This macro enables a module to test for the
1052384bf8334Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1052484bf8334Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
1052584bf8334Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
1052684bf8334Smrg# --with-doxygen assumes 'auto'.
1052784bf8334Smrg#
1052884bf8334Smrg# Interface to module:
1052984bf8334Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
1053084bf8334Smrg# DOXYGEN:	 returns the path of the doxygen program found
1053184bf8334Smrg#		 returns the path set by the user in the environment
1053284bf8334Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
1053384bf8334Smrg#		  'no' user instructs the module not to use doxygen
1053484bf8334Smrg#
1053584bf8334Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
1053684bf8334Smrg#
1053784bf8334SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
1053884bf8334SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
1053984bf8334SmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
1054084bf8334Smrgm4_define([_defopt], m4_default([$2], [auto]))
1054184bf8334SmrgAC_ARG_WITH(doxygen,
1054284bf8334Smrg	AS_HELP_STRING([--with-doxygen],
1054384bf8334Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
1054484bf8334Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
1054584bf8334Smrgm4_undefine([_defopt])
10546659607e0Smrg
1054784bf8334Smrgif test "x$use_doxygen" = x"auto"; then
1054884bf8334Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1054984bf8334Smrg   if test "x$DOXYGEN" = "x"; then
1055084bf8334Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
1055184bf8334Smrg	have_doxygen=no
1055284bf8334Smrg   else
1055384bf8334Smrg        have_doxygen=yes
1055484bf8334Smrg   fi
1055584bf8334Smrgelif test "x$use_doxygen" = x"yes" ; then
1055684bf8334Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1055784bf8334Smrg   if test "x$DOXYGEN" = "x"; then
1055884bf8334Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
1055984bf8334Smrg   fi
1056084bf8334Smrg   have_doxygen=yes
1056184bf8334Smrgelif test "x$use_doxygen" = x"no" ; then
1056284bf8334Smrg   if test "x$DOXYGEN" != "x"; then
1056384bf8334Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
1056484bf8334Smrg   fi
1056584bf8334Smrg   have_doxygen=no
1056684bf8334Smrgelse
1056784bf8334Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
1056884bf8334Smrgfi
1056984bf8334Smrgm4_ifval([$1],
1057084bf8334Smrg[if test "$have_doxygen" = yes; then
1057184bf8334Smrg    # scrape the doxygen version
1057284bf8334Smrg    AC_MSG_CHECKING([the doxygen version])
1057384bf8334Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
1057484bf8334Smrg    AC_MSG_RESULT([$doxygen_version])
1057584bf8334Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
1057684bf8334Smrg        [if test "x$use_doxygen" = xauto; then
1057784bf8334Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
1057884bf8334Smrg            have_doxygen=no
1057984bf8334Smrg        else
1058084bf8334Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
1058184bf8334Smrg        fi])
1058284bf8334Smrgfi])
10583659607e0Smrg
1058484bf8334Smrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
1058584bf8334Smrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
1058684bf8334Smrgdnl 	HAVE_DOT = @HAVE_DOT@
1058784bf8334SmrgHAVE_DOT=no
1058884bf8334Smrgif test "x$have_doxygen" = "xyes"; then
1058984bf8334Smrg  AC_PATH_PROG([DOT], [dot])
1059084bf8334Smrg    if test "x$DOT" != "x"; then
1059184bf8334Smrg      HAVE_DOT=yes
1059284bf8334Smrg    fi
1059384bf8334Smrgfi
10594659607e0Smrg
1059584bf8334SmrgAC_SUBST([HAVE_DOT])
1059684bf8334SmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
1059784bf8334SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
1059884bf8334Smrg]) # XORG_WITH_DOXYGEN
10599659607e0Smrg
1060084bf8334Smrg# XORG_WITH_GROFF([DEFAULT])
1060184bf8334Smrg# ----------------
1060284bf8334Smrg# Minimum version: 1.6.0
1060384bf8334Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10604a73597f9Smrg#
1060584bf8334Smrg# Documentation tools are not always available on all platforms and sometimes
1060684bf8334Smrg# not at the appropriate level. This macro enables a module to test for the
1060784bf8334Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1060884bf8334Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
1060984bf8334Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
1061084bf8334Smrg# --with-groff assumes 'auto'.
10611a73597f9Smrg#
1061284bf8334Smrg# Interface to module:
1061384bf8334Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
1061484bf8334Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
1061584bf8334Smrg# HAVE_GROFF_MS: the -ms macros package
1061684bf8334Smrg# GROFF:	 returns the path of the groff program found
1061784bf8334Smrg#		 returns the path set by the user in the environment
1061884bf8334Smrg# --with-groff:	 'yes' user instructs the module to use groff
1061984bf8334Smrg#		 'no' user instructs the module not to use groff
10620a73597f9Smrg#
1062184bf8334Smrg# Added in version 1.9.0:
1062284bf8334Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
1062384bf8334Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
1062484bf8334Smrg#		   psselect from the psutils package.
1062584bf8334Smrg#		   the ghostcript package. Refer to the grohtml man pages
10626a73597f9Smrg#
1062784bf8334Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
10628a73597f9Smrg#
1062984bf8334Smrg# OS and distros often splits groff in a basic and full package, the former
1063084bf8334Smrg# having the groff program and the later having devices, fonts and macros
1063184bf8334Smrg# Checking for the groff executable is not enough.
10632a73597f9Smrg#
1063384bf8334Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
1063484bf8334Smrg# unset HAVE_GROFF or GROFF env variables.
1063584bf8334Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
10636a73597f9Smrg#
1063784bf8334SmrgAC_DEFUN([XORG_WITH_GROFF],[
1063884bf8334SmrgAC_ARG_VAR([GROFF], [Path to groff command])
1063984bf8334Smrgm4_define([_defopt], m4_default([$1], [auto]))
1064084bf8334SmrgAC_ARG_WITH(groff,
1064184bf8334Smrg	AS_HELP_STRING([--with-groff],
1064284bf8334Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
1064384bf8334Smrg	   [use_groff=$withval], [use_groff=]_defopt)
1064484bf8334Smrgm4_undefine([_defopt])
10645659607e0Smrg
1064684bf8334Smrgif test "x$use_groff" = x"auto"; then
1064784bf8334Smrg   AC_PATH_PROG([GROFF], [groff])
1064884bf8334Smrg   if test "x$GROFF" = "x"; then
1064984bf8334Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
1065084bf8334Smrg	have_groff=no
1065184bf8334Smrg   else
1065284bf8334Smrg        have_groff=yes
1065384bf8334Smrg   fi
1065484bf8334Smrgelif test "x$use_groff" = x"yes" ; then
1065584bf8334Smrg   AC_PATH_PROG([GROFF], [groff])
1065684bf8334Smrg   if test "x$GROFF" = "x"; then
1065784bf8334Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
1065884bf8334Smrg   fi
1065984bf8334Smrg   have_groff=yes
1066084bf8334Smrgelif test "x$use_groff" = x"no" ; then
1066184bf8334Smrg   if test "x$GROFF" != "x"; then
1066284bf8334Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
1066384bf8334Smrg   fi
1066484bf8334Smrg   have_groff=no
10665a73597f9Smrgelse
1066684bf8334Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
10667a73597f9Smrgfi
106686aab59a7Smrg
1066984bf8334Smrg# We have groff, test for the presence of the macro packages
1067084bf8334Smrgif test "x$have_groff" = x"yes"; then
1067184bf8334Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
1067284bf8334Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
1067384bf8334Smrg        groff_ms_works=yes
1067484bf8334Smrg    else
1067584bf8334Smrg        groff_ms_works=no
10676a73597f9Smrg    fi
1067784bf8334Smrg    AC_MSG_RESULT([$groff_ms_works])
1067884bf8334Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
1067984bf8334Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
1068084bf8334Smrg        groff_mm_works=yes
1068184bf8334Smrg    else
1068284bf8334Smrg        groff_mm_works=no
1068384bf8334Smrg    fi
1068484bf8334Smrg    AC_MSG_RESULT([$groff_mm_works])
10685a73597f9Smrgfi
10686fc27e79cSmrg
1068784bf8334Smrg# We have groff, test for HTML dependencies, one command per package
1068884bf8334Smrgif test "x$have_groff" = x"yes"; then
1068984bf8334Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
1069084bf8334Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
1069184bf8334Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
1069284bf8334Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
1069384bf8334Smrg      have_groff_html=yes
1069484bf8334Smrg   else
1069584bf8334Smrg      have_groff_html=no
1069684bf8334Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
1069784bf8334Smrg   fi
1069884bf8334Smrgfi
10699a73597f9Smrg
1070084bf8334Smrg# Set Automake conditionals for Makefiles
1070184bf8334SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
1070284bf8334SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
1070384bf8334SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
1070484bf8334SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
1070584bf8334Smrg]) # XORG_WITH_GROFF
10706b73be646Smrg
1070784bf8334Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
1070884bf8334Smrg# ---------------------------------------
1070984bf8334Smrg# Minimum version: 1.6.0
1071084bf8334Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1071184bf8334Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
1071284bf8334Smrg#
1071384bf8334Smrg# Documentation tools are not always available on all platforms and sometimes
1071484bf8334Smrg# not at the appropriate level. This macro enables a module to test for the
1071584bf8334Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1071684bf8334Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
1071784bf8334Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
1071884bf8334Smrg# --with-fop assumes 'auto'.
1071984bf8334Smrg#
1072084bf8334Smrg# Interface to module:
1072184bf8334Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
1072284bf8334Smrg# FOP:	 	returns the path of the fop program found
1072384bf8334Smrg#		returns the path set by the user in the environment
1072484bf8334Smrg# --with-fop: 	'yes' user instructs the module to use fop
1072584bf8334Smrg#		'no' user instructs the module not to use fop
1072684bf8334Smrg#
1072784bf8334Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
1072884bf8334Smrg#
1072984bf8334SmrgAC_DEFUN([XORG_WITH_FOP],[
1073084bf8334SmrgAC_ARG_VAR([FOP], [Path to fop command])
1073184bf8334Smrgm4_define([_defopt], m4_default([$2], [auto]))
1073284bf8334SmrgAC_ARG_WITH(fop,
1073384bf8334Smrg	AS_HELP_STRING([--with-fop],
1073484bf8334Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
1073584bf8334Smrg	   [use_fop=$withval], [use_fop=]_defopt)
1073684bf8334Smrgm4_undefine([_defopt])
10737b73be646Smrg
1073884bf8334Smrgif test "x$use_fop" = x"auto"; then
1073984bf8334Smrg   AC_PATH_PROG([FOP], [fop])
1074084bf8334Smrg   if test "x$FOP" = "x"; then
1074184bf8334Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
1074284bf8334Smrg	have_fop=no
1074384bf8334Smrg   else
1074484bf8334Smrg        have_fop=yes
1074584bf8334Smrg   fi
1074684bf8334Smrgelif test "x$use_fop" = x"yes" ; then
1074784bf8334Smrg   AC_PATH_PROG([FOP], [fop])
1074884bf8334Smrg   if test "x$FOP" = "x"; then
1074984bf8334Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
1075084bf8334Smrg   fi
1075184bf8334Smrg   have_fop=yes
1075284bf8334Smrgelif test "x$use_fop" = x"no" ; then
1075384bf8334Smrg   if test "x$FOP" != "x"; then
1075484bf8334Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
1075584bf8334Smrg   fi
1075684bf8334Smrg   have_fop=no
1075784bf8334Smrgelse
1075884bf8334Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
10759a73597f9Smrgfi
10760b73be646Smrg
1076184bf8334Smrg# Test for a minimum version of fop, if provided.
1076284bf8334Smrgm4_ifval([$1],
1076384bf8334Smrg[if test "$have_fop" = yes; then
1076484bf8334Smrg    # scrape the fop version
1076584bf8334Smrg    AC_MSG_CHECKING([for fop minimum version])
1076684bf8334Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
1076784bf8334Smrg    AC_MSG_RESULT([$fop_version])
1076884bf8334Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
1076984bf8334Smrg        [if test "x$use_fop" = xauto; then
1077084bf8334Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
1077184bf8334Smrg            have_fop=no
1077284bf8334Smrg        else
1077384bf8334Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
1077484bf8334Smrg        fi])
1077584bf8334Smrgfi])
1077684bf8334SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
1077784bf8334Smrg]) # XORG_WITH_FOP
10778b73be646Smrg
1077984bf8334Smrg# XORG_WITH_M4([MIN-VERSION])
1078084bf8334Smrg# ---------------------------
1078184bf8334Smrg# Minimum version: 1.19.0
10782a73597f9Smrg#
1078384bf8334Smrg# This macro attempts to locate an m4 macro processor which supports
1078484bf8334Smrg# -I option and is only useful for modules relying on M4 in order to
1078584bf8334Smrg# expand macros in source code files.
1078684bf8334Smrg#
1078784bf8334Smrg# Interface to module:
1078884bf8334Smrg# M4:	 	returns the path of the m4 program found
1078984bf8334Smrg#		returns the path set by the user in the environment
1079084bf8334Smrg#
1079184bf8334SmrgAC_DEFUN([XORG_WITH_M4], [
1079284bf8334SmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
1079384bf8334Smrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
1079484bf8334Smrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
1079584bf8334Smrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
1079684bf8334Smrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
1079784bf8334Smrg   [$PATH:/usr/gnu/bin])])
10798b73be646Smrg
1079984bf8334SmrgAC_SUBST([M4], [$ac_cv_path_M4])
1080084bf8334Smrg]) # XORG_WITH_M4
10801659607e0Smrg
1080284bf8334Smrg# XORG_WITH_PS2PDF([DEFAULT])
1080384bf8334Smrg# ----------------
1080484bf8334Smrg# Minimum version: 1.6.0
1080584bf8334Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1080684bf8334Smrg#
1080784bf8334Smrg# Documentation tools are not always available on all platforms and sometimes
1080884bf8334Smrg# not at the appropriate level. This macro enables a module to test for the
1080984bf8334Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1081084bf8334Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
1081184bf8334Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
1081284bf8334Smrg# --with-ps2pdf assumes 'auto'.
1081384bf8334Smrg#
1081484bf8334Smrg# Interface to module:
1081584bf8334Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
1081684bf8334Smrg# PS2PDF:	returns the path of the ps2pdf program found
1081784bf8334Smrg#		returns the path set by the user in the environment
1081884bf8334Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
1081984bf8334Smrg#		 'no' user instructs the module not to use ps2pdf
1082084bf8334Smrg#
1082184bf8334Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
1082284bf8334Smrg#
1082384bf8334SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
1082484bf8334SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
1082584bf8334Smrgm4_define([_defopt], m4_default([$1], [auto]))
1082684bf8334SmrgAC_ARG_WITH(ps2pdf,
1082784bf8334Smrg	AS_HELP_STRING([--with-ps2pdf],
1082884bf8334Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
1082984bf8334Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
1083084bf8334Smrgm4_undefine([_defopt])
10831659607e0Smrg
1083284bf8334Smrgif test "x$use_ps2pdf" = x"auto"; then
1083384bf8334Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1083484bf8334Smrg   if test "x$PS2PDF" = "x"; then
1083584bf8334Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
1083684bf8334Smrg	have_ps2pdf=no
1083784bf8334Smrg   else
1083884bf8334Smrg        have_ps2pdf=yes
1083984bf8334Smrg   fi
1084084bf8334Smrgelif test "x$use_ps2pdf" = x"yes" ; then
1084184bf8334Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1084284bf8334Smrg   if test "x$PS2PDF" = "x"; then
1084384bf8334Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
1084484bf8334Smrg   fi
1084584bf8334Smrg   have_ps2pdf=yes
1084684bf8334Smrgelif test "x$use_ps2pdf" = x"no" ; then
1084784bf8334Smrg   if test "x$PS2PDF" != "x"; then
1084884bf8334Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
1084984bf8334Smrg   fi
1085084bf8334Smrg   have_ps2pdf=no
1085184bf8334Smrgelse
1085284bf8334Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
1085384bf8334Smrgfi
1085484bf8334SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
1085584bf8334Smrg]) # XORG_WITH_PS2PDF
10856659607e0Smrg
1085784bf8334Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
1085884bf8334Smrg# ----------------
1085984bf8334Smrg# Minimum version: 1.6.0
10860a73597f9Smrg#
1086184bf8334Smrg# Documentation tools are not always available on all platforms and sometimes
1086284bf8334Smrg# not at the appropriate level. This macro enables a builder to skip all
1086384bf8334Smrg# documentation targets except traditional man pages.
1086484bf8334Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1086584bf8334Smrg# maximum flexibilty in controlling documentation building.
1086684bf8334Smrg# Refer to:
1086784bf8334Smrg# XORG_WITH_XMLTO         --with-xmlto
1086884bf8334Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1086984bf8334Smrg# XORG_WITH_DOXYGEN       --with-doxygen
1087084bf8334Smrg# XORG_WITH_FOP           --with-fop
1087184bf8334Smrg# XORG_WITH_GROFF         --with-groff
1087284bf8334Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
1087384bf8334Smrg#
1087484bf8334Smrg# Interface to module:
1087584bf8334Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
1087684bf8334Smrg# --enable-docs: 'yes' user instructs the module to generate docs
1087784bf8334Smrg#		 'no' user instructs the module not to generate docs
1087884bf8334Smrg# parm1:	specify the default value, yes or no.
1087984bf8334Smrg#
1088084bf8334SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
1088184bf8334Smrgm4_define([docs_default], m4_default([$1], [yes]))
1088284bf8334SmrgAC_ARG_ENABLE(docs,
1088384bf8334Smrg	AS_HELP_STRING([--enable-docs],
1088484bf8334Smrg	   [Enable building the documentation (default: ]docs_default[)]),
1088584bf8334Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
1088684bf8334Smrgm4_undefine([docs_default])
1088784bf8334SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
1088884bf8334SmrgAC_MSG_CHECKING([whether to build documentation])
1088984bf8334SmrgAC_MSG_RESULT([$build_docs])
1089084bf8334Smrg]) # XORG_ENABLE_DOCS
10891659607e0Smrg
1089284bf8334Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
1089384bf8334Smrg# ----------------
1089484bf8334Smrg# Minimum version: 1.6.0
10895a73597f9Smrg#
1089684bf8334Smrg# This macro enables a builder to skip all developer documentation.
1089784bf8334Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1089884bf8334Smrg# maximum flexibilty in controlling documentation building.
1089984bf8334Smrg# Refer to:
1090084bf8334Smrg# XORG_WITH_XMLTO         --with-xmlto
1090184bf8334Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1090284bf8334Smrg# XORG_WITH_DOXYGEN       --with-doxygen
1090384bf8334Smrg# XORG_WITH_FOP           --with-fop
1090484bf8334Smrg# XORG_WITH_GROFF         --with-groff
1090584bf8334Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
1090684bf8334Smrg#
1090784bf8334Smrg# Interface to module:
1090884bf8334Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
1090984bf8334Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
1091084bf8334Smrg#			'no' user instructs the module not to generate developer docs
1091184bf8334Smrg# parm1:		specify the default value, yes or no.
1091284bf8334Smrg#
1091384bf8334SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1091484bf8334Smrgm4_define([devel_default], m4_default([$1], [yes]))
1091584bf8334SmrgAC_ARG_ENABLE(devel-docs,
1091684bf8334Smrg	AS_HELP_STRING([--enable-devel-docs],
1091784bf8334Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
1091884bf8334Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
1091984bf8334Smrgm4_undefine([devel_default])
1092084bf8334SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1092184bf8334SmrgAC_MSG_CHECKING([whether to build developer documentation])
1092284bf8334SmrgAC_MSG_RESULT([$build_devel_docs])
1092384bf8334Smrg]) # XORG_ENABLE_DEVEL_DOCS
10924659607e0Smrg
1092584bf8334Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
1092684bf8334Smrg# ----------------
1092784bf8334Smrg# Minimum version: 1.6.0
1092884bf8334Smrg#
1092984bf8334Smrg# This macro enables a builder to skip all functional specification targets.
1093084bf8334Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1093184bf8334Smrg# maximum flexibilty in controlling documentation building.
1093284bf8334Smrg# Refer to:
1093384bf8334Smrg# XORG_WITH_XMLTO         --with-xmlto
1093484bf8334Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1093584bf8334Smrg# XORG_WITH_DOXYGEN       --with-doxygen
1093684bf8334Smrg# XORG_WITH_FOP           --with-fop
1093784bf8334Smrg# XORG_WITH_GROFF         --with-groff
1093884bf8334Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
1093984bf8334Smrg#
1094084bf8334Smrg# Interface to module:
1094184bf8334Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
1094284bf8334Smrg# --enable-specs:	'yes' user instructs the module to generate specs
1094384bf8334Smrg#			'no' user instructs the module not to generate specs
1094484bf8334Smrg# parm1:		specify the default value, yes or no.
1094584bf8334Smrg#
1094684bf8334SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
1094784bf8334Smrgm4_define([spec_default], m4_default([$1], [yes]))
1094884bf8334SmrgAC_ARG_ENABLE(specs,
1094984bf8334Smrg	AS_HELP_STRING([--enable-specs],
1095084bf8334Smrg	   [Enable building the specs (default: ]spec_default[)]),
1095184bf8334Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
1095284bf8334Smrgm4_undefine([spec_default])
1095384bf8334SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
1095484bf8334SmrgAC_MSG_CHECKING([whether to build functional specifications])
1095584bf8334SmrgAC_MSG_RESULT([$build_specs])
1095684bf8334Smrg]) # XORG_ENABLE_SPECS
10957b73be646Smrg
1095884bf8334Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
1095984bf8334Smrg# ----------------------------------------------
1096084bf8334Smrg# Minimum version: 1.13.0
1096184bf8334Smrg#
1096284bf8334Smrg# This macro enables a builder to enable/disable unit testing
1096384bf8334Smrg# It makes no assumption about the test cases implementation
1096484bf8334Smrg# Test cases may or may not use Automake "Support for test suites"
1096584bf8334Smrg# They may or may not use the software utility library GLib
1096684bf8334Smrg#
1096784bf8334Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
1096884bf8334Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
1096984bf8334Smrg# The variable enable_unit_tests is used by other macros in this file.
1097084bf8334Smrg#
1097184bf8334Smrg# Interface to module:
1097284bf8334Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
1097384bf8334Smrg# enable_unit_tests:    used in configure.ac for additional configuration
1097484bf8334Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
1097584bf8334Smrg#			'no' user instructs the module not to build tests
1097684bf8334Smrg# parm1:		specify the default value, yes or no.
1097784bf8334Smrg#
1097884bf8334SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
1097984bf8334SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
1098084bf8334SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
1098184bf8334SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
1098284bf8334Smrgm4_define([_defopt], m4_default([$1], [auto]))
1098384bf8334SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
1098484bf8334Smrg	[Enable building unit test cases (default: ]_defopt[)]),
1098584bf8334Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
1098684bf8334Smrgm4_undefine([_defopt])
1098784bf8334SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
1098884bf8334SmrgAC_MSG_CHECKING([whether to build unit test cases])
1098984bf8334SmrgAC_MSG_RESULT([$enable_unit_tests])
1099084bf8334Smrg]) # XORG_ENABLE_UNIT_TESTS
10991659607e0Smrg
1099284bf8334Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
1099384bf8334Smrg# ------------------------------------------------------
1099484bf8334Smrg# Minimum version: 1.17.0
1099584bf8334Smrg#
1099684bf8334Smrg# This macro enables a builder to enable/disable integration testing
1099784bf8334Smrg# It makes no assumption about the test cases' implementation
1099884bf8334Smrg# Test cases may or may not use Automake "Support for test suites"
1099984bf8334Smrg#
1100084bf8334Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
1100184bf8334Smrg# usually requires less dependencies and may be built and run under less
1100284bf8334Smrg# stringent environments than integration tests.
1100384bf8334Smrg#
1100484bf8334Smrg# Interface to module:
1100584bf8334Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
1100684bf8334Smrg# enable_integration_tests:   used in configure.ac for additional configuration
1100784bf8334Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
1100884bf8334Smrg#                             'no' user instructs the module not to build tests
1100984bf8334Smrg# parm1:                      specify the default value, yes or no.
1101084bf8334Smrg#
1101184bf8334SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
1101284bf8334SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
1101384bf8334Smrgm4_define([_defopt], m4_default([$1], [auto]))
1101484bf8334SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
1101584bf8334Smrg	[Enable building integration test cases (default: ]_defopt[)]),
1101684bf8334Smrg	[enable_integration_tests=$enableval],
1101784bf8334Smrg	[enable_integration_tests=]_defopt)
1101884bf8334Smrgm4_undefine([_defopt])
1101984bf8334SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
1102084bf8334Smrg	[test "x$enable_integration_tests" != xno])
1102184bf8334SmrgAC_MSG_CHECKING([whether to build unit test cases])
1102284bf8334SmrgAC_MSG_RESULT([$enable_integration_tests])
1102384bf8334Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
11024659607e0Smrg
1102584bf8334Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
1102684bf8334Smrg# ----------------------------------------
1102784bf8334Smrg# Minimum version: 1.13.0
1102884bf8334Smrg#
1102984bf8334Smrg# GLib is a library which provides advanced data structures and functions.
1103084bf8334Smrg# This macro enables a module to test for the presence of Glib.
1103184bf8334Smrg#
1103284bf8334Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
1103384bf8334Smrg# Otherwise the value of $enable_unit_tests is blank.
1103484bf8334Smrg#
1103584bf8334Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
1103684bf8334Smrg# test support usually requires less dependencies and may be built and run under
1103784bf8334Smrg# less stringent environments than integration tests.
1103884bf8334Smrg#
1103984bf8334Smrg# Interface to module:
1104084bf8334Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
1104184bf8334Smrg# with_glib: used in configure.ac to know if GLib has been found
1104284bf8334Smrg# --with-glib:	'yes' user instructs the module to use glib
1104384bf8334Smrg#		'no' user instructs the module not to use glib
1104484bf8334Smrg#
1104584bf8334SmrgAC_DEFUN([XORG_WITH_GLIB],[
1104684bf8334SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
1104784bf8334Smrgm4_define([_defopt], m4_default([$2], [auto]))
1104884bf8334SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
1104984bf8334Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
1105084bf8334Smrg	[with_glib=$withval], [with_glib=]_defopt)
1105184bf8334Smrgm4_undefine([_defopt])
11052659607e0Smrg
1105384bf8334Smrghave_glib=no
1105484bf8334Smrg# Do not probe GLib if user explicitly disabled unit testing
1105584bf8334Smrgif test "x$enable_unit_tests" != x"no"; then
1105684bf8334Smrg  # Do not probe GLib if user explicitly disabled it
1105784bf8334Smrg  if test "x$with_glib" != x"no"; then
1105884bf8334Smrg    m4_ifval(
1105984bf8334Smrg      [$1],
1106084bf8334Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
1106184bf8334Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
1106284bf8334Smrg    )
1106384bf8334Smrg  fi
1106484bf8334Smrgfi
11065659607e0Smrg
1106684bf8334Smrg# Not having GLib when unit testing has been explicitly requested is an error
1106784bf8334Smrgif test "x$enable_unit_tests" = x"yes"; then
1106884bf8334Smrg  if test "x$have_glib" = x"no"; then
1106984bf8334Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1107084bf8334Smrg  fi
1107184bf8334Smrgfi
11072659607e0Smrg
1107384bf8334Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
1107484bf8334Smrgif test "x$enable_unit_tests" = x"no"; then
1107584bf8334Smrg  if test "x$with_glib" = x"yes"; then
1107684bf8334Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1107784bf8334Smrg  fi
1107884bf8334Smrgfi
11079659607e0Smrg
1108084bf8334Smrg# Not having GLib when it has been explicitly requested is an error
1108184bf8334Smrgif test "x$with_glib" = x"yes"; then
1108284bf8334Smrg  if test "x$have_glib" = x"no"; then
1108384bf8334Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
1108484bf8334Smrg  fi
1108584bf8334Smrgfi
11086659607e0Smrg
1108784bf8334SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
1108884bf8334Smrg]) # XORG_WITH_GLIB
1108984bf8334Smrg
1109084bf8334Smrg# XORG_LD_WRAP([required|optional])
1109184bf8334Smrg# ---------------------------------
1109284bf8334Smrg# Minimum version: 1.13.0
11093a73597f9Smrg#
1109484bf8334Smrg# Check if linker supports -wrap, passed via compiler flags
1109584bf8334Smrg#
1109684bf8334Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
1109784bf8334Smrg# Otherwise the value of $enable_unit_tests is blank.
1109884bf8334Smrg#
1109984bf8334Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
1110084bf8334Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
1110184bf8334Smrg# available, an argument of "optional" allows use when some unit tests require
1110284bf8334Smrg# ld -wrap and others do not.
1110384bf8334Smrg#
1110484bf8334SmrgAC_DEFUN([XORG_LD_WRAP],[
1110584bf8334SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
1110684bf8334Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
1110784bf8334Smrg                      void __wrap_exit(int status) { return; }],
1110884bf8334Smrg                     [exit(0);])])
1110984bf8334Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
1111084bf8334Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
1111184bf8334Smrg  if test "x$have_ld_wrap" = x"no"; then
1111284bf8334Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
1111384bf8334Smrg  fi
1111484bf8334Smrgfi
1111584bf8334SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
1111684bf8334Smrg#
1111784bf8334Smrg]) # XORG_LD_WRAP
1111884bf8334Smrg
1111984bf8334Smrg# XORG_CHECK_LINKER_FLAGS
1112084bf8334Smrg# -----------------------
1112184bf8334Smrg# SYNOPSIS
1112284bf8334Smrg#
1112384bf8334Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
1112484bf8334Smrg#
1112584bf8334Smrg# DESCRIPTION
1112684bf8334Smrg#
1112784bf8334Smrg#   Check whether the given linker FLAGS work with the current language's
1112884bf8334Smrg#   linker, or whether they give an error.
1112984bf8334Smrg#
1113084bf8334Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
1113184bf8334Smrg#   success/failure.
1113284bf8334Smrg#
1113384bf8334Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
1113484bf8334Smrg#
1113584bf8334Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
1113684bf8334Smrg#
1113784bf8334Smrg# LICENSE
1113884bf8334Smrg#
1113984bf8334Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
1114084bf8334Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
1114184bf8334Smrg#   Copyright (c) 2009 Matteo Frigo
1114284bf8334Smrg#
1114384bf8334Smrg#   This program is free software: you can redistribute it and/or modify it
1114484bf8334Smrg#   under the terms of the GNU General Public License as published by the
1114584bf8334Smrg#   Free Software Foundation, either version 3 of the License, or (at your
1114684bf8334Smrg#   option) any later version.
1114784bf8334Smrg#
1114884bf8334Smrg#   This program is distributed in the hope that it will be useful, but
1114984bf8334Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
1115084bf8334Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
1115184bf8334Smrg#   Public License for more details.
1115284bf8334Smrg#
1115384bf8334Smrg#   You should have received a copy of the GNU General Public License along
1115484bf8334Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
1115584bf8334Smrg#
1115684bf8334Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
1115784bf8334Smrg#   gives unlimited permission to copy, distribute and modify the configure
1115884bf8334Smrg#   scripts that are the output of Autoconf when processing the Macro. You
1115984bf8334Smrg#   need not follow the terms of the GNU General Public License when using
1116084bf8334Smrg#   or distributing such scripts, even though portions of the text of the
1116184bf8334Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
1116284bf8334Smrg#   all other use of the material that constitutes the Autoconf Macro.
1116384bf8334Smrg#
1116484bf8334Smrg#   This special exception to the GPL applies to versions of the Autoconf
1116584bf8334Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
1116684bf8334Smrg#   modified version of the Autoconf Macro, you may extend this special
1116784bf8334Smrg#   exception to the GPL to apply to your modified version as well.#
1116884bf8334SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
1116984bf8334Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
1117084bf8334Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
1117184bf8334SmrgAS_LITERAL_IF([$1],
1117284bf8334Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
1117384bf8334Smrg      ax_save_FLAGS=$LDFLAGS
1117484bf8334Smrg      LDFLAGS="$1"
1117584bf8334Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
1117684bf8334Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1117784bf8334Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1117884bf8334Smrg      LDFLAGS=$ax_save_FLAGS])],
1117984bf8334Smrg  [ax_save_FLAGS=$LDFLAGS
1118084bf8334Smrg   LDFLAGS="$1"
1118184bf8334Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
1118284bf8334Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1118384bf8334Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1118484bf8334Smrg   LDFLAGS=$ax_save_FLAGS])
1118584bf8334Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
1118684bf8334SmrgAC_MSG_RESULT($xorg_check_linker_flags)
1118784bf8334Smrgif test "x$xorg_check_linker_flags" = xyes; then
1118884bf8334Smrg	m4_default([$2], :)
1118984bf8334Smrgelse
1119084bf8334Smrg	m4_default([$3], :)
1119184bf8334Smrgfi
1119284bf8334Smrg]) # XORG_CHECK_LINKER_FLAGS
11193659607e0Smrg
1119484bf8334Smrg# XORG_MEMORY_CHECK_FLAGS
1119584bf8334Smrg# -----------------------
1119684bf8334Smrg# Minimum version: 1.16.0
1119784bf8334Smrg#
1119884bf8334Smrg# This macro attempts to find appropriate memory checking functionality
1119984bf8334Smrg# for various platforms which unit testing code may use to catch various
1120084bf8334Smrg# forms of memory allocation and access errors in testing.
1120184bf8334Smrg#
1120284bf8334Smrg# Interface to module:
1120384bf8334Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
1120484bf8334Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
1120584bf8334Smrg#
1120684bf8334Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
1120784bf8334Smrg#
1120884bf8334SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
11209659607e0Smrg
1121084bf8334SmrgAC_REQUIRE([AC_CANONICAL_HOST])
1121184bf8334SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
1121284bf8334Smrg           [Environment variables to enable memory checking in tests])
1121384bf8334Smrg
1121484bf8334Smrg# Check for different types of support on different platforms
1121584bf8334Smrgcase $host_os in
1121684bf8334Smrg    solaris*)
1121784bf8334Smrg        AC_CHECK_LIB([umem], [umem_alloc],
1121884bf8334Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
1121984bf8334Smrg        ;;
1122084bf8334Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
1122184bf8334Smrg        # both directly and inverted, so should not be 0 or 255.
1122284bf8334Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
1122384bf8334Smrg        ;;
1122484bf8334Smrg    darwin*)
1122584bf8334Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
1122684bf8334Smrg        ;;
1122784bf8334Smrg    *bsd*)
1122884bf8334Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
1122984bf8334Smrg        ;;
1123084bf8334Smrgesac
1123184bf8334Smrg
1123284bf8334Smrg# User supplied flags override default flags
1123384bf8334Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
1123484bf8334Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
11235a73597f9Smrgfi
11236659607e0Smrg
1123784bf8334SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
1123884bf8334Smrg]) # XORG_WITH_LINT
1123984bf8334Smrg
1124084bf8334Smrg# XORG_CHECK_MALLOC_ZERO
1124184bf8334Smrg# ----------------------
1124284bf8334Smrg# Minimum version: 1.0.0
11243a73597f9Smrg#
1124484bf8334Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1124584bf8334Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1124684bf8334Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1124784bf8334SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1124884bf8334SmrgAC_ARG_ENABLE(malloc0returnsnull,
1124984bf8334Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1125084bf8334Smrg		       [malloc(0) returns NULL (default: auto)]),
1125184bf8334Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1125284bf8334Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
11253659607e0Smrg
1125484bf8334SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1125584bf8334Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1125684bf8334SmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
1125784bf8334Smrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
1125884bf8334Smrg#include <stdlib.h>
1125984bf8334Smrg],[
1126084bf8334Smrg    char *m0, *r0, *c0, *p;
1126184bf8334Smrg    m0 = malloc(0);
1126284bf8334Smrg    p = malloc(10);
1126384bf8334Smrg    r0 = realloc(p,0);
1126484bf8334Smrg    c0 = calloc(0,10);
1126584bf8334Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
1126684bf8334Smrg])],
1126784bf8334Smrg		[xorg_cv_malloc0_returns_null=yes],
1126884bf8334Smrg		[xorg_cv_malloc0_returns_null=no])])
1126984bf8334SmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
1127084bf8334Smrgfi
1127184bf8334SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
11272659607e0Smrg
1127384bf8334Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1127484bf8334Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1127584bf8334Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1127684bf8334Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
11277a73597f9Smrgelse
1127884bf8334Smrg	MALLOC_ZERO_CFLAGS=""
1127984bf8334Smrg	XMALLOC_ZERO_CFLAGS=""
1128084bf8334Smrg	XTMALLOC_ZERO_CFLAGS=""
11281a73597f9Smrgfi
11282659607e0Smrg
1128384bf8334SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1128484bf8334SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1128584bf8334SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1128684bf8334Smrg]) # XORG_CHECK_MALLOC_ZERO
11287659607e0Smrg
1128884bf8334Smrg# XORG_WITH_LINT()
1128984bf8334Smrg# ----------------
1129084bf8334Smrg# Minimum version: 1.1.0
11291b73be646Smrg#
1129284bf8334Smrg# This macro enables the use of a tool that flags some suspicious and
1129384bf8334Smrg# non-portable constructs (likely to be bugs) in C language source code.
1129484bf8334Smrg# It will attempt to locate the tool and use appropriate options.
1129584bf8334Smrg# There are various lint type tools on different platforms.
1129684bf8334Smrg#
1129784bf8334Smrg# Interface to module:
1129884bf8334Smrg# LINT:		returns the path to the tool found on the platform
1129984bf8334Smrg#		or the value set to LINT on the configure cmd line
1130084bf8334Smrg#		also an Automake conditional
1130184bf8334Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
1130284bf8334Smrg#
1130384bf8334Smrg# --with-lint:	'yes' user instructs the module to use lint
1130484bf8334Smrg#		'no' user instructs the module not to use lint (default)
1130584bf8334Smrg#
1130684bf8334Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1130784bf8334Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
1130884bf8334Smrg#
1130984bf8334SmrgAC_DEFUN([XORG_WITH_LINT],[
11310659607e0Smrg
1131184bf8334SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
1131284bf8334SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1131384bf8334SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1131484bf8334Smrg		[Use a lint-style source code checker (default: disabled)])],
1131584bf8334Smrg		[use_lint=$withval], [use_lint=no])
11316659607e0Smrg
1131784bf8334Smrg# Obtain platform specific info like program name and options
1131884bf8334Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
1131984bf8334Smrgcase $host_os in
1132084bf8334Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1132184bf8334Smrg	lint_name=splint
1132284bf8334Smrg	lint_options="-badflag"
1132384bf8334Smrg	;;
1132484bf8334Smrg  *freebsd* | *netbsd*)
1132584bf8334Smrg	lint_name=lint
1132684bf8334Smrg	lint_options="-u -b"
1132784bf8334Smrg	;;
1132884bf8334Smrg  *solaris*)
1132984bf8334Smrg	lint_name=lint
1133084bf8334Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1133184bf8334Smrg	;;
11332a73597f9Smrgesac
1133384bf8334Smrg
1133484bf8334Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
1133584bf8334Smrgif test "x$use_lint" = x"yes" ; then
1133684bf8334Smrg   AC_PATH_PROG([LINT], [$lint_name])
1133784bf8334Smrg   if test "x$LINT" = "x"; then
1133884bf8334Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
1133984bf8334Smrg   fi
1134084bf8334Smrgelif test "x$use_lint" = x"no" ; then
1134184bf8334Smrg   if test "x$LINT" != "x"; then
1134284bf8334Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
1134384bf8334Smrg   fi
1134484bf8334Smrgelse
1134584bf8334Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
11346a73597f9Smrgfi
11347659607e0Smrg
1134884bf8334Smrg# User supplied flags override default flags
1134984bf8334Smrgif test "x$LINT_FLAGS" != "x"; then
1135084bf8334Smrg   lint_options=$LINT_FLAGS
1135184bf8334Smrgfi
11352659607e0Smrg
1135384bf8334SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
1135484bf8334SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
11355659607e0Smrg
1135684bf8334Smrg]) # XORG_WITH_LINT
113576aab59a7Smrg
1135884bf8334Smrg# XORG_LINT_LIBRARY(LIBNAME)
1135984bf8334Smrg# --------------------------
1136084bf8334Smrg# Minimum version: 1.1.0
1136184bf8334Smrg#
1136284bf8334Smrg# Sets up flags for building lint libraries for checking programs that call
1136384bf8334Smrg# functions in the library.
1136484bf8334Smrg#
1136584bf8334Smrg# Interface to module:
1136684bf8334Smrg# LINTLIB		- Automake variable with the name of lint library file to make
1136784bf8334Smrg# MAKE_LINT_LIB		- Automake conditional
1136884bf8334Smrg#
1136984bf8334Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
1137084bf8334Smrg#			  - 'no' user instructs the module not to create a lint library (default)
11371659607e0Smrg
1137284bf8334SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1137384bf8334SmrgAC_REQUIRE([XORG_WITH_LINT])
1137484bf8334SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1137584bf8334Smrg	[Create lint library (default: disabled)])],
1137684bf8334Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
11377659607e0Smrg
1137884bf8334Smrgif test "x$make_lint_lib" = x"yes" ; then
1137984bf8334Smrg   LINTLIB=llib-l$1.ln
1138084bf8334Smrg   if test "x$LINT" = "x"; then
1138184bf8334Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
1138284bf8334Smrg   fi
1138384bf8334Smrgelif test "x$make_lint_lib" != x"no" ; then
1138484bf8334Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
11385a73597f9Smrgfi
11386659607e0Smrg
1138784bf8334SmrgAC_SUBST(LINTLIB)
1138884bf8334SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1138984bf8334Smrg
1139084bf8334Smrg]) # XORG_LINT_LIBRARY
11391659607e0Smrg
1139284bf8334Smrg# XORG_COMPILER_BRAND
1139384bf8334Smrg# -------------------
1139484bf8334Smrg# Minimum version: 1.14.0
11395a73597f9Smrg#
1139684bf8334Smrg# Checks for various brands of compilers and sets flags as appropriate:
1139784bf8334Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
1139884bf8334Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
1139984bf8334Smrg#   clang compiler - sets CLANGCC to "yes"
1140084bf8334Smrg#   Intel compiler - sets INTELCC to "yes"
1140184bf8334Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
1140284bf8334Smrg#
1140384bf8334SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
1140484bf8334SmrgAC_LANG_CASE(
1140584bf8334Smrg	[C], [
1140684bf8334Smrg		AC_REQUIRE([AC_PROG_CC_C99])
1140784bf8334Smrg	],
1140884bf8334Smrg	[C++], [
1140984bf8334Smrg		AC_REQUIRE([AC_PROG_CXX])
1141084bf8334Smrg	]
1141184bf8334Smrg)
1141284bf8334SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
1141384bf8334SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1141484bf8334SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1141584bf8334Smrg]) # XORG_COMPILER_BRAND
1141684bf8334Smrg
1141784bf8334Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
1141884bf8334Smrg# ---------------
1141984bf8334Smrg# Minimum version: 1.16.0
1142084bf8334Smrg#
1142184bf8334Smrg# Test if the compiler works when passed the given flag as a command line argument.
1142284bf8334Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
1142384bf8334Smrg# next flag in the list until there are no more options.
1142484bf8334Smrg#
1142584bf8334Smrg# Note that this does not guarantee that the compiler supports the flag as some
1142684bf8334Smrg# compilers will simply ignore arguments that they do not understand, but we do
1142784bf8334Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
1142884bf8334Smrg# -Werror=unused-command-line-argument
1142984bf8334Smrg#
1143084bf8334SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
1143184bf8334Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
1143284bf8334Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
1143384bf8334Smrg
1143484bf8334SmrgAC_LANG_COMPILER_REQUIRE
1143584bf8334Smrg
1143684bf8334SmrgAC_LANG_CASE(
1143784bf8334Smrg	[C], [
1143884bf8334Smrg		AC_REQUIRE([AC_PROG_CC_C99])
1143984bf8334Smrg		define([PREFIX], [C])
1144084bf8334Smrg		define([CACHE_PREFIX], [cc])
1144184bf8334Smrg		define([COMPILER], [$CC])
1144284bf8334Smrg	],
1144384bf8334Smrg	[C++], [
1144484bf8334Smrg		define([PREFIX], [CXX])
1144584bf8334Smrg		define([CACHE_PREFIX], [cxx])
1144684bf8334Smrg		define([COMPILER], [$CXX])
1144784bf8334Smrg	]
1144884bf8334Smrg)
1144984bf8334Smrg
1145084bf8334Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
11451659607e0Smrg
1145284bf8334Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
1145384bf8334Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1145484bf8334Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
1145584bf8334Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
1145684bf8334Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1145784bf8334Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
1145884bf8334Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
1145984bf8334Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
1146084bf8334Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1146184bf8334Smrgfi
11462659607e0Smrg
1146384bf8334Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
1146484bf8334Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
1146584bf8334Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1146684bf8334Smrg	fi
1146784bf8334Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1146884bf8334Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
1146984bf8334Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
1147084bf8334Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1147184bf8334Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
1147284bf8334Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
1147384bf8334Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
1147484bf8334Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1147584bf8334Smrgfi
11476659607e0Smrg
1147784bf8334Smrgfound="no"
1147884bf8334Smrgm4_foreach([flag], m4_cdr($@), [
1147984bf8334Smrg	if test $found = "no" ; then
1148084bf8334Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
1148184bf8334Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1148284bf8334Smrg		fi
11483659607e0Smrg
1148484bf8334Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
1148584bf8334Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1148684bf8334Smrg		fi
114876aab59a7Smrg
1148884bf8334Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
114896aab59a7Smrg
1149084bf8334Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
1149184bf8334Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
1149284bf8334Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
1149384bf8334Smrg		AC_CACHE_VAL($cacheid,
1149484bf8334Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
1149584bf8334Smrg					     [eval $cacheid=yes],
1149684bf8334Smrg					     [eval $cacheid=no])])
11497659607e0Smrg
1149884bf8334Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11499b73be646Smrg
1150084bf8334Smrg		eval supported=\$$cacheid
1150184bf8334Smrg		AC_MSG_RESULT([$supported])
1150284bf8334Smrg		if test "$supported" = "yes" ; then
1150384bf8334Smrg			$1="$$1 ]flag["
1150484bf8334Smrg			found="yes"
1150584bf8334Smrg		fi
1150684bf8334Smrg	fi
1150784bf8334Smrg])
1150884bf8334Smrg]) # XORG_TESTSET_CFLAG
11509b73be646Smrg
1151084bf8334Smrg# XORG_COMPILER_FLAGS
11511a73597f9Smrg# ---------------
1151284bf8334Smrg# Minimum version: 1.16.0
1151384bf8334Smrg#
1151484bf8334Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
1151584bf8334Smrg# arguments supported by the selected compiler which do NOT alter the generated
1151684bf8334Smrg# code.  These arguments will cause the compiler to print various warnings
1151784bf8334Smrg# during compilation AND turn a conservative set of warnings into errors.
1151884bf8334Smrg#
1151984bf8334Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
1152084bf8334Smrg# future versions of util-macros as options are added to new compilers.
1152184bf8334Smrg#
1152284bf8334SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
1152384bf8334SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
11524b73be646Smrg
1152584bf8334SmrgAC_ARG_ENABLE(selective-werror,
1152684bf8334Smrg              AS_HELP_STRING([--disable-selective-werror],
1152784bf8334Smrg                             [Turn off selective compiler errors. (default: enabled)]),
1152884bf8334Smrg              [SELECTIVE_WERROR=$enableval],
1152984bf8334Smrg              [SELECTIVE_WERROR=yes])
11530a73597f9Smrg
1153184bf8334SmrgAC_LANG_CASE(
1153284bf8334Smrg        [C], [
1153384bf8334Smrg                define([PREFIX], [C])
1153484bf8334Smrg        ],
1153584bf8334Smrg        [C++], [
1153684bf8334Smrg                define([PREFIX], [CXX])
1153784bf8334Smrg        ]
1153884bf8334Smrg)
1153984bf8334Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
1154084bf8334Smrgif test "x$SUNCC" = "xyes"; then
1154184bf8334Smrg    [BASE_]PREFIX[FLAGS]="-v"
11542a73597f9Smrgelse
1154384bf8334Smrg    [BASE_]PREFIX[FLAGS]=""
11544a73597f9Smrgfi
11545659607e0Smrg
1154684bf8334Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
1154784bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
1154884bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
1154984bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
1155084bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
11551fc27e79cSmrg
1155284bf8334SmrgAC_LANG_CASE(
1155384bf8334Smrg	[C], [
1155484bf8334Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
1155584bf8334Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
1155684bf8334Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
1155784bf8334Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
1155884bf8334Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
1155984bf8334Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
1156084bf8334Smrg	]
1156184bf8334Smrg)
11562b73be646Smrg
1156384bf8334Smrg# This chunk adds additional warnings that could catch undesired effects.
1156484bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
1156584bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
1156684bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
1156784bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
1156884bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
1156984bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
1157084bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
1157184bf8334Smrg
1157284bf8334Smrg# These are currently disabled because they are noisy.  They will be enabled
1157384bf8334Smrg# in the future once the codebase is sufficiently modernized to silence
1157484bf8334Smrg# them.  For now, I don't want them to drown out the other warnings.
1157584bf8334Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
1157684bf8334Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
1157784bf8334Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
1157884bf8334Smrg
1157984bf8334Smrg# Turn some warnings into errors, so we don't accidently get successful builds
1158084bf8334Smrg# when there are problems that should be fixed.
1158184bf8334Smrg
1158284bf8334Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
1158384bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
1158484bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
1158584bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
1158684bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
1158784bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
1158884bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
1158984bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
1159084bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
1159184bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
1159284bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
1159384bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
1159484bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
1159584bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
11596a73597f9Smrgelse
1159784bf8334SmrgAC_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])
1159884bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
1159984bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
1160084bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
1160184bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
1160284bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
1160384bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
1160484bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
1160584bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
1160684bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
1160784bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
1160884bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
1160984bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
1161084bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
11611a73597f9Smrgfi
11612a73597f9Smrg
1161384bf8334SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
1161484bf8334Smrg]) # XORG_COMPILER_FLAGS
11615a73597f9Smrg
1161684bf8334Smrg# XORG_CWARNFLAGS
1161784bf8334Smrg# ---------------
1161884bf8334Smrg# Minimum version: 1.2.0
1161984bf8334Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
116206aab59a7Smrg#
1162184bf8334Smrg# Defines CWARNFLAGS to enable C compiler warnings.
1162284bf8334Smrg#
1162384bf8334Smrg# This function is deprecated because it defines -fno-strict-aliasing
1162484bf8334Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
1162584bf8334Smrg# is needed, then it should be added explicitly in the module when
1162684bf8334Smrg# it is updated to use BASE_CFLAGS.
1162784bf8334Smrg#
1162884bf8334SmrgAC_DEFUN([XORG_CWARNFLAGS], [
1162984bf8334SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
1163084bf8334SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
1163184bf8334SmrgAC_LANG_CASE(
1163284bf8334Smrg	[C], [
1163384bf8334Smrg		CWARNFLAGS="$BASE_CFLAGS"
1163484bf8334Smrg		if  test "x$GCC" = xyes ; then
1163584bf8334Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
1163684bf8334Smrg		fi
1163784bf8334Smrg		AC_SUBST(CWARNFLAGS)
1163884bf8334Smrg	]
1163984bf8334Smrg)
1164084bf8334Smrg]) # XORG_CWARNFLAGS
11641659607e0Smrg
1164284bf8334Smrg# XORG_STRICT_OPTION
1164384bf8334Smrg# -----------------------
1164484bf8334Smrg# Minimum version: 1.3.0
1164584bf8334Smrg#
1164684bf8334Smrg# Add configure option to enable strict compilation flags, such as treating
1164784bf8334Smrg# warnings as fatal errors.
1164884bf8334Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
1164984bf8334Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
1165084bf8334Smrg#
1165184bf8334Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
1165284bf8334Smrg# when strict compilation is unconditionally desired.
1165384bf8334SmrgAC_DEFUN([XORG_STRICT_OPTION], [
1165484bf8334SmrgAC_REQUIRE([XORG_CWARNFLAGS])
1165584bf8334SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
11656fc27e79cSmrg
1165784bf8334SmrgAC_ARG_ENABLE(strict-compilation,
1165884bf8334Smrg			  AS_HELP_STRING([--enable-strict-compilation],
1165984bf8334Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
1166084bf8334Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
11661fc27e79cSmrg
1166284bf8334SmrgAC_LANG_CASE(
1166384bf8334Smrg        [C], [
1166484bf8334Smrg                define([PREFIX], [C])
1166584bf8334Smrg        ],
1166684bf8334Smrg        [C++], [
1166784bf8334Smrg                define([PREFIX], [CXX])
1166884bf8334Smrg        ]
1166984bf8334Smrg)
11670b73be646Smrg
1167184bf8334Smrg[STRICT_]PREFIX[FLAGS]=""
1167284bf8334SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
1167384bf8334SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
11674b73be646Smrg
1167584bf8334Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
1167684bf8334Smrg# activate it with -Werror, so we add it here explicitly.
1167784bf8334SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
11678659607e0Smrg
1167984bf8334Smrgif test "x$STRICT_COMPILE" = "xyes"; then
1168084bf8334Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
1168184bf8334Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
1168284bf8334Smrgfi
1168384bf8334SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
1168484bf8334SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
1168584bf8334SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
1168684bf8334Smrg]) # XORG_STRICT_OPTION
11687659607e0Smrg
1168884bf8334Smrg# XORG_DEFAULT_OPTIONS
11689a73597f9Smrg# --------------------
1169084bf8334Smrg# Minimum version: 1.3.0
11691fc27e79cSmrg#
1169284bf8334Smrg# Defines default options for X.Org modules.
11693b73be646Smrg#
1169484bf8334SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
1169584bf8334SmrgAC_REQUIRE([AC_PROG_INSTALL])
1169684bf8334SmrgXORG_COMPILER_FLAGS
1169784bf8334SmrgXORG_CWARNFLAGS
1169884bf8334SmrgXORG_STRICT_OPTION
1169984bf8334SmrgXORG_RELEASE_VERSION
1170084bf8334SmrgXORG_CHANGELOG
1170184bf8334SmrgXORG_INSTALL
1170284bf8334SmrgXORG_MANPAGE_SECTIONS
1170384bf8334Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
1170484bf8334Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
1170584bf8334Smrg]) # XORG_DEFAULT_OPTIONS
1170684bf8334Smrg
1170784bf8334Smrg# XORG_INSTALL()
1170884bf8334Smrg# ----------------
1170984bf8334Smrg# Minimum version: 1.4.0
1171084bf8334Smrg#
1171184bf8334Smrg# Defines the variable INSTALL_CMD as the command to copy
1171284bf8334Smrg# INSTALL from $prefix/share/util-macros.
1171384bf8334Smrg#
1171484bf8334SmrgAC_DEFUN([XORG_INSTALL], [
1171584bf8334SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
1171684bf8334Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
1171784bf8334SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
1171884bf8334Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
1171984bf8334Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
1172084bf8334Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
1172184bf8334SmrgAC_SUBST([INSTALL_CMD])
1172284bf8334Smrg]) # XORG_INSTALL
1172384bf8334Smrgdnl Copyright 2005 Red Hat, Inc
1172484bf8334Smrgdnl
1172584bf8334Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1172684bf8334Smrgdnl documentation for any purpose is hereby granted without fee, provided that
1172784bf8334Smrgdnl the above copyright notice appear in all copies and that both that
1172884bf8334Smrgdnl copyright notice and this permission notice appear in supporting
1172984bf8334Smrgdnl documentation.
1173084bf8334Smrgdnl
1173184bf8334Smrgdnl The above copyright notice and this permission notice shall be included
1173284bf8334Smrgdnl in all copies or substantial portions of the Software.
1173384bf8334Smrgdnl
1173484bf8334Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1173584bf8334Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1173684bf8334Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1173784bf8334Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1173884bf8334Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1173984bf8334Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1174084bf8334Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
1174184bf8334Smrgdnl
1174284bf8334Smrgdnl Except as contained in this notice, the name of the copyright holders shall
1174384bf8334Smrgdnl not be used in advertising or otherwise to promote the sale, use or
1174484bf8334Smrgdnl other dealings in this Software without prior written authorization
1174584bf8334Smrgdnl from the copyright holders.
1174684bf8334Smrgdnl
11747659607e0Smrg
1174884bf8334Smrg# XORG_RELEASE_VERSION
1174984bf8334Smrg# --------------------
1175084bf8334Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
11751659607e0Smrg
1175284bf8334SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1175384bf8334Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1175484bf8334Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1175584bf8334Smrg		[Major version of this package])
1175684bf8334Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1175784bf8334Smrg	if test "x$PVM" = "x"; then
1175884bf8334Smrg		PVM="0"
1175984bf8334Smrg	fi
1176084bf8334Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1176184bf8334Smrg		[$PVM],
1176284bf8334Smrg		[Minor version of this package])
1176384bf8334Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1176484bf8334Smrg	if test "x$PVP" = "x"; then
1176584bf8334Smrg		PVP="0"
1176684bf8334Smrg	fi
1176784bf8334Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1176884bf8334Smrg		[$PVP],
1176984bf8334Smrg		[Patch version of this package])
1177084bf8334Smrg])
11771a73597f9Smrg
1177284bf8334Smrg# XORG_CHANGELOG()
1177384bf8334Smrg# ----------------
1177484bf8334Smrg# Minimum version: 1.2.0
1177584bf8334Smrg#
1177684bf8334Smrg# Defines the variable CHANGELOG_CMD as the command to generate
1177784bf8334Smrg# ChangeLog from git.
1177884bf8334Smrg#
1177984bf8334Smrg#
1178084bf8334SmrgAC_DEFUN([XORG_CHANGELOG], [
1178184bf8334SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
1178284bf8334Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
1178384bf8334Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
1178484bf8334Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
1178584bf8334SmrgAC_SUBST([CHANGELOG_CMD])
1178684bf8334Smrg]) # XORG_CHANGELOG
11787659607e0Smrg
11788