aclocal.m4 revision 8bd17e5f
18bd17e5fSmrg# generated automatically by aclocal 1.13.2 -*- Autoconf -*-
28bd17e5fSmrg
38bd17e5fSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
4b042e37fSmrg
5b042e37fSmrg# This file is free software; the Free Software Foundation
6b042e37fSmrg# gives unlimited permission to copy and/or distribute it,
7b042e37fSmrg# with or without modifications, as long as this notice is preserved.
8b042e37fSmrg
9b042e37fSmrg# This program is distributed in the hope that it will be useful,
10b042e37fSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11b042e37fSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12b042e37fSmrg# PARTICULAR PURPOSE.
13b042e37fSmrg
148bd17e5fSmrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
158c4a8e55Smrgm4_ifndef([AC_AUTOCONF_VERSION],
168c4a8e55Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17706b6b52Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
18706b6b52Smrg[m4_warning([this file was generated for autoconf 2.68.
198c4a8e55SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
208c4a8e55SmrgIf you have problems, you may need to regenerate the build system entirely.
218bd17e5fSmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22b042e37fSmrg
238bd17e5fSmrg# Copyright (C) 2002-2013 Free Software Foundation, Inc.
24b042e37fSmrg#
258bd17e5fSmrg# This file is free software; the Free Software Foundation
268bd17e5fSmrg# gives unlimited permission to copy and/or distribute it,
278bd17e5fSmrg# with or without modifications, as long as this notice is preserved.
288bd17e5fSmrg
298bd17e5fSmrg# AM_AUTOMAKE_VERSION(VERSION)
308bd17e5fSmrg# ----------------------------
318bd17e5fSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
328bd17e5fSmrg# generated from the m4 files accompanying Automake X.Y.
338bd17e5fSmrg# (This private macro should not be called outside this file.)
348bd17e5fSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
358bd17e5fSmrg[am__api_version='1.13'
368bd17e5fSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
378bd17e5fSmrgdnl require some minimum version.  Point them to the right macro.
388bd17e5fSmrgm4_if([$1], [1.13.2], [],
398bd17e5fSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
408bd17e5fSmrg])
418bd17e5fSmrg
428bd17e5fSmrg# _AM_AUTOCONF_VERSION(VERSION)
438bd17e5fSmrg# -----------------------------
448bd17e5fSmrg# aclocal traces this macro to find the Autoconf version.
458bd17e5fSmrg# This is a private macro too.  Using m4_define simplifies
468bd17e5fSmrg# the logic in aclocal, which can simply ignore this definition.
478bd17e5fSmrgm4_define([_AM_AUTOCONF_VERSION], [])
488bd17e5fSmrg
498bd17e5fSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
508bd17e5fSmrg# -------------------------------
518bd17e5fSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
528bd17e5fSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
538bd17e5fSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
548bd17e5fSmrg[AM_AUTOMAKE_VERSION([1.13.2])dnl
558bd17e5fSmrgm4_ifndef([AC_AUTOCONF_VERSION],
568bd17e5fSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
578bd17e5fSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
588bd17e5fSmrg
598bd17e5fSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
608bd17e5fSmrg
618bd17e5fSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
62b042e37fSmrg#
638bd17e5fSmrg# This file is free software; the Free Software Foundation
648bd17e5fSmrg# gives unlimited permission to copy and/or distribute it,
658bd17e5fSmrg# with or without modifications, as long as this notice is preserved.
668c4a8e55Smrg
678bd17e5fSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
688bd17e5fSmrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
698bd17e5fSmrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
70b042e37fSmrg#
718bd17e5fSmrg# Of course, Automake must honor this variable whenever it calls a
728bd17e5fSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
738bd17e5fSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
748bd17e5fSmrg# depending on how configure is run.  This is pretty annoying, since
758bd17e5fSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
768bd17e5fSmrg# source directory, any form will work fine, but in subdirectories a
778bd17e5fSmrg# relative path needs to be adjusted first.
78b042e37fSmrg#
798bd17e5fSmrg# $ac_aux_dir/missing
808bd17e5fSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
818bd17e5fSmrg# $top_srcdir/$ac_aux_dir/missing
828bd17e5fSmrg#    fails if $ac_aux_dir is absolute,
838bd17e5fSmrg#    fails when called from a subdirectory in a VPATH build with
848bd17e5fSmrg#          a relative $ac_aux_dir
85b042e37fSmrg#
868bd17e5fSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
878bd17e5fSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
888bd17e5fSmrg# harmless because $srcdir is '.', but things will broke when you
898bd17e5fSmrg# start a VPATH build or use an absolute $srcdir.
90b042e37fSmrg#
918bd17e5fSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
928bd17e5fSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
938bd17e5fSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
948bd17e5fSmrg# and then we would define $MISSING as
958bd17e5fSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
968bd17e5fSmrg# This will work as long as MISSING is not called from configure, because
978bd17e5fSmrg# unfortunately $(top_srcdir) has no meaning in configure.
988bd17e5fSmrg# However there are other variables, like CC, which are often used in
998bd17e5fSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
100b042e37fSmrg#
1018bd17e5fSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
1028bd17e5fSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
1038bd17e5fSmrg# configured tree to be moved without reconfiguration.
104b042e37fSmrg
1058bd17e5fSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
1068bd17e5fSmrg[dnl Rely on autoconf to set up CDPATH properly.
1078bd17e5fSmrgAC_PREREQ([2.50])dnl
1088bd17e5fSmrg# expand $ac_aux_dir to an absolute path
1098bd17e5fSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
1100597fb56Smrg])
111b042e37fSmrg
1128bd17e5fSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
113b042e37fSmrg
1148bd17e5fSmrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
1158bd17e5fSmrg#
1168bd17e5fSmrg# This file is free software; the Free Software Foundation
1178bd17e5fSmrg# gives unlimited permission to copy and/or distribute it,
1188bd17e5fSmrg# with or without modifications, as long as this notice is preserved.
119b042e37fSmrg
1208bd17e5fSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1218bd17e5fSmrg# -------------------------------------
1228bd17e5fSmrg# Define a conditional.
1238bd17e5fSmrgAC_DEFUN([AM_CONDITIONAL],
1248bd17e5fSmrg[AC_PREREQ([2.52])dnl
1258bd17e5fSmrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1268bd17e5fSmrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1278bd17e5fSmrgAC_SUBST([$1_TRUE])dnl
1288bd17e5fSmrgAC_SUBST([$1_FALSE])dnl
1298bd17e5fSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1308bd17e5fSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1318bd17e5fSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
1328bd17e5fSmrgif $2; then
1338bd17e5fSmrg  $1_TRUE=
1348bd17e5fSmrg  $1_FALSE='#'
1358bd17e5fSmrgelse
1368bd17e5fSmrg  $1_TRUE='#'
1378bd17e5fSmrg  $1_FALSE=
1388bd17e5fSmrgfi
1398bd17e5fSmrgAC_CONFIG_COMMANDS_PRE(
1408bd17e5fSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1418bd17e5fSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
1428bd17e5fSmrgUsually this means the macro was only invoked conditionally.]])
1438bd17e5fSmrgfi])])
144b042e37fSmrg
1458bd17e5fSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
1468bd17e5fSmrg#
1478bd17e5fSmrg# This file is free software; the Free Software Foundation
1488bd17e5fSmrg# gives unlimited permission to copy and/or distribute it,
1498bd17e5fSmrg# with or without modifications, as long as this notice is preserved.
150b042e37fSmrg
151b042e37fSmrg
1528bd17e5fSmrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
1538bd17e5fSmrg# written in clear, in which case automake, when reading aclocal.m4,
1548bd17e5fSmrg# will think it sees a *use*, and therefore will trigger all it's
1558bd17e5fSmrg# C support machinery.  Also note that it means that autoscan, seeing
1568bd17e5fSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
157b042e37fSmrg
158b042e37fSmrg
1598bd17e5fSmrg# _AM_DEPENDENCIES(NAME)
1608bd17e5fSmrg# ----------------------
1618bd17e5fSmrg# See how the compiler implements dependency checking.
1628bd17e5fSmrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
1638bd17e5fSmrg# We try a few techniques and use that to set a single cache variable.
1648bd17e5fSmrg#
1658bd17e5fSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1668bd17e5fSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1678bd17e5fSmrg# dependency, and given that the user is not expected to run this macro,
1688bd17e5fSmrg# just rely on AC_PROG_CC.
1698bd17e5fSmrgAC_DEFUN([_AM_DEPENDENCIES],
1708bd17e5fSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1718bd17e5fSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1728bd17e5fSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1738bd17e5fSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
174b042e37fSmrg
1758bd17e5fSmrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
1768bd17e5fSmrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
1778bd17e5fSmrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1788bd17e5fSmrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
1798bd17e5fSmrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
1808bd17e5fSmrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1818bd17e5fSmrg                    [depcc="$$1"   am_compiler_list=])
182b042e37fSmrg
1838bd17e5fSmrgAC_CACHE_CHECK([dependency style of $depcc],
1848bd17e5fSmrg               [am_cv_$1_dependencies_compiler_type],
1858bd17e5fSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1868bd17e5fSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
1878bd17e5fSmrg  # making bogus files that we don't know about and never remove.  For
1888bd17e5fSmrg  # instance it was reported that on HP-UX the gcc test will end up
1898bd17e5fSmrg  # making a dummy file named 'D' -- because '-MD' means "put the output
1908bd17e5fSmrg  # in D".
1918bd17e5fSmrg  rm -rf conftest.dir
1928bd17e5fSmrg  mkdir conftest.dir
1938bd17e5fSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1948bd17e5fSmrg  # using a relative directory.
1958bd17e5fSmrg  cp "$am_depcomp" conftest.dir
1968bd17e5fSmrg  cd conftest.dir
1978bd17e5fSmrg  # We will build objects and dependencies in a subdirectory because
1988bd17e5fSmrg  # it helps to detect inapplicable dependency modes.  For instance
1998bd17e5fSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
2008bd17e5fSmrg  # side effect of compilation, but ICC will put the dependencies in
2018bd17e5fSmrg  # the current directory while Tru64 will put them in the object
2028bd17e5fSmrg  # directory.
2038bd17e5fSmrg  mkdir sub
204b042e37fSmrg
2058bd17e5fSmrg  am_cv_$1_dependencies_compiler_type=none
2068bd17e5fSmrg  if test "$am_compiler_list" = ""; then
2078bd17e5fSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2088bd17e5fSmrg  fi
2098bd17e5fSmrg  am__universal=false
2108bd17e5fSmrg  m4_case([$1], [CC],
2118bd17e5fSmrg    [case " $depcc " in #(
2128bd17e5fSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2138bd17e5fSmrg     esac],
2148bd17e5fSmrg    [CXX],
2158bd17e5fSmrg    [case " $depcc " in #(
2168bd17e5fSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
2178bd17e5fSmrg     esac])
218b042e37fSmrg
2198bd17e5fSmrg  for depmode in $am_compiler_list; do
2208bd17e5fSmrg    # Setup a source with many dependencies, because some compilers
2218bd17e5fSmrg    # like to wrap large dependency lists on column 80 (with \), and
2228bd17e5fSmrg    # we should not choose a depcomp mode which is confused by this.
2238bd17e5fSmrg    #
2248bd17e5fSmrg    # We need to recreate these files for each test, as the compiler may
2258bd17e5fSmrg    # overwrite some of them when testing with obscure command lines.
2268bd17e5fSmrg    # This happens at least with the AIX C compiler.
2278bd17e5fSmrg    : > sub/conftest.c
2288bd17e5fSmrg    for i in 1 2 3 4 5 6; do
2298bd17e5fSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
2308bd17e5fSmrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
2318bd17e5fSmrg      # Solaris 10 /bin/sh.
2328bd17e5fSmrg      echo '/* dummy */' > sub/conftst$i.h
2338bd17e5fSmrg    done
2348bd17e5fSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
235b042e37fSmrg
2368bd17e5fSmrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
2378bd17e5fSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
2388bd17e5fSmrg    # handle '-M -o', and we need to detect this.  Also, some Intel
2398bd17e5fSmrg    # versions had trouble with output in subdirs.
2408bd17e5fSmrg    am__obj=sub/conftest.${OBJEXT-o}
2418bd17e5fSmrg    am__minus_obj="-o $am__obj"
2428bd17e5fSmrg    case $depmode in
2438bd17e5fSmrg    gcc)
2448bd17e5fSmrg      # This depmode causes a compiler race in universal mode.
2458bd17e5fSmrg      test "$am__universal" = false || continue
2468bd17e5fSmrg      ;;
2478bd17e5fSmrg    nosideeffect)
2488bd17e5fSmrg      # After this tag, mechanisms are not by side-effect, so they'll
2498bd17e5fSmrg      # only be used when explicitly requested.
2508bd17e5fSmrg      if test "x$enable_dependency_tracking" = xyes; then
2518bd17e5fSmrg	continue
2528bd17e5fSmrg      else
2538bd17e5fSmrg	break
2548bd17e5fSmrg      fi
2558bd17e5fSmrg      ;;
2568bd17e5fSmrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
2578bd17e5fSmrg      # This compiler won't grok '-c -o', but also, the minuso test has
2588bd17e5fSmrg      # not run yet.  These depmodes are late enough in the game, and
2598bd17e5fSmrg      # so weak that their functioning should not be impacted.
2608bd17e5fSmrg      am__obj=conftest.${OBJEXT-o}
2618bd17e5fSmrg      am__minus_obj=
2628bd17e5fSmrg      ;;
2638bd17e5fSmrg    none) break ;;
2648bd17e5fSmrg    esac
2658bd17e5fSmrg    if depmode=$depmode \
2668bd17e5fSmrg       source=sub/conftest.c object=$am__obj \
2678bd17e5fSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2688bd17e5fSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
2698bd17e5fSmrg         >/dev/null 2>conftest.err &&
2708bd17e5fSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2718bd17e5fSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2728bd17e5fSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
2738bd17e5fSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2748bd17e5fSmrg      # icc doesn't choke on unknown options, it will just issue warnings
2758bd17e5fSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
2768bd17e5fSmrg      # that says an option was ignored or not supported.
2778bd17e5fSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
2788bd17e5fSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
2798bd17e5fSmrg      # The diagnosis changed in icc 8.0:
2808bd17e5fSmrg      #   icc: Command line remark: option '-MP' not supported
2818bd17e5fSmrg      if (grep 'ignoring option' conftest.err ||
2828bd17e5fSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2838bd17e5fSmrg        am_cv_$1_dependencies_compiler_type=$depmode
2848bd17e5fSmrg        break
2858bd17e5fSmrg      fi
2868bd17e5fSmrg    fi
2878bd17e5fSmrg  done
288b042e37fSmrg
2898bd17e5fSmrg  cd ..
2908bd17e5fSmrg  rm -rf conftest.dir
2918bd17e5fSmrgelse
2928bd17e5fSmrg  am_cv_$1_dependencies_compiler_type=none
2938bd17e5fSmrgfi
2948bd17e5fSmrg])
2958bd17e5fSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2968bd17e5fSmrgAM_CONDITIONAL([am__fastdep$1], [
2978bd17e5fSmrg  test "x$enable_dependency_tracking" != xno \
2988bd17e5fSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
2998bd17e5fSmrg])
300b042e37fSmrg
301b042e37fSmrg
3028bd17e5fSmrg# AM_SET_DEPDIR
3038bd17e5fSmrg# -------------
3048bd17e5fSmrg# Choose a directory name for dependency files.
3058bd17e5fSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
3068bd17e5fSmrgAC_DEFUN([AM_SET_DEPDIR],
3078bd17e5fSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3088bd17e5fSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
3098bd17e5fSmrg])
310b042e37fSmrg
311b042e37fSmrg
3128bd17e5fSmrg# AM_DEP_TRACK
3138bd17e5fSmrg# ------------
3148bd17e5fSmrgAC_DEFUN([AM_DEP_TRACK],
3158bd17e5fSmrg[AC_ARG_ENABLE([dependency-tracking], [dnl
3168bd17e5fSmrgAS_HELP_STRING(
3178bd17e5fSmrg  [--enable-dependency-tracking],
3188bd17e5fSmrg  [do not reject slow dependency extractors])
3198bd17e5fSmrgAS_HELP_STRING(
3208bd17e5fSmrg  [--disable-dependency-tracking],
3218bd17e5fSmrg  [speeds up one-time build])])
3228bd17e5fSmrgif test "x$enable_dependency_tracking" != xno; then
3238bd17e5fSmrg  am_depcomp="$ac_aux_dir/depcomp"
3248bd17e5fSmrg  AMDEPBACKSLASH='\'
3258bd17e5fSmrg  am__nodep='_no'
3260597fb56Smrgfi
3278bd17e5fSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
3288bd17e5fSmrgAC_SUBST([AMDEPBACKSLASH])dnl
3298bd17e5fSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
3308bd17e5fSmrgAC_SUBST([am__nodep])dnl
3318bd17e5fSmrg_AM_SUBST_NOTMAKE([am__nodep])dnl
332706b6b52Smrg])
333b042e37fSmrg
3348bd17e5fSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
335b042e37fSmrg
3368bd17e5fSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
3378bd17e5fSmrg#
3388bd17e5fSmrg# This file is free software; the Free Software Foundation
3398bd17e5fSmrg# gives unlimited permission to copy and/or distribute it,
3408bd17e5fSmrg# with or without modifications, as long as this notice is preserved.
341b042e37fSmrg
342b042e37fSmrg
3438bd17e5fSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
3448bd17e5fSmrg# ------------------------------
3458bd17e5fSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3468bd17e5fSmrg[{
3478bd17e5fSmrg  # Older Autoconf quotes --file arguments for eval, but not when files
3488bd17e5fSmrg  # are listed without --file.  Let's play safe and only enable the eval
3498bd17e5fSmrg  # if we detect the quoting.
3508bd17e5fSmrg  case $CONFIG_FILES in
3518bd17e5fSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
3528bd17e5fSmrg  *)   set x $CONFIG_FILES ;;
3538bd17e5fSmrg  esac
3548bd17e5fSmrg  shift
3558bd17e5fSmrg  for mf
3568bd17e5fSmrg  do
3578bd17e5fSmrg    # Strip MF so we end up with the name of the file.
3588bd17e5fSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
3598bd17e5fSmrg    # Check whether this is an Automake generated Makefile or not.
3608bd17e5fSmrg    # We used to match only the files named 'Makefile.in', but
3618bd17e5fSmrg    # some people rename them; so instead we look at the file content.
3628bd17e5fSmrg    # Grep'ing the first line is not enough: some people post-process
3638bd17e5fSmrg    # each Makefile.in and add a new line on top of each file to say so.
3648bd17e5fSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
3658bd17e5fSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
3668bd17e5fSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
3678bd17e5fSmrg      dirpart=`AS_DIRNAME("$mf")`
3688bd17e5fSmrg    else
3698bd17e5fSmrg      continue
3708bd17e5fSmrg    fi
3718bd17e5fSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
3728bd17e5fSmrg    # from the Makefile without running 'make'.
3738bd17e5fSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
3748bd17e5fSmrg    test -z "$DEPDIR" && continue
3758bd17e5fSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
3768bd17e5fSmrg    test -z "$am__include" && continue
3778bd17e5fSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
3788bd17e5fSmrg    # Find all dependency output files, they are included files with
3798bd17e5fSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
3808bd17e5fSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
3818bd17e5fSmrg    # expansion.
3828bd17e5fSmrg    for file in `sed -n "
3838bd17e5fSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3848bd17e5fSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
3858bd17e5fSmrg      # Make sure the directory exists.
3868bd17e5fSmrg      test -f "$dirpart/$file" && continue
3878bd17e5fSmrg      fdir=`AS_DIRNAME(["$file"])`
3888bd17e5fSmrg      AS_MKDIR_P([$dirpart/$fdir])
3898bd17e5fSmrg      # echo "creating $dirpart/$file"
3908bd17e5fSmrg      echo '# dummy' > "$dirpart/$file"
3918bd17e5fSmrg    done
3928bd17e5fSmrg  done
3938bd17e5fSmrg}
3948bd17e5fSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
395b042e37fSmrg
3968c4a8e55Smrg
3978bd17e5fSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
3988bd17e5fSmrg# -----------------------------
3998bd17e5fSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
4008bd17e5fSmrg#
4018bd17e5fSmrg# This code is only required when automatic dependency tracking
4028bd17e5fSmrg# is enabled.  FIXME.  This creates each '.P' file that we will
4038bd17e5fSmrg# need in order to bootstrap the dependency handling code.
4048bd17e5fSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
4058bd17e5fSmrg[AC_CONFIG_COMMANDS([depfiles],
4068bd17e5fSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
4078bd17e5fSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
4088bd17e5fSmrg])
4098c4a8e55Smrg
4108bd17e5fSmrg# Do all the work for Automake.                             -*- Autoconf -*-
4118c4a8e55Smrg
4128bd17e5fSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
4138bd17e5fSmrg#
4148bd17e5fSmrg# This file is free software; the Free Software Foundation
4158bd17e5fSmrg# gives unlimited permission to copy and/or distribute it,
4168bd17e5fSmrg# with or without modifications, as long as this notice is preserved.
417b042e37fSmrg
4188bd17e5fSmrg# This macro actually does too much.  Some checks are only needed if
4198bd17e5fSmrg# your package does certain things.  But this isn't really a big deal.
420b042e37fSmrg
4218bd17e5fSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
4228bd17e5fSmrg# AM_INIT_AUTOMAKE([OPTIONS])
4238bd17e5fSmrg# -----------------------------------------------
4248bd17e5fSmrg# The call with PACKAGE and VERSION arguments is the old style
4258bd17e5fSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
4268bd17e5fSmrg# and VERSION should now be passed to AC_INIT and removed from
4278bd17e5fSmrg# the call to AM_INIT_AUTOMAKE.
4288bd17e5fSmrg# We support both call styles for the transition.  After
4298bd17e5fSmrg# the next Automake release, Autoconf can make the AC_INIT
4308bd17e5fSmrg# arguments mandatory, and then we can depend on a new Autoconf
4318bd17e5fSmrg# release and drop the old call support.
4328bd17e5fSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
4338bd17e5fSmrg[AC_PREREQ([2.65])dnl
4348bd17e5fSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
4358bd17e5fSmrgdnl the ones we care about.
4368bd17e5fSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
4378bd17e5fSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
4388bd17e5fSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
4398bd17e5fSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
4408bd17e5fSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
4418bd17e5fSmrg  # is not polluted with repeated "-I."
4428bd17e5fSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
4438bd17e5fSmrg  # test to see if srcdir already configured
4448bd17e5fSmrg  if test -f $srcdir/config.status; then
4458bd17e5fSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
4468bd17e5fSmrg  fi
4478bd17e5fSmrgfi
4488c4a8e55Smrg
4498bd17e5fSmrg# test whether we have cygpath
4508bd17e5fSmrgif test -z "$CYGPATH_W"; then
4518bd17e5fSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
4528bd17e5fSmrg    CYGPATH_W='cygpath -w'
4538bd17e5fSmrg  else
4548bd17e5fSmrg    CYGPATH_W=echo
4558bd17e5fSmrg  fi
4568bd17e5fSmrgfi
4578bd17e5fSmrgAC_SUBST([CYGPATH_W])
4588c4a8e55Smrg
4598bd17e5fSmrg# Define the identity of the package.
4608bd17e5fSmrgdnl Distinguish between old-style and new-style calls.
4618bd17e5fSmrgm4_ifval([$2],
4628bd17e5fSmrg[AC_DIAGNOSE([obsolete],
4638bd17e5fSmrg             [$0: two- and three-arguments forms are deprecated.])
4648bd17e5fSmrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
4658bd17e5fSmrg AC_SUBST([PACKAGE], [$1])dnl
4668bd17e5fSmrg AC_SUBST([VERSION], [$2])],
4678bd17e5fSmrg[_AM_SET_OPTIONS([$1])dnl
4688bd17e5fSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
4698bd17e5fSmrgm4_if(
4708bd17e5fSmrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
4718bd17e5fSmrg  [ok:ok],,
4728bd17e5fSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
4738bd17e5fSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
4748bd17e5fSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
4758c4a8e55Smrg
4768bd17e5fSmrg_AM_IF_OPTION([no-define],,
4778bd17e5fSmrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
4788bd17e5fSmrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
4798c4a8e55Smrg
4808bd17e5fSmrg# Some tools Automake needs.
4818bd17e5fSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
4828bd17e5fSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
4838bd17e5fSmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
4848bd17e5fSmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
4858bd17e5fSmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
4868bd17e5fSmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
4878bd17e5fSmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
4888bd17e5fSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
4898bd17e5fSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
4908bd17e5fSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
4918bd17e5fSmrg# For better backward compatibility.  To be removed once Automake 1.9.x
4928bd17e5fSmrg# dies out for good.  For more background, see:
4938bd17e5fSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
4948bd17e5fSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
4958bd17e5fSmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
4968bd17e5fSmrg# We need awk for the "check" target.  The system "awk" is bad on
4978bd17e5fSmrg# some platforms.
4988bd17e5fSmrgAC_REQUIRE([AC_PROG_AWK])dnl
4998bd17e5fSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
5008bd17e5fSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
5018bd17e5fSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
5028bd17e5fSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
5038bd17e5fSmrg			     [_AM_PROG_TAR([v7])])])
5048bd17e5fSmrg_AM_IF_OPTION([no-dependencies],,
5058bd17e5fSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
5068bd17e5fSmrg		  [_AM_DEPENDENCIES([CC])],
5078bd17e5fSmrg		  [m4_define([AC_PROG_CC],
5088bd17e5fSmrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
5098bd17e5fSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
5108bd17e5fSmrg		  [_AM_DEPENDENCIES([CXX])],
5118bd17e5fSmrg		  [m4_define([AC_PROG_CXX],
5128bd17e5fSmrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
5138bd17e5fSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
5148bd17e5fSmrg		  [_AM_DEPENDENCIES([OBJC])],
5158bd17e5fSmrg		  [m4_define([AC_PROG_OBJC],
5168bd17e5fSmrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
5178bd17e5fSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
5188bd17e5fSmrg		  [_AM_DEPENDENCIES([OBJCXX])],
5198bd17e5fSmrg		  [m4_define([AC_PROG_OBJCXX],
5208bd17e5fSmrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
5218bd17e5fSmrg])
5228bd17e5fSmrgAC_REQUIRE([AM_SILENT_RULES])dnl
5238bd17e5fSmrgdnl The testsuite driver may need to know about EXEEXT, so add the
5248bd17e5fSmrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
5258bd17e5fSmrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
5268bd17e5fSmrgAC_CONFIG_COMMANDS_PRE(dnl
5278bd17e5fSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
5288bd17e5fSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
5290597fb56Smrg])
5308c4a8e55Smrg
5318bd17e5fSmrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
5328bd17e5fSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
5338bd17e5fSmrgdnl mangled by Autoconf and run in a shell conditional statement.
5348bd17e5fSmrgm4_define([_AC_COMPILER_EXEEXT],
5358bd17e5fSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
536b042e37fSmrg
537b042e37fSmrg
5388bd17e5fSmrg# When config.status generates a header, we must update the stamp-h file.
5398bd17e5fSmrg# This file resides in the same directory as the config header
5408bd17e5fSmrg# that is generated.  The stamp files are numbered to have different names.
541b042e37fSmrg
5428bd17e5fSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
5438bd17e5fSmrg# loop where config.status creates the headers, so we can generate
5448bd17e5fSmrg# our stamp files there.
5458bd17e5fSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
5468bd17e5fSmrg[# Compute $1's index in $config_headers.
5478bd17e5fSmrg_am_arg=$1
5488bd17e5fSmrg_am_stamp_count=1
5498bd17e5fSmrgfor _am_header in $config_headers :; do
5508bd17e5fSmrg  case $_am_header in
5518bd17e5fSmrg    $_am_arg | $_am_arg:* )
5528bd17e5fSmrg      break ;;
5538bd17e5fSmrg    * )
5548bd17e5fSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
5558bd17e5fSmrg  esac
5568bd17e5fSmrgdone
5578bd17e5fSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
558b042e37fSmrg
5598bd17e5fSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
5608bd17e5fSmrg#
5618bd17e5fSmrg# This file is free software; the Free Software Foundation
5628bd17e5fSmrg# gives unlimited permission to copy and/or distribute it,
5638bd17e5fSmrg# with or without modifications, as long as this notice is preserved.
564b042e37fSmrg
5658bd17e5fSmrg# AM_PROG_INSTALL_SH
5668bd17e5fSmrg# ------------------
5678bd17e5fSmrg# Define $install_sh.
5688bd17e5fSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
5698bd17e5fSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
5708bd17e5fSmrgif test x"${install_sh}" != xset; then
5718bd17e5fSmrg  case $am_aux_dir in
5728bd17e5fSmrg  *\ * | *\	*)
5738bd17e5fSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
5748bd17e5fSmrg  *)
5758bd17e5fSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
5768bd17e5fSmrg  esac
5778bd17e5fSmrgfi
5788bd17e5fSmrgAC_SUBST([install_sh])])
579706b6b52Smrg
5808bd17e5fSmrg# Copyright (C) 2003-2013 Free Software Foundation, Inc.
5818bd17e5fSmrg#
5828bd17e5fSmrg# This file is free software; the Free Software Foundation
5838bd17e5fSmrg# gives unlimited permission to copy and/or distribute it,
5848bd17e5fSmrg# with or without modifications, as long as this notice is preserved.
585b042e37fSmrg
5868bd17e5fSmrg# Check whether the underlying file-system supports filenames
5878bd17e5fSmrg# with a leading dot.  For instance MS-DOS doesn't.
5888bd17e5fSmrgAC_DEFUN([AM_SET_LEADING_DOT],
5898bd17e5fSmrg[rm -rf .tst 2>/dev/null
5908bd17e5fSmrgmkdir .tst 2>/dev/null
5918bd17e5fSmrgif test -d .tst; then
5928bd17e5fSmrg  am__leading_dot=.
5938bd17e5fSmrgelse
5948bd17e5fSmrg  am__leading_dot=_
5958bd17e5fSmrgfi
5968bd17e5fSmrgrmdir .tst 2>/dev/null
5978bd17e5fSmrgAC_SUBST([am__leading_dot])])
598b042e37fSmrg
5998bd17e5fSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
600b042e37fSmrg
6018bd17e5fSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
6028bd17e5fSmrg#
6038bd17e5fSmrg# This file is free software; the Free Software Foundation
6048bd17e5fSmrg# gives unlimited permission to copy and/or distribute it,
6058bd17e5fSmrg# with or without modifications, as long as this notice is preserved.
606b042e37fSmrg
6078bd17e5fSmrg# AM_MAKE_INCLUDE()
6088bd17e5fSmrg# -----------------
6098bd17e5fSmrg# Check to see how make treats includes.
6108bd17e5fSmrgAC_DEFUN([AM_MAKE_INCLUDE],
6118bd17e5fSmrg[am_make=${MAKE-make}
6128bd17e5fSmrgcat > confinc << 'END'
6138bd17e5fSmrgam__doit:
6148bd17e5fSmrg	@echo this is the am__doit target
6158bd17e5fSmrg.PHONY: am__doit
6168bd17e5fSmrgEND
6178bd17e5fSmrg# If we don't find an include directive, just comment out the code.
6188bd17e5fSmrgAC_MSG_CHECKING([for style of include used by $am_make])
6198bd17e5fSmrgam__include="#"
6208bd17e5fSmrgam__quote=
6218bd17e5fSmrg_am_result=none
6228bd17e5fSmrg# First try GNU make style include.
6238bd17e5fSmrgecho "include confinc" > confmf
6248bd17e5fSmrg# Ignore all kinds of additional output from 'make'.
6258bd17e5fSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
6268bd17e5fSmrg*the\ am__doit\ target*)
6278bd17e5fSmrg  am__include=include
6288bd17e5fSmrg  am__quote=
6298bd17e5fSmrg  _am_result=GNU
6308bd17e5fSmrg  ;;
6318bd17e5fSmrgesac
6328bd17e5fSmrg# Now try BSD make style include.
6338bd17e5fSmrgif test "$am__include" = "#"; then
6348bd17e5fSmrg   echo '.include "confinc"' > confmf
6358bd17e5fSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
6368bd17e5fSmrg   *the\ am__doit\ target*)
6378bd17e5fSmrg     am__include=.include
6388bd17e5fSmrg     am__quote="\""
6398bd17e5fSmrg     _am_result=BSD
6408bd17e5fSmrg     ;;
6418bd17e5fSmrg   esac
6428bd17e5fSmrgfi
6438bd17e5fSmrgAC_SUBST([am__include])
6448bd17e5fSmrgAC_SUBST([am__quote])
6458bd17e5fSmrgAC_MSG_RESULT([$_am_result])
6468bd17e5fSmrgrm -f confinc confmf
6470597fb56Smrg])
648b042e37fSmrg
6498bd17e5fSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
650b042e37fSmrg
6518bd17e5fSmrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
6528bd17e5fSmrg#
6538bd17e5fSmrg# This file is free software; the Free Software Foundation
6548bd17e5fSmrg# gives unlimited permission to copy and/or distribute it,
6558bd17e5fSmrg# with or without modifications, as long as this notice is preserved.
656b042e37fSmrg
6578bd17e5fSmrg# AM_MISSING_PROG(NAME, PROGRAM)
6588bd17e5fSmrg# ------------------------------
6598bd17e5fSmrgAC_DEFUN([AM_MISSING_PROG],
6608bd17e5fSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
6618bd17e5fSmrg$1=${$1-"${am_missing_run}$2"}
6628bd17e5fSmrgAC_SUBST($1)])
663b042e37fSmrg
6648bd17e5fSmrg# AM_MISSING_HAS_RUN
6658bd17e5fSmrg# ------------------
6668bd17e5fSmrg# Define MISSING if not defined so far and test if it is modern enough.
6678bd17e5fSmrg# If it is, set am_missing_run to use it, otherwise, to nothing.
6688bd17e5fSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
6698bd17e5fSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
6708bd17e5fSmrgAC_REQUIRE_AUX_FILE([missing])dnl
6718bd17e5fSmrgif test x"${MISSING+set}" != xset; then
6728bd17e5fSmrg  case $am_aux_dir in
6738bd17e5fSmrg  *\ * | *\	*)
6748bd17e5fSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
6758bd17e5fSmrg  *)
6768bd17e5fSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
6778bd17e5fSmrg  esac
6788bd17e5fSmrgfi
6798bd17e5fSmrg# Use eval to expand $SHELL
6808bd17e5fSmrgif eval "$MISSING --is-lightweight"; then
6818bd17e5fSmrg  am_missing_run="$MISSING "
6828bd17e5fSmrgelse
6838bd17e5fSmrg  am_missing_run=
6848bd17e5fSmrg  AC_MSG_WARN(['missing' script is too old or missing])
6858bd17e5fSmrgfi
6860597fb56Smrg])
687b042e37fSmrg
6888bd17e5fSmrg# Helper functions for option handling.                     -*- Autoconf -*-
689b042e37fSmrg
6908bd17e5fSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
6918bd17e5fSmrg#
6928bd17e5fSmrg# This file is free software; the Free Software Foundation
6938bd17e5fSmrg# gives unlimited permission to copy and/or distribute it,
6948bd17e5fSmrg# with or without modifications, as long as this notice is preserved.
695b042e37fSmrg
6968bd17e5fSmrg# _AM_MANGLE_OPTION(NAME)
6978bd17e5fSmrg# -----------------------
6988bd17e5fSmrgAC_DEFUN([_AM_MANGLE_OPTION],
6998bd17e5fSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
700b042e37fSmrg
7018bd17e5fSmrg# _AM_SET_OPTION(NAME)
7028bd17e5fSmrg# --------------------
7038bd17e5fSmrg# Set option NAME.  Presently that only means defining a flag for this option.
7048bd17e5fSmrgAC_DEFUN([_AM_SET_OPTION],
7058bd17e5fSmrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
706b042e37fSmrg
7078bd17e5fSmrg# _AM_SET_OPTIONS(OPTIONS)
7088bd17e5fSmrg# ------------------------
7098bd17e5fSmrg# OPTIONS is a space-separated list of Automake options.
7108bd17e5fSmrgAC_DEFUN([_AM_SET_OPTIONS],
7118bd17e5fSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
7128c4a8e55Smrg
7138bd17e5fSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
7148bd17e5fSmrg# -------------------------------------------
7158bd17e5fSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7168bd17e5fSmrgAC_DEFUN([_AM_IF_OPTION],
7178bd17e5fSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
7188c4a8e55Smrg
7198bd17e5fSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
720b042e37fSmrg
7218bd17e5fSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
7228bd17e5fSmrg#
7238bd17e5fSmrg# This file is free software; the Free Software Foundation
7248bd17e5fSmrg# gives unlimited permission to copy and/or distribute it,
7258bd17e5fSmrg# with or without modifications, as long as this notice is preserved.
726b042e37fSmrg
7278bd17e5fSmrg# AM_SANITY_CHECK
7288bd17e5fSmrg# ---------------
7298bd17e5fSmrgAC_DEFUN([AM_SANITY_CHECK],
7308bd17e5fSmrg[AC_MSG_CHECKING([whether build environment is sane])
7318bd17e5fSmrg# Reject unsafe characters in $srcdir or the absolute working directory
7328bd17e5fSmrg# name.  Accept space and tab only in the latter.
7338bd17e5fSmrgam_lf='
7348bd17e5fSmrg'
7358bd17e5fSmrgcase `pwd` in
7368bd17e5fSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
7378bd17e5fSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
7388bd17e5fSmrgesac
7398bd17e5fSmrgcase $srcdir in
7408bd17e5fSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
7418bd17e5fSmrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
7428bd17e5fSmrgesac
7438c4a8e55Smrg
7448bd17e5fSmrg# Do 'set' in a subshell so we don't clobber the current shell's
7458bd17e5fSmrg# arguments.  Must try -L first in case configure is actually a
7468bd17e5fSmrg# symlink; some systems play weird games with the mod time of symlinks
7478bd17e5fSmrg# (eg FreeBSD returns the mod time of the symlink's containing
7488bd17e5fSmrg# directory).
7498bd17e5fSmrgif (
7508bd17e5fSmrg   am_has_slept=no
7518bd17e5fSmrg   for am_try in 1 2; do
7528bd17e5fSmrg     echo "timestamp, slept: $am_has_slept" > conftest.file
7538bd17e5fSmrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
7548bd17e5fSmrg     if test "$[*]" = "X"; then
7558bd17e5fSmrg	# -L didn't work.
7568bd17e5fSmrg	set X `ls -t "$srcdir/configure" conftest.file`
7578bd17e5fSmrg     fi
7588bd17e5fSmrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
7598bd17e5fSmrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
7608bd17e5fSmrg
7618bd17e5fSmrg	# If neither matched, then we have a broken ls.  This can happen
7628bd17e5fSmrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
7638bd17e5fSmrg	# broken ls alias from the environment.  This has actually
7648bd17e5fSmrg	# happened.  Such a system could not be considered "sane".
7658bd17e5fSmrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
7668bd17e5fSmrg  alias in your environment])
7678bd17e5fSmrg     fi
7688bd17e5fSmrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
7698bd17e5fSmrg       break
7708bd17e5fSmrg     fi
7718bd17e5fSmrg     # Just in case.
7728bd17e5fSmrg     sleep 1
7738bd17e5fSmrg     am_has_slept=yes
7748bd17e5fSmrg   done
7758bd17e5fSmrg   test "$[2]" = conftest.file
7768bd17e5fSmrg   )
7778bd17e5fSmrgthen
7788bd17e5fSmrg   # Ok.
7798bd17e5fSmrg   :
7808bd17e5fSmrgelse
7818bd17e5fSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
7828bd17e5fSmrgCheck your system clock])
7838bd17e5fSmrgfi
7848bd17e5fSmrgAC_MSG_RESULT([yes])
7858bd17e5fSmrg# If we didn't sleep, we still need to ensure time stamps of config.status and
7868bd17e5fSmrg# generated files are strictly newer.
7878bd17e5fSmrgam_sleep_pid=
7888bd17e5fSmrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
7898bd17e5fSmrg  ( sleep 1 ) &
7908bd17e5fSmrg  am_sleep_pid=$!
7918bd17e5fSmrgfi
7928bd17e5fSmrgAC_CONFIG_COMMANDS_PRE(
7938bd17e5fSmrg  [AC_MSG_CHECKING([that generated files are newer than configure])
7948bd17e5fSmrg   if test -n "$am_sleep_pid"; then
7958bd17e5fSmrg     # Hide warnings about reused PIDs.
7968bd17e5fSmrg     wait $am_sleep_pid 2>/dev/null
7978bd17e5fSmrg   fi
7988bd17e5fSmrg   AC_MSG_RESULT([done])])
7998bd17e5fSmrgrm -f conftest.file
8008bd17e5fSmrg])
801b042e37fSmrg
8028bd17e5fSmrg# Copyright (C) 2009-2013 Free Software Foundation, Inc.
8038bd17e5fSmrg#
8048bd17e5fSmrg# This file is free software; the Free Software Foundation
8058bd17e5fSmrg# gives unlimited permission to copy and/or distribute it,
8068bd17e5fSmrg# with or without modifications, as long as this notice is preserved.
807b042e37fSmrg
8088bd17e5fSmrg# AM_SILENT_RULES([DEFAULT])
8098bd17e5fSmrg# --------------------------
8108bd17e5fSmrg# Enable less verbose build rules; with the default set to DEFAULT
8118bd17e5fSmrg# ("yes" being less verbose, "no" or empty being verbose).
8128bd17e5fSmrgAC_DEFUN([AM_SILENT_RULES],
8138bd17e5fSmrg[AC_ARG_ENABLE([silent-rules], [dnl
8148bd17e5fSmrgAS_HELP_STRING(
8158bd17e5fSmrg  [--enable-silent-rules],
8168bd17e5fSmrg  [less verbose build output (undo: "make V=1")])
8178bd17e5fSmrgAS_HELP_STRING(
8188bd17e5fSmrg  [--disable-silent-rules],
8198bd17e5fSmrg  [verbose build output (undo: "make V=0")])dnl
8200597fb56Smrg])
8218bd17e5fSmrgcase $enable_silent_rules in @%:@ (((
8228bd17e5fSmrg  yes) AM_DEFAULT_VERBOSITY=0;;
8238bd17e5fSmrg   no) AM_DEFAULT_VERBOSITY=1;;
8248bd17e5fSmrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
8258bd17e5fSmrgesac
8268bd17e5fSmrgdnl
8278bd17e5fSmrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
8288bd17e5fSmrgdnl do not support nested variable expansions.
8298bd17e5fSmrgdnl See automake bug#9928 and bug#10237.
8308bd17e5fSmrgam_make=${MAKE-make}
8318bd17e5fSmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
8328bd17e5fSmrg   [am_cv_make_support_nested_variables],
8338bd17e5fSmrg   [if AS_ECHO([['TRUE=$(BAR$(V))
8348bd17e5fSmrgBAR0=false
8358bd17e5fSmrgBAR1=true
8368bd17e5fSmrgV=1
8378bd17e5fSmrgam__doit:
8388bd17e5fSmrg	@$(TRUE)
8398bd17e5fSmrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
8408bd17e5fSmrg  am_cv_make_support_nested_variables=yes
8418bd17e5fSmrgelse
8428bd17e5fSmrg  am_cv_make_support_nested_variables=no
8438bd17e5fSmrgfi])
8448bd17e5fSmrgif test $am_cv_make_support_nested_variables = yes; then
8458bd17e5fSmrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
8468bd17e5fSmrg  AM_V='$(V)'
8478bd17e5fSmrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
8488bd17e5fSmrgelse
8498bd17e5fSmrg  AM_V=$AM_DEFAULT_VERBOSITY
8508bd17e5fSmrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
8518bd17e5fSmrgfi
8528bd17e5fSmrgAC_SUBST([AM_V])dnl
8538bd17e5fSmrgAM_SUBST_NOTMAKE([AM_V])dnl
8548bd17e5fSmrgAC_SUBST([AM_DEFAULT_V])dnl
8558bd17e5fSmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
8568bd17e5fSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
8578bd17e5fSmrgAM_BACKSLASH='\'
8588bd17e5fSmrgAC_SUBST([AM_BACKSLASH])dnl
8598bd17e5fSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
8608c4a8e55Smrg])
861b042e37fSmrg
8628bd17e5fSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
8638bd17e5fSmrg#
8648bd17e5fSmrg# This file is free software; the Free Software Foundation
8658bd17e5fSmrg# gives unlimited permission to copy and/or distribute it,
8668bd17e5fSmrg# with or without modifications, as long as this notice is preserved.
867b042e37fSmrg
8688bd17e5fSmrg# AM_PROG_INSTALL_STRIP
8698bd17e5fSmrg# ---------------------
8708bd17e5fSmrg# One issue with vendor 'install' (even GNU) is that you can't
8718bd17e5fSmrg# specify the program used to strip binaries.  This is especially
8728bd17e5fSmrg# annoying in cross-compiling environments, where the build's strip
8738bd17e5fSmrg# is unlikely to handle the host's binaries.
8748bd17e5fSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
8758bd17e5fSmrg# always use install-sh in "make install-strip", and initialize
8768bd17e5fSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
8778bd17e5fSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
8788bd17e5fSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
8798bd17e5fSmrg# Installed binaries are usually stripped using 'strip' when the user
8808bd17e5fSmrg# run "make install-strip".  However 'strip' might not be the right
8818bd17e5fSmrg# tool to use in cross-compilation environments, therefore Automake
8828bd17e5fSmrg# will honor the 'STRIP' environment variable to overrule this program.
8838bd17e5fSmrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
8848bd17e5fSmrgif test "$cross_compiling" != no; then
8858bd17e5fSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
8868bd17e5fSmrgfi
8878bd17e5fSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
8888bd17e5fSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
889b042e37fSmrg
8908bd17e5fSmrg# Copyright (C) 2006-2013 Free Software Foundation, Inc.
8910597fb56Smrg#
8928bd17e5fSmrg# This file is free software; the Free Software Foundation
8938bd17e5fSmrg# gives unlimited permission to copy and/or distribute it,
8948bd17e5fSmrg# with or without modifications, as long as this notice is preserved.
895b042e37fSmrg
8968bd17e5fSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
8978bd17e5fSmrg# ---------------------------
8988bd17e5fSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
8998bd17e5fSmrg# This macro is traced by Automake.
9008bd17e5fSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
901b042e37fSmrg
9028bd17e5fSmrg# AM_SUBST_NOTMAKE(VARIABLE)
9038bd17e5fSmrg# --------------------------
9048bd17e5fSmrg# Public sister of _AM_SUBST_NOTMAKE.
9058bd17e5fSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
906b042e37fSmrg
9078bd17e5fSmrg# Check how to create a tarball.                            -*- Autoconf -*-
908b042e37fSmrg
9098bd17e5fSmrg# Copyright (C) 2004-2013 Free Software Foundation, Inc.
910706b6b52Smrg#
9118bd17e5fSmrg# This file is free software; the Free Software Foundation
9128bd17e5fSmrg# gives unlimited permission to copy and/or distribute it,
9138bd17e5fSmrg# with or without modifications, as long as this notice is preserved.
914b042e37fSmrg
9158bd17e5fSmrg# _AM_PROG_TAR(FORMAT)
9168bd17e5fSmrg# --------------------
9178bd17e5fSmrg# Check how to create a tarball in format FORMAT.
9188bd17e5fSmrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
9198bd17e5fSmrg#
9208bd17e5fSmrg# Substitute a variable $(am__tar) that is a command
9218bd17e5fSmrg# writing to stdout a FORMAT-tarball containing the directory
9228bd17e5fSmrg# $tardir.
9238bd17e5fSmrg#     tardir=directory && $(am__tar) > result.tar
9248bd17e5fSmrg#
9258bd17e5fSmrg# Substitute a variable $(am__untar) that extract such
9268bd17e5fSmrg# a tarball read from stdin.
9278bd17e5fSmrg#     $(am__untar) < result.tar
9288bd17e5fSmrg#
9298bd17e5fSmrgAC_DEFUN([_AM_PROG_TAR],
9308bd17e5fSmrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
9318bd17e5fSmrg# in the wild :-(  We should find a proper way to deprecate it ...
9328bd17e5fSmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
933b042e37fSmrg
9348bd17e5fSmrg# We'll loop over all known methods to create a tar archive until one works.
9358bd17e5fSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
936b042e37fSmrg
9378bd17e5fSmrgm4_if([$1], [v7],
9388bd17e5fSmrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
9398bd17e5fSmrg
9408bd17e5fSmrg  [m4_case([$1],
9418bd17e5fSmrg    [ustar],
9428bd17e5fSmrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
9438bd17e5fSmrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
9448bd17e5fSmrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
9458bd17e5fSmrg      # and bug#13588).
9468bd17e5fSmrg      am_max_uid=2097151 # 2^21 - 1
9478bd17e5fSmrg      am_max_gid=$am_max_uid
9488bd17e5fSmrg      # The $UID and $GID variables are not portable, so we need to resort
9498bd17e5fSmrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
9508bd17e5fSmrg      # below are definitely unexpected, so allow the users to see them
9518bd17e5fSmrg      # (that is, avoid stderr redirection).
9528bd17e5fSmrg      am_uid=`id -u || echo unknown`
9538bd17e5fSmrg      am_gid=`id -g || echo unknown`
9548bd17e5fSmrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
9558bd17e5fSmrg      if test $am_uid -le $am_max_uid; then
9568bd17e5fSmrg         AC_MSG_RESULT([yes])
9578bd17e5fSmrg      else
9588bd17e5fSmrg         AC_MSG_RESULT([no])
9598bd17e5fSmrg         _am_tools=none
9608bd17e5fSmrg      fi
9618bd17e5fSmrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
9628bd17e5fSmrg      if test $am_gid -le $am_max_gid; then
9638bd17e5fSmrg         AC_MSG_RESULT([yes])
9648bd17e5fSmrg      else
9658bd17e5fSmrg        AC_MSG_RESULT([no])
9668bd17e5fSmrg        _am_tools=none
9678bd17e5fSmrg      fi],
968b042e37fSmrg
9698bd17e5fSmrg  [pax],
9708bd17e5fSmrg    [],
971706b6b52Smrg
9728bd17e5fSmrg  [m4_fatal([Unknown tar format])])
973706b6b52Smrg
9748bd17e5fSmrg  AC_MSG_CHECKING([how to create a $1 tar archive])
975b042e37fSmrg
9768bd17e5fSmrg  # Go ahead even if we have the value already cached.  We do so because we
9778bd17e5fSmrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
9788bd17e5fSmrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
979b042e37fSmrg
9808bd17e5fSmrg  for _am_tool in $_am_tools; do
9818bd17e5fSmrg    case $_am_tool in
9828bd17e5fSmrg    gnutar)
9838bd17e5fSmrg      for _am_tar in tar gnutar gtar; do
9848bd17e5fSmrg        AM_RUN_LOG([$_am_tar --version]) && break
9858bd17e5fSmrg      done
9868bd17e5fSmrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
9878bd17e5fSmrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
9888bd17e5fSmrg      am__untar="$_am_tar -xf -"
9890597fb56Smrg      ;;
9908bd17e5fSmrg    plaintar)
9918bd17e5fSmrg      # Must skip GNU tar: if it does not support --format= it doesn't create
9928bd17e5fSmrg      # ustar tarball either.
9938bd17e5fSmrg      (tar --version) >/dev/null 2>&1 && continue
9948bd17e5fSmrg      am__tar='tar chf - "$$tardir"'
9958bd17e5fSmrg      am__tar_='tar chf - "$tardir"'
9968bd17e5fSmrg      am__untar='tar xf -'
9970597fb56Smrg      ;;
9988bd17e5fSmrg    pax)
9998bd17e5fSmrg      am__tar='pax -L -x $1 -w "$$tardir"'
10008bd17e5fSmrg      am__tar_='pax -L -x $1 -w "$tardir"'
10018bd17e5fSmrg      am__untar='pax -r'
10020597fb56Smrg      ;;
10038bd17e5fSmrg    cpio)
10048bd17e5fSmrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
10058bd17e5fSmrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
10068bd17e5fSmrg      am__untar='cpio -i -H $1 -d'
10078bd17e5fSmrg      ;;
10088bd17e5fSmrg    none)
10098bd17e5fSmrg      am__tar=false
10108bd17e5fSmrg      am__tar_=false
10118bd17e5fSmrg      am__untar=false
10120597fb56Smrg      ;;
1013706b6b52Smrg    esac
1014b042e37fSmrg
10158bd17e5fSmrg    # If the value was cached, stop now.  We just wanted to have am__tar
10168bd17e5fSmrg    # and am__untar set.
10178bd17e5fSmrg    test -n "${am_cv_prog_tar_$1}" && break
10188bd17e5fSmrg
10198bd17e5fSmrg    # tar/untar a dummy directory, and stop if the command works.
10208bd17e5fSmrg    rm -rf conftest.dir
10218bd17e5fSmrg    mkdir conftest.dir
10228bd17e5fSmrg    echo GrepMe > conftest.dir/file
10238bd17e5fSmrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
10248bd17e5fSmrg    rm -rf conftest.dir
10258bd17e5fSmrg    if test -s conftest.tar; then
10268bd17e5fSmrg      AM_RUN_LOG([$am__untar <conftest.tar])
10278bd17e5fSmrg      AM_RUN_LOG([cat conftest.dir/file])
10288bd17e5fSmrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
10298bd17e5fSmrg    fi
10308bd17e5fSmrg  done
10318bd17e5fSmrg  rm -rf conftest.dir
1032b042e37fSmrg
10338bd17e5fSmrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
10348bd17e5fSmrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1035b042e37fSmrg
10368bd17e5fSmrgAC_SUBST([am__tar])
10378bd17e5fSmrgAC_SUBST([am__untar])
10388bd17e5fSmrg]) # _AM_PROG_TAR
1039b042e37fSmrg
10408bd17e5fSmrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
10418bd17e5fSmrg#
10428bd17e5fSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
10438bd17e5fSmrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
10448bd17e5fSmrg#                 Foundation, Inc.
10458bd17e5fSmrg#   Written by Gordon Matzigkeit, 1996
10468bd17e5fSmrg#
10478bd17e5fSmrg# This file is free software; the Free Software Foundation gives
10488bd17e5fSmrg# unlimited permission to copy and/or distribute it, with or without
10498bd17e5fSmrg# modifications, as long as this notice is preserved.
1050b042e37fSmrg
10518bd17e5fSmrgm4_define([_LT_COPYING], [dnl
10528bd17e5fSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
10538bd17e5fSmrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
10548bd17e5fSmrg#                 Foundation, Inc.
10558bd17e5fSmrg#   Written by Gordon Matzigkeit, 1996
10568bd17e5fSmrg#
10578bd17e5fSmrg#   This file is part of GNU Libtool.
10588bd17e5fSmrg#
10598bd17e5fSmrg# GNU Libtool is free software; you can redistribute it and/or
10608bd17e5fSmrg# modify it under the terms of the GNU General Public License as
10618bd17e5fSmrg# published by the Free Software Foundation; either version 2 of
10628bd17e5fSmrg# the License, or (at your option) any later version.
10638bd17e5fSmrg#
10648bd17e5fSmrg# As a special exception to the GNU General Public License,
10658bd17e5fSmrg# if you distribute this file as part of a program or library that
10668bd17e5fSmrg# is built using GNU Libtool, you may include this file under the
10678bd17e5fSmrg# same distribution terms that you use for the rest of that program.
10688bd17e5fSmrg#
10698bd17e5fSmrg# GNU Libtool is distributed in the hope that it will be useful,
10708bd17e5fSmrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
10718bd17e5fSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10728bd17e5fSmrg# GNU General Public License for more details.
10738bd17e5fSmrg#
10748bd17e5fSmrg# You should have received a copy of the GNU General Public License
10758bd17e5fSmrg# along with GNU Libtool; see the file COPYING.  If not, a copy
10768bd17e5fSmrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
10778bd17e5fSmrg# obtained by writing to the Free Software Foundation, Inc.,
10788bd17e5fSmrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
10798bd17e5fSmrg])
1080b042e37fSmrg
10818bd17e5fSmrg# serial 57 LT_INIT
1082b042e37fSmrg
1083b042e37fSmrg
10848bd17e5fSmrg# LT_PREREQ(VERSION)
10858bd17e5fSmrg# ------------------
10868bd17e5fSmrg# Complain and exit if this libtool version is less that VERSION.
10878bd17e5fSmrgm4_defun([LT_PREREQ],
10888bd17e5fSmrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
10898bd17e5fSmrg       [m4_default([$3],
10908bd17e5fSmrg		   [m4_fatal([Libtool version $1 or higher is required],
10918bd17e5fSmrg		             63)])],
10928bd17e5fSmrg       [$2])])
10938c4a8e55Smrg
10948c4a8e55Smrg
10958bd17e5fSmrg# _LT_CHECK_BUILDDIR
10968bd17e5fSmrg# ------------------
10978bd17e5fSmrg# Complain if the absolute build directory name contains unusual characters
10988bd17e5fSmrgm4_defun([_LT_CHECK_BUILDDIR],
10998bd17e5fSmrg[case `pwd` in
11008bd17e5fSmrg  *\ * | *\	*)
11018bd17e5fSmrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
11028bd17e5fSmrgesac
11038bd17e5fSmrg])
1104b042e37fSmrg
1105b042e37fSmrg
11068bd17e5fSmrg# LT_INIT([OPTIONS])
11078bd17e5fSmrg# ------------------
11088bd17e5fSmrgAC_DEFUN([LT_INIT],
11098bd17e5fSmrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
11108bd17e5fSmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
11118bd17e5fSmrgAC_BEFORE([$0], [LT_LANG])dnl
11128bd17e5fSmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
11138bd17e5fSmrgAC_BEFORE([$0], [LTDL_INIT])dnl
11148bd17e5fSmrgm4_require([_LT_CHECK_BUILDDIR])dnl
11158c4a8e55Smrg
11168bd17e5fSmrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
11178bd17e5fSmrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
11188bd17e5fSmrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
11198bd17e5fSmrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
11208bd17e5fSmrgdnl unless we require an AC_DEFUNed macro:
11218bd17e5fSmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
11228bd17e5fSmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
11238bd17e5fSmrgAC_REQUIRE([LTVERSION_VERSION])dnl
11248bd17e5fSmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
11258bd17e5fSmrgm4_require([_LT_PROG_LTMAIN])dnl
11268c4a8e55Smrg
11278bd17e5fSmrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
11288c4a8e55Smrg
11298bd17e5fSmrgdnl Parse OPTIONS
11308bd17e5fSmrg_LT_SET_OPTIONS([$0], [$1])
11318c4a8e55Smrg
11328bd17e5fSmrg# This can be used to rebuild libtool when needed
11338bd17e5fSmrgLIBTOOL_DEPS="$ltmain"
11348c4a8e55Smrg
11358bd17e5fSmrg# Always use our own libtool.
11368bd17e5fSmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
11378bd17e5fSmrgAC_SUBST(LIBTOOL)dnl
1138b042e37fSmrg
11398bd17e5fSmrg_LT_SETUP
1140b042e37fSmrg
11418bd17e5fSmrg# Only expand once:
11428bd17e5fSmrgm4_define([LT_INIT])
11438bd17e5fSmrg])# LT_INIT
1144b042e37fSmrg
11458bd17e5fSmrg# Old names:
11468bd17e5fSmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
11478bd17e5fSmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
11488bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
11498bd17e5fSmrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
11508bd17e5fSmrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
1151b042e37fSmrg
1152b042e37fSmrg
11538bd17e5fSmrg# _LT_CC_BASENAME(CC)
11548bd17e5fSmrg# -------------------
11558bd17e5fSmrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
11568bd17e5fSmrgm4_defun([_LT_CC_BASENAME],
11578bd17e5fSmrg[for cc_temp in $1""; do
11588bd17e5fSmrg  case $cc_temp in
11598bd17e5fSmrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
11608bd17e5fSmrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
11618bd17e5fSmrg    \-*) ;;
11628bd17e5fSmrg    *) break;;
11630597fb56Smrg  esac
11648bd17e5fSmrgdone
11658bd17e5fSmrgcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
11668bd17e5fSmrg])
1167b042e37fSmrg
1168b042e37fSmrg
11698bd17e5fSmrg# _LT_FILEUTILS_DEFAULTS
11708bd17e5fSmrg# ----------------------
11718bd17e5fSmrg# It is okay to use these file commands and assume they have been set
11728bd17e5fSmrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
11738bd17e5fSmrgm4_defun([_LT_FILEUTILS_DEFAULTS],
11748bd17e5fSmrg[: ${CP="cp -f"}
11758bd17e5fSmrg: ${MV="mv -f"}
11768bd17e5fSmrg: ${RM="rm -f"}
11778bd17e5fSmrg])# _LT_FILEUTILS_DEFAULTS
1178b042e37fSmrg
11798c4a8e55Smrg
11808bd17e5fSmrg# _LT_SETUP
11818bd17e5fSmrg# ---------
11828bd17e5fSmrgm4_defun([_LT_SETUP],
11838bd17e5fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
11848bd17e5fSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
11858bd17e5fSmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
11868bd17e5fSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1187706b6b52Smrg
11888bd17e5fSmrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
11898bd17e5fSmrgdnl
11908bd17e5fSmrg_LT_DECL([], [host_alias], [0], [The host system])dnl
11918bd17e5fSmrg_LT_DECL([], [host], [0])dnl
11928bd17e5fSmrg_LT_DECL([], [host_os], [0])dnl
11938bd17e5fSmrgdnl
11948bd17e5fSmrg_LT_DECL([], [build_alias], [0], [The build system])dnl
11958bd17e5fSmrg_LT_DECL([], [build], [0])dnl
11968bd17e5fSmrg_LT_DECL([], [build_os], [0])dnl
11978bd17e5fSmrgdnl
11988bd17e5fSmrgAC_REQUIRE([AC_PROG_CC])dnl
11998bd17e5fSmrgAC_REQUIRE([LT_PATH_LD])dnl
12008bd17e5fSmrgAC_REQUIRE([LT_PATH_NM])dnl
12018bd17e5fSmrgdnl
12028bd17e5fSmrgAC_REQUIRE([AC_PROG_LN_S])dnl
12038bd17e5fSmrgtest -z "$LN_S" && LN_S="ln -s"
12048bd17e5fSmrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
12058bd17e5fSmrgdnl
12068bd17e5fSmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
12078bd17e5fSmrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
12088bd17e5fSmrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
12098bd17e5fSmrgdnl
12108bd17e5fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
12118bd17e5fSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
12128bd17e5fSmrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
12138bd17e5fSmrgm4_require([_LT_CMD_RELOAD])dnl
12148bd17e5fSmrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
12158bd17e5fSmrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
12168bd17e5fSmrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
12178bd17e5fSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
12188bd17e5fSmrgm4_require([_LT_WITH_SYSROOT])dnl
1219706b6b52Smrg
12208bd17e5fSmrg_LT_CONFIG_LIBTOOL_INIT([
12218bd17e5fSmrg# See if we are running on zsh, and set the options which allow our
12228bd17e5fSmrg# commands through without removal of \ escapes INIT.
12238bd17e5fSmrgif test -n "\${ZSH_VERSION+set}" ; then
12248bd17e5fSmrg   setopt NO_GLOB_SUBST
12258bd17e5fSmrgfi
12268bd17e5fSmrg])
12278bd17e5fSmrgif test -n "${ZSH_VERSION+set}" ; then
12288bd17e5fSmrg   setopt NO_GLOB_SUBST
12298bd17e5fSmrgfi
1230706b6b52Smrg
12318bd17e5fSmrg_LT_CHECK_OBJDIR
1232706b6b52Smrg
12338bd17e5fSmrgm4_require([_LT_TAG_COMPILER])dnl
1234706b6b52Smrg
12358bd17e5fSmrgcase $host_os in
12368bd17e5fSmrgaix3*)
12378bd17e5fSmrg  # AIX sometimes has problems with the GCC collect2 program.  For some
12388bd17e5fSmrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
12398bd17e5fSmrg  # vanish in a puff of smoke.
12408bd17e5fSmrg  if test "X${COLLECT_NAMES+set}" != Xset; then
12418bd17e5fSmrg    COLLECT_NAMES=
12428bd17e5fSmrg    export COLLECT_NAMES
12438bd17e5fSmrg  fi
12448bd17e5fSmrg  ;;
12458bd17e5fSmrgesac
1246bd23fbfaSmrg
12478bd17e5fSmrg# Global variables:
12488bd17e5fSmrgofile=libtool
12498bd17e5fSmrgcan_build_shared=yes
1250bd23fbfaSmrg
12518bd17e5fSmrg# All known linkers require a `.a' archive for static linking (except MSVC,
12528bd17e5fSmrg# which needs '.lib').
12538bd17e5fSmrglibext=a
1254bd23fbfaSmrg
12558bd17e5fSmrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
1256bd23fbfaSmrg
12578bd17e5fSmrgold_CC="$CC"
12588bd17e5fSmrgold_CFLAGS="$CFLAGS"
12590597fb56Smrg
12608bd17e5fSmrg# Set sane defaults for various variables
12618bd17e5fSmrgtest -z "$CC" && CC=cc
12628bd17e5fSmrgtest -z "$LTCC" && LTCC=$CC
12638bd17e5fSmrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
12648bd17e5fSmrgtest -z "$LD" && LD=ld
12658bd17e5fSmrgtest -z "$ac_objext" && ac_objext=o
12660597fb56Smrg
12678bd17e5fSmrg_LT_CC_BASENAME([$compiler])
1268bd23fbfaSmrg
12698bd17e5fSmrg# Only perform the check for file, if the check method requires it
12708bd17e5fSmrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
12718bd17e5fSmrgcase $deplibs_check_method in
12728bd17e5fSmrgfile_magic*)
12738bd17e5fSmrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
12748bd17e5fSmrg    _LT_PATH_MAGIC
12758bd17e5fSmrg  fi
12768bd17e5fSmrg  ;;
12778bd17e5fSmrgesac
1278bd23fbfaSmrg
12798bd17e5fSmrg# Use C for the default configuration in the libtool script
12808bd17e5fSmrgLT_SUPPORTED_TAG([CC])
12818bd17e5fSmrg_LT_LANG_C_CONFIG
12828bd17e5fSmrg_LT_LANG_DEFAULT_CONFIG
12838bd17e5fSmrg_LT_CONFIG_COMMANDS
12848bd17e5fSmrg])# _LT_SETUP
1285706b6b52Smrg
1286706b6b52Smrg
12878bd17e5fSmrg# _LT_PREPARE_SED_QUOTE_VARS
12888bd17e5fSmrg# --------------------------
12898bd17e5fSmrg# Define a few sed substitution that help us do robust quoting.
12908bd17e5fSmrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
12918bd17e5fSmrg[# Backslashify metacharacters that are still active within
12928bd17e5fSmrg# double-quoted strings.
12938bd17e5fSmrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
1294706b6b52Smrg
12958bd17e5fSmrg# Same as above, but do not quote variable references.
12968bd17e5fSmrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
1297706b6b52Smrg
12988bd17e5fSmrg# Sed substitution to delay expansion of an escaped shell variable in a
12998bd17e5fSmrg# double_quote_subst'ed string.
13008bd17e5fSmrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
1301706b6b52Smrg
13028bd17e5fSmrg# Sed substitution to delay expansion of an escaped single quote.
13038bd17e5fSmrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
1304706b6b52Smrg
13058bd17e5fSmrg# Sed substitution to avoid accidental globbing in evaled expressions
13068bd17e5fSmrgno_glob_subst='s/\*/\\\*/g'
13078bd17e5fSmrg])
1308b042e37fSmrg
13098bd17e5fSmrg# _LT_PROG_LTMAIN
13108bd17e5fSmrg# ---------------
13118bd17e5fSmrg# Note that this code is called both from `configure', and `config.status'
13128bd17e5fSmrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
13138bd17e5fSmrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
13148bd17e5fSmrg# so we pass a copy along to make sure it has a sensible value anyway.
13158bd17e5fSmrgm4_defun([_LT_PROG_LTMAIN],
13168bd17e5fSmrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
13178bd17e5fSmrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
13188bd17e5fSmrgltmain="$ac_aux_dir/ltmain.sh"
13198bd17e5fSmrg])# _LT_PROG_LTMAIN
1320b042e37fSmrg
1321b042e37fSmrg
1322706b6b52Smrg
13238bd17e5fSmrg# So that we can recreate a full libtool script including additional
13248bd17e5fSmrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
13258bd17e5fSmrg# in macros and then make a single call at the end using the `libtool'
13268bd17e5fSmrg# label.
1327bd23fbfaSmrg
1328b042e37fSmrg
13298bd17e5fSmrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
13308bd17e5fSmrg# ----------------------------------------
13318bd17e5fSmrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
13328bd17e5fSmrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
13338bd17e5fSmrg[m4_ifval([$1],
13348bd17e5fSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
13358bd17e5fSmrg                     [$1
13368bd17e5fSmrg])])])
1337706b6b52Smrg
13388bd17e5fSmrg# Initialize.
13398bd17e5fSmrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
1340b042e37fSmrg
1341706b6b52Smrg
13428bd17e5fSmrg# _LT_CONFIG_LIBTOOL([COMMANDS])
13438bd17e5fSmrg# ------------------------------
13448bd17e5fSmrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
13458bd17e5fSmrgm4_define([_LT_CONFIG_LIBTOOL],
13468bd17e5fSmrg[m4_ifval([$1],
13478bd17e5fSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
13488bd17e5fSmrg                     [$1
13498bd17e5fSmrg])])])
1350706b6b52Smrg
13518bd17e5fSmrg# Initialize.
13528bd17e5fSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
1353b042e37fSmrg
1354bd23fbfaSmrg
13558bd17e5fSmrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
13568bd17e5fSmrg# -----------------------------------------------------
13578bd17e5fSmrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
13588bd17e5fSmrg[_LT_CONFIG_LIBTOOL([$1])
13598bd17e5fSmrg_LT_CONFIG_LIBTOOL_INIT([$2])
13608bd17e5fSmrg])
1361bd23fbfaSmrg
1362bd23fbfaSmrg
13638bd17e5fSmrg# _LT_FORMAT_COMMENT([COMMENT])
13648bd17e5fSmrg# -----------------------------
13658bd17e5fSmrg# Add leading comment marks to the start of each line, and a trailing
13668bd17e5fSmrg# full-stop to the whole comment if one is not present already.
13678bd17e5fSmrgm4_define([_LT_FORMAT_COMMENT],
13688bd17e5fSmrg[m4_ifval([$1], [
13698bd17e5fSmrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
13708bd17e5fSmrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
13718bd17e5fSmrg)])
1372bd23fbfaSmrg
1373bd23fbfaSmrg
1374bd23fbfaSmrg
1375bd23fbfaSmrg
13760597fb56Smrg
13778bd17e5fSmrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
13788bd17e5fSmrg# -------------------------------------------------------------------
13798bd17e5fSmrg# CONFIGNAME is the name given to the value in the libtool script.
13808bd17e5fSmrg# VARNAME is the (base) name used in the configure script.
13818bd17e5fSmrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
13828bd17e5fSmrg# VARNAME.  Any other value will be used directly.
13838bd17e5fSmrgm4_define([_LT_DECL],
13848bd17e5fSmrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
13858bd17e5fSmrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
13868bd17e5fSmrg	[m4_ifval([$1], [$1], [$2])])
13878bd17e5fSmrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
13888bd17e5fSmrg    m4_ifval([$4],
13898bd17e5fSmrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
13908bd17e5fSmrg    lt_dict_add_subkey([lt_decl_dict], [$2],
13918bd17e5fSmrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
13928bd17e5fSmrg])
13930597fb56Smrg
13940597fb56Smrg
13958bd17e5fSmrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
13968bd17e5fSmrg# --------------------------------------------------------
13978bd17e5fSmrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
13980597fb56Smrg
13990597fb56Smrg
14008bd17e5fSmrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
14018bd17e5fSmrg# ------------------------------------------------
14028bd17e5fSmrgm4_define([lt_decl_tag_varnames],
14038bd17e5fSmrg[_lt_decl_filter([tagged?], [yes], $@)])
1404bd23fbfaSmrg
1405b042e37fSmrg
14068bd17e5fSmrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
14078bd17e5fSmrg# ---------------------------------------------------------
14088bd17e5fSmrgm4_define([_lt_decl_filter],
14098bd17e5fSmrg[m4_case([$#],
14108bd17e5fSmrg  [0], [m4_fatal([$0: too few arguments: $#])],
14118bd17e5fSmrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
14128bd17e5fSmrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
14138bd17e5fSmrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
14148bd17e5fSmrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
14158bd17e5fSmrg])
1416b042e37fSmrg
1417b042e37fSmrg
14188bd17e5fSmrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
14198bd17e5fSmrg# --------------------------------------------------
14208bd17e5fSmrgm4_define([lt_decl_quote_varnames],
14218bd17e5fSmrg[_lt_decl_filter([value], [1], $@)])
1422b042e37fSmrg
1423b042e37fSmrg
14248bd17e5fSmrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
14258bd17e5fSmrg# ---------------------------------------------------
14268bd17e5fSmrgm4_define([lt_decl_dquote_varnames],
14278bd17e5fSmrg[_lt_decl_filter([value], [2], $@)])
1428b042e37fSmrg
14290597fb56Smrg
14308bd17e5fSmrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
14318bd17e5fSmrg# ---------------------------------------------------
14328bd17e5fSmrgm4_define([lt_decl_varnames_tagged],
14338bd17e5fSmrg[m4_assert([$# <= 2])dnl
14348bd17e5fSmrg_$0(m4_quote(m4_default([$1], [[, ]])),
14358bd17e5fSmrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
14368bd17e5fSmrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
14378bd17e5fSmrgm4_define([_lt_decl_varnames_tagged],
14388bd17e5fSmrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
1439b042e37fSmrg
1440b042e37fSmrg
14418bd17e5fSmrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
14428bd17e5fSmrg# ------------------------------------------------
14438bd17e5fSmrgm4_define([lt_decl_all_varnames],
14448bd17e5fSmrg[_$0(m4_quote(m4_default([$1], [[, ]])),
14458bd17e5fSmrg     m4_if([$2], [],
14468bd17e5fSmrg	   m4_quote(lt_decl_varnames),
14478bd17e5fSmrg	m4_quote(m4_shift($@))))[]dnl
14488bd17e5fSmrg])
14498bd17e5fSmrgm4_define([_lt_decl_all_varnames],
14508bd17e5fSmrg[lt_join($@, lt_decl_varnames_tagged([$1],
14518bd17e5fSmrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
14528bd17e5fSmrg])
1453b042e37fSmrg
1454b042e37fSmrg
14558bd17e5fSmrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
14568bd17e5fSmrg# ------------------------------------
14578bd17e5fSmrg# Quote a variable value, and forward it to `config.status' so that its
14588bd17e5fSmrg# declaration there will have the same value as in `configure'.  VARNAME
14598bd17e5fSmrg# must have a single quote delimited value for this to work.
14608bd17e5fSmrgm4_define([_LT_CONFIG_STATUS_DECLARE],
14618bd17e5fSmrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
1462706b6b52Smrg
1463706b6b52Smrg
14648bd17e5fSmrg# _LT_CONFIG_STATUS_DECLARATIONS
14658bd17e5fSmrg# ------------------------------
14668bd17e5fSmrg# We delimit libtool config variables with single quotes, so when
14678bd17e5fSmrg# we write them to config.status, we have to be sure to quote all
14688bd17e5fSmrg# embedded single quotes properly.  In configure, this macro expands
14698bd17e5fSmrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
14708bd17e5fSmrg#
14718bd17e5fSmrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
14728bd17e5fSmrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
14738bd17e5fSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
14748bd17e5fSmrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
1475b042e37fSmrg
1476b042e37fSmrg
14778bd17e5fSmrg# _LT_LIBTOOL_TAGS
14788bd17e5fSmrg# ----------------
14798bd17e5fSmrg# Output comment and list of tags supported by the script
14808bd17e5fSmrgm4_defun([_LT_LIBTOOL_TAGS],
14818bd17e5fSmrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
14828bd17e5fSmrgavailable_tags="_LT_TAGS"dnl
14838bd17e5fSmrg])
1484b042e37fSmrg
1485bd23fbfaSmrg
14868bd17e5fSmrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
14878bd17e5fSmrg# -----------------------------------
14888bd17e5fSmrg# Extract the dictionary values for VARNAME (optionally with TAG) and
14898bd17e5fSmrg# expand to a commented shell variable setting:
14908bd17e5fSmrg#
14918bd17e5fSmrg#    # Some comment about what VAR is for.
14928bd17e5fSmrg#    visible_name=$lt_internal_name
14938bd17e5fSmrgm4_define([_LT_LIBTOOL_DECLARE],
14948bd17e5fSmrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
14958bd17e5fSmrg					   [description])))[]dnl
14968bd17e5fSmrgm4_pushdef([_libtool_name],
14978bd17e5fSmrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
14988bd17e5fSmrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
14998bd17e5fSmrg    [0], [_libtool_name=[$]$1],
15008bd17e5fSmrg    [1], [_libtool_name=$lt_[]$1],
15018bd17e5fSmrg    [2], [_libtool_name=$lt_[]$1],
15028bd17e5fSmrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
15038bd17e5fSmrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
15048bd17e5fSmrg])
1505b042e37fSmrg
1506706b6b52Smrg
15078bd17e5fSmrg# _LT_LIBTOOL_CONFIG_VARS
15088bd17e5fSmrg# -----------------------
15098bd17e5fSmrg# Produce commented declarations of non-tagged libtool config variables
15108bd17e5fSmrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
15118bd17e5fSmrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
15128bd17e5fSmrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
15138bd17e5fSmrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
15148bd17e5fSmrg[m4_foreach([_lt_var],
15158bd17e5fSmrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
15168bd17e5fSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
15170597fb56Smrg
15188c4a8e55Smrg
15198bd17e5fSmrg# _LT_LIBTOOL_TAG_VARS(TAG)
15208bd17e5fSmrg# -------------------------
15218bd17e5fSmrgm4_define([_LT_LIBTOOL_TAG_VARS],
15228bd17e5fSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
15238bd17e5fSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
1524706b6b52Smrg
1525706b6b52Smrg
15268bd17e5fSmrg# _LT_TAGVAR(VARNAME, [TAGNAME])
15278bd17e5fSmrg# ------------------------------
15288bd17e5fSmrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
1529b042e37fSmrg
15308c4a8e55Smrg
15318bd17e5fSmrg# _LT_CONFIG_COMMANDS
15328bd17e5fSmrg# -------------------
15338bd17e5fSmrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
15348bd17e5fSmrg# variables for single and double quote escaping we saved from calls
15358bd17e5fSmrg# to _LT_DECL, we can put quote escaped variables declarations
15368bd17e5fSmrg# into `config.status', and then the shell code to quote escape them in
15378bd17e5fSmrg# for loops in `config.status'.  Finally, any additional code accumulated
15388bd17e5fSmrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
15398bd17e5fSmrgm4_defun([_LT_CONFIG_COMMANDS],
15408bd17e5fSmrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
15418bd17e5fSmrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
15428bd17e5fSmrg	dnl instead of duplicating it all over again into config.status,
15438bd17e5fSmrg	dnl then we will have config.status run $CONFIG_LT later, so it
15448bd17e5fSmrg	dnl needs to know what name is stored there:
15458bd17e5fSmrg        [AC_CONFIG_COMMANDS([libtool],
15468bd17e5fSmrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
15478bd17e5fSmrg    dnl If the libtool generation code is destined for config.status,
15488bd17e5fSmrg    dnl expand the accumulated commands and init code now:
15498bd17e5fSmrg    [AC_CONFIG_COMMANDS([libtool],
15508bd17e5fSmrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
15518bd17e5fSmrg])#_LT_CONFIG_COMMANDS
15528c4a8e55Smrg
15538c4a8e55Smrg
15548bd17e5fSmrg# Initialize.
15558bd17e5fSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
15568bd17e5fSmrg[
1557b042e37fSmrg
15588bd17e5fSmrg# The HP-UX ksh and POSIX shell print the target directory to stdout
15598bd17e5fSmrg# if CDPATH is set.
15608bd17e5fSmrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1561b042e37fSmrg
15628bd17e5fSmrgsed_quote_subst='$sed_quote_subst'
15638bd17e5fSmrgdouble_quote_subst='$double_quote_subst'
15648bd17e5fSmrgdelay_variable_subst='$delay_variable_subst'
15658bd17e5fSmrg_LT_CONFIG_STATUS_DECLARATIONS
15668bd17e5fSmrgLTCC='$LTCC'
15678bd17e5fSmrgLTCFLAGS='$LTCFLAGS'
15688bd17e5fSmrgcompiler='$compiler_DEFAULT'
1569b042e37fSmrg
15708bd17e5fSmrg# A function that is used when there is no print builtin or printf.
15718bd17e5fSmrgfunc_fallback_echo ()
15728bd17e5fSmrg{
15738bd17e5fSmrg  eval 'cat <<_LTECHO_EOF
15748bd17e5fSmrg\$[]1
15758bd17e5fSmrg_LTECHO_EOF'
15768bd17e5fSmrg}
1577b042e37fSmrg
15788bd17e5fSmrg# Quote evaled strings.
15798bd17e5fSmrgfor var in lt_decl_all_varnames([[ \
15808bd17e5fSmrg]], lt_decl_quote_varnames); do
15818bd17e5fSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
15828bd17e5fSmrg    *[[\\\\\\\`\\"\\\$]]*)
15838bd17e5fSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
15848bd17e5fSmrg      ;;
15858bd17e5fSmrg    *)
15868bd17e5fSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
15878bd17e5fSmrg      ;;
15888bd17e5fSmrg    esac
15898bd17e5fSmrgdone
1590b042e37fSmrg
15918bd17e5fSmrg# Double-quote double-evaled strings.
15928bd17e5fSmrgfor var in lt_decl_all_varnames([[ \
15938bd17e5fSmrg]], lt_decl_dquote_varnames); do
15948bd17e5fSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
15958bd17e5fSmrg    *[[\\\\\\\`\\"\\\$]]*)
15968bd17e5fSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
15978bd17e5fSmrg      ;;
15988bd17e5fSmrg    *)
15998bd17e5fSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
16008bd17e5fSmrg      ;;
16018bd17e5fSmrg    esac
16028bd17e5fSmrgdone
1603b042e37fSmrg
16048bd17e5fSmrg_LT_OUTPUT_LIBTOOL_INIT
16058bd17e5fSmrg])
16068c4a8e55Smrg
16078bd17e5fSmrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
16088bd17e5fSmrg# ------------------------------------
16098bd17e5fSmrg# Generate a child script FILE with all initialization necessary to
16108bd17e5fSmrg# reuse the environment learned by the parent script, and make the
16118bd17e5fSmrg# file executable.  If COMMENT is supplied, it is inserted after the
16128bd17e5fSmrg# `#!' sequence but before initialization text begins.  After this
16138bd17e5fSmrg# macro, additional text can be appended to FILE to form the body of
16148bd17e5fSmrg# the child script.  The macro ends with non-zero status if the
16158bd17e5fSmrg# file could not be fully written (such as if the disk is full).
16168bd17e5fSmrgm4_ifdef([AS_INIT_GENERATED],
16178bd17e5fSmrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
16188bd17e5fSmrg[m4_defun([_LT_GENERATED_FILE_INIT],
16198bd17e5fSmrg[m4_require([AS_PREPARE])]dnl
16208bd17e5fSmrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
16218bd17e5fSmrg[lt_write_fail=0
16228bd17e5fSmrgcat >$1 <<_ASEOF || lt_write_fail=1
16238bd17e5fSmrg#! $SHELL
16248bd17e5fSmrg# Generated by $as_me.
16258bd17e5fSmrg$2
16268bd17e5fSmrgSHELL=\${CONFIG_SHELL-$SHELL}
16278bd17e5fSmrgexport SHELL
16288bd17e5fSmrg_ASEOF
16298bd17e5fSmrgcat >>$1 <<\_ASEOF || lt_write_fail=1
16308bd17e5fSmrgAS_SHELL_SANITIZE
16318bd17e5fSmrg_AS_PREPARE
16328bd17e5fSmrgexec AS_MESSAGE_FD>&1
16338bd17e5fSmrg_ASEOF
16348bd17e5fSmrgtest $lt_write_fail = 0 && chmod +x $1[]dnl
16358bd17e5fSmrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
1636b042e37fSmrg
16378bd17e5fSmrg# LT_OUTPUT
16388bd17e5fSmrg# ---------
16398bd17e5fSmrg# This macro allows early generation of the libtool script (before
16408bd17e5fSmrg# AC_OUTPUT is called), incase it is used in configure for compilation
16418bd17e5fSmrg# tests.
16428bd17e5fSmrgAC_DEFUN([LT_OUTPUT],
16438bd17e5fSmrg[: ${CONFIG_LT=./config.lt}
16448bd17e5fSmrgAC_MSG_NOTICE([creating $CONFIG_LT])
16458bd17e5fSmrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
16468bd17e5fSmrg[# Run this file to recreate a libtool stub with the current configuration.])
1647b042e37fSmrg
16488bd17e5fSmrgcat >>"$CONFIG_LT" <<\_LTEOF
16498bd17e5fSmrglt_cl_silent=false
16508bd17e5fSmrgexec AS_MESSAGE_LOG_FD>>config.log
16518bd17e5fSmrg{
16528bd17e5fSmrg  echo
16538bd17e5fSmrg  AS_BOX([Running $as_me.])
16548bd17e5fSmrg} >&AS_MESSAGE_LOG_FD
1655b042e37fSmrg
16568bd17e5fSmrglt_cl_help="\
16578bd17e5fSmrg\`$as_me' creates a local libtool stub from the current configuration,
16588bd17e5fSmrgfor use in further configure time tests before the real libtool is
16598bd17e5fSmrggenerated.
16608c4a8e55Smrg
16618bd17e5fSmrgUsage: $[0] [[OPTIONS]]
1662b042e37fSmrg
16638bd17e5fSmrg  -h, --help      print this help, then exit
16648bd17e5fSmrg  -V, --version   print version number, then exit
16658bd17e5fSmrg  -q, --quiet     do not print progress messages
16668bd17e5fSmrg  -d, --debug     don't remove temporary files
1667b042e37fSmrg
16688bd17e5fSmrgReport bugs to <bug-libtool@gnu.org>."
16698bd17e5fSmrg
16708bd17e5fSmrglt_cl_version="\
16718bd17e5fSmrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
16728bd17e5fSmrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
16738bd17e5fSmrgconfigured by $[0], generated by m4_PACKAGE_STRING.
16748bd17e5fSmrg
16758bd17e5fSmrgCopyright (C) 2011 Free Software Foundation, Inc.
16768bd17e5fSmrgThis config.lt script is free software; the Free Software Foundation
16778bd17e5fSmrggives unlimited permision to copy, distribute and modify it."
16788bd17e5fSmrg
16798bd17e5fSmrgwhile test $[#] != 0
16808bd17e5fSmrgdo
16818bd17e5fSmrg  case $[1] in
16828bd17e5fSmrg    --version | --v* | -V )
16838bd17e5fSmrg      echo "$lt_cl_version"; exit 0 ;;
16848bd17e5fSmrg    --help | --h* | -h )
16858bd17e5fSmrg      echo "$lt_cl_help"; exit 0 ;;
16868bd17e5fSmrg    --debug | --d* | -d )
16878bd17e5fSmrg      debug=: ;;
16888bd17e5fSmrg    --quiet | --q* | --silent | --s* | -q )
16898bd17e5fSmrg      lt_cl_silent=: ;;
16908bd17e5fSmrg
16918bd17e5fSmrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
16928bd17e5fSmrgTry \`$[0] --help' for more information.]) ;;
16938bd17e5fSmrg
16948bd17e5fSmrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
16958bd17e5fSmrgTry \`$[0] --help' for more information.]) ;;
16960597fb56Smrg  esac
16978bd17e5fSmrg  shift
16988bd17e5fSmrgdone
16998bd17e5fSmrg
17008bd17e5fSmrgif $lt_cl_silent; then
17018bd17e5fSmrg  exec AS_MESSAGE_FD>/dev/null
17020597fb56Smrgfi
17038bd17e5fSmrg_LTEOF
1704b042e37fSmrg
17058bd17e5fSmrgcat >>"$CONFIG_LT" <<_LTEOF
17068bd17e5fSmrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
17078bd17e5fSmrg_LTEOF
1708b042e37fSmrg
17098bd17e5fSmrgcat >>"$CONFIG_LT" <<\_LTEOF
17108bd17e5fSmrgAC_MSG_NOTICE([creating $ofile])
17118bd17e5fSmrg_LT_OUTPUT_LIBTOOL_COMMANDS
17128bd17e5fSmrgAS_EXIT(0)
17138bd17e5fSmrg_LTEOF
17148bd17e5fSmrgchmod +x "$CONFIG_LT"
1715b042e37fSmrg
17168bd17e5fSmrg# configure is writing to config.log, but config.lt does its own redirection,
17178bd17e5fSmrg# appending to config.log, which fails on DOS, as config.log is still kept
17188bd17e5fSmrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
17198bd17e5fSmrg# config.log, so it can be properly (re)opened and appended to by config.lt.
17208bd17e5fSmrglt_cl_success=:
17218bd17e5fSmrgtest "$silent" = yes &&
17228bd17e5fSmrg  lt_config_lt_args="$lt_config_lt_args --quiet"
17238bd17e5fSmrgexec AS_MESSAGE_LOG_FD>/dev/null
17248bd17e5fSmrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
17258bd17e5fSmrgexec AS_MESSAGE_LOG_FD>>config.log
17268bd17e5fSmrg$lt_cl_success || AS_EXIT(1)
17278bd17e5fSmrg])# LT_OUTPUT
1728b042e37fSmrg
1729b042e37fSmrg
17308bd17e5fSmrg# _LT_CONFIG(TAG)
17318bd17e5fSmrg# ---------------
17328bd17e5fSmrg# If TAG is the built-in tag, create an initial libtool script with a
17338bd17e5fSmrg# default configuration from the untagged config vars.  Otherwise add code
17348bd17e5fSmrg# to config.status for appending the configuration named by TAG from the
17358bd17e5fSmrg# matching tagged config vars.
17368bd17e5fSmrgm4_defun([_LT_CONFIG],
17378bd17e5fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
17388bd17e5fSmrg_LT_CONFIG_SAVE_COMMANDS([
17398bd17e5fSmrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
17408bd17e5fSmrg  m4_if(_LT_TAG, [C], [
17418bd17e5fSmrg    # See if we are running on zsh, and set the options which allow our
17428bd17e5fSmrg    # commands through without removal of \ escapes.
17438bd17e5fSmrg    if test -n "${ZSH_VERSION+set}" ; then
17448bd17e5fSmrg      setopt NO_GLOB_SUBST
17458bd17e5fSmrg    fi
1746b042e37fSmrg
17478bd17e5fSmrg    cfgfile="${ofile}T"
17488bd17e5fSmrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
17498bd17e5fSmrg    $RM "$cfgfile"
17508c4a8e55Smrg
17518bd17e5fSmrg    cat <<_LT_EOF >> "$cfgfile"
17528bd17e5fSmrg#! $SHELL
1753b042e37fSmrg
17548bd17e5fSmrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
17558bd17e5fSmrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
17568bd17e5fSmrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
17578bd17e5fSmrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
17588bd17e5fSmrg#
17598bd17e5fSmrg_LT_COPYING
17608bd17e5fSmrg_LT_LIBTOOL_TAGS
1761b042e37fSmrg
17628bd17e5fSmrg# ### BEGIN LIBTOOL CONFIG
17638bd17e5fSmrg_LT_LIBTOOL_CONFIG_VARS
17648bd17e5fSmrg_LT_LIBTOOL_TAG_VARS
17658bd17e5fSmrg# ### END LIBTOOL CONFIG
1766b042e37fSmrg
17670597fb56Smrg_LT_EOF
1768b042e37fSmrg
17690597fb56Smrg  case $host_os in
17708bd17e5fSmrg  aix3*)
17718bd17e5fSmrg    cat <<\_LT_EOF >> "$cfgfile"
17728bd17e5fSmrg# AIX sometimes has problems with the GCC collect2 program.  For some
17738bd17e5fSmrg# reason, if we set the COLLECT_NAMES environment variable, the problems
17748bd17e5fSmrg# vanish in a puff of smoke.
17758bd17e5fSmrgif test "X${COLLECT_NAMES+set}" != Xset; then
17768bd17e5fSmrg  COLLECT_NAMES=
17778bd17e5fSmrg  export COLLECT_NAMES
17788bd17e5fSmrgfi
17798bd17e5fSmrg_LT_EOF
17800597fb56Smrg    ;;
1781706b6b52Smrg  esac
1782b042e37fSmrg
17838bd17e5fSmrg  _LT_PROG_LTMAIN
1784b042e37fSmrg
17858bd17e5fSmrg  # We use sed instead of cat because bash on DJGPP gets confused if
17868bd17e5fSmrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
17878bd17e5fSmrg  # text mode, it properly converts lines to CR/LF.  This bash problem
17888bd17e5fSmrg  # is reportedly fixed, but why not run on old versions too?
17898bd17e5fSmrg  sed '$q' "$ltmain" >> "$cfgfile" \
17908bd17e5fSmrg     || (rm -f "$cfgfile"; exit 1)
1791b042e37fSmrg
17928bd17e5fSmrg  _LT_PROG_REPLACE_SHELLFNS
1793b042e37fSmrg
17948bd17e5fSmrg   mv -f "$cfgfile" "$ofile" ||
17958bd17e5fSmrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
17968bd17e5fSmrg  chmod +x "$ofile"
17978bd17e5fSmrg],
17988bd17e5fSmrg[cat <<_LT_EOF >> "$ofile"
1799b042e37fSmrg
18008bd17e5fSmrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
18018bd17e5fSmrgdnl in a comment (ie after a #).
18028bd17e5fSmrg# ### BEGIN LIBTOOL TAG CONFIG: $1
18038bd17e5fSmrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
18048bd17e5fSmrg# ### END LIBTOOL TAG CONFIG: $1
18058bd17e5fSmrg_LT_EOF
18068bd17e5fSmrg])dnl /m4_if
18078bd17e5fSmrg],
18088bd17e5fSmrg[m4_if([$1], [], [
18098bd17e5fSmrg    PACKAGE='$PACKAGE'
18108bd17e5fSmrg    VERSION='$VERSION'
18118bd17e5fSmrg    TIMESTAMP='$TIMESTAMP'
18128bd17e5fSmrg    RM='$RM'
18138bd17e5fSmrg    ofile='$ofile'], [])
18148bd17e5fSmrg])dnl /_LT_CONFIG_SAVE_COMMANDS
18158bd17e5fSmrg])# _LT_CONFIG
1816b042e37fSmrg
1817b042e37fSmrg
18188bd17e5fSmrg# LT_SUPPORTED_TAG(TAG)
18198bd17e5fSmrg# ---------------------
18208bd17e5fSmrg# Trace this macro to discover what tags are supported by the libtool
18218bd17e5fSmrg# --tag option, using:
18228bd17e5fSmrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
18238bd17e5fSmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
1824b042e37fSmrg
1825b042e37fSmrg
18268bd17e5fSmrg# C support is built-in for now
18278bd17e5fSmrgm4_define([_LT_LANG_C_enabled], [])
18288bd17e5fSmrgm4_define([_LT_TAGS], [])
1829b042e37fSmrg
1830b042e37fSmrg
18318bd17e5fSmrg# LT_LANG(LANG)
18328bd17e5fSmrg# -------------
18338bd17e5fSmrg# Enable libtool support for the given language if not already enabled.
18348bd17e5fSmrgAC_DEFUN([LT_LANG],
18358bd17e5fSmrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
18368bd17e5fSmrgm4_case([$1],
18378bd17e5fSmrg  [C],			[_LT_LANG(C)],
18388bd17e5fSmrg  [C++],		[_LT_LANG(CXX)],
18398bd17e5fSmrg  [Go],			[_LT_LANG(GO)],
18408bd17e5fSmrg  [Java],		[_LT_LANG(GCJ)],
18418bd17e5fSmrg  [Fortran 77],		[_LT_LANG(F77)],
18428bd17e5fSmrg  [Fortran],		[_LT_LANG(FC)],
18438bd17e5fSmrg  [Windows Resource],	[_LT_LANG(RC)],
18448bd17e5fSmrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
18458bd17e5fSmrg    [_LT_LANG($1)],
18468bd17e5fSmrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
18478bd17e5fSmrg])# LT_LANG
1848b042e37fSmrg
1849b042e37fSmrg
18508bd17e5fSmrg# _LT_LANG(LANGNAME)
18518bd17e5fSmrg# ------------------
18528bd17e5fSmrgm4_defun([_LT_LANG],
18538bd17e5fSmrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
18548bd17e5fSmrg  [LT_SUPPORTED_TAG([$1])dnl
18558bd17e5fSmrg  m4_append([_LT_TAGS], [$1 ])dnl
18568bd17e5fSmrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
18578bd17e5fSmrg  _LT_LANG_$1_CONFIG($1)])dnl
18588bd17e5fSmrg])# _LT_LANG
1859b042e37fSmrg
18608c4a8e55Smrg
18618bd17e5fSmrgm4_ifndef([AC_PROG_GO], [
18628bd17e5fSmrg# NOTE: This macro has been submitted for inclusion into   #
18638bd17e5fSmrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
18648bd17e5fSmrg#  a released version of Autoconf we should remove this    #
18658bd17e5fSmrg#  macro and use it instead.                               #
18668bd17e5fSmrgm4_defun([AC_PROG_GO],
18678bd17e5fSmrg[AC_LANG_PUSH(Go)dnl
18688bd17e5fSmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
18698bd17e5fSmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
18708bd17e5fSmrg_AC_ARG_VAR_LDFLAGS()dnl
18718bd17e5fSmrgAC_CHECK_TOOL(GOC, gccgo)
18728bd17e5fSmrgif test -z "$GOC"; then
18738bd17e5fSmrg  if test -n "$ac_tool_prefix"; then
18748bd17e5fSmrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
1875706b6b52Smrg  fi
18760597fb56Smrgfi
18778bd17e5fSmrgif test -z "$GOC"; then
18788bd17e5fSmrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
18798bd17e5fSmrgfi
18808bd17e5fSmrg])#m4_defun
18818bd17e5fSmrg])#m4_ifndef
1882b042e37fSmrg
1883b042e37fSmrg
18848bd17e5fSmrg# _LT_LANG_DEFAULT_CONFIG
18858bd17e5fSmrg# -----------------------
18868bd17e5fSmrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
18878bd17e5fSmrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
18888bd17e5fSmrg  [LT_LANG(CXX)],
18898bd17e5fSmrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
1890b042e37fSmrg
18918bd17e5fSmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
18928bd17e5fSmrg  [LT_LANG(F77)],
18938bd17e5fSmrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
1894b042e37fSmrg
18958bd17e5fSmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
18968bd17e5fSmrg  [LT_LANG(FC)],
18978bd17e5fSmrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
1898b042e37fSmrg
18998bd17e5fSmrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
19008bd17e5fSmrgdnl pulling things in needlessly.
19018bd17e5fSmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
19028bd17e5fSmrg  [LT_LANG(GCJ)],
19038bd17e5fSmrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
19048bd17e5fSmrg    [LT_LANG(GCJ)],
19058bd17e5fSmrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
19068bd17e5fSmrg      [LT_LANG(GCJ)],
19078bd17e5fSmrg      [m4_ifdef([AC_PROG_GCJ],
19088bd17e5fSmrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
19098bd17e5fSmrg       m4_ifdef([A][M_PROG_GCJ],
19108bd17e5fSmrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
19118bd17e5fSmrg       m4_ifdef([LT_PROG_GCJ],
19128bd17e5fSmrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
1913b042e37fSmrg
19148bd17e5fSmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
19158bd17e5fSmrg  [LT_LANG(GO)],
19168bd17e5fSmrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
1917b042e37fSmrg
19188bd17e5fSmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
19198bd17e5fSmrg  [LT_LANG(RC)],
19208bd17e5fSmrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
19218bd17e5fSmrg])# _LT_LANG_DEFAULT_CONFIG
1922b042e37fSmrg
19238bd17e5fSmrg# Obsolete macros:
19248bd17e5fSmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
19258bd17e5fSmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
19268bd17e5fSmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
19278bd17e5fSmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
19288bd17e5fSmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
19298bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
19308bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
19318bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
19328bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
19338bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
19348bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
19358bd17e5fSmrg
19368bd17e5fSmrg
19378bd17e5fSmrg# _LT_TAG_COMPILER
19380597fb56Smrg# ----------------
19398bd17e5fSmrgm4_defun([_LT_TAG_COMPILER],
19408bd17e5fSmrg[AC_REQUIRE([AC_PROG_CC])dnl
1941b042e37fSmrg
19428bd17e5fSmrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
19438bd17e5fSmrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
19448bd17e5fSmrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
19458bd17e5fSmrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
1946b042e37fSmrg
19478bd17e5fSmrg# If no C compiler was specified, use CC.
19488bd17e5fSmrgLTCC=${LTCC-"$CC"}
1949b042e37fSmrg
19508bd17e5fSmrg# If no C compiler flags were specified, use CFLAGS.
19518bd17e5fSmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
1952b042e37fSmrg
19538bd17e5fSmrg# Allow CC to be a program name with arguments.
19548bd17e5fSmrgcompiler=$CC
19558bd17e5fSmrg])# _LT_TAG_COMPILER
1956b042e37fSmrg
1957b042e37fSmrg
19588bd17e5fSmrg# _LT_COMPILER_BOILERPLATE
19598bd17e5fSmrg# ------------------------
19608bd17e5fSmrg# Check for compiler boilerplate output or warnings with
19618bd17e5fSmrg# the simple compiler test code.
19628bd17e5fSmrgm4_defun([_LT_COMPILER_BOILERPLATE],
19638bd17e5fSmrg[m4_require([_LT_DECL_SED])dnl
19648bd17e5fSmrgac_outfile=conftest.$ac_objext
19658bd17e5fSmrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
19668bd17e5fSmrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
19678bd17e5fSmrg_lt_compiler_boilerplate=`cat conftest.err`
19688bd17e5fSmrg$RM conftest*
19698bd17e5fSmrg])# _LT_COMPILER_BOILERPLATE
1970b042e37fSmrg
1971b042e37fSmrg
19728bd17e5fSmrg# _LT_LINKER_BOILERPLATE
19738bd17e5fSmrg# ----------------------
19748bd17e5fSmrg# Check for linker boilerplate output or warnings with
19758bd17e5fSmrg# the simple link test code.
19768bd17e5fSmrgm4_defun([_LT_LINKER_BOILERPLATE],
19778bd17e5fSmrg[m4_require([_LT_DECL_SED])dnl
19788bd17e5fSmrgac_outfile=conftest.$ac_objext
19798bd17e5fSmrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
19808bd17e5fSmrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
19818bd17e5fSmrg_lt_linker_boilerplate=`cat conftest.err`
19828bd17e5fSmrg$RM -r conftest*
19838bd17e5fSmrg])# _LT_LINKER_BOILERPLATE
19848c4a8e55Smrg
19858bd17e5fSmrg# _LT_REQUIRED_DARWIN_CHECKS
19868bd17e5fSmrg# -------------------------
19878bd17e5fSmrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
19888bd17e5fSmrg  case $host_os in
19898bd17e5fSmrg    rhapsody* | darwin*)
19908bd17e5fSmrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
19918bd17e5fSmrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
19928bd17e5fSmrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
19938bd17e5fSmrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
19948bd17e5fSmrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
19958bd17e5fSmrg    _LT_DECL([], [DSYMUTIL], [1],
19968bd17e5fSmrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
19978bd17e5fSmrg    _LT_DECL([], [NMEDIT], [1],
19988bd17e5fSmrg      [Tool to change global to local symbols on Mac OS X])
19998bd17e5fSmrg    _LT_DECL([], [LIPO], [1],
20008bd17e5fSmrg      [Tool to manipulate fat objects and archives on Mac OS X])
20018bd17e5fSmrg    _LT_DECL([], [OTOOL], [1],
20028bd17e5fSmrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
20038bd17e5fSmrg    _LT_DECL([], [OTOOL64], [1],
20048bd17e5fSmrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
2005b042e37fSmrg
20068bd17e5fSmrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
20078bd17e5fSmrg      [lt_cv_apple_cc_single_mod=no
20088bd17e5fSmrg      if test -z "${LT_MULTI_MODULE}"; then
20098bd17e5fSmrg	# By default we will add the -single_module flag. You can override
20108bd17e5fSmrg	# by either setting the environment variable LT_MULTI_MODULE
20118bd17e5fSmrg	# non-empty at configure time, or by adding -multi_module to the
20128bd17e5fSmrg	# link flags.
20138bd17e5fSmrg	rm -rf libconftest.dylib*
20148bd17e5fSmrg	echo "int foo(void){return 1;}" > conftest.c
20158bd17e5fSmrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
20168bd17e5fSmrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
20178bd17e5fSmrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
20188bd17e5fSmrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
20198bd17e5fSmrg        _lt_result=$?
20208bd17e5fSmrg	# If there is a non-empty error log, and "single_module"
20218bd17e5fSmrg	# appears in it, assume the flag caused a linker warning
20228bd17e5fSmrg        if test -s conftest.err && $GREP single_module conftest.err; then
20238bd17e5fSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
20248bd17e5fSmrg	# Otherwise, if the output was created with a 0 exit code from
20258bd17e5fSmrg	# the compiler, it worked.
20268bd17e5fSmrg	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
20278bd17e5fSmrg	  lt_cv_apple_cc_single_mod=yes
20288bd17e5fSmrg	else
20298bd17e5fSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
20308bd17e5fSmrg	fi
20318bd17e5fSmrg	rm -rf libconftest.dylib*
20328bd17e5fSmrg	rm -f conftest.*
20338bd17e5fSmrg      fi])
2034b042e37fSmrg
20358bd17e5fSmrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
20368bd17e5fSmrg      [lt_cv_ld_exported_symbols_list],
20378bd17e5fSmrg      [lt_cv_ld_exported_symbols_list=no
20388bd17e5fSmrg      save_LDFLAGS=$LDFLAGS
20398bd17e5fSmrg      echo "_main" > conftest.sym
20408bd17e5fSmrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
20418bd17e5fSmrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
20428bd17e5fSmrg	[lt_cv_ld_exported_symbols_list=yes],
20438bd17e5fSmrg	[lt_cv_ld_exported_symbols_list=no])
20448bd17e5fSmrg	LDFLAGS="$save_LDFLAGS"
20458bd17e5fSmrg    ])
2046b042e37fSmrg
20478bd17e5fSmrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
20488bd17e5fSmrg      [lt_cv_ld_force_load=no
20498bd17e5fSmrg      cat > conftest.c << _LT_EOF
20508bd17e5fSmrgint forced_loaded() { return 2;}
20518bd17e5fSmrg_LT_EOF
20528bd17e5fSmrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
20538bd17e5fSmrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
20548bd17e5fSmrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
20558bd17e5fSmrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
20568bd17e5fSmrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
20578bd17e5fSmrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
20588bd17e5fSmrg      cat > conftest.c << _LT_EOF
20598bd17e5fSmrgint main() { return 0;}
20608bd17e5fSmrg_LT_EOF
20618bd17e5fSmrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
20628bd17e5fSmrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
20638bd17e5fSmrg      _lt_result=$?
20648bd17e5fSmrg      if test -s conftest.err && $GREP force_load conftest.err; then
20658bd17e5fSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
20668bd17e5fSmrg      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
20678bd17e5fSmrg	lt_cv_ld_force_load=yes
20680597fb56Smrg      else
20698bd17e5fSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
20700597fb56Smrg      fi
20718bd17e5fSmrg        rm -f conftest.err libconftest.a conftest conftest.c
20728bd17e5fSmrg        rm -rf conftest.dSYM
20738bd17e5fSmrg    ])
20748bd17e5fSmrg    case $host_os in
20758bd17e5fSmrg    rhapsody* | darwin1.[[012]])
20768bd17e5fSmrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
20778bd17e5fSmrg    darwin1.*)
20788bd17e5fSmrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
20798bd17e5fSmrg    darwin*) # darwin 5.x on
20808bd17e5fSmrg      # if running on 10.5 or later, the deployment target defaults
20818bd17e5fSmrg      # to the OS version, if on x86, and 10.4, the deployment
20828bd17e5fSmrg      # target defaults to 10.4. Don't you love it?
20838bd17e5fSmrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
20848bd17e5fSmrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
20858bd17e5fSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
20868bd17e5fSmrg	10.[[012]]*)
20878bd17e5fSmrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
20888bd17e5fSmrg	10.*)
20898bd17e5fSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
20908bd17e5fSmrg      esac
20910597fb56Smrg    ;;
20928bd17e5fSmrg  esac
20938bd17e5fSmrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
20948bd17e5fSmrg      _lt_dar_single_mod='$single_module'
20958bd17e5fSmrg    fi
20968bd17e5fSmrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
20978bd17e5fSmrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
20988bd17e5fSmrg    else
20998bd17e5fSmrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
21008bd17e5fSmrg    fi
21018bd17e5fSmrg    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
21028bd17e5fSmrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
21038bd17e5fSmrg    else
21048bd17e5fSmrg      _lt_dsymutil=
21058bd17e5fSmrg    fi
21060597fb56Smrg    ;;
21070597fb56Smrg  esac
21088bd17e5fSmrg])
2109b042e37fSmrg
21108c4a8e55Smrg
21118bd17e5fSmrg# _LT_DARWIN_LINKER_FEATURES([TAG])
21128bd17e5fSmrg# ---------------------------------
21138bd17e5fSmrg# Checks for linker and compiler features on darwin
21148bd17e5fSmrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
21158bd17e5fSmrg[
21168bd17e5fSmrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
21178bd17e5fSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
21188bd17e5fSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
21198bd17e5fSmrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
21208bd17e5fSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
21218bd17e5fSmrg  if test "$lt_cv_ld_force_load" = "yes"; then
21228bd17e5fSmrg    _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\"`'
21238bd17e5fSmrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
21248bd17e5fSmrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
21250597fb56Smrg  else
21268bd17e5fSmrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
21270597fb56Smrg  fi
21288bd17e5fSmrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
21298bd17e5fSmrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
21308bd17e5fSmrg  case $cc_basename in
21318bd17e5fSmrg     ifort*) _lt_dar_can_shared=yes ;;
21328bd17e5fSmrg     *) _lt_dar_can_shared=$GCC ;;
21330597fb56Smrg  esac
21348bd17e5fSmrg  if test "$_lt_dar_can_shared" = "yes"; then
21358bd17e5fSmrg    output_verbose_link_cmd=func_echo_all
21368bd17e5fSmrg    _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}"
21378bd17e5fSmrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
21388bd17e5fSmrg    _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}"
21398bd17e5fSmrg    _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}"
21408bd17e5fSmrg    m4_if([$1], [CXX],
21418bd17e5fSmrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
21428bd17e5fSmrg      _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}"
21438bd17e5fSmrg      _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}"
21440597fb56Smrg    fi
21458bd17e5fSmrg],[])
21468bd17e5fSmrg  else
21478bd17e5fSmrg  _LT_TAGVAR(ld_shlibs, $1)=no
21488bd17e5fSmrg  fi
21498bd17e5fSmrg])
2150b042e37fSmrg
21518bd17e5fSmrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
21528bd17e5fSmrg# ----------------------------------
21538bd17e5fSmrg# Links a minimal program and checks the executable
21548bd17e5fSmrg# for the system default hardcoded library path. In most cases,
21558bd17e5fSmrg# this is /usr/lib:/lib, but when the MPI compilers are used
21568bd17e5fSmrg# the location of the communication and MPI libs are included too.
21578bd17e5fSmrg# If we don't find anything, use the default library path according
21588bd17e5fSmrg# to the aix ld manual.
21598bd17e5fSmrg# Store the results from the different compilers for each TAGNAME.
21608bd17e5fSmrg# Allow to override them for all tags through lt_cv_aix_libpath.
21618bd17e5fSmrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
21628bd17e5fSmrg[m4_require([_LT_DECL_SED])dnl
21638bd17e5fSmrgif test "${lt_cv_aix_libpath+set}" = set; then
21648bd17e5fSmrg  aix_libpath=$lt_cv_aix_libpath
21658bd17e5fSmrgelse
21668bd17e5fSmrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
21678bd17e5fSmrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
21688bd17e5fSmrg  lt_aix_libpath_sed='[
21698bd17e5fSmrg      /Import File Strings/,/^$/ {
21708bd17e5fSmrg	  /^0/ {
21718bd17e5fSmrg	      s/^0  *\([^ ]*\) *$/\1/
21728bd17e5fSmrg	      p
21738bd17e5fSmrg	  }
21748bd17e5fSmrg      }]'
21758bd17e5fSmrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
21768bd17e5fSmrg  # Check for a 64-bit object if we didn't find anything.
21778bd17e5fSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
21788bd17e5fSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
21798bd17e5fSmrg  fi],[])
21808bd17e5fSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
21818bd17e5fSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
21828bd17e5fSmrg  fi
21838bd17e5fSmrg  ])
21848bd17e5fSmrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
21858bd17e5fSmrgfi
21868bd17e5fSmrg])# _LT_SYS_MODULE_PATH_AIX
2187b042e37fSmrg
21888c4a8e55Smrg
21898bd17e5fSmrg# _LT_SHELL_INIT(ARG)
21908bd17e5fSmrg# -------------------
21918bd17e5fSmrgm4_define([_LT_SHELL_INIT],
21928bd17e5fSmrg[m4_divert_text([M4SH-INIT], [$1
21938bd17e5fSmrg])])# _LT_SHELL_INIT
2194b042e37fSmrg
2195b042e37fSmrg
2196b042e37fSmrg
21978bd17e5fSmrg# _LT_PROG_ECHO_BACKSLASH
21988bd17e5fSmrg# -----------------------
21998bd17e5fSmrg# Find how we can fake an echo command that does not interpret backslash.
22008bd17e5fSmrg# In particular, with Autoconf 2.60 or later we add some code to the start
22018bd17e5fSmrg# of the generated configure script which will find a shell with a builtin
22028bd17e5fSmrg# printf (which we can use as an echo command).
22038bd17e5fSmrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
22048bd17e5fSmrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
22058bd17e5fSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
22068bd17e5fSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
2207b042e37fSmrg
22088bd17e5fSmrgAC_MSG_CHECKING([how to print strings])
22098bd17e5fSmrg# Test print first, because it will be a builtin if present.
22108bd17e5fSmrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
22118bd17e5fSmrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
22128bd17e5fSmrg  ECHO='print -r --'
22138bd17e5fSmrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
22148bd17e5fSmrg  ECHO='printf %s\n'
22158bd17e5fSmrgelse
22168bd17e5fSmrg  # Use this function as a fallback that always works.
22178bd17e5fSmrg  func_fallback_echo ()
22188bd17e5fSmrg  {
22198bd17e5fSmrg    eval 'cat <<_LTECHO_EOF
22208bd17e5fSmrg$[]1
22218bd17e5fSmrg_LTECHO_EOF'
22228bd17e5fSmrg  }
22238bd17e5fSmrg  ECHO='func_fallback_echo'
22248bd17e5fSmrgfi
22258c4a8e55Smrg
22268bd17e5fSmrg# func_echo_all arg...
22278bd17e5fSmrg# Invoke $ECHO with all args, space-separated.
22288bd17e5fSmrgfunc_echo_all ()
22298bd17e5fSmrg{
22308bd17e5fSmrg    $ECHO "$*" 
22318bd17e5fSmrg}
22328c4a8e55Smrg
22338bd17e5fSmrgcase "$ECHO" in
22348bd17e5fSmrg  printf*) AC_MSG_RESULT([printf]) ;;
22358bd17e5fSmrg  print*) AC_MSG_RESULT([print -r]) ;;
22368bd17e5fSmrg  *) AC_MSG_RESULT([cat]) ;;
22378bd17e5fSmrgesac
22388c4a8e55Smrg
22398bd17e5fSmrgm4_ifdef([_AS_DETECT_SUGGESTED],
22408bd17e5fSmrg[_AS_DETECT_SUGGESTED([
22418bd17e5fSmrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
22428bd17e5fSmrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
22438bd17e5fSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
22448bd17e5fSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
22458bd17e5fSmrg    PATH=/empty FPATH=/empty; export PATH FPATH
22468bd17e5fSmrg    test "X`printf %s $ECHO`" = "X$ECHO" \
22478bd17e5fSmrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
2248b042e37fSmrg
22498bd17e5fSmrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
22508bd17e5fSmrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
22518bd17e5fSmrg])# _LT_PROG_ECHO_BACKSLASH
2252b042e37fSmrg
2253b042e37fSmrg
22548bd17e5fSmrg# _LT_WITH_SYSROOT
22558bd17e5fSmrg# ----------------
22568bd17e5fSmrgAC_DEFUN([_LT_WITH_SYSROOT],
22578bd17e5fSmrg[AC_MSG_CHECKING([for sysroot])
22588bd17e5fSmrgAC_ARG_WITH([sysroot],
22598bd17e5fSmrg[  --with-sysroot[=DIR] Search for dependent libraries within DIR
22608bd17e5fSmrg                        (or the compiler's sysroot if not specified).],
22618bd17e5fSmrg[], [with_sysroot=no])
2262b042e37fSmrg
22638bd17e5fSmrgdnl lt_sysroot will always be passed unquoted.  We quote it here
22648bd17e5fSmrgdnl in case the user passed a directory name.
22658bd17e5fSmrglt_sysroot=
22668bd17e5fSmrgcase ${with_sysroot} in #(
22678bd17e5fSmrg yes)
22688bd17e5fSmrg   if test "$GCC" = yes; then
22698bd17e5fSmrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
22708bd17e5fSmrg   fi
22718bd17e5fSmrg   ;; #(
22728bd17e5fSmrg /*)
22738bd17e5fSmrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
22748bd17e5fSmrg   ;; #(
22758bd17e5fSmrg no|'')
22768bd17e5fSmrg   ;; #(
22778bd17e5fSmrg *)
22788bd17e5fSmrg   AC_MSG_RESULT([${with_sysroot}])
22798bd17e5fSmrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
22808bd17e5fSmrg   ;;
22818bd17e5fSmrgesac
22828bd17e5fSmrg
22838bd17e5fSmrg AC_MSG_RESULT([${lt_sysroot:-no}])
22848bd17e5fSmrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
22858bd17e5fSmrg[dependent libraries, and in which our libraries should be installed.])])
22868bd17e5fSmrg
22878bd17e5fSmrg# _LT_ENABLE_LOCK
22888bd17e5fSmrg# ---------------
22898bd17e5fSmrgm4_defun([_LT_ENABLE_LOCK],
22908bd17e5fSmrg[AC_ARG_ENABLE([libtool-lock],
22918bd17e5fSmrg  [AS_HELP_STRING([--disable-libtool-lock],
22928bd17e5fSmrg    [avoid locking (might break parallel builds)])])
22938bd17e5fSmrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
22948bd17e5fSmrg
22958bd17e5fSmrg# Some flags need to be propagated to the compiler or linker for good
22968bd17e5fSmrg# libtool support.
22978bd17e5fSmrgcase $host in
22988bd17e5fSmrgia64-*-hpux*)
22998bd17e5fSmrg  # Find out which ABI we are using.
23008bd17e5fSmrg  echo 'int i;' > conftest.$ac_ext
23018bd17e5fSmrg  if AC_TRY_EVAL(ac_compile); then
23028bd17e5fSmrg    case `/usr/bin/file conftest.$ac_objext` in
23038bd17e5fSmrg      *ELF-32*)
23048bd17e5fSmrg	HPUX_IA64_MODE="32"
23050597fb56Smrg	;;
23068bd17e5fSmrg      *ELF-64*)
23078bd17e5fSmrg	HPUX_IA64_MODE="64"
23088bd17e5fSmrg	;;
23098bd17e5fSmrg    esac
23108bd17e5fSmrg  fi
23118bd17e5fSmrg  rm -rf conftest*
23128bd17e5fSmrg  ;;
23138bd17e5fSmrg*-*-irix6*)
23148bd17e5fSmrg  # Find out which ABI we are using.
23158bd17e5fSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
23168bd17e5fSmrg  if AC_TRY_EVAL(ac_compile); then
23178bd17e5fSmrg    if test "$lt_cv_prog_gnu_ld" = yes; then
23188bd17e5fSmrg      case `/usr/bin/file conftest.$ac_objext` in
23198bd17e5fSmrg	*32-bit*)
23208bd17e5fSmrg	  LD="${LD-ld} -melf32bsmip"
23218bd17e5fSmrg	  ;;
23228bd17e5fSmrg	*N32*)
23238bd17e5fSmrg	  LD="${LD-ld} -melf32bmipn32"
23248bd17e5fSmrg	  ;;
23258bd17e5fSmrg	*64-bit*)
23268bd17e5fSmrg	  LD="${LD-ld} -melf64bmip"
23270597fb56Smrg	;;
23280597fb56Smrg      esac
23298bd17e5fSmrg    else
23308bd17e5fSmrg      case `/usr/bin/file conftest.$ac_objext` in
23318bd17e5fSmrg	*32-bit*)
23328bd17e5fSmrg	  LD="${LD-ld} -32"
23338bd17e5fSmrg	  ;;
23348bd17e5fSmrg	*N32*)
23358bd17e5fSmrg	  LD="${LD-ld} -n32"
23368bd17e5fSmrg	  ;;
23378bd17e5fSmrg	*64-bit*)
23388bd17e5fSmrg	  LD="${LD-ld} -64"
23398bd17e5fSmrg	  ;;
23408bd17e5fSmrg      esac
23418bd17e5fSmrg    fi
23420597fb56Smrg  fi
23438bd17e5fSmrg  rm -rf conftest*
23440597fb56Smrg  ;;
2345b042e37fSmrg
23468bd17e5fSmrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
23478bd17e5fSmrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
23488bd17e5fSmrg  # Find out which ABI we are using.
23498bd17e5fSmrg  echo 'int i;' > conftest.$ac_ext
23508bd17e5fSmrg  if AC_TRY_EVAL(ac_compile); then
23518bd17e5fSmrg    case `/usr/bin/file conftest.o` in
23528bd17e5fSmrg      *32-bit*)
23538bd17e5fSmrg	case $host in
23548bd17e5fSmrg	  x86_64-*kfreebsd*-gnu)
23558bd17e5fSmrg	    LD="${LD-ld} -m elf_i386_fbsd"
23568bd17e5fSmrg	    ;;
23578bd17e5fSmrg	  x86_64-*linux*)
23588bd17e5fSmrg	    LD="${LD-ld} -m elf_i386"
23598bd17e5fSmrg	    ;;
23608bd17e5fSmrg	  ppc64-*linux*|powerpc64-*linux*)
23618bd17e5fSmrg	    LD="${LD-ld} -m elf32ppclinux"
23628bd17e5fSmrg	    ;;
23638bd17e5fSmrg	  s390x-*linux*)
23648bd17e5fSmrg	    LD="${LD-ld} -m elf_s390"
23658bd17e5fSmrg	    ;;
23668bd17e5fSmrg	  sparc64-*linux*)
23678bd17e5fSmrg	    LD="${LD-ld} -m elf32_sparc"
23688bd17e5fSmrg	    ;;
23698bd17e5fSmrg	esac
23708bd17e5fSmrg	;;
23718bd17e5fSmrg      *64-bit*)
23728bd17e5fSmrg	case $host in
23738bd17e5fSmrg	  x86_64-*kfreebsd*-gnu)
23748bd17e5fSmrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
23758bd17e5fSmrg	    ;;
23768bd17e5fSmrg	  x86_64-*linux*)
23778bd17e5fSmrg	    LD="${LD-ld} -m elf_x86_64"
23788bd17e5fSmrg	    ;;
23798bd17e5fSmrg	  ppc*-*linux*|powerpc*-*linux*)
23808bd17e5fSmrg	    LD="${LD-ld} -m elf64ppc"
23818bd17e5fSmrg	    ;;
23828bd17e5fSmrg	  s390*-*linux*|s390*-*tpf*)
23838bd17e5fSmrg	    LD="${LD-ld} -m elf64_s390"
23848bd17e5fSmrg	    ;;
23858bd17e5fSmrg	  sparc*-*linux*)
23868bd17e5fSmrg	    LD="${LD-ld} -m elf64_sparc"
23878bd17e5fSmrg	    ;;
23888bd17e5fSmrg	esac
23898bd17e5fSmrg	;;
23908bd17e5fSmrg    esac
23918bd17e5fSmrg  fi
23928bd17e5fSmrg  rm -rf conftest*
23930597fb56Smrg  ;;
2394b042e37fSmrg
23958bd17e5fSmrg*-*-sco3.2v5*)
23968bd17e5fSmrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
23978bd17e5fSmrg  SAVE_CFLAGS="$CFLAGS"
23988bd17e5fSmrg  CFLAGS="$CFLAGS -belf"
23998bd17e5fSmrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
24008bd17e5fSmrg    [AC_LANG_PUSH(C)
24018bd17e5fSmrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
24028bd17e5fSmrg     AC_LANG_POP])
24038bd17e5fSmrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
24048bd17e5fSmrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
24058bd17e5fSmrg    CFLAGS="$SAVE_CFLAGS"
24068bd17e5fSmrg  fi
24070597fb56Smrg  ;;
24088bd17e5fSmrg*-*solaris*)
24098bd17e5fSmrg  # Find out which ABI we are using.
24108bd17e5fSmrg  echo 'int i;' > conftest.$ac_ext
24118bd17e5fSmrg  if AC_TRY_EVAL(ac_compile); then
24128bd17e5fSmrg    case `/usr/bin/file conftest.o` in
24138bd17e5fSmrg    *64-bit*)
24148bd17e5fSmrg      case $lt_cv_prog_gnu_ld in
24158bd17e5fSmrg      yes*)
24168bd17e5fSmrg        case $host in
24178bd17e5fSmrg        i?86-*-solaris*)
24188bd17e5fSmrg          LD="${LD-ld} -m elf_x86_64"
24198bd17e5fSmrg          ;;
24208bd17e5fSmrg        sparc*-*-solaris*)
24218bd17e5fSmrg          LD="${LD-ld} -m elf64_sparc"
24228bd17e5fSmrg          ;;
24238bd17e5fSmrg        esac
24248bd17e5fSmrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
24258bd17e5fSmrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
24268bd17e5fSmrg          LD="${LD-ld}_sol2"
24278bd17e5fSmrg        fi
24288bd17e5fSmrg        ;;
24298bd17e5fSmrg      *)
24308bd17e5fSmrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
24318bd17e5fSmrg	  LD="${LD-ld} -64"
24328bd17e5fSmrg	fi
24338bd17e5fSmrg	;;
24348bd17e5fSmrg      esac
24358bd17e5fSmrg      ;;
24368bd17e5fSmrg    esac
24378bd17e5fSmrg  fi
24388bd17e5fSmrg  rm -rf conftest*
24390597fb56Smrg  ;;
24408bd17e5fSmrgesac
24418c4a8e55Smrg
24428bd17e5fSmrgneed_locks="$enable_libtool_lock"
24438bd17e5fSmrg])# _LT_ENABLE_LOCK
2444b042e37fSmrg
24458c4a8e55Smrg
24468bd17e5fSmrg# _LT_PROG_AR
24478bd17e5fSmrg# -----------
24488bd17e5fSmrgm4_defun([_LT_PROG_AR],
24498bd17e5fSmrg[AC_CHECK_TOOLS(AR, [ar], false)
24508bd17e5fSmrg: ${AR=ar}
24518bd17e5fSmrg: ${AR_FLAGS=cru}
24528bd17e5fSmrg_LT_DECL([], [AR], [1], [The archiver])
24538bd17e5fSmrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
24548c4a8e55Smrg
24558bd17e5fSmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
24568bd17e5fSmrg  [lt_cv_ar_at_file=no
24578bd17e5fSmrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
24588bd17e5fSmrg     [echo conftest.$ac_objext > conftest.lst
24598bd17e5fSmrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
24608bd17e5fSmrg      AC_TRY_EVAL([lt_ar_try])
24618bd17e5fSmrg      if test "$ac_status" -eq 0; then
24628bd17e5fSmrg	# Ensure the archiver fails upon bogus file names.
24638bd17e5fSmrg	rm -f conftest.$ac_objext libconftest.a
24648bd17e5fSmrg	AC_TRY_EVAL([lt_ar_try])
24658bd17e5fSmrg	if test "$ac_status" -ne 0; then
24668bd17e5fSmrg          lt_cv_ar_at_file=@
24678bd17e5fSmrg        fi
24688bd17e5fSmrg      fi
24698bd17e5fSmrg      rm -f conftest.* libconftest.a
24708bd17e5fSmrg     ])
24718bd17e5fSmrg  ])
2472b042e37fSmrg
24738bd17e5fSmrgif test "x$lt_cv_ar_at_file" = xno; then
24748bd17e5fSmrg  archiver_list_spec=
24758bd17e5fSmrgelse
24768bd17e5fSmrg  archiver_list_spec=$lt_cv_ar_at_file
24778bd17e5fSmrgfi
24788bd17e5fSmrg_LT_DECL([], [archiver_list_spec], [1],
24798bd17e5fSmrg  [How to feed a file listing to the archiver])
24808bd17e5fSmrg])# _LT_PROG_AR
2481b042e37fSmrg
2482b042e37fSmrg
24838bd17e5fSmrg# _LT_CMD_OLD_ARCHIVE
24848bd17e5fSmrg# -------------------
24858bd17e5fSmrgm4_defun([_LT_CMD_OLD_ARCHIVE],
24868bd17e5fSmrg[_LT_PROG_AR
2487b042e37fSmrg
24888bd17e5fSmrgAC_CHECK_TOOL(STRIP, strip, :)
24898bd17e5fSmrgtest -z "$STRIP" && STRIP=:
24908bd17e5fSmrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
2491b042e37fSmrg
24928bd17e5fSmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
24938bd17e5fSmrgtest -z "$RANLIB" && RANLIB=:
24948bd17e5fSmrg_LT_DECL([], [RANLIB], [1],
24958bd17e5fSmrg    [Commands used to install an old-style archive])
2496b042e37fSmrg
24978bd17e5fSmrg# Determine commands to create old-style static archives.
24988bd17e5fSmrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
24998bd17e5fSmrgold_postinstall_cmds='chmod 644 $oldlib'
25008bd17e5fSmrgold_postuninstall_cmds=
25018c4a8e55Smrg
25028bd17e5fSmrgif test -n "$RANLIB"; then
25038bd17e5fSmrg  case $host_os in
25048bd17e5fSmrg  openbsd*)
25058bd17e5fSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
25068bd17e5fSmrg    ;;
25078bd17e5fSmrg  *)
25088bd17e5fSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
25098bd17e5fSmrg    ;;
25108bd17e5fSmrg  esac
25118bd17e5fSmrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
25128bd17e5fSmrgfi
2513b042e37fSmrg
25148bd17e5fSmrgcase $host_os in
25158bd17e5fSmrg  darwin*)
25168bd17e5fSmrg    lock_old_archive_extraction=yes ;;
25178bd17e5fSmrg  *)
25188bd17e5fSmrg    lock_old_archive_extraction=no ;;
25198bd17e5fSmrgesac
25208bd17e5fSmrg_LT_DECL([], [old_postinstall_cmds], [2])
25218bd17e5fSmrg_LT_DECL([], [old_postuninstall_cmds], [2])
25228bd17e5fSmrg_LT_TAGDECL([], [old_archive_cmds], [2],
25238bd17e5fSmrg    [Commands used to build an old-style archive])
25248bd17e5fSmrg_LT_DECL([], [lock_old_archive_extraction], [0],
25258bd17e5fSmrg    [Whether to use a lock for old archive extraction])
25268bd17e5fSmrg])# _LT_CMD_OLD_ARCHIVE
2527b042e37fSmrg
2528b042e37fSmrg
25298bd17e5fSmrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
25308bd17e5fSmrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
25318bd17e5fSmrg# ----------------------------------------------------------------
25328bd17e5fSmrg# Check whether the given compiler option works
25338bd17e5fSmrgAC_DEFUN([_LT_COMPILER_OPTION],
25348bd17e5fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
25358bd17e5fSmrgm4_require([_LT_DECL_SED])dnl
25368bd17e5fSmrgAC_CACHE_CHECK([$1], [$2],
25378bd17e5fSmrg  [$2=no
25388bd17e5fSmrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
25398bd17e5fSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
25408bd17e5fSmrg   lt_compiler_flag="$3"
25418bd17e5fSmrg   # Insert the option either (1) after the last *FLAGS variable, or
25428bd17e5fSmrg   # (2) before a word containing "conftest.", or (3) at the end.
25438bd17e5fSmrg   # Note that $ac_compile itself does not contain backslashes and begins
25448bd17e5fSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
25458bd17e5fSmrg   # The option is referenced via a variable to avoid confusing sed.
25468bd17e5fSmrg   lt_compile=`echo "$ac_compile" | $SED \
25478bd17e5fSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
25488bd17e5fSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
25498bd17e5fSmrg   -e 's:$: $lt_compiler_flag:'`
25508bd17e5fSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
25518bd17e5fSmrg   (eval "$lt_compile" 2>conftest.err)
25528bd17e5fSmrg   ac_status=$?
25538bd17e5fSmrg   cat conftest.err >&AS_MESSAGE_LOG_FD
25548bd17e5fSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
25558bd17e5fSmrg   if (exit $ac_status) && test -s "$ac_outfile"; then
25568bd17e5fSmrg     # The compiler can only warn and ignore the option if not recognized
25578bd17e5fSmrg     # So say no if there are warnings other than the usual output.
25588bd17e5fSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
25598bd17e5fSmrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
25608bd17e5fSmrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
25618bd17e5fSmrg       $2=yes
25628bd17e5fSmrg     fi
25638bd17e5fSmrg   fi
25648bd17e5fSmrg   $RM conftest*
25658bd17e5fSmrg])
25668bd17e5fSmrg
25678bd17e5fSmrgif test x"[$]$2" = xyes; then
25688bd17e5fSmrg    m4_if([$5], , :, [$5])
25690597fb56Smrgelse
25708bd17e5fSmrg    m4_if([$6], , :, [$6])
25710597fb56Smrgfi
25728bd17e5fSmrg])# _LT_COMPILER_OPTION
2573b042e37fSmrg
25740597fb56Smrg# Old name:
25758bd17e5fSmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
25760597fb56Smrgdnl aclocal-1.4 backwards compatibility:
25778bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
2578706b6b52Smrg
2579706b6b52Smrg
25808bd17e5fSmrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
25818bd17e5fSmrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
25828bd17e5fSmrg# ----------------------------------------------------
25838bd17e5fSmrg# Check whether the given linker option works
25848bd17e5fSmrgAC_DEFUN([_LT_LINKER_OPTION],
25858bd17e5fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
25868bd17e5fSmrgm4_require([_LT_DECL_SED])dnl
25878bd17e5fSmrgAC_CACHE_CHECK([$1], [$2],
25888bd17e5fSmrg  [$2=no
25898bd17e5fSmrg   save_LDFLAGS="$LDFLAGS"
25908bd17e5fSmrg   LDFLAGS="$LDFLAGS $3"
25918bd17e5fSmrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
25928bd17e5fSmrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
25938bd17e5fSmrg     # The linker can only warn and ignore the option if not recognized
25948bd17e5fSmrg     # So say no if there are warnings
25958bd17e5fSmrg     if test -s conftest.err; then
25968bd17e5fSmrg       # Append any errors to the config.log.
25978bd17e5fSmrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
25988bd17e5fSmrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
25998bd17e5fSmrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
26008bd17e5fSmrg       if diff conftest.exp conftest.er2 >/dev/null; then
26018bd17e5fSmrg         $2=yes
26028bd17e5fSmrg       fi
26038bd17e5fSmrg     else
26048bd17e5fSmrg       $2=yes
26058bd17e5fSmrg     fi
26068bd17e5fSmrg   fi
26078bd17e5fSmrg   $RM -r conftest*
26088bd17e5fSmrg   LDFLAGS="$save_LDFLAGS"
26098bd17e5fSmrg])
26108bd17e5fSmrg
26118bd17e5fSmrgif test x"[$]$2" = xyes; then
26128bd17e5fSmrg    m4_if([$4], , :, [$4])
26138bd17e5fSmrgelse
26148bd17e5fSmrg    m4_if([$5], , :, [$5])
26150597fb56Smrgfi
26168bd17e5fSmrg])# _LT_LINKER_OPTION
2617706b6b52Smrg
26188bd17e5fSmrg# Old name:
26198bd17e5fSmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
26208bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
26218bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
2622706b6b52Smrg
2623706b6b52Smrg
26248bd17e5fSmrg# LT_CMD_MAX_LEN
26258bd17e5fSmrg#---------------
26268bd17e5fSmrgAC_DEFUN([LT_CMD_MAX_LEN],
26278bd17e5fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
26288bd17e5fSmrg# find the maximum length of command line arguments
26298bd17e5fSmrgAC_MSG_CHECKING([the maximum length of command line arguments])
26308bd17e5fSmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
26318bd17e5fSmrg  i=0
26328bd17e5fSmrg  teststring="ABCD"
2633b042e37fSmrg
26348bd17e5fSmrg  case $build_os in
26358bd17e5fSmrg  msdosdjgpp*)
26368bd17e5fSmrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
26378bd17e5fSmrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
26388bd17e5fSmrg    # during glob expansion).  Even if it were fixed, the result of this
26398bd17e5fSmrg    # check would be larger than it should be.
26408bd17e5fSmrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
26410597fb56Smrg    ;;
26428bd17e5fSmrg
26438bd17e5fSmrg  gnu*)
26448bd17e5fSmrg    # Under GNU Hurd, this test is not required because there is
26458bd17e5fSmrg    # no limit to the length of command line arguments.
26468bd17e5fSmrg    # Libtool will interpret -1 as no limit whatsoever
26478bd17e5fSmrg    lt_cv_sys_max_cmd_len=-1;
26480597fb56Smrg    ;;
2649b042e37fSmrg
26508bd17e5fSmrg  cygwin* | mingw* | cegcc*)
26518bd17e5fSmrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
26528bd17e5fSmrg    # about 5 minutes as the teststring grows exponentially.
26538bd17e5fSmrg    # Worse, since 9x/ME are not pre-emptively multitasking,
26548bd17e5fSmrg    # you end up with a "frozen" computer, even though with patience
26558bd17e5fSmrg    # the test eventually succeeds (with a max line length of 256k).
26568bd17e5fSmrg    # Instead, let's just punt: use the minimum linelength reported by
26578bd17e5fSmrg    # all of the supported platforms: 8192 (on NT/2K/XP).
26588bd17e5fSmrg    lt_cv_sys_max_cmd_len=8192;
26598bd17e5fSmrg    ;;
2660b042e37fSmrg
26618bd17e5fSmrg  mint*)
26628bd17e5fSmrg    # On MiNT this can take a long time and run out of memory.
26638bd17e5fSmrg    lt_cv_sys_max_cmd_len=8192;
26648bd17e5fSmrg    ;;
2665b042e37fSmrg
26668bd17e5fSmrg  amigaos*)
26678bd17e5fSmrg    # On AmigaOS with pdksh, this test takes hours, literally.
26688bd17e5fSmrg    # So we just punt and use a minimum line length of 8192.
26698bd17e5fSmrg    lt_cv_sys_max_cmd_len=8192;
26708bd17e5fSmrg    ;;
2671b042e37fSmrg
26728bd17e5fSmrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
26738bd17e5fSmrg    # This has been around since 386BSD, at least.  Likely further.
26748bd17e5fSmrg    if test -x /sbin/sysctl; then
26758bd17e5fSmrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
26768bd17e5fSmrg    elif test -x /usr/sbin/sysctl; then
26778bd17e5fSmrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
26788bd17e5fSmrg    else
26798bd17e5fSmrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
26808bd17e5fSmrg    fi
26818bd17e5fSmrg    # And add a safety zone
26828bd17e5fSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
26838bd17e5fSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
26848bd17e5fSmrg    ;;
2685b042e37fSmrg
26868bd17e5fSmrg  interix*)
26878bd17e5fSmrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
26888bd17e5fSmrg    lt_cv_sys_max_cmd_len=196608
26898bd17e5fSmrg    ;;
2690b042e37fSmrg
26918bd17e5fSmrg  os2*)
26928bd17e5fSmrg    # The test takes a long time on OS/2.
26938bd17e5fSmrg    lt_cv_sys_max_cmd_len=8192
26948bd17e5fSmrg    ;;
26958bd17e5fSmrg
26968bd17e5fSmrg  osf*)
26978bd17e5fSmrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
26988bd17e5fSmrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
26998bd17e5fSmrg    # nice to cause kernel panics so lets avoid the loop below.
27008bd17e5fSmrg    # First set a reasonable default.
27018bd17e5fSmrg    lt_cv_sys_max_cmd_len=16384
27028bd17e5fSmrg    #
27038bd17e5fSmrg    if test -x /sbin/sysconfig; then
27048bd17e5fSmrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
27058bd17e5fSmrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
27068bd17e5fSmrg      esac
27070597fb56Smrg    fi
27080597fb56Smrg    ;;
27098bd17e5fSmrg  sco3.2v5*)
27108bd17e5fSmrg    lt_cv_sys_max_cmd_len=102400
27118bd17e5fSmrg    ;;
27128bd17e5fSmrg  sysv5* | sco5v6* | sysv4.2uw2*)
27138bd17e5fSmrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
27148bd17e5fSmrg    if test -n "$kargmax"; then
27158bd17e5fSmrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
27160597fb56Smrg    else
27178bd17e5fSmrg      lt_cv_sys_max_cmd_len=32768
27180597fb56Smrg    fi
27190597fb56Smrg    ;;
27208bd17e5fSmrg  *)
27218bd17e5fSmrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
27228bd17e5fSmrg    if test -n "$lt_cv_sys_max_cmd_len"; then
27238bd17e5fSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
27248bd17e5fSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
27258bd17e5fSmrg    else
27268bd17e5fSmrg      # Make teststring a little bigger before we do anything with it.
27278bd17e5fSmrg      # a 1K string should be a reasonable start.
27288bd17e5fSmrg      for i in 1 2 3 4 5 6 7 8 ; do
27298bd17e5fSmrg        teststring=$teststring$teststring
27308bd17e5fSmrg      done
27318bd17e5fSmrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
27328bd17e5fSmrg      # If test is not a shell built-in, we'll probably end up computing a
27338bd17e5fSmrg      # maximum length that is only half of the actual maximum length, but
27348bd17e5fSmrg      # we can't tell.
27358bd17e5fSmrg      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
27368bd17e5fSmrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
27378bd17e5fSmrg	      test $i != 17 # 1/2 MB should be enough
27388bd17e5fSmrg      do
27398bd17e5fSmrg        i=`expr $i + 1`
27408bd17e5fSmrg        teststring=$teststring$teststring
27418bd17e5fSmrg      done
27428bd17e5fSmrg      # Only check the string length outside the loop.
27438bd17e5fSmrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
27448bd17e5fSmrg      teststring=
27458bd17e5fSmrg      # Add a significant safety factor because C++ compilers can tack on
27468bd17e5fSmrg      # massive amounts of additional arguments before passing them to the
27478bd17e5fSmrg      # linker.  It appears as though 1/2 is a usable value.
27488bd17e5fSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
27498bd17e5fSmrg    fi
27508bd17e5fSmrg    ;;
27518bd17e5fSmrg  esac
27528bd17e5fSmrg])
27538bd17e5fSmrgif test -n $lt_cv_sys_max_cmd_len ; then
27548bd17e5fSmrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
27558bd17e5fSmrgelse
27568bd17e5fSmrg  AC_MSG_RESULT(none)
27578bd17e5fSmrgfi
27588bd17e5fSmrgmax_cmd_len=$lt_cv_sys_max_cmd_len
27598bd17e5fSmrg_LT_DECL([], [max_cmd_len], [0],
27608bd17e5fSmrg    [What is the maximum length of a command?])
27618bd17e5fSmrg])# LT_CMD_MAX_LEN
2762b042e37fSmrg
27638bd17e5fSmrg# Old name:
27648bd17e5fSmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
27658bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
27668bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
27678c4a8e55Smrg
2768b042e37fSmrg
27698bd17e5fSmrg# _LT_HEADER_DLFCN
27708bd17e5fSmrg# ----------------
27718bd17e5fSmrgm4_defun([_LT_HEADER_DLFCN],
27728bd17e5fSmrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
27738bd17e5fSmrg])# _LT_HEADER_DLFCN
2774b042e37fSmrg
2775b042e37fSmrg
27768bd17e5fSmrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
27778bd17e5fSmrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
27788bd17e5fSmrg# ----------------------------------------------------------------
27798bd17e5fSmrgm4_defun([_LT_TRY_DLOPEN_SELF],
27808bd17e5fSmrg[m4_require([_LT_HEADER_DLFCN])dnl
27818bd17e5fSmrgif test "$cross_compiling" = yes; then :
27828bd17e5fSmrg  [$4]
27838bd17e5fSmrgelse
27848bd17e5fSmrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
27858bd17e5fSmrg  lt_status=$lt_dlunknown
27868bd17e5fSmrg  cat > conftest.$ac_ext <<_LT_EOF
27878bd17e5fSmrg[#line $LINENO "configure"
27888bd17e5fSmrg#include "confdefs.h"
27898c4a8e55Smrg
27908bd17e5fSmrg#if HAVE_DLFCN_H
27918bd17e5fSmrg#include <dlfcn.h>
27928bd17e5fSmrg#endif
27938c4a8e55Smrg
27948bd17e5fSmrg#include <stdio.h>
2795b042e37fSmrg
27968bd17e5fSmrg#ifdef RTLD_GLOBAL
27978bd17e5fSmrg#  define LT_DLGLOBAL		RTLD_GLOBAL
27988bd17e5fSmrg#else
27998bd17e5fSmrg#  ifdef DL_GLOBAL
28008bd17e5fSmrg#    define LT_DLGLOBAL		DL_GLOBAL
28018bd17e5fSmrg#  else
28028bd17e5fSmrg#    define LT_DLGLOBAL		0
28038bd17e5fSmrg#  endif
28048bd17e5fSmrg#endif
2805b042e37fSmrg
28068bd17e5fSmrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
28078bd17e5fSmrg   find out it does not work in some platform. */
28088bd17e5fSmrg#ifndef LT_DLLAZY_OR_NOW
28098bd17e5fSmrg#  ifdef RTLD_LAZY
28108bd17e5fSmrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
28118bd17e5fSmrg#  else
28128bd17e5fSmrg#    ifdef DL_LAZY
28138bd17e5fSmrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
28148bd17e5fSmrg#    else
28158bd17e5fSmrg#      ifdef RTLD_NOW
28168bd17e5fSmrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
28178bd17e5fSmrg#      else
28188bd17e5fSmrg#        ifdef DL_NOW
28198bd17e5fSmrg#          define LT_DLLAZY_OR_NOW	DL_NOW
28208bd17e5fSmrg#        else
28218bd17e5fSmrg#          define LT_DLLAZY_OR_NOW	0
28228bd17e5fSmrg#        endif
28238bd17e5fSmrg#      endif
28248bd17e5fSmrg#    endif
28258bd17e5fSmrg#  endif
28268bd17e5fSmrg#endif
28278c4a8e55Smrg
28288bd17e5fSmrg/* When -fvisbility=hidden is used, assume the code has been annotated
28298bd17e5fSmrg   correspondingly for the symbols needed.  */
28308bd17e5fSmrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
28318bd17e5fSmrgint fnord () __attribute__((visibility("default")));
28328bd17e5fSmrg#endif
2833b042e37fSmrg
28348bd17e5fSmrgint fnord () { return 42; }
28358bd17e5fSmrgint main ()
28368bd17e5fSmrg{
28378bd17e5fSmrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
28388bd17e5fSmrg  int status = $lt_dlunknown;
2839b042e37fSmrg
28408bd17e5fSmrg  if (self)
28418bd17e5fSmrg    {
28428bd17e5fSmrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
28438bd17e5fSmrg      else
28448bd17e5fSmrg        {
28458bd17e5fSmrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
28468bd17e5fSmrg          else puts (dlerror ());
28478bd17e5fSmrg	}
28488bd17e5fSmrg      /* dlclose (self); */
28498bd17e5fSmrg    }
28508bd17e5fSmrg  else
28518bd17e5fSmrg    puts (dlerror ());
28528bd17e5fSmrg
28538bd17e5fSmrg  return status;
28548bd17e5fSmrg}]
28558bd17e5fSmrg_LT_EOF
28568bd17e5fSmrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
28578bd17e5fSmrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
28588bd17e5fSmrg    lt_status=$?
28598bd17e5fSmrg    case x$lt_status in
28608bd17e5fSmrg      x$lt_dlno_uscore) $1 ;;
28618bd17e5fSmrg      x$lt_dlneed_uscore) $2 ;;
28628bd17e5fSmrg      x$lt_dlunknown|x*) $3 ;;
28638bd17e5fSmrg    esac
28648bd17e5fSmrg  else :
28658bd17e5fSmrg    # compilation failed
28668bd17e5fSmrg    $3
28678bd17e5fSmrg  fi
28688bd17e5fSmrgfi
28698bd17e5fSmrgrm -fr conftest*
28708bd17e5fSmrg])# _LT_TRY_DLOPEN_SELF
28718bd17e5fSmrg
28728bd17e5fSmrg
28738bd17e5fSmrg# LT_SYS_DLOPEN_SELF
28748bd17e5fSmrg# ------------------
28758bd17e5fSmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
28768bd17e5fSmrg[m4_require([_LT_HEADER_DLFCN])dnl
28778bd17e5fSmrgif test "x$enable_dlopen" != xyes; then
28788bd17e5fSmrg  enable_dlopen=unknown
28798bd17e5fSmrg  enable_dlopen_self=unknown
28808bd17e5fSmrg  enable_dlopen_self_static=unknown
28818bd17e5fSmrgelse
28828bd17e5fSmrg  lt_cv_dlopen=no
28838bd17e5fSmrg  lt_cv_dlopen_libs=
28848bd17e5fSmrg
28858bd17e5fSmrg  case $host_os in
28868bd17e5fSmrg  beos*)
28878bd17e5fSmrg    lt_cv_dlopen="load_add_on"
28888bd17e5fSmrg    lt_cv_dlopen_libs=
28898bd17e5fSmrg    lt_cv_dlopen_self=yes
28900597fb56Smrg    ;;
28918bd17e5fSmrg
28928bd17e5fSmrg  mingw* | pw32* | cegcc*)
28938bd17e5fSmrg    lt_cv_dlopen="LoadLibrary"
28948bd17e5fSmrg    lt_cv_dlopen_libs=
28950597fb56Smrg    ;;
28968bd17e5fSmrg
28978bd17e5fSmrg  cygwin*)
28988bd17e5fSmrg    lt_cv_dlopen="dlopen"
28998bd17e5fSmrg    lt_cv_dlopen_libs=
29000597fb56Smrg    ;;
2901b042e37fSmrg
29028bd17e5fSmrg  darwin*)
29038bd17e5fSmrg  # if libdl is installed we need to link against it
29048bd17e5fSmrg    AC_CHECK_LIB([dl], [dlopen],
29058bd17e5fSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
29068bd17e5fSmrg    lt_cv_dlopen="dyld"
29078bd17e5fSmrg    lt_cv_dlopen_libs=
29088bd17e5fSmrg    lt_cv_dlopen_self=yes
29098bd17e5fSmrg    ])
29108bd17e5fSmrg    ;;
2911b042e37fSmrg
29128bd17e5fSmrg  *)
29138bd17e5fSmrg    AC_CHECK_FUNC([shl_load],
29148bd17e5fSmrg	  [lt_cv_dlopen="shl_load"],
29158bd17e5fSmrg      [AC_CHECK_LIB([dld], [shl_load],
29168bd17e5fSmrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
29178bd17e5fSmrg	[AC_CHECK_FUNC([dlopen],
29188bd17e5fSmrg	      [lt_cv_dlopen="dlopen"],
29198bd17e5fSmrg	  [AC_CHECK_LIB([dl], [dlopen],
29208bd17e5fSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
29218bd17e5fSmrg	    [AC_CHECK_LIB([svld], [dlopen],
29228bd17e5fSmrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
29238bd17e5fSmrg	      [AC_CHECK_LIB([dld], [dld_link],
29248bd17e5fSmrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
29258bd17e5fSmrg	      ])
29268bd17e5fSmrg	    ])
29278bd17e5fSmrg	  ])
29288bd17e5fSmrg	])
29298bd17e5fSmrg      ])
29308bd17e5fSmrg    ;;
29310597fb56Smrg  esac
2932b042e37fSmrg
29338bd17e5fSmrg  if test "x$lt_cv_dlopen" != xno; then
29348bd17e5fSmrg    enable_dlopen=yes
29350597fb56Smrg  else
29368bd17e5fSmrg    enable_dlopen=no
29370597fb56Smrg  fi
2938b042e37fSmrg
29398bd17e5fSmrg  case $lt_cv_dlopen in
29408bd17e5fSmrg  dlopen)
29418bd17e5fSmrg    save_CPPFLAGS="$CPPFLAGS"
29428bd17e5fSmrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2943b042e37fSmrg
29448bd17e5fSmrg    save_LDFLAGS="$LDFLAGS"
29458bd17e5fSmrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2946b042e37fSmrg
29478bd17e5fSmrg    save_LIBS="$LIBS"
29488bd17e5fSmrg    LIBS="$lt_cv_dlopen_libs $LIBS"
2949b042e37fSmrg
29508bd17e5fSmrg    AC_CACHE_CHECK([whether a program can dlopen itself],
29518bd17e5fSmrg	  lt_cv_dlopen_self, [dnl
29528bd17e5fSmrg	  _LT_TRY_DLOPEN_SELF(
29538bd17e5fSmrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
29548bd17e5fSmrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
29558bd17e5fSmrg    ])
29560597fb56Smrg
29578bd17e5fSmrg    if test "x$lt_cv_dlopen_self" = xyes; then
29588bd17e5fSmrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
29598bd17e5fSmrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
29608bd17e5fSmrg	  lt_cv_dlopen_self_static, [dnl
29618bd17e5fSmrg	  _LT_TRY_DLOPEN_SELF(
29628bd17e5fSmrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
29638bd17e5fSmrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
29648bd17e5fSmrg      ])
29658bd17e5fSmrg    fi
29660597fb56Smrg
29678bd17e5fSmrg    CPPFLAGS="$save_CPPFLAGS"
29688bd17e5fSmrg    LDFLAGS="$save_LDFLAGS"
29698bd17e5fSmrg    LIBS="$save_LIBS"
29700597fb56Smrg    ;;
29710597fb56Smrg  esac
29720597fb56Smrg
29738bd17e5fSmrg  case $lt_cv_dlopen_self in
29748bd17e5fSmrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
29758bd17e5fSmrg  *) enable_dlopen_self=unknown ;;
29768bd17e5fSmrg  esac
29770597fb56Smrg
29788bd17e5fSmrg  case $lt_cv_dlopen_self_static in
29798bd17e5fSmrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
29808bd17e5fSmrg  *) enable_dlopen_self_static=unknown ;;
29810597fb56Smrg  esac
29820597fb56Smrgfi
29838bd17e5fSmrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
29848bd17e5fSmrg	 [Whether dlopen is supported])
29858bd17e5fSmrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
29868bd17e5fSmrg	 [Whether dlopen of programs is supported])
29878bd17e5fSmrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
29888bd17e5fSmrg	 [Whether dlopen of statically linked programs is supported])
29898bd17e5fSmrg])# LT_SYS_DLOPEN_SELF
2990b042e37fSmrg
29918bd17e5fSmrg# Old name:
29928bd17e5fSmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
29938bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
29948bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
2995b042e37fSmrg
2996b042e37fSmrg
29978bd17e5fSmrg# _LT_COMPILER_C_O([TAGNAME])
29988bd17e5fSmrg# ---------------------------
29998bd17e5fSmrg# Check to see if options -c and -o are simultaneously supported by compiler.
30008bd17e5fSmrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
30018bd17e5fSmrgm4_defun([_LT_COMPILER_C_O],
30028bd17e5fSmrg[m4_require([_LT_DECL_SED])dnl
30038bd17e5fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
30048bd17e5fSmrgm4_require([_LT_TAG_COMPILER])dnl
30058bd17e5fSmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
30068bd17e5fSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
30078bd17e5fSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
30088bd17e5fSmrg   $RM -r conftest 2>/dev/null
30098bd17e5fSmrg   mkdir conftest
30108bd17e5fSmrg   cd conftest
30118bd17e5fSmrg   mkdir out
30128bd17e5fSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
30130597fb56Smrg
30148bd17e5fSmrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
30158bd17e5fSmrg   # Insert the option either (1) after the last *FLAGS variable, or
30168bd17e5fSmrg   # (2) before a word containing "conftest.", or (3) at the end.
30178bd17e5fSmrg   # Note that $ac_compile itself does not contain backslashes and begins
30188bd17e5fSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
30198bd17e5fSmrg   lt_compile=`echo "$ac_compile" | $SED \
30208bd17e5fSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
30218bd17e5fSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
30228bd17e5fSmrg   -e 's:$: $lt_compiler_flag:'`
30238bd17e5fSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
30248bd17e5fSmrg   (eval "$lt_compile" 2>out/conftest.err)
30258bd17e5fSmrg   ac_status=$?
30268bd17e5fSmrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
30278bd17e5fSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
30288bd17e5fSmrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
30298bd17e5fSmrg   then
30308bd17e5fSmrg     # The compiler can only warn and ignore the option if not recognized
30318bd17e5fSmrg     # So say no if there are warnings
30328bd17e5fSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
30338bd17e5fSmrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
30348bd17e5fSmrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
30358bd17e5fSmrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
30368bd17e5fSmrg     fi
30378bd17e5fSmrg   fi
30388bd17e5fSmrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
30398bd17e5fSmrg   $RM conftest*
30408bd17e5fSmrg   # SGI C++ compiler will create directory out/ii_files/ for
30418bd17e5fSmrg   # template instantiation
30428bd17e5fSmrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
30438bd17e5fSmrg   $RM out/* && rmdir out
30448bd17e5fSmrg   cd ..
30458bd17e5fSmrg   $RM -r conftest
30468bd17e5fSmrg   $RM conftest*
30478bd17e5fSmrg])
30488bd17e5fSmrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
30498bd17e5fSmrg	[Does compiler simultaneously support -c and -o options?])
30508bd17e5fSmrg])# _LT_COMPILER_C_O
30518bd17e5fSmrg
30528bd17e5fSmrg
30538bd17e5fSmrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
30548bd17e5fSmrg# ----------------------------------
30558bd17e5fSmrg# Check to see if we can do hard links to lock some files if needed
30568bd17e5fSmrgm4_defun([_LT_COMPILER_FILE_LOCKS],
30578bd17e5fSmrg[m4_require([_LT_ENABLE_LOCK])dnl
30588bd17e5fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
30598bd17e5fSmrg_LT_COMPILER_C_O([$1])
30608bd17e5fSmrg
30618bd17e5fSmrghard_links="nottested"
30628bd17e5fSmrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
30638bd17e5fSmrg  # do not overwrite the value of need_locks provided by the user
30648bd17e5fSmrg  AC_MSG_CHECKING([if we can lock with hard links])
30658bd17e5fSmrg  hard_links=yes
30668bd17e5fSmrg  $RM conftest*
30678bd17e5fSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
30688bd17e5fSmrg  touch conftest.a
30698bd17e5fSmrg  ln conftest.a conftest.b 2>&5 || hard_links=no
30708bd17e5fSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
30718bd17e5fSmrg  AC_MSG_RESULT([$hard_links])
30728bd17e5fSmrg  if test "$hard_links" = no; then
30738bd17e5fSmrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
30748bd17e5fSmrg    need_locks=warn
3075706b6b52Smrg  fi
30760597fb56Smrgelse
30778bd17e5fSmrg  need_locks=no
30788bd17e5fSmrgfi
30798bd17e5fSmrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
30808bd17e5fSmrg])# _LT_COMPILER_FILE_LOCKS
30818bd17e5fSmrg
30828bd17e5fSmrg
30838bd17e5fSmrg# _LT_CHECK_OBJDIR
30848bd17e5fSmrg# ----------------
30858bd17e5fSmrgm4_defun([_LT_CHECK_OBJDIR],
30868bd17e5fSmrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
30878bd17e5fSmrg[rm -f .libs 2>/dev/null
30888bd17e5fSmrgmkdir .libs 2>/dev/null
30898bd17e5fSmrgif test -d .libs; then
30908bd17e5fSmrg  lt_cv_objdir=.libs
30918bd17e5fSmrgelse
30928bd17e5fSmrg  # MS-DOS does not allow filenames that begin with a dot.
30938bd17e5fSmrg  lt_cv_objdir=_libs
30948bd17e5fSmrgfi
30958bd17e5fSmrgrmdir .libs 2>/dev/null])
30968bd17e5fSmrgobjdir=$lt_cv_objdir
30978bd17e5fSmrg_LT_DECL([], [objdir], [0],
30988bd17e5fSmrg         [The name of the directory that contains temporary libtool files])dnl
30998bd17e5fSmrgm4_pattern_allow([LT_OBJDIR])dnl
31008bd17e5fSmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
31018bd17e5fSmrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
31028bd17e5fSmrg])# _LT_CHECK_OBJDIR
31038bd17e5fSmrg
31048bd17e5fSmrg
31058bd17e5fSmrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
31068bd17e5fSmrg# --------------------------------------
31078bd17e5fSmrg# Check hardcoding attributes.
31088bd17e5fSmrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
31098bd17e5fSmrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
31108bd17e5fSmrg_LT_TAGVAR(hardcode_action, $1)=
31118bd17e5fSmrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
31128bd17e5fSmrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
31138bd17e5fSmrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
31148bd17e5fSmrg
31158bd17e5fSmrg  # We can hardcode non-existent directories.
31168bd17e5fSmrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
31178bd17e5fSmrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
31188bd17e5fSmrg     # have to relink, otherwise we might link with an installed library
31198bd17e5fSmrg     # when we should be linking with a yet-to-be-installed one
31208bd17e5fSmrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
31218bd17e5fSmrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
31228bd17e5fSmrg    # Linking always hardcodes the temporary library directory.
31238bd17e5fSmrg    _LT_TAGVAR(hardcode_action, $1)=relink
3124706b6b52Smrg  else
31258bd17e5fSmrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
31268bd17e5fSmrg    _LT_TAGVAR(hardcode_action, $1)=immediate
3127bd23fbfaSmrg  fi
31288bd17e5fSmrgelse
31298bd17e5fSmrg  # We cannot hardcode anything, or else we can only hardcode existing
31308bd17e5fSmrg  # directories.
31318bd17e5fSmrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
3132bd23fbfaSmrgfi
31338bd17e5fSmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
3134b042e37fSmrg
31358bd17e5fSmrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
31368bd17e5fSmrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
31378bd17e5fSmrg  # Fast installation is not supported
31388bd17e5fSmrg  enable_fast_install=no
31398bd17e5fSmrgelif test "$shlibpath_overrides_runpath" = yes ||
31408bd17e5fSmrg     test "$enable_shared" = no; then
31418bd17e5fSmrg  # Fast installation is not necessary
31428bd17e5fSmrg  enable_fast_install=needless
31438bd17e5fSmrgfi
31448bd17e5fSmrg_LT_TAGDECL([], [hardcode_action], [0],
31458bd17e5fSmrg    [How to hardcode a shared library path into an executable])
31468bd17e5fSmrg])# _LT_LINKER_HARDCODE_LIBPATH
3147b042e37fSmrg
3148b042e37fSmrg
31498bd17e5fSmrg# _LT_CMD_STRIPLIB
31508bd17e5fSmrg# ----------------
31518bd17e5fSmrgm4_defun([_LT_CMD_STRIPLIB],
31520597fb56Smrg[m4_require([_LT_DECL_EGREP])
31538bd17e5fSmrgstriplib=
31548bd17e5fSmrgold_striplib=
31558bd17e5fSmrgAC_MSG_CHECKING([whether stripping libraries is possible])
31568bd17e5fSmrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
31578bd17e5fSmrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
31588bd17e5fSmrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
31598bd17e5fSmrg  AC_MSG_RESULT([yes])
31608bd17e5fSmrgelse
31618bd17e5fSmrg# FIXME - insert some real tests, host_os isn't really good enough
31628bd17e5fSmrg  case $host_os in
31638bd17e5fSmrg  darwin*)
31648bd17e5fSmrg    if test -n "$STRIP" ; then
31658bd17e5fSmrg      striplib="$STRIP -x"
31668bd17e5fSmrg      old_striplib="$STRIP -S"
31678bd17e5fSmrg      AC_MSG_RESULT([yes])
31688bd17e5fSmrg    else
31698bd17e5fSmrg      AC_MSG_RESULT([no])
31708bd17e5fSmrg    fi
31710597fb56Smrg    ;;
31720597fb56Smrg  *)
31738bd17e5fSmrg    AC_MSG_RESULT([no])
31740597fb56Smrg    ;;
31750597fb56Smrg  esac
3176706b6b52Smrgfi
31778bd17e5fSmrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
31788bd17e5fSmrg_LT_DECL([], [striplib], [1])
31798bd17e5fSmrg])# _LT_CMD_STRIPLIB
3180b042e37fSmrg
3181b042e37fSmrg
31828bd17e5fSmrg# _LT_SYS_DYNAMIC_LINKER([TAG])
31838bd17e5fSmrg# -----------------------------
31848bd17e5fSmrg# PORTME Fill in your ld.so characteristics
31858bd17e5fSmrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
31860597fb56Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
31878bd17e5fSmrgm4_require([_LT_DECL_EGREP])dnl
31888bd17e5fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
31898bd17e5fSmrgm4_require([_LT_DECL_OBJDUMP])dnl
31908bd17e5fSmrgm4_require([_LT_DECL_SED])dnl
31918bd17e5fSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
31928bd17e5fSmrgAC_MSG_CHECKING([dynamic linker characteristics])
31938bd17e5fSmrgm4_if([$1],
31948bd17e5fSmrg	[], [
31950597fb56Smrgif test "$GCC" = yes; then
31968bd17e5fSmrg  case $host_os in
31978bd17e5fSmrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
31988bd17e5fSmrg    *) lt_awk_arg="/^libraries:/" ;;
31998bd17e5fSmrg  esac
32008bd17e5fSmrg  case $host_os in
32018bd17e5fSmrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
32028bd17e5fSmrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
32038bd17e5fSmrg  esac
32048bd17e5fSmrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
32058bd17e5fSmrg  case $lt_search_path_spec in
32068bd17e5fSmrg  *\;*)
32078bd17e5fSmrg    # if the path contains ";" then we assume it to be the separator
32088bd17e5fSmrg    # otherwise default to the standard path separator (i.e. ":") - it is
32098bd17e5fSmrg    # assumed that no part of a normal pathname contains ";" but that should
32108bd17e5fSmrg    # okay in the real world where ";" in dirpaths is itself problematic.
32118bd17e5fSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
32128bd17e5fSmrg    ;;
32130597fb56Smrg  *)
32148bd17e5fSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
32158bd17e5fSmrg    ;;
32160597fb56Smrg  esac
32178bd17e5fSmrg  # Ok, now we have the path, separated by spaces, we can step through it
32188bd17e5fSmrg  # and add multilib dir if necessary.
32198bd17e5fSmrg  lt_tmp_lt_search_path_spec=
32208bd17e5fSmrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
32218bd17e5fSmrg  for lt_sys_path in $lt_search_path_spec; do
32228bd17e5fSmrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
32238bd17e5fSmrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
32248bd17e5fSmrg    else
32258bd17e5fSmrg      test -d "$lt_sys_path" && \
32268bd17e5fSmrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
32278bd17e5fSmrg    fi
32288bd17e5fSmrg  done
32298bd17e5fSmrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
32308bd17e5fSmrgBEGIN {RS=" "; FS="/|\n";} {
32318bd17e5fSmrg  lt_foo="";
32328bd17e5fSmrg  lt_count=0;
32338bd17e5fSmrg  for (lt_i = NF; lt_i > 0; lt_i--) {
32348bd17e5fSmrg    if ($lt_i != "" && $lt_i != ".") {
32358bd17e5fSmrg      if ($lt_i == "..") {
32368bd17e5fSmrg        lt_count++;
32378bd17e5fSmrg      } else {
32388bd17e5fSmrg        if (lt_count == 0) {
32398bd17e5fSmrg          lt_foo="/" $lt_i lt_foo;
32408bd17e5fSmrg        } else {
32418bd17e5fSmrg          lt_count--;
32428bd17e5fSmrg        }
32438bd17e5fSmrg      }
32448bd17e5fSmrg    }
32458bd17e5fSmrg  }
32468bd17e5fSmrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
32478bd17e5fSmrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
32488bd17e5fSmrg}'`
32498bd17e5fSmrg  # AWK program above erroneously prepends '/' to C:/dos/paths
32508bd17e5fSmrg  # for these hosts.
32518bd17e5fSmrg  case $host_os in
32528bd17e5fSmrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
32538bd17e5fSmrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
32548bd17e5fSmrg  esac
32558bd17e5fSmrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
32568bd17e5fSmrgelse
32578bd17e5fSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
32588bd17e5fSmrgfi])
32598bd17e5fSmrglibrary_names_spec=
32608bd17e5fSmrglibname_spec='lib$name'
32618bd17e5fSmrgsoname_spec=
32628bd17e5fSmrgshrext_cmds=".so"
32638bd17e5fSmrgpostinstall_cmds=
32648bd17e5fSmrgpostuninstall_cmds=
32658bd17e5fSmrgfinish_cmds=
32668bd17e5fSmrgfinish_eval=
32678bd17e5fSmrgshlibpath_var=
32688bd17e5fSmrgshlibpath_overrides_runpath=unknown
32698bd17e5fSmrgversion_type=none
32708bd17e5fSmrgdynamic_linker="$host_os ld.so"
32718bd17e5fSmrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
32728bd17e5fSmrgneed_lib_prefix=unknown
32738bd17e5fSmrghardcode_into_libs=no
3274bd23fbfaSmrg
32758bd17e5fSmrg# when you set need_version to no, make sure it does not cause -set_version
32768bd17e5fSmrg# flags to be left without arguments
32778bd17e5fSmrgneed_version=unknown
32780597fb56Smrg
32790597fb56Smrgcase $host_os in
32808bd17e5fSmrgaix3*)
32818bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
32828bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
32838bd17e5fSmrg  shlibpath_var=LIBPATH
32848bd17e5fSmrg
32858bd17e5fSmrg  # AIX 3 has no versioning support, so we append a major version to the name.
32868bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
32870597fb56Smrg  ;;
32888bd17e5fSmrg
32898bd17e5fSmrgaix[[4-9]]*)
32908bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
32918bd17e5fSmrg  need_lib_prefix=no
32928bd17e5fSmrg  need_version=no
32938bd17e5fSmrg  hardcode_into_libs=yes
32940597fb56Smrg  if test "$host_cpu" = ia64; then
32958bd17e5fSmrg    # AIX 5 supports IA64
32968bd17e5fSmrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
32978bd17e5fSmrg    shlibpath_var=LD_LIBRARY_PATH
32988bd17e5fSmrg  else
32998bd17e5fSmrg    # With GCC up to 2.95.x, collect2 would create an import file
33008bd17e5fSmrg    # for dependence libraries.  The import file would start with
33018bd17e5fSmrg    # the line `#! .'.  This would cause the generated library to
33028bd17e5fSmrg    # depend on `.', always an invalid library.  This was fixed in
33038bd17e5fSmrg    # development snapshots of GCC prior to 3.0.
33048bd17e5fSmrg    case $host_os in
33058bd17e5fSmrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
33068bd17e5fSmrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
33078bd17e5fSmrg	   echo ' yes '
33088bd17e5fSmrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
33098bd17e5fSmrg	:
33108bd17e5fSmrg      else
33118bd17e5fSmrg	can_build_shared=no
33128bd17e5fSmrg      fi
33138bd17e5fSmrg      ;;
33148bd17e5fSmrg    esac
33158bd17e5fSmrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
33168bd17e5fSmrg    # soname into executable. Probably we can add versioning support to
33178bd17e5fSmrg    # collect2, so additional links can be useful in future.
33188bd17e5fSmrg    if test "$aix_use_runtimelinking" = yes; then
33198bd17e5fSmrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
33208bd17e5fSmrg      # instead of lib<name>.a to let people know that these are not
33218bd17e5fSmrg      # typical AIX shared libraries.
33228bd17e5fSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
33238bd17e5fSmrg    else
33248bd17e5fSmrg      # We preserve .a as extension for shared libraries through AIX4.2
33258bd17e5fSmrg      # and later when we are not doing run time linking.
33268bd17e5fSmrg      library_names_spec='${libname}${release}.a $libname.a'
33278bd17e5fSmrg      soname_spec='${libname}${release}${shared_ext}$major'
33288bd17e5fSmrg    fi
33298bd17e5fSmrg    shlibpath_var=LIBPATH
33308bd17e5fSmrg  fi
3331706b6b52Smrg  ;;
33328c4a8e55Smrg
33338bd17e5fSmrgamigaos*)
33348bd17e5fSmrg  case $host_cpu in
33358bd17e5fSmrg  powerpc)
33368bd17e5fSmrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
33378bd17e5fSmrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
33388bd17e5fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
33398bd17e5fSmrg    ;;
33408bd17e5fSmrg  m68k)
33418bd17e5fSmrg    library_names_spec='$libname.ixlibrary $libname.a'
33428bd17e5fSmrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
33438bd17e5fSmrg    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'
33448bd17e5fSmrg    ;;
33458bd17e5fSmrg  esac
33468bd17e5fSmrg  ;;
3347bd23fbfaSmrg
33488bd17e5fSmrgbeos*)
33498bd17e5fSmrg  library_names_spec='${libname}${shared_ext}'
33508bd17e5fSmrg  dynamic_linker="$host_os ld.so"
33518bd17e5fSmrg  shlibpath_var=LIBRARY_PATH
33520597fb56Smrg  ;;
3353bd23fbfaSmrg
33548bd17e5fSmrgbsdi[[45]]*)
33558bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
33568bd17e5fSmrg  need_version=no
33578bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
33588bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
33598bd17e5fSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
33608bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
33618bd17e5fSmrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
33628bd17e5fSmrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
33638bd17e5fSmrg  # the default ld.so.conf also contains /usr/contrib/lib and
33648bd17e5fSmrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
33658bd17e5fSmrg  # libtool to hard-code these into programs
33668bd17e5fSmrg  ;;
3367bd23fbfaSmrg
33688bd17e5fSmrgcygwin* | mingw* | pw32* | cegcc*)
33698bd17e5fSmrg  version_type=windows
33708bd17e5fSmrg  shrext_cmds=".dll"
33718bd17e5fSmrg  need_version=no
33728bd17e5fSmrg  need_lib_prefix=no
3373bd23fbfaSmrg
33748bd17e5fSmrg  case $GCC,$cc_basename in
33758bd17e5fSmrg  yes,*)
33768bd17e5fSmrg    # gcc
33778bd17e5fSmrg    library_names_spec='$libname.dll.a'
33788bd17e5fSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
33798bd17e5fSmrg    postinstall_cmds='base_file=`basename \${file}`~
33808bd17e5fSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
33818bd17e5fSmrg      dldir=$destdir/`dirname \$dlpath`~
33828bd17e5fSmrg      test -d \$dldir || mkdir -p \$dldir~
33838bd17e5fSmrg      $install_prog $dir/$dlname \$dldir/$dlname~
33848bd17e5fSmrg      chmod a+x \$dldir/$dlname~
33858bd17e5fSmrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
33868bd17e5fSmrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
33878bd17e5fSmrg      fi'
33888bd17e5fSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
33898bd17e5fSmrg      dlpath=$dir/\$dldll~
33908bd17e5fSmrg       $RM \$dlpath'
33918bd17e5fSmrg    shlibpath_overrides_runpath=yes
33928c4a8e55Smrg
33938bd17e5fSmrg    case $host_os in
33948bd17e5fSmrg    cygwin*)
33958bd17e5fSmrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
33968bd17e5fSmrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
33978bd17e5fSmrgm4_if([$1], [],[
33988bd17e5fSmrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
33998bd17e5fSmrg      ;;
34008bd17e5fSmrg    mingw* | cegcc*)
34018bd17e5fSmrg      # MinGW DLLs use traditional 'lib' prefix
34028bd17e5fSmrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
34038bd17e5fSmrg      ;;
34048bd17e5fSmrg    pw32*)
34058bd17e5fSmrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
34068bd17e5fSmrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
34078bd17e5fSmrg      ;;
34088bd17e5fSmrg    esac
34098bd17e5fSmrg    dynamic_linker='Win32 ld.exe'
34108bd17e5fSmrg    ;;
3411706b6b52Smrg
34128bd17e5fSmrg  *,cl*)
34138bd17e5fSmrg    # Native MSVC
34148bd17e5fSmrg    libname_spec='$name'
34158bd17e5fSmrg    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
34168bd17e5fSmrg    library_names_spec='${libname}.dll.lib'
3417706b6b52Smrg
34188bd17e5fSmrg    case $build_os in
34198bd17e5fSmrg    mingw*)
34208bd17e5fSmrg      sys_lib_search_path_spec=
34218bd17e5fSmrg      lt_save_ifs=$IFS
34228bd17e5fSmrg      IFS=';'
34238bd17e5fSmrg      for lt_path in $LIB
34248bd17e5fSmrg      do
34258bd17e5fSmrg        IFS=$lt_save_ifs
34268bd17e5fSmrg        # Let DOS variable expansion print the short 8.3 style file name.
34278bd17e5fSmrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
34288bd17e5fSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
34298bd17e5fSmrg      done
34308bd17e5fSmrg      IFS=$lt_save_ifs
34318bd17e5fSmrg      # Convert to MSYS style.
34328bd17e5fSmrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
34338bd17e5fSmrg      ;;
34348bd17e5fSmrg    cygwin*)
34358bd17e5fSmrg      # Convert to unix form, then to dos form, then back to unix form
34368bd17e5fSmrg      # but this time dos style (no spaces!) so that the unix form looks
34378bd17e5fSmrg      # like /cygdrive/c/PROGRA~1:/cygdr...
34388bd17e5fSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
34398bd17e5fSmrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
34408bd17e5fSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
34418bd17e5fSmrg      ;;
34428bd17e5fSmrg    *)
34438bd17e5fSmrg      sys_lib_search_path_spec="$LIB"
34448bd17e5fSmrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
34458bd17e5fSmrg        # It is most probably a Windows format PATH.
34468bd17e5fSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
34470597fb56Smrg      else
34488bd17e5fSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
34490597fb56Smrg      fi
34508bd17e5fSmrg      # FIXME: find the short name or the path components, as spaces are
34518bd17e5fSmrg      # common. (e.g. "Program Files" -> "PROGRA~1")
34528bd17e5fSmrg      ;;
34538bd17e5fSmrg    esac
3454706b6b52Smrg
34558bd17e5fSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
34568bd17e5fSmrg    postinstall_cmds='base_file=`basename \${file}`~
34578bd17e5fSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
34588bd17e5fSmrg      dldir=$destdir/`dirname \$dlpath`~
34598bd17e5fSmrg      test -d \$dldir || mkdir -p \$dldir~
34608bd17e5fSmrg      $install_prog $dir/$dlname \$dldir/$dlname'
34618bd17e5fSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
34628bd17e5fSmrg      dlpath=$dir/\$dldll~
34638bd17e5fSmrg       $RM \$dlpath'
34648bd17e5fSmrg    shlibpath_overrides_runpath=yes
34658bd17e5fSmrg    dynamic_linker='Win32 link.exe'
34668bd17e5fSmrg    ;;
3467706b6b52Smrg
34688bd17e5fSmrg  *)
34698bd17e5fSmrg    # Assume MSVC wrapper
34708bd17e5fSmrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
34718bd17e5fSmrg    dynamic_linker='Win32 ld.exe'
34728bd17e5fSmrg    ;;
34738bd17e5fSmrg  esac
34748bd17e5fSmrg  # FIXME: first we should search . and the directory the executable is in
34758bd17e5fSmrg  shlibpath_var=PATH
34768bd17e5fSmrg  ;;
3477706b6b52Smrg
34788bd17e5fSmrgdarwin* | rhapsody*)
34798bd17e5fSmrg  dynamic_linker="$host_os dyld"
34808bd17e5fSmrg  version_type=darwin
34818bd17e5fSmrg  need_lib_prefix=no
34828bd17e5fSmrg  need_version=no
34838bd17e5fSmrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
34848bd17e5fSmrg  soname_spec='${libname}${release}${major}$shared_ext'
34858bd17e5fSmrg  shlibpath_overrides_runpath=yes
34868bd17e5fSmrg  shlibpath_var=DYLD_LIBRARY_PATH
34878bd17e5fSmrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
34888bd17e5fSmrgm4_if([$1], [],[
34898bd17e5fSmrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
34908bd17e5fSmrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
34918bd17e5fSmrg  ;;
3492706b6b52Smrg
34938bd17e5fSmrgdgux*)
34948bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
34958bd17e5fSmrg  need_lib_prefix=no
34968bd17e5fSmrg  need_version=no
34978bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
34988bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
34998bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
35008bd17e5fSmrg  ;;
3501706b6b52Smrg
35028bd17e5fSmrgfreebsd* | dragonfly*)
35038bd17e5fSmrg  # DragonFly does not have aout.  When/if they implement a new
35048bd17e5fSmrg  # versioning mechanism, adjust this.
35058bd17e5fSmrg  if test -x /usr/bin/objformat; then
35068bd17e5fSmrg    objformat=`/usr/bin/objformat`
35070597fb56Smrg  else
35088bd17e5fSmrg    case $host_os in
35098bd17e5fSmrg    freebsd[[23]].*) objformat=aout ;;
35108bd17e5fSmrg    *) objformat=elf ;;
35118bd17e5fSmrg    esac
35120597fb56Smrg  fi
35138bd17e5fSmrg  version_type=freebsd-$objformat
35148bd17e5fSmrg  case $version_type in
35158bd17e5fSmrg    freebsd-elf*)
35168bd17e5fSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
35178bd17e5fSmrg      need_version=no
35188bd17e5fSmrg      need_lib_prefix=no
35198bd17e5fSmrg      ;;
35208bd17e5fSmrg    freebsd-*)
35218bd17e5fSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
35228bd17e5fSmrg      need_version=yes
35238bd17e5fSmrg      ;;
35248bd17e5fSmrg  esac
35258bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
35268bd17e5fSmrg  case $host_os in
35278bd17e5fSmrg  freebsd2.*)
35288bd17e5fSmrg    shlibpath_overrides_runpath=yes
35298bd17e5fSmrg    ;;
35308bd17e5fSmrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
35318bd17e5fSmrg    shlibpath_overrides_runpath=yes
35328bd17e5fSmrg    hardcode_into_libs=yes
35338bd17e5fSmrg    ;;
35348bd17e5fSmrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
35358bd17e5fSmrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
35368bd17e5fSmrg    shlibpath_overrides_runpath=no
35378bd17e5fSmrg    hardcode_into_libs=yes
35388bd17e5fSmrg    ;;
35398bd17e5fSmrg  *) # from 4.6 on, and DragonFly
35408bd17e5fSmrg    shlibpath_overrides_runpath=yes
35418bd17e5fSmrg    hardcode_into_libs=yes
35428bd17e5fSmrg    ;;
35438bd17e5fSmrg  esac
35448bd17e5fSmrg  ;;
3545706b6b52Smrg
35468bd17e5fSmrggnu*)
35478bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
35488bd17e5fSmrg  need_lib_prefix=no
35498bd17e5fSmrg  need_version=no
35508bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
35518bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
35528bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
35538bd17e5fSmrg  shlibpath_overrides_runpath=no
35548bd17e5fSmrg  hardcode_into_libs=yes
35558bd17e5fSmrg  ;;
3556706b6b52Smrg
35578bd17e5fSmrghaiku*)
35588bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
35598bd17e5fSmrg  need_lib_prefix=no
35608bd17e5fSmrg  need_version=no
35618bd17e5fSmrg  dynamic_linker="$host_os runtime_loader"
35628bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
35638bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
35648bd17e5fSmrg  shlibpath_var=LIBRARY_PATH
35658bd17e5fSmrg  shlibpath_overrides_runpath=yes
35668bd17e5fSmrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
35678bd17e5fSmrg  hardcode_into_libs=yes
35688bd17e5fSmrg  ;;
3569706b6b52Smrg
35708bd17e5fSmrghpux9* | hpux10* | hpux11*)
35718bd17e5fSmrg  # Give a soname corresponding to the major version so that dld.sl refuses to
35728bd17e5fSmrg  # link against other versions.
35738bd17e5fSmrg  version_type=sunos
35748bd17e5fSmrg  need_lib_prefix=no
35758bd17e5fSmrg  need_version=no
35768bd17e5fSmrg  case $host_cpu in
35778bd17e5fSmrg  ia64*)
35788bd17e5fSmrg    shrext_cmds='.so'
35798bd17e5fSmrg    hardcode_into_libs=yes
35808bd17e5fSmrg    dynamic_linker="$host_os dld.so"
35818bd17e5fSmrg    shlibpath_var=LD_LIBRARY_PATH
35828bd17e5fSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
35838bd17e5fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
35848bd17e5fSmrg    soname_spec='${libname}${release}${shared_ext}$major'
35858bd17e5fSmrg    if test "X$HPUX_IA64_MODE" = X32; then
35868bd17e5fSmrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
35878bd17e5fSmrg    else
35888bd17e5fSmrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
35898bd17e5fSmrg    fi
35908bd17e5fSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
35918bd17e5fSmrg    ;;
35928bd17e5fSmrg  hppa*64*)
35938bd17e5fSmrg    shrext_cmds='.sl'
35948bd17e5fSmrg    hardcode_into_libs=yes
35958bd17e5fSmrg    dynamic_linker="$host_os dld.sl"
35968bd17e5fSmrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
35978bd17e5fSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
35988bd17e5fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
35998bd17e5fSmrg    soname_spec='${libname}${release}${shared_ext}$major'
36008bd17e5fSmrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
36018bd17e5fSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
36028bd17e5fSmrg    ;;
36038bd17e5fSmrg  *)
36048bd17e5fSmrg    shrext_cmds='.sl'
36058bd17e5fSmrg    dynamic_linker="$host_os dld.sl"
36068bd17e5fSmrg    shlibpath_var=SHLIB_PATH
36078bd17e5fSmrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
36088bd17e5fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
36098bd17e5fSmrg    soname_spec='${libname}${release}${shared_ext}$major'
36108bd17e5fSmrg    ;;
36118bd17e5fSmrg  esac
36128bd17e5fSmrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
36138bd17e5fSmrg  postinstall_cmds='chmod 555 $lib'
36148bd17e5fSmrg  # or fails outright, so override atomically:
36158bd17e5fSmrg  install_override_mode=555
36168bd17e5fSmrg  ;;
3617706b6b52Smrg
36188bd17e5fSmrginterix[[3-9]]*)
36198bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
36208bd17e5fSmrg  need_lib_prefix=no
36218bd17e5fSmrg  need_version=no
36228bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
36238bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
36248bd17e5fSmrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
36258bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
36268bd17e5fSmrg  shlibpath_overrides_runpath=no
36278bd17e5fSmrg  hardcode_into_libs=yes
36288bd17e5fSmrg  ;;
3629706b6b52Smrg
36308bd17e5fSmrgirix5* | irix6* | nonstopux*)
36318bd17e5fSmrg  case $host_os in
36328bd17e5fSmrg    nonstopux*) version_type=nonstopux ;;
36338bd17e5fSmrg    *)
36348bd17e5fSmrg	if test "$lt_cv_prog_gnu_ld" = yes; then
36358bd17e5fSmrg		version_type=linux # correct to gnu/linux during the next big refactor
36368bd17e5fSmrg	else
36378bd17e5fSmrg		version_type=irix
36388bd17e5fSmrg	fi ;;
36398bd17e5fSmrg  esac
36408bd17e5fSmrg  need_lib_prefix=no
36418bd17e5fSmrg  need_version=no
36428bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
36438bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
36448bd17e5fSmrg  case $host_os in
36458bd17e5fSmrg  irix5* | nonstopux*)
36468bd17e5fSmrg    libsuff= shlibsuff=
36478bd17e5fSmrg    ;;
36488bd17e5fSmrg  *)
36498bd17e5fSmrg    case $LD in # libtool.m4 will add one of these switches to LD
36508bd17e5fSmrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
36518bd17e5fSmrg      libsuff= shlibsuff= libmagic=32-bit;;
36528bd17e5fSmrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
36538bd17e5fSmrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
36548bd17e5fSmrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
36558bd17e5fSmrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
36568bd17e5fSmrg    *) libsuff= shlibsuff= libmagic=never-match;;
36578bd17e5fSmrg    esac
36588bd17e5fSmrg    ;;
36598bd17e5fSmrg  esac
36608bd17e5fSmrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
36618bd17e5fSmrg  shlibpath_overrides_runpath=no
36628bd17e5fSmrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
36638bd17e5fSmrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
36648bd17e5fSmrg  hardcode_into_libs=yes
36658bd17e5fSmrg  ;;
3666706b6b52Smrg
36678bd17e5fSmrg# No shared lib support for Linux oldld, aout, or coff.
36688bd17e5fSmrglinux*oldld* | linux*aout* | linux*coff*)
36698bd17e5fSmrg  dynamic_linker=no
36708bd17e5fSmrg  ;;
3671706b6b52Smrg
36728bd17e5fSmrg# This must be glibc/ELF.
36738bd17e5fSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
36748bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
36758bd17e5fSmrg  need_lib_prefix=no
36768bd17e5fSmrg  need_version=no
36778bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
36788bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
36798bd17e5fSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
36808bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
36818bd17e5fSmrg  shlibpath_overrides_runpath=no
36828bd17e5fSmrg
36838bd17e5fSmrg  # Some binutils ld are patched to set DT_RUNPATH
36848bd17e5fSmrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
36858bd17e5fSmrg    [lt_cv_shlibpath_overrides_runpath=no
36868bd17e5fSmrg    save_LDFLAGS=$LDFLAGS
36878bd17e5fSmrg    save_libdir=$libdir
36888bd17e5fSmrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
36898bd17e5fSmrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
36908bd17e5fSmrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
36918bd17e5fSmrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
36928bd17e5fSmrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
36938bd17e5fSmrg    LDFLAGS=$save_LDFLAGS
36948bd17e5fSmrg    libdir=$save_libdir
36958bd17e5fSmrg    ])
36968bd17e5fSmrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
36978bd17e5fSmrg
36988bd17e5fSmrg  # This implies no fast_install, which is unacceptable.
36998bd17e5fSmrg  # Some rework will be needed to allow for fast_install
37008bd17e5fSmrg  # before this can be enabled.
37018bd17e5fSmrg  hardcode_into_libs=yes
37028bd17e5fSmrg
37038bd17e5fSmrg  # Append ld.so.conf contents to the search path
37048bd17e5fSmrg  if test -f /etc/ld.so.conf; then
37058bd17e5fSmrg    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' ' '`
37068bd17e5fSmrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
37078bd17e5fSmrg  fi
37088bd17e5fSmrg
37098bd17e5fSmrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
37108bd17e5fSmrg  # powerpc, because MkLinux only supported shared libraries with the
37118bd17e5fSmrg  # GNU dynamic linker.  Since this was broken with cross compilers,
37128bd17e5fSmrg  # most powerpc-linux boxes support dynamic linking these days and
37138bd17e5fSmrg  # people can always --disable-shared, the test was removed, and we
37148bd17e5fSmrg  # assume the GNU/Linux dynamic linker is in use.
37158bd17e5fSmrg  dynamic_linker='GNU/Linux ld.so'
37168bd17e5fSmrg  ;;
37178bd17e5fSmrg
37188bd17e5fSmrgnetbsd*)
37198bd17e5fSmrg  version_type=sunos
37208bd17e5fSmrg  need_lib_prefix=no
37218bd17e5fSmrg  need_version=no
37228bd17e5fSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
37238bd17e5fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
37248bd17e5fSmrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
37258bd17e5fSmrg    dynamic_linker='NetBSD (a.out) ld.so'
37268bd17e5fSmrg  else
37278bd17e5fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
37288bd17e5fSmrg    soname_spec='${libname}${release}${shared_ext}$major'
37298bd17e5fSmrg    dynamic_linker='NetBSD ld.elf_so'
37308bd17e5fSmrg  fi
37318bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
37328bd17e5fSmrg  shlibpath_overrides_runpath=yes
37338bd17e5fSmrg  hardcode_into_libs=yes
37348bd17e5fSmrg  ;;
37358bd17e5fSmrg
37368bd17e5fSmrgnewsos6)
37378bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
37388bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
37398bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
37408bd17e5fSmrg  shlibpath_overrides_runpath=yes
37418bd17e5fSmrg  ;;
37428bd17e5fSmrg
37438bd17e5fSmrg*nto* | *qnx*)
37448bd17e5fSmrg  version_type=qnx
37458bd17e5fSmrg  need_lib_prefix=no
37468bd17e5fSmrg  need_version=no
37478bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
37488bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
37498bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
37508bd17e5fSmrg  shlibpath_overrides_runpath=no
37518bd17e5fSmrg  hardcode_into_libs=yes
37528bd17e5fSmrg  dynamic_linker='ldqnx.so'
37538bd17e5fSmrg  ;;
37548bd17e5fSmrg
37558bd17e5fSmrgopenbsd*)
37568bd17e5fSmrg  version_type=sunos
37578bd17e5fSmrg  sys_lib_dlsearch_path_spec="/usr/lib"
37588bd17e5fSmrg  need_lib_prefix=no
37598bd17e5fSmrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
37608bd17e5fSmrg  case $host_os in
37618bd17e5fSmrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
37628bd17e5fSmrg    *)				need_version=no  ;;
37638bd17e5fSmrg  esac
37648bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
37658bd17e5fSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
37668bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
37678bd17e5fSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
37688bd17e5fSmrg    case $host_os in
37698bd17e5fSmrg      openbsd2.[[89]] | openbsd2.[[89]].*)
37708bd17e5fSmrg	shlibpath_overrides_runpath=no
37710597fb56Smrg	;;
37720597fb56Smrg      *)
37738bd17e5fSmrg	shlibpath_overrides_runpath=yes
37740597fb56Smrg	;;
3775706b6b52Smrg      esac
3776706b6b52Smrg  else
37778bd17e5fSmrg    shlibpath_overrides_runpath=yes
3778706b6b52Smrg  fi
37798bd17e5fSmrg  ;;
3780706b6b52Smrg
37818bd17e5fSmrgos2*)
37828bd17e5fSmrg  libname_spec='$name'
37838bd17e5fSmrg  shrext_cmds=".dll"
37848bd17e5fSmrg  need_lib_prefix=no
37858bd17e5fSmrg  library_names_spec='$libname${shared_ext} $libname.a'
37868bd17e5fSmrg  dynamic_linker='OS/2 ld.exe'
37878bd17e5fSmrg  shlibpath_var=LIBPATH
37888bd17e5fSmrg  ;;
3789706b6b52Smrg
37908bd17e5fSmrgosf3* | osf4* | osf5*)
37918bd17e5fSmrg  version_type=osf
37928bd17e5fSmrg  need_lib_prefix=no
37938bd17e5fSmrg  need_version=no
37948bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
37958bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
37968bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
37978bd17e5fSmrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
37988bd17e5fSmrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
37998bd17e5fSmrg  ;;
38008c4a8e55Smrg
38018bd17e5fSmrgrdos*)
38028bd17e5fSmrg  dynamic_linker=no
38038bd17e5fSmrg  ;;
38048bd17e5fSmrg
38058bd17e5fSmrgsolaris*)
38068bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
38078bd17e5fSmrg  need_lib_prefix=no
38088bd17e5fSmrg  need_version=no
38098bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
38108bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
38118bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
38128bd17e5fSmrg  shlibpath_overrides_runpath=yes
38138bd17e5fSmrg  hardcode_into_libs=yes
38148bd17e5fSmrg  # ldd complains unless libraries are executable
38158bd17e5fSmrg  postinstall_cmds='chmod +x $lib'
38168bd17e5fSmrg  ;;
38178bd17e5fSmrg
38188bd17e5fSmrgsunos4*)
38198bd17e5fSmrg  version_type=sunos
38208bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
38218bd17e5fSmrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
38228bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
38238bd17e5fSmrg  shlibpath_overrides_runpath=yes
38248bd17e5fSmrg  if test "$with_gnu_ld" = yes; then
38258bd17e5fSmrg    need_lib_prefix=no
38268bd17e5fSmrg  fi
38278bd17e5fSmrg  need_version=yes
38288bd17e5fSmrg  ;;
38298c4a8e55Smrg
38308bd17e5fSmrgsysv4 | sysv4.3*)
38318bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
38328bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
38338bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
38348bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
38358bd17e5fSmrg  case $host_vendor in
38368bd17e5fSmrg    sni)
38378bd17e5fSmrg      shlibpath_overrides_runpath=no
38388bd17e5fSmrg      need_lib_prefix=no
38398bd17e5fSmrg      runpath_var=LD_RUN_PATH
38400597fb56Smrg      ;;
38418bd17e5fSmrg    siemens)
38428bd17e5fSmrg      need_lib_prefix=no
38430597fb56Smrg      ;;
38448bd17e5fSmrg    motorola)
38458bd17e5fSmrg      need_lib_prefix=no
38468bd17e5fSmrg      need_version=no
38478bd17e5fSmrg      shlibpath_overrides_runpath=no
38488bd17e5fSmrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
38490597fb56Smrg      ;;
38508bd17e5fSmrg  esac
38518bd17e5fSmrg  ;;
38528c4a8e55Smrg
38538bd17e5fSmrgsysv4*MP*)
38548bd17e5fSmrg  if test -d /usr/nec ;then
38558bd17e5fSmrg    version_type=linux # correct to gnu/linux during the next big refactor
38568bd17e5fSmrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
38578bd17e5fSmrg    soname_spec='$libname${shared_ext}.$major'
38588bd17e5fSmrg    shlibpath_var=LD_LIBRARY_PATH
38598bd17e5fSmrg  fi
38608bd17e5fSmrg  ;;
38618bd17e5fSmrg
38628bd17e5fSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
38638bd17e5fSmrg  version_type=freebsd-elf
38648bd17e5fSmrg  need_lib_prefix=no
38658bd17e5fSmrg  need_version=no
38668bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
38678bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
38688bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
38698bd17e5fSmrg  shlibpath_overrides_runpath=yes
38708bd17e5fSmrg  hardcode_into_libs=yes
38718bd17e5fSmrg  if test "$with_gnu_ld" = yes; then
38728bd17e5fSmrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
38738bd17e5fSmrg  else
38748bd17e5fSmrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
38758bd17e5fSmrg    case $host_os in
38768bd17e5fSmrg      sco3.2v5*)
38778bd17e5fSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
38780597fb56Smrg	;;
38798bd17e5fSmrg    esac
38808bd17e5fSmrg  fi
38818bd17e5fSmrg  sys_lib_dlsearch_path_spec='/usr/lib'
38828bd17e5fSmrg  ;;
3883b042e37fSmrg
38848bd17e5fSmrgtpf*)
38858bd17e5fSmrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
38868bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
38878bd17e5fSmrg  need_lib_prefix=no
38888bd17e5fSmrg  need_version=no
38898bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
38908bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
38918bd17e5fSmrg  shlibpath_overrides_runpath=no
38928bd17e5fSmrg  hardcode_into_libs=yes
38938bd17e5fSmrg  ;;
3894b042e37fSmrg
38958bd17e5fSmrguts4*)
38968bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
38978bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
38988bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
38998bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
39008bd17e5fSmrg  ;;
3901b042e37fSmrg
39028bd17e5fSmrg*)
39038bd17e5fSmrg  dynamic_linker=no
39048bd17e5fSmrg  ;;
39058bd17e5fSmrgesac
39068bd17e5fSmrgAC_MSG_RESULT([$dynamic_linker])
39078bd17e5fSmrgtest "$dynamic_linker" = no && can_build_shared=no
3908706b6b52Smrg
39098bd17e5fSmrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
39108bd17e5fSmrgif test "$GCC" = yes; then
39118bd17e5fSmrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
39128bd17e5fSmrgfi
3913b042e37fSmrg
39148bd17e5fSmrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
39158bd17e5fSmrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
39168bd17e5fSmrgfi
39178bd17e5fSmrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
39188bd17e5fSmrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
39198bd17e5fSmrgfi
39200597fb56Smrg
39218bd17e5fSmrg_LT_DECL([], [variables_saved_for_relink], [1],
39228bd17e5fSmrg    [Variables whose values should be saved in libtool wrapper scripts and
39238bd17e5fSmrg    restored at link time])
39248bd17e5fSmrg_LT_DECL([], [need_lib_prefix], [0],
39258bd17e5fSmrg    [Do we need the "lib" prefix for modules?])
39268bd17e5fSmrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
39278bd17e5fSmrg_LT_DECL([], [version_type], [0], [Library versioning type])
39288bd17e5fSmrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
39298bd17e5fSmrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
39308bd17e5fSmrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
39318bd17e5fSmrg    [Is shlibpath searched before the hard-coded library search path?])
39328bd17e5fSmrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
39338bd17e5fSmrg_LT_DECL([], [library_names_spec], [1],
39348bd17e5fSmrg    [[List of archive names.  First name is the real one, the rest are links.
39358bd17e5fSmrg    The last name is the one that the linker finds with -lNAME]])
39368bd17e5fSmrg_LT_DECL([], [soname_spec], [1],
39378bd17e5fSmrg    [[The coded name of the library, if different from the real name]])
39388bd17e5fSmrg_LT_DECL([], [install_override_mode], [1],
39398bd17e5fSmrg    [Permission mode override for installation of shared libraries])
39408bd17e5fSmrg_LT_DECL([], [postinstall_cmds], [2],
39418bd17e5fSmrg    [Command to use after installation of a shared archive])
39428bd17e5fSmrg_LT_DECL([], [postuninstall_cmds], [2],
39438bd17e5fSmrg    [Command to use after uninstallation of a shared archive])
39448bd17e5fSmrg_LT_DECL([], [finish_cmds], [2],
39458bd17e5fSmrg    [Commands used to finish a libtool library installation in a directory])
39468bd17e5fSmrg_LT_DECL([], [finish_eval], [1],
39478bd17e5fSmrg    [[As "finish_cmds", except a single script fragment to be evaled but
39488bd17e5fSmrg    not shown]])
39498bd17e5fSmrg_LT_DECL([], [hardcode_into_libs], [0],
39508bd17e5fSmrg    [Whether we should hardcode library paths into libraries])
39518bd17e5fSmrg_LT_DECL([], [sys_lib_search_path_spec], [2],
39528bd17e5fSmrg    [Compile-time system search path for libraries])
39538bd17e5fSmrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
39548bd17e5fSmrg    [Run-time system search path for libraries])
39558bd17e5fSmrg])# _LT_SYS_DYNAMIC_LINKER
3956b042e37fSmrg
3957b042e37fSmrg
39588bd17e5fSmrg# _LT_PATH_TOOL_PREFIX(TOOL)
39598bd17e5fSmrg# --------------------------
39608bd17e5fSmrg# find a file program which can recognize shared library
39618bd17e5fSmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
39628bd17e5fSmrg[m4_require([_LT_DECL_EGREP])dnl
39638bd17e5fSmrgAC_MSG_CHECKING([for $1])
39648bd17e5fSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
39658bd17e5fSmrg[case $MAGIC_CMD in
39668bd17e5fSmrg[[\\/*] |  ?:[\\/]*])
39678bd17e5fSmrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
39688bd17e5fSmrg  ;;
39698bd17e5fSmrg*)
39708bd17e5fSmrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
39718bd17e5fSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
39728bd17e5fSmrgdnl $ac_dummy forces splitting on constant user-supplied paths.
39738bd17e5fSmrgdnl POSIX.2 word splitting is done only on the output of word expansions,
39748bd17e5fSmrgdnl not every word.  This closes a longstanding sh security hole.
39758bd17e5fSmrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
39768bd17e5fSmrg  for ac_dir in $ac_dummy; do
39778bd17e5fSmrg    IFS="$lt_save_ifs"
39788bd17e5fSmrg    test -z "$ac_dir" && ac_dir=.
39798bd17e5fSmrg    if test -f $ac_dir/$1; then
39808bd17e5fSmrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
39818bd17e5fSmrg      if test -n "$file_magic_test_file"; then
39828bd17e5fSmrg	case $deplibs_check_method in
39838bd17e5fSmrg	"file_magic "*)
39848bd17e5fSmrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
39858bd17e5fSmrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
39868bd17e5fSmrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
39878bd17e5fSmrg	    $EGREP "$file_magic_regex" > /dev/null; then
39888bd17e5fSmrg	    :
39898bd17e5fSmrg	  else
39908bd17e5fSmrg	    cat <<_LT_EOF 1>&2
3991b042e37fSmrg
39928bd17e5fSmrg*** Warning: the command libtool uses to detect shared libraries,
39938bd17e5fSmrg*** $file_magic_cmd, produces output that libtool cannot recognize.
39948bd17e5fSmrg*** The result is that libtool may fail to recognize shared libraries
39958bd17e5fSmrg*** as such.  This will affect the creation of libtool libraries that
39968bd17e5fSmrg*** depend on shared libraries, but programs linked with such libtool
39978bd17e5fSmrg*** libraries will work regardless of this problem.  Nevertheless, you
39988bd17e5fSmrg*** may want to report the problem to your system manager and/or to
39998bd17e5fSmrg*** bug-libtool@gnu.org
4000b042e37fSmrg
40018bd17e5fSmrg_LT_EOF
40028bd17e5fSmrg	  fi ;;
40030597fb56Smrg	esac
40048bd17e5fSmrg      fi
40058bd17e5fSmrg      break
40068bd17e5fSmrg    fi
40078bd17e5fSmrg  done
40088bd17e5fSmrg  IFS="$lt_save_ifs"
40098bd17e5fSmrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
40108bd17e5fSmrg  ;;
40118bd17e5fSmrgesac])
40128bd17e5fSmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
40138bd17e5fSmrgif test -n "$MAGIC_CMD"; then
40148bd17e5fSmrg  AC_MSG_RESULT($MAGIC_CMD)
40158bd17e5fSmrgelse
40168bd17e5fSmrg  AC_MSG_RESULT(no)
40178bd17e5fSmrgfi
40188bd17e5fSmrg_LT_DECL([], [MAGIC_CMD], [0],
40198bd17e5fSmrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
40208bd17e5fSmrg])# _LT_PATH_TOOL_PREFIX
40210597fb56Smrg
40228bd17e5fSmrg# Old name:
40238bd17e5fSmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
40248bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
40258bd17e5fSmrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
4026bd23fbfaSmrg
4027bd23fbfaSmrg
40288bd17e5fSmrg# _LT_PATH_MAGIC
40298bd17e5fSmrg# --------------
40308bd17e5fSmrg# find a file program which can recognize a shared library
40318bd17e5fSmrgm4_defun([_LT_PATH_MAGIC],
40328bd17e5fSmrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
40338bd17e5fSmrgif test -z "$lt_cv_path_MAGIC_CMD"; then
40348bd17e5fSmrg  if test -n "$ac_tool_prefix"; then
40358bd17e5fSmrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
40368bd17e5fSmrg  else
40378bd17e5fSmrg    MAGIC_CMD=:
40388bd17e5fSmrg  fi
40398bd17e5fSmrgfi
40408bd17e5fSmrg])# _LT_PATH_MAGIC
40410597fb56Smrg
40420597fb56Smrg
40438bd17e5fSmrg# LT_PATH_LD
40448bd17e5fSmrg# ----------
40458bd17e5fSmrg# find the pathname to the GNU or non-GNU linker
40468bd17e5fSmrgAC_DEFUN([LT_PATH_LD],
40478bd17e5fSmrg[AC_REQUIRE([AC_PROG_CC])dnl
40488bd17e5fSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
40498bd17e5fSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
40508bd17e5fSmrgm4_require([_LT_DECL_SED])dnl
40518bd17e5fSmrgm4_require([_LT_DECL_EGREP])dnl
40528bd17e5fSmrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
4053bd23fbfaSmrg
40548bd17e5fSmrgAC_ARG_WITH([gnu-ld],
40558bd17e5fSmrg    [AS_HELP_STRING([--with-gnu-ld],
40568bd17e5fSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
40578bd17e5fSmrg    [test "$withval" = no || with_gnu_ld=yes],
40588bd17e5fSmrg    [with_gnu_ld=no])dnl
4059706b6b52Smrg
40608bd17e5fSmrgac_prog=ld
40618bd17e5fSmrgif test "$GCC" = yes; then
40628bd17e5fSmrg  # Check if gcc -print-prog-name=ld gives a path.
40638bd17e5fSmrg  AC_MSG_CHECKING([for ld used by $CC])
40648bd17e5fSmrg  case $host in
40658bd17e5fSmrg  *-*-mingw*)
40668bd17e5fSmrg    # gcc leaves a trailing carriage return which upsets mingw
40678bd17e5fSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
40688bd17e5fSmrg  *)
40698bd17e5fSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
40708bd17e5fSmrg  esac
40718bd17e5fSmrg  case $ac_prog in
40728bd17e5fSmrg    # Accept absolute paths.
40738bd17e5fSmrg    [[\\/]]* | ?:[[\\/]]*)
40748bd17e5fSmrg      re_direlt='/[[^/]][[^/]]*/\.\./'
40758bd17e5fSmrg      # Canonicalize the pathname of ld
40768bd17e5fSmrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
40778bd17e5fSmrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
40788bd17e5fSmrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
40798bd17e5fSmrg      done
40808bd17e5fSmrg      test -z "$LD" && LD="$ac_prog"
40810597fb56Smrg      ;;
40828bd17e5fSmrg  "")
40838bd17e5fSmrg    # If it fails, then pretend we aren't using GCC.
40848bd17e5fSmrg    ac_prog=ld
40858bd17e5fSmrg    ;;
40868bd17e5fSmrg  *)
40878bd17e5fSmrg    # If it is relative, then search for the first ld in PATH.
40888bd17e5fSmrg    with_gnu_ld=unknown
40898bd17e5fSmrg    ;;
40908bd17e5fSmrg  esac
40918bd17e5fSmrgelif test "$with_gnu_ld" = yes; then
40928bd17e5fSmrg  AC_MSG_CHECKING([for GNU ld])
40938bd17e5fSmrgelse
40948bd17e5fSmrg  AC_MSG_CHECKING([for non-GNU ld])
40958bd17e5fSmrgfi
40968bd17e5fSmrgAC_CACHE_VAL(lt_cv_path_LD,
40978bd17e5fSmrg[if test -z "$LD"; then
40988bd17e5fSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
40998bd17e5fSmrg  for ac_dir in $PATH; do
41008bd17e5fSmrg    IFS="$lt_save_ifs"
41018bd17e5fSmrg    test -z "$ac_dir" && ac_dir=.
41028bd17e5fSmrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
41038bd17e5fSmrg      lt_cv_path_LD="$ac_dir/$ac_prog"
41048bd17e5fSmrg      # Check to see if the program is GNU ld.  I'd rather use --version,
41058bd17e5fSmrg      # but apparently some variants of GNU ld only accept -v.
41068bd17e5fSmrg      # Break only if it was the GNU/non-GNU ld that we prefer.
41078bd17e5fSmrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
41088bd17e5fSmrg      *GNU* | *'with BFD'*)
41098bd17e5fSmrg	test "$with_gnu_ld" != no && break
41108bd17e5fSmrg	;;
41118bd17e5fSmrg      *)
41128bd17e5fSmrg	test "$with_gnu_ld" != yes && break
41138bd17e5fSmrg	;;
41148bd17e5fSmrg      esac
41158bd17e5fSmrg    fi
41168bd17e5fSmrg  done
41178bd17e5fSmrg  IFS="$lt_save_ifs"
41188bd17e5fSmrgelse
41198bd17e5fSmrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
41208bd17e5fSmrgfi])
41218bd17e5fSmrgLD="$lt_cv_path_LD"
41228bd17e5fSmrgif test -n "$LD"; then
41238bd17e5fSmrg  AC_MSG_RESULT($LD)
41248bd17e5fSmrgelse
41258bd17e5fSmrg  AC_MSG_RESULT(no)
41268bd17e5fSmrgfi
41278bd17e5fSmrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
41288bd17e5fSmrg_LT_PATH_LD_GNU
41298bd17e5fSmrgAC_SUBST([LD])
4130b042e37fSmrg
41318bd17e5fSmrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
41328bd17e5fSmrg])# LT_PATH_LD
4133b042e37fSmrg
41348bd17e5fSmrg# Old names:
41358bd17e5fSmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
41368bd17e5fSmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
41378bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
41388bd17e5fSmrgdnl AC_DEFUN([AM_PROG_LD], [])
41398bd17e5fSmrgdnl AC_DEFUN([AC_PROG_LD], [])
4140b042e37fSmrg
4141b042e37fSmrg
41428bd17e5fSmrg# _LT_PATH_LD_GNU
41438bd17e5fSmrg#- --------------
41448bd17e5fSmrgm4_defun([_LT_PATH_LD_GNU],
41458bd17e5fSmrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
41468bd17e5fSmrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
41478bd17e5fSmrgcase `$LD -v 2>&1 </dev/null` in
41488bd17e5fSmrg*GNU* | *'with BFD'*)
41498bd17e5fSmrg  lt_cv_prog_gnu_ld=yes
41508bd17e5fSmrg  ;;
41518bd17e5fSmrg*)
41528bd17e5fSmrg  lt_cv_prog_gnu_ld=no
41538bd17e5fSmrg  ;;
41548bd17e5fSmrgesac])
41558bd17e5fSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
41568bd17e5fSmrg])# _LT_PATH_LD_GNU
41578bd17e5fSmrg
41588bd17e5fSmrg
41598bd17e5fSmrg# _LT_CMD_RELOAD
41608bd17e5fSmrg# --------------
41618bd17e5fSmrg# find reload flag for linker
41628bd17e5fSmrg#   -- PORTME Some linkers may need a different reload flag.
41638bd17e5fSmrgm4_defun([_LT_CMD_RELOAD],
41648bd17e5fSmrg[AC_CACHE_CHECK([for $LD option to reload object files],
41658bd17e5fSmrg  lt_cv_ld_reload_flag,
41668bd17e5fSmrg  [lt_cv_ld_reload_flag='-r'])
41678bd17e5fSmrgreload_flag=$lt_cv_ld_reload_flag
41688bd17e5fSmrgcase $reload_flag in
41698bd17e5fSmrg"" | " "*) ;;
41708bd17e5fSmrg*) reload_flag=" $reload_flag" ;;
41718bd17e5fSmrgesac
41728bd17e5fSmrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
41730597fb56Smrgcase $host_os in
41748bd17e5fSmrg  cygwin* | mingw* | pw32* | cegcc*)
41758bd17e5fSmrg    if test "$GCC" != yes; then
41768bd17e5fSmrg      reload_cmds=false
41778bd17e5fSmrg    fi
4178706b6b52Smrg    ;;
41798bd17e5fSmrg  darwin*)
41808bd17e5fSmrg    if test "$GCC" = yes; then
41818bd17e5fSmrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
41828bd17e5fSmrg    else
41838bd17e5fSmrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
41848bd17e5fSmrg    fi
4185706b6b52Smrg    ;;
41860597fb56Smrgesac
41878bd17e5fSmrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
41888bd17e5fSmrg_LT_TAGDECL([], [reload_cmds], [2])dnl
41898bd17e5fSmrg])# _LT_CMD_RELOAD
4190706b6b52Smrg
4191706b6b52Smrg
41928bd17e5fSmrg# _LT_CHECK_MAGIC_METHOD
41938bd17e5fSmrg# ----------------------
41948bd17e5fSmrg# how to check for library dependencies
41958bd17e5fSmrg#  -- PORTME fill in with the dynamic library characteristics
41968bd17e5fSmrgm4_defun([_LT_CHECK_MAGIC_METHOD],
41978bd17e5fSmrg[m4_require([_LT_DECL_EGREP])
41988bd17e5fSmrgm4_require([_LT_DECL_OBJDUMP])
41998bd17e5fSmrgAC_CACHE_CHECK([how to recognize dependent libraries],
42008bd17e5fSmrglt_cv_deplibs_check_method,
42018bd17e5fSmrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
42028bd17e5fSmrglt_cv_file_magic_test_file=
42038bd17e5fSmrglt_cv_deplibs_check_method='unknown'
42048bd17e5fSmrg# Need to set the preceding variable on all platforms that support
42058bd17e5fSmrg# interlibrary dependencies.
42068bd17e5fSmrg# 'none' -- dependencies not supported.
42078bd17e5fSmrg# `unknown' -- same as none, but documents that we really don't know.
42088bd17e5fSmrg# 'pass_all' -- all dependencies passed with no checks.
42098bd17e5fSmrg# 'test_compile' -- check by making test program.
42108bd17e5fSmrg# 'file_magic [[regex]]' -- check by looking for files in library path
42118bd17e5fSmrg# which responds to the $file_magic_cmd with a given extended regex.
42128bd17e5fSmrg# If you have `file' or equivalent on your system and you're not sure
42138bd17e5fSmrg# whether `pass_all' will *always* work, you probably want this one.
4214b042e37fSmrg
42158bd17e5fSmrgcase $host_os in
42168bd17e5fSmrgaix[[4-9]]*)
42178bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
42188bd17e5fSmrg  ;;
42190597fb56Smrg
42208bd17e5fSmrgbeos*)
42218bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
42228bd17e5fSmrg  ;;
42230597fb56Smrg
42248bd17e5fSmrgbsdi[[45]]*)
42258bd17e5fSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
42268bd17e5fSmrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
42278bd17e5fSmrg  lt_cv_file_magic_test_file=/shlib/libc.so
42288bd17e5fSmrg  ;;
42298bd17e5fSmrg
42308bd17e5fSmrgcygwin*)
42318bd17e5fSmrg  # func_win32_libid is a shell function defined in ltmain.sh
42328bd17e5fSmrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
42338bd17e5fSmrg  lt_cv_file_magic_cmd='func_win32_libid'
42348bd17e5fSmrg  ;;
42358bd17e5fSmrg
42368bd17e5fSmrgmingw* | pw32*)
42378bd17e5fSmrg  # Base MSYS/MinGW do not provide the 'file' command needed by
42388bd17e5fSmrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
42398bd17e5fSmrg  # unless we find 'file', for example because we are cross-compiling.
42408bd17e5fSmrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
42418bd17e5fSmrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
42428bd17e5fSmrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
42438bd17e5fSmrg    lt_cv_file_magic_cmd='func_win32_libid'
42448bd17e5fSmrg  else
42458bd17e5fSmrg    # Keep this pattern in sync with the one in func_win32_libid.
42468bd17e5fSmrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
42478bd17e5fSmrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
42488bd17e5fSmrg  fi
42498bd17e5fSmrg  ;;
42508bd17e5fSmrg
42518bd17e5fSmrgcegcc*)
42528bd17e5fSmrg  # use the weaker test based on 'objdump'. See mingw*.
42538bd17e5fSmrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
42548bd17e5fSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
42558bd17e5fSmrg  ;;
42568bd17e5fSmrg
42578bd17e5fSmrgdarwin* | rhapsody*)
42588bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
42598bd17e5fSmrg  ;;
42608bd17e5fSmrg
42618bd17e5fSmrgfreebsd* | dragonfly*)
42628bd17e5fSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
42638bd17e5fSmrg    case $host_cpu in
42648bd17e5fSmrg    i*86 )
42658bd17e5fSmrg      # Not sure whether the presence of OpenBSD here was a mistake.
42668bd17e5fSmrg      # Let's accept both of them until this is cleared up.
42678bd17e5fSmrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
42688bd17e5fSmrg      lt_cv_file_magic_cmd=/usr/bin/file
42698bd17e5fSmrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
42700597fb56Smrg      ;;
42710597fb56Smrg    esac
42728bd17e5fSmrg  else
42738bd17e5fSmrg    lt_cv_deplibs_check_method=pass_all
42748bd17e5fSmrg  fi
42758bd17e5fSmrg  ;;
4276b042e37fSmrg
42778bd17e5fSmrggnu*)
42788bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
42798bd17e5fSmrg  ;;
42808bd17e5fSmrg
42818bd17e5fSmrghaiku*)
42828bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
42838bd17e5fSmrg  ;;
42848bd17e5fSmrg
42858bd17e5fSmrghpux10.20* | hpux11*)
42868bd17e5fSmrg  lt_cv_file_magic_cmd=/usr/bin/file
42878bd17e5fSmrg  case $host_cpu in
42888bd17e5fSmrg  ia64*)
42898bd17e5fSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
42908bd17e5fSmrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
4291706b6b52Smrg    ;;
42928bd17e5fSmrg  hppa*64*)
42938bd17e5fSmrg    [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]']
42948bd17e5fSmrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
42950597fb56Smrg    ;;
42968bd17e5fSmrg  *)
42978bd17e5fSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
42988bd17e5fSmrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
4299706b6b52Smrg    ;;
4300706b6b52Smrg  esac
43018bd17e5fSmrg  ;;
4302b042e37fSmrg
43038bd17e5fSmrginterix[[3-9]]*)
43048bd17e5fSmrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
43058bd17e5fSmrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
43068bd17e5fSmrg  ;;
4307b042e37fSmrg
43088bd17e5fSmrgirix5* | irix6* | nonstopux*)
43098bd17e5fSmrg  case $LD in
43108bd17e5fSmrg  *-32|*"-32 ") libmagic=32-bit;;
43118bd17e5fSmrg  *-n32|*"-n32 ") libmagic=N32;;
43128bd17e5fSmrg  *-64|*"-64 ") libmagic=64-bit;;
43138bd17e5fSmrg  *) libmagic=never-match;;
43148bd17e5fSmrg  esac
43158bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
43168bd17e5fSmrg  ;;
4317b042e37fSmrg
43188bd17e5fSmrg# This must be glibc/ELF.
43198bd17e5fSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
43208bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
43218bd17e5fSmrg  ;;
4322b042e37fSmrg
43238bd17e5fSmrgnetbsd*)
43248bd17e5fSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
43258bd17e5fSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
43268bd17e5fSmrg  else
43278bd17e5fSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
43288bd17e5fSmrg  fi
43298bd17e5fSmrg  ;;
4330b042e37fSmrg
43318bd17e5fSmrgnewos6*)
43328bd17e5fSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
43338bd17e5fSmrg  lt_cv_file_magic_cmd=/usr/bin/file
43348bd17e5fSmrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
43358bd17e5fSmrg  ;;
4336706b6b52Smrg
43378bd17e5fSmrg*nto* | *qnx*)
43388bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
43398bd17e5fSmrg  ;;
4340b042e37fSmrg
43418bd17e5fSmrgopenbsd*)
43428bd17e5fSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
43438bd17e5fSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
43448bd17e5fSmrg  else
43458bd17e5fSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
43468bd17e5fSmrg  fi
43478bd17e5fSmrg  ;;
4348b042e37fSmrg
43498bd17e5fSmrgosf3* | osf4* | osf5*)
43508bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
43518bd17e5fSmrg  ;;
43520597fb56Smrg
43538bd17e5fSmrgrdos*)
43548bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
43558bd17e5fSmrg  ;;
43560597fb56Smrg
43578bd17e5fSmrgsolaris*)
43588bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
43598bd17e5fSmrg  ;;
43600597fb56Smrg
43618bd17e5fSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
43628bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
43638bd17e5fSmrg  ;;
43640597fb56Smrg
43658bd17e5fSmrgsysv4 | sysv4.3*)
43668bd17e5fSmrg  case $host_vendor in
43678bd17e5fSmrg  motorola)
43688bd17e5fSmrg    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]]'
43698bd17e5fSmrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
43708bd17e5fSmrg    ;;
43718bd17e5fSmrg  ncr)
43728bd17e5fSmrg    lt_cv_deplibs_check_method=pass_all
43738bd17e5fSmrg    ;;
43748bd17e5fSmrg  sequent)
43758bd17e5fSmrg    lt_cv_file_magic_cmd='/bin/file'
43768bd17e5fSmrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
43778bd17e5fSmrg    ;;
43788bd17e5fSmrg  sni)
43798bd17e5fSmrg    lt_cv_file_magic_cmd='/bin/file'
43808bd17e5fSmrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
43818bd17e5fSmrg    lt_cv_file_magic_test_file=/lib/libc.so
43828bd17e5fSmrg    ;;
43838bd17e5fSmrg  siemens)
43848bd17e5fSmrg    lt_cv_deplibs_check_method=pass_all
43858bd17e5fSmrg    ;;
43868bd17e5fSmrg  pc)
43878bd17e5fSmrg    lt_cv_deplibs_check_method=pass_all
43888bd17e5fSmrg    ;;
43898bd17e5fSmrg  esac
43908bd17e5fSmrg  ;;
43910597fb56Smrg
43928bd17e5fSmrgtpf*)
43938bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
43948bd17e5fSmrg  ;;
43958bd17e5fSmrgesac
43968bd17e5fSmrg])
43978bd17e5fSmrg
43988bd17e5fSmrgfile_magic_glob=
43998bd17e5fSmrgwant_nocaseglob=no
44008bd17e5fSmrgif test "$build" = "$host"; then
44018bd17e5fSmrg  case $host_os in
44028bd17e5fSmrg  mingw* | pw32*)
44038bd17e5fSmrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
44048bd17e5fSmrg      want_nocaseglob=yes
44058bd17e5fSmrg    else
44068bd17e5fSmrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
44078bd17e5fSmrg    fi
44088bd17e5fSmrg    ;;
44098bd17e5fSmrg  esac
44108bd17e5fSmrgfi
44110597fb56Smrg
44128bd17e5fSmrgfile_magic_cmd=$lt_cv_file_magic_cmd
44138bd17e5fSmrgdeplibs_check_method=$lt_cv_deplibs_check_method
44148bd17e5fSmrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
44150597fb56Smrg
44168bd17e5fSmrg_LT_DECL([], [deplibs_check_method], [1],
44178bd17e5fSmrg    [Method to check whether dependent libraries are shared objects])
44188bd17e5fSmrg_LT_DECL([], [file_magic_cmd], [1],
44198bd17e5fSmrg    [Command to use when deplibs_check_method = "file_magic"])
44208bd17e5fSmrg_LT_DECL([], [file_magic_glob], [1],
44218bd17e5fSmrg    [How to find potential files when deplibs_check_method = "file_magic"])
44228bd17e5fSmrg_LT_DECL([], [want_nocaseglob], [1],
44238bd17e5fSmrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
44248bd17e5fSmrg])# _LT_CHECK_MAGIC_METHOD
44250597fb56Smrg
44268bd17e5fSmrg
44278bd17e5fSmrg# LT_PATH_NM
44288bd17e5fSmrg# ----------
44298bd17e5fSmrg# find the pathname to a BSD- or MS-compatible name lister
44308bd17e5fSmrgAC_DEFUN([LT_PATH_NM],
44318bd17e5fSmrg[AC_REQUIRE([AC_PROG_CC])dnl
44328bd17e5fSmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
44338bd17e5fSmrg[if test -n "$NM"; then
44348bd17e5fSmrg  # Let the user override the test.
44358bd17e5fSmrg  lt_cv_path_NM="$NM"
44368bd17e5fSmrgelse
44378bd17e5fSmrg  lt_nm_to_check="${ac_tool_prefix}nm"
44388bd17e5fSmrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
44398bd17e5fSmrg    lt_nm_to_check="$lt_nm_to_check nm"
44408bd17e5fSmrg  fi
44418bd17e5fSmrg  for lt_tmp_nm in $lt_nm_to_check; do
44428bd17e5fSmrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
44438bd17e5fSmrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
44448bd17e5fSmrg      IFS="$lt_save_ifs"
44458bd17e5fSmrg      test -z "$ac_dir" && ac_dir=.
44468bd17e5fSmrg      tmp_nm="$ac_dir/$lt_tmp_nm"
44478bd17e5fSmrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
44488bd17e5fSmrg	# Check to see if the nm accepts a BSD-compat flag.
44498bd17e5fSmrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
44508bd17e5fSmrg	#   nm: unknown option "B" ignored
44518bd17e5fSmrg	# Tru64's nm complains that /dev/null is an invalid object file
44528bd17e5fSmrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
44538bd17e5fSmrg	*/dev/null* | *'Invalid file or object type'*)
44548bd17e5fSmrg	  lt_cv_path_NM="$tmp_nm -B"
44558bd17e5fSmrg	  break
44568bd17e5fSmrg	  ;;
44578bd17e5fSmrg	*)
44588bd17e5fSmrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
44598bd17e5fSmrg	  */dev/null*)
44608bd17e5fSmrg	    lt_cv_path_NM="$tmp_nm -p"
44618bd17e5fSmrg	    break
44628bd17e5fSmrg	    ;;
44638bd17e5fSmrg	  *)
44648bd17e5fSmrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
44658bd17e5fSmrg	    continue # so that we can try to find one that supports BSD flags
44668bd17e5fSmrg	    ;;
44678bd17e5fSmrg	  esac
44680597fb56Smrg	  ;;
44690597fb56Smrg	esac
44700597fb56Smrg      fi
44718bd17e5fSmrg    done
44728bd17e5fSmrg    IFS="$lt_save_ifs"
44738bd17e5fSmrg  done
44748bd17e5fSmrg  : ${lt_cv_path_NM=no}
44758bd17e5fSmrgfi])
44768bd17e5fSmrgif test "$lt_cv_path_NM" != "no"; then
44778bd17e5fSmrg  NM="$lt_cv_path_NM"
44788bd17e5fSmrgelse
44798bd17e5fSmrg  # Didn't find any BSD compatible name lister, look for dumpbin.
44808bd17e5fSmrg  if test -n "$DUMPBIN"; then :
44818bd17e5fSmrg    # Let the user override the test.
44828bd17e5fSmrg  else
44838bd17e5fSmrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
44848bd17e5fSmrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
44858bd17e5fSmrg    *COFF*)
44868bd17e5fSmrg      DUMPBIN="$DUMPBIN -symbols"
4487706b6b52Smrg      ;;
44888bd17e5fSmrg    *)
44898bd17e5fSmrg      DUMPBIN=:
44900597fb56Smrg      ;;
44918bd17e5fSmrg    esac
44928bd17e5fSmrg  fi
44938bd17e5fSmrg  AC_SUBST([DUMPBIN])
44948bd17e5fSmrg  if test "$DUMPBIN" != ":"; then
44958bd17e5fSmrg    NM="$DUMPBIN"
44968bd17e5fSmrg  fi
44978bd17e5fSmrgfi
44988bd17e5fSmrgtest -z "$NM" && NM=nm
44998bd17e5fSmrgAC_SUBST([NM])
45008bd17e5fSmrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
4501706b6b52Smrg
45028bd17e5fSmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
45038bd17e5fSmrg  [lt_cv_nm_interface="BSD nm"
45048bd17e5fSmrg  echo "int some_variable = 0;" > conftest.$ac_ext
45058bd17e5fSmrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
45068bd17e5fSmrg  (eval "$ac_compile" 2>conftest.err)
45078bd17e5fSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
45088bd17e5fSmrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
45098bd17e5fSmrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
45108bd17e5fSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
45118bd17e5fSmrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
45128bd17e5fSmrg  cat conftest.out >&AS_MESSAGE_LOG_FD
45138bd17e5fSmrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
45148bd17e5fSmrg    lt_cv_nm_interface="MS dumpbin"
45158bd17e5fSmrg  fi
45168bd17e5fSmrg  rm -f conftest*])
45178bd17e5fSmrg])# LT_PATH_NM
4518b042e37fSmrg
45198bd17e5fSmrg# Old names:
45208bd17e5fSmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
45218bd17e5fSmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
45228bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
45238bd17e5fSmrgdnl AC_DEFUN([AM_PROG_NM], [])
45248bd17e5fSmrgdnl AC_DEFUN([AC_PROG_NM], [])
4525b042e37fSmrg
45268bd17e5fSmrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
45278bd17e5fSmrg# --------------------------------
45288bd17e5fSmrg# how to determine the name of the shared library
45298bd17e5fSmrg# associated with a specific link library.
45308bd17e5fSmrg#  -- PORTME fill in with the dynamic library characteristics
45318bd17e5fSmrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
45328bd17e5fSmrg[m4_require([_LT_DECL_EGREP])
45338bd17e5fSmrgm4_require([_LT_DECL_OBJDUMP])
45348bd17e5fSmrgm4_require([_LT_DECL_DLLTOOL])
45358bd17e5fSmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
45368bd17e5fSmrglt_cv_sharedlib_from_linklib_cmd,
45378bd17e5fSmrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
4538b042e37fSmrg
45398bd17e5fSmrgcase $host_os in
45408bd17e5fSmrgcygwin* | mingw* | pw32* | cegcc*)
45418bd17e5fSmrg  # two different shell functions defined in ltmain.sh
45428bd17e5fSmrg  # decide which to use based on capabilities of $DLLTOOL
45438bd17e5fSmrg  case `$DLLTOOL --help 2>&1` in
45448bd17e5fSmrg  *--identify-strict*)
45458bd17e5fSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
45468bd17e5fSmrg    ;;
45478bd17e5fSmrg  *)
45488bd17e5fSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
45498bd17e5fSmrg    ;;
45508bd17e5fSmrg  esac
45518bd17e5fSmrg  ;;
45528bd17e5fSmrg*)
45538bd17e5fSmrg  # fallback: assume linklib IS sharedlib
45548bd17e5fSmrg  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
45558bd17e5fSmrg  ;;
45568bd17e5fSmrgesac
45578bd17e5fSmrg])
45588bd17e5fSmrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
45598bd17e5fSmrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
4560b042e37fSmrg
45618bd17e5fSmrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
45628bd17e5fSmrg    [Command to associate shared and link libraries])
45638bd17e5fSmrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
4564706b6b52Smrg
4565706b6b52Smrg
45668bd17e5fSmrg# _LT_PATH_MANIFEST_TOOL
45678bd17e5fSmrg# ----------------------
45688bd17e5fSmrg# locate the manifest tool
45698bd17e5fSmrgm4_defun([_LT_PATH_MANIFEST_TOOL],
45708bd17e5fSmrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
45718bd17e5fSmrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
45728bd17e5fSmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
45738bd17e5fSmrg  [lt_cv_path_mainfest_tool=no
45748bd17e5fSmrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
45758bd17e5fSmrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
45768bd17e5fSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
45778bd17e5fSmrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
45788bd17e5fSmrg    lt_cv_path_mainfest_tool=yes
45798bd17e5fSmrg  fi
45808bd17e5fSmrg  rm -f conftest*])
45818bd17e5fSmrgif test "x$lt_cv_path_mainfest_tool" != xyes; then
45828bd17e5fSmrg  MANIFEST_TOOL=:
45838bd17e5fSmrgfi
45848bd17e5fSmrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
45858bd17e5fSmrg])# _LT_PATH_MANIFEST_TOOL
4586706b6b52Smrg
4587706b6b52Smrg
45888bd17e5fSmrg# LT_LIB_M
45898bd17e5fSmrg# --------
45908bd17e5fSmrg# check for math library
45918bd17e5fSmrgAC_DEFUN([LT_LIB_M],
45928bd17e5fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
45938bd17e5fSmrgLIBM=
45948bd17e5fSmrgcase $host in
45958bd17e5fSmrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
45968bd17e5fSmrg  # These system don't have libm, or don't need it
45978bd17e5fSmrg  ;;
45988bd17e5fSmrg*-ncr-sysv4.3*)
45998bd17e5fSmrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
46008bd17e5fSmrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
46018bd17e5fSmrg  ;;
46028bd17e5fSmrg*)
46038bd17e5fSmrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
46048bd17e5fSmrg  ;;
46058bd17e5fSmrgesac
46068bd17e5fSmrgAC_SUBST([LIBM])
46078bd17e5fSmrg])# LT_LIB_M
4608b042e37fSmrg
46098bd17e5fSmrg# Old name:
46108bd17e5fSmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
46118bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
46128bd17e5fSmrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
4613b042e37fSmrg
4614b042e37fSmrg
46158bd17e5fSmrg# _LT_COMPILER_NO_RTTI([TAGNAME])
46168bd17e5fSmrg# -------------------------------
46178bd17e5fSmrgm4_defun([_LT_COMPILER_NO_RTTI],
46188bd17e5fSmrg[m4_require([_LT_TAG_COMPILER])dnl
4619b042e37fSmrg
46208bd17e5fSmrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
4621b042e37fSmrg
46228bd17e5fSmrgif test "$GCC" = yes; then
46238bd17e5fSmrg  case $cc_basename in
46248bd17e5fSmrg  nvcc*)
46258bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
46268bd17e5fSmrg  *)
46278bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
46288bd17e5fSmrg  esac
46298bd17e5fSmrg
46308bd17e5fSmrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
46318bd17e5fSmrg    lt_cv_prog_compiler_rtti_exceptions,
46328bd17e5fSmrg    [-fno-rtti -fno-exceptions], [],
46338bd17e5fSmrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
46348bd17e5fSmrgfi
46358bd17e5fSmrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
46368bd17e5fSmrg	[Compiler flag to turn off builtin functions])
46378bd17e5fSmrg])# _LT_COMPILER_NO_RTTI
4638b042e37fSmrg
4639b042e37fSmrg
46408bd17e5fSmrg# _LT_CMD_GLOBAL_SYMBOLS
46418bd17e5fSmrg# ----------------------
46428bd17e5fSmrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
46438bd17e5fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
46448bd17e5fSmrgAC_REQUIRE([AC_PROG_CC])dnl
46458bd17e5fSmrgAC_REQUIRE([AC_PROG_AWK])dnl
46468bd17e5fSmrgAC_REQUIRE([LT_PATH_NM])dnl
46478bd17e5fSmrgAC_REQUIRE([LT_PATH_LD])dnl
46488bd17e5fSmrgm4_require([_LT_DECL_SED])dnl
46498bd17e5fSmrgm4_require([_LT_DECL_EGREP])dnl
46508bd17e5fSmrgm4_require([_LT_TAG_COMPILER])dnl
46510597fb56Smrg
46528bd17e5fSmrg# Check for command to grab the raw symbol name followed by C symbol from nm.
46538bd17e5fSmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
46548bd17e5fSmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
46558bd17e5fSmrg[
46568bd17e5fSmrg# These are sane defaults that work on at least a few old systems.
46578bd17e5fSmrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
4658b042e37fSmrg
46598bd17e5fSmrg# Character class describing NM global symbol codes.
46608bd17e5fSmrgsymcode='[[BCDEGRST]]'
4661b042e37fSmrg
46628bd17e5fSmrg# Regexp to match symbols that can be accessed directly from C.
46638bd17e5fSmrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
4664b042e37fSmrg
46658bd17e5fSmrg# Define system-specific variables.
46668bd17e5fSmrgcase $host_os in
46678bd17e5fSmrgaix*)
46688bd17e5fSmrg  symcode='[[BCDT]]'
46698bd17e5fSmrg  ;;
46708bd17e5fSmrgcygwin* | mingw* | pw32* | cegcc*)
46718bd17e5fSmrg  symcode='[[ABCDGISTW]]'
46728bd17e5fSmrg  ;;
46738bd17e5fSmrghpux*)
46748bd17e5fSmrg  if test "$host_cpu" = ia64; then
46758bd17e5fSmrg    symcode='[[ABCDEGRST]]'
46768bd17e5fSmrg  fi
46778bd17e5fSmrg  ;;
46788bd17e5fSmrgirix* | nonstopux*)
46798bd17e5fSmrg  symcode='[[BCDEGRST]]'
46808bd17e5fSmrg  ;;
46818bd17e5fSmrgosf*)
46828bd17e5fSmrg  symcode='[[BCDEGQRST]]'
46838bd17e5fSmrg  ;;
46848bd17e5fSmrgsolaris*)
46858bd17e5fSmrg  symcode='[[BDRT]]'
46868bd17e5fSmrg  ;;
46878bd17e5fSmrgsco3.2v5*)
46888bd17e5fSmrg  symcode='[[DT]]'
46898bd17e5fSmrg  ;;
46908bd17e5fSmrgsysv4.2uw2*)
46918bd17e5fSmrg  symcode='[[DT]]'
46928bd17e5fSmrg  ;;
46938bd17e5fSmrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
46948bd17e5fSmrg  symcode='[[ABDT]]'
46958bd17e5fSmrg  ;;
46968bd17e5fSmrgsysv4)
46978bd17e5fSmrg  symcode='[[DFNSTU]]'
46988bd17e5fSmrg  ;;
46998bd17e5fSmrgesac
4700b042e37fSmrg
47018bd17e5fSmrg# If we're using GNU nm, then use its standard symbol codes.
47028bd17e5fSmrgcase `$NM -V 2>&1` in
47038bd17e5fSmrg*GNU* | *'with BFD'*)
47048bd17e5fSmrg  symcode='[[ABCDGIRSTW]]' ;;
47058bd17e5fSmrgesac
4706b042e37fSmrg
47078bd17e5fSmrg# Transform an extracted symbol line into a proper C declaration.
47088bd17e5fSmrg# Some systems (esp. on ia64) link data and code symbols differently,
47098bd17e5fSmrg# so use this general approach.
47108bd17e5fSmrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4711b042e37fSmrg
47128bd17e5fSmrg# Transform an extracted symbol line into symbol name and symbol address
47138bd17e5fSmrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
47148bd17e5fSmrglt_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'"
4715b042e37fSmrg
47168bd17e5fSmrg# Handle CRLF in mingw tool chain
47178bd17e5fSmrgopt_cr=
47188bd17e5fSmrgcase $build_os in
47198bd17e5fSmrgmingw*)
47208bd17e5fSmrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
47218bd17e5fSmrg  ;;
47228bd17e5fSmrgesac
4723b042e37fSmrg
47248bd17e5fSmrg# Try without a prefix underscore, then with it.
47258bd17e5fSmrgfor ac_symprfx in "" "_"; do
4726b042e37fSmrg
47278bd17e5fSmrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
47288bd17e5fSmrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
47298bd17e5fSmrg
47308bd17e5fSmrg  # Write the raw and C identifiers.
47318bd17e5fSmrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
47328bd17e5fSmrg    # Fake it for dumpbin and say T for any non-static function
47338bd17e5fSmrg    # and D for any global variable.
47348bd17e5fSmrg    # Also find C++ and __fastcall symbols from MSVC++,
47358bd17e5fSmrg    # which start with @ or ?.
47368bd17e5fSmrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
47378bd17e5fSmrg"     {last_section=section; section=\$ 3};"\
47388bd17e5fSmrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
47398bd17e5fSmrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
47408bd17e5fSmrg"     \$ 0!~/External *\|/{next};"\
47418bd17e5fSmrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
47428bd17e5fSmrg"     {if(hide[section]) next};"\
47438bd17e5fSmrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
47448bd17e5fSmrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
47458bd17e5fSmrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
47468bd17e5fSmrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
47478bd17e5fSmrg"     ' prfx=^$ac_symprfx]"
47488bd17e5fSmrg  else
47498bd17e5fSmrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
47508bd17e5fSmrg  fi
47518bd17e5fSmrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4752b042e37fSmrg
47538bd17e5fSmrg  # Check to see that the pipe works correctly.
47548bd17e5fSmrg  pipe_works=no
4755b042e37fSmrg
47568bd17e5fSmrg  rm -f conftest*
47578bd17e5fSmrg  cat > conftest.$ac_ext <<_LT_EOF
47588bd17e5fSmrg#ifdef __cplusplus
47598bd17e5fSmrgextern "C" {
47608bd17e5fSmrg#endif
47618bd17e5fSmrgchar nm_test_var;
47628bd17e5fSmrgvoid nm_test_func(void);
47638bd17e5fSmrgvoid nm_test_func(void){}
47648bd17e5fSmrg#ifdef __cplusplus
47658bd17e5fSmrg}
47668bd17e5fSmrg#endif
47678bd17e5fSmrgint main(){nm_test_var='a';nm_test_func();return(0);}
47688bd17e5fSmrg_LT_EOF
4769b042e37fSmrg
47708bd17e5fSmrg  if AC_TRY_EVAL(ac_compile); then
47718bd17e5fSmrg    # Now try to grab the symbols.
47728bd17e5fSmrg    nlist=conftest.nm
47738bd17e5fSmrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
47748bd17e5fSmrg      # Try sorting and uniquifying the output.
47758bd17e5fSmrg      if sort "$nlist" | uniq > "$nlist"T; then
47768bd17e5fSmrg	mv -f "$nlist"T "$nlist"
47770597fb56Smrg      else
47788bd17e5fSmrg	rm -f "$nlist"T
47790597fb56Smrg      fi
4780b042e37fSmrg
47818bd17e5fSmrg      # Make sure that we snagged all the symbols we need.
47828bd17e5fSmrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
47838bd17e5fSmrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
47848bd17e5fSmrg	  cat <<_LT_EOF > conftest.$ac_ext
47858bd17e5fSmrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
47868bd17e5fSmrg#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
47878bd17e5fSmrg/* DATA imports from DLLs on WIN32 con't be const, because runtime
47888bd17e5fSmrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
47898bd17e5fSmrg# define LT@&t@_DLSYM_CONST
47908bd17e5fSmrg#elif defined(__osf__)
47918bd17e5fSmrg/* This system does not cope well with relocations in const data.  */
47928bd17e5fSmrg# define LT@&t@_DLSYM_CONST
47938bd17e5fSmrg#else
47948bd17e5fSmrg# define LT@&t@_DLSYM_CONST const
47958bd17e5fSmrg#endif
4796b042e37fSmrg
47978bd17e5fSmrg#ifdef __cplusplus
47988bd17e5fSmrgextern "C" {
47998bd17e5fSmrg#endif
4800b042e37fSmrg
48018bd17e5fSmrg_LT_EOF
48028bd17e5fSmrg	  # Now generate the symbol file.
48038bd17e5fSmrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4804b042e37fSmrg
48058bd17e5fSmrg	  cat <<_LT_EOF >> conftest.$ac_ext
48068bd17e5fSmrg
48078bd17e5fSmrg/* The mapping between symbol names and symbols.  */
48088bd17e5fSmrgLT@&t@_DLSYM_CONST struct {
48098bd17e5fSmrg  const char *name;
48108bd17e5fSmrg  void       *address;
48118bd17e5fSmrg}
48128bd17e5fSmrglt__PROGRAM__LTX_preloaded_symbols[[]] =
48138bd17e5fSmrg{
48148bd17e5fSmrg  { "@PROGRAM@", (void *) 0 },
48158bd17e5fSmrg_LT_EOF
48168bd17e5fSmrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
48178bd17e5fSmrg	  cat <<\_LT_EOF >> conftest.$ac_ext
48188bd17e5fSmrg  {0, (void *) 0}
48198bd17e5fSmrg};
48208bd17e5fSmrg
48218bd17e5fSmrg/* This works around a problem in FreeBSD linker */
48228bd17e5fSmrg#ifdef FREEBSD_WORKAROUND
48238bd17e5fSmrgstatic const void *lt_preloaded_setup() {
48248bd17e5fSmrg  return lt__PROGRAM__LTX_preloaded_symbols;
48258bd17e5fSmrg}
48268bd17e5fSmrg#endif
48278bd17e5fSmrg
48288bd17e5fSmrg#ifdef __cplusplus
48298bd17e5fSmrg}
48308bd17e5fSmrg#endif
48318bd17e5fSmrg_LT_EOF
48328bd17e5fSmrg	  # Now try linking the two files.
48338bd17e5fSmrg	  mv conftest.$ac_objext conftstm.$ac_objext
48348bd17e5fSmrg	  lt_globsym_save_LIBS=$LIBS
48358bd17e5fSmrg	  lt_globsym_save_CFLAGS=$CFLAGS
48368bd17e5fSmrg	  LIBS="conftstm.$ac_objext"
48378bd17e5fSmrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
48388bd17e5fSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
48398bd17e5fSmrg	    pipe_works=yes
48408bd17e5fSmrg	  fi
48418bd17e5fSmrg	  LIBS=$lt_globsym_save_LIBS
48428bd17e5fSmrg	  CFLAGS=$lt_globsym_save_CFLAGS
48430597fb56Smrg	else
48448bd17e5fSmrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
48450597fb56Smrg	fi
48460597fb56Smrg      else
48478bd17e5fSmrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
48488bd17e5fSmrg      fi
48498bd17e5fSmrg    else
48508bd17e5fSmrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
48518bd17e5fSmrg    fi
48528bd17e5fSmrg  else
48538bd17e5fSmrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
48548bd17e5fSmrg    cat conftest.$ac_ext >&5
48558bd17e5fSmrg  fi
48568bd17e5fSmrg  rm -rf conftest* conftst*
48578bd17e5fSmrg
48588bd17e5fSmrg  # Do not use the global_symbol_pipe unless it works.
48598bd17e5fSmrg  if test "$pipe_works" = yes; then
48608bd17e5fSmrg    break
48618bd17e5fSmrg  else
48628bd17e5fSmrg    lt_cv_sys_global_symbol_pipe=
48638bd17e5fSmrg  fi
48648bd17e5fSmrgdone
48658bd17e5fSmrg])
48668bd17e5fSmrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
48678bd17e5fSmrg  lt_cv_sys_global_symbol_to_cdecl=
48688bd17e5fSmrgfi
48698bd17e5fSmrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
48708bd17e5fSmrg  AC_MSG_RESULT(failed)
48718bd17e5fSmrgelse
48728bd17e5fSmrg  AC_MSG_RESULT(ok)
48738bd17e5fSmrgfi
48748bd17e5fSmrg
48758bd17e5fSmrg# Response file support.
48768bd17e5fSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
48778bd17e5fSmrg  nm_file_list_spec='@'
48788bd17e5fSmrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
48798bd17e5fSmrg  nm_file_list_spec='@'
48808bd17e5fSmrgfi
48818bd17e5fSmrg
48828bd17e5fSmrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
48838bd17e5fSmrg    [Take the output of nm and produce a listing of raw symbols and C names])
48848bd17e5fSmrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
48858bd17e5fSmrg    [Transform the output of nm in a proper C declaration])
48868bd17e5fSmrg_LT_DECL([global_symbol_to_c_name_address],
48878bd17e5fSmrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
48888bd17e5fSmrg    [Transform the output of nm in a C name address pair])
48898bd17e5fSmrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
48908bd17e5fSmrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
48918bd17e5fSmrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
48928bd17e5fSmrg_LT_DECL([], [nm_file_list_spec], [1],
48938bd17e5fSmrg    [Specify filename containing input files for $NM])
48948bd17e5fSmrg]) # _LT_CMD_GLOBAL_SYMBOLS
48958bd17e5fSmrg
48968bd17e5fSmrg
48978bd17e5fSmrg# _LT_COMPILER_PIC([TAGNAME])
48988bd17e5fSmrg# ---------------------------
48998bd17e5fSmrgm4_defun([_LT_COMPILER_PIC],
49008bd17e5fSmrg[m4_require([_LT_TAG_COMPILER])dnl
49018bd17e5fSmrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
49028bd17e5fSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
49038bd17e5fSmrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
49048bd17e5fSmrg
49058bd17e5fSmrgm4_if([$1], [CXX], [
49068bd17e5fSmrg  # C++ specific cases for pic, static, wl, etc.
49078bd17e5fSmrg  if test "$GXX" = yes; then
49088bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
49098bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
49108bd17e5fSmrg
49118bd17e5fSmrg    case $host_os in
49128bd17e5fSmrg    aix*)
49138bd17e5fSmrg      # All AIX code is PIC.
49148bd17e5fSmrg      if test "$host_cpu" = ia64; then
49158bd17e5fSmrg	# AIX 5 now supports IA64 processor
49168bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
49170597fb56Smrg      fi
49180597fb56Smrg      ;;
4919b042e37fSmrg
49208bd17e5fSmrg    amigaos*)
49218bd17e5fSmrg      case $host_cpu in
49228bd17e5fSmrg      powerpc)
49238bd17e5fSmrg            # see comment about AmigaOS4 .so support
49248bd17e5fSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
49258bd17e5fSmrg        ;;
49268bd17e5fSmrg      m68k)
49278bd17e5fSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
49288bd17e5fSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
49298bd17e5fSmrg            # like `-m68040'.
49308bd17e5fSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
49318bd17e5fSmrg        ;;
49328bd17e5fSmrg      esac
49330597fb56Smrg      ;;
4934b042e37fSmrg
49358bd17e5fSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
49368bd17e5fSmrg      # PIC is the default for these OSes.
49370597fb56Smrg      ;;
49388bd17e5fSmrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
49398bd17e5fSmrg      # This hack is so that the source file can tell whether it is being
49408bd17e5fSmrg      # built for inclusion in a dll (and should export symbols for example).
49418bd17e5fSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
49428bd17e5fSmrg      # (--disable-auto-import) libraries
49438bd17e5fSmrg      m4_if([$1], [GCJ], [],
49448bd17e5fSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
49458bd17e5fSmrg      ;;
49468bd17e5fSmrg    darwin* | rhapsody*)
49478bd17e5fSmrg      # PIC is the default on this platform
49488bd17e5fSmrg      # Common symbols not allowed in MH_DYLIB files
49498bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
49508bd17e5fSmrg      ;;
49518bd17e5fSmrg    *djgpp*)
49528bd17e5fSmrg      # DJGPP does not support shared libraries at all
49538bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
49548bd17e5fSmrg      ;;
49558bd17e5fSmrg    haiku*)
49568bd17e5fSmrg      # PIC is the default for Haiku.
49578bd17e5fSmrg      # The "-static" flag exists, but is broken.
49588bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
49598bd17e5fSmrg      ;;
49608bd17e5fSmrg    interix[[3-9]]*)
49618bd17e5fSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
49628bd17e5fSmrg      # Instead, we relocate shared libraries at runtime.
49638bd17e5fSmrg      ;;
49648bd17e5fSmrg    sysv4*MP*)
49658bd17e5fSmrg      if test -d /usr/nec; then
49668bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
49670597fb56Smrg      fi
49680597fb56Smrg      ;;
49698bd17e5fSmrg    hpux*)
49708bd17e5fSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
49718bd17e5fSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
49728bd17e5fSmrg      # sets the default TLS model and affects inlining.
49738bd17e5fSmrg      case $host_cpu in
49748bd17e5fSmrg      hppa*64*)
49758bd17e5fSmrg	;;
49768bd17e5fSmrg      *)
49778bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
49788bd17e5fSmrg	;;
49798bd17e5fSmrg      esac
49808bd17e5fSmrg      ;;
49818bd17e5fSmrg    *qnx* | *nto*)
49828bd17e5fSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
49838bd17e5fSmrg      # it will coredump.
49848bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
49858bd17e5fSmrg      ;;
49868bd17e5fSmrg    *)
49878bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
49888bd17e5fSmrg      ;;
49898bd17e5fSmrg    esac
49908bd17e5fSmrg  else
49918bd17e5fSmrg    case $host_os in
49928bd17e5fSmrg      aix[[4-9]]*)
49938bd17e5fSmrg	# All AIX code is PIC.
49948bd17e5fSmrg	if test "$host_cpu" = ia64; then
49958bd17e5fSmrg	  # AIX 5 now supports IA64 processor
49968bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
49978bd17e5fSmrg	else
49988bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
49998bd17e5fSmrg	fi
50008bd17e5fSmrg	;;
50018bd17e5fSmrg      chorus*)
50028bd17e5fSmrg	case $cc_basename in
50038bd17e5fSmrg	cxch68*)
50048bd17e5fSmrg	  # Green Hills C++ Compiler
50058bd17e5fSmrg	  # _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"
50060597fb56Smrg	  ;;
50070597fb56Smrg	esac
50080597fb56Smrg	;;
50098bd17e5fSmrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
50108bd17e5fSmrg	# This hack is so that the source file can tell whether it is being
50118bd17e5fSmrg	# built for inclusion in a dll (and should export symbols for example).
50128bd17e5fSmrg	m4_if([$1], [GCJ], [],
50138bd17e5fSmrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
50148bd17e5fSmrg	;;
50158bd17e5fSmrg      dgux*)
50168bd17e5fSmrg	case $cc_basename in
50178bd17e5fSmrg	  ec++*)
50188bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
50198bd17e5fSmrg	    ;;
50208bd17e5fSmrg	  ghcx*)
50218bd17e5fSmrg	    # Green Hills C++ Compiler
50228bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
50238bd17e5fSmrg	    ;;
50248bd17e5fSmrg	  *)
50258bd17e5fSmrg	    ;;
50268bd17e5fSmrg	esac
50278bd17e5fSmrg	;;
50288bd17e5fSmrg      freebsd* | dragonfly*)
50298bd17e5fSmrg	# FreeBSD uses GNU C++
50308bd17e5fSmrg	;;
50318bd17e5fSmrg      hpux9* | hpux10* | hpux11*)
50328bd17e5fSmrg	case $cc_basename in
50338bd17e5fSmrg	  CC*)
50348bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
50358bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
50368bd17e5fSmrg	    if test "$host_cpu" != ia64; then
50378bd17e5fSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
50388bd17e5fSmrg	    fi
50398bd17e5fSmrg	    ;;
50408bd17e5fSmrg	  aCC*)
50418bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
50428bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
50438bd17e5fSmrg	    case $host_cpu in
50448bd17e5fSmrg	    hppa*64*|ia64*)
50458bd17e5fSmrg	      # +Z the default
50468bd17e5fSmrg	      ;;
50478bd17e5fSmrg	    *)
50488bd17e5fSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
50498bd17e5fSmrg	      ;;
50508bd17e5fSmrg	    esac
50518bd17e5fSmrg	    ;;
50528bd17e5fSmrg	  *)
50538bd17e5fSmrg	    ;;
50548bd17e5fSmrg	esac
50558bd17e5fSmrg	;;
50568bd17e5fSmrg      interix*)
50578bd17e5fSmrg	# This is c89, which is MS Visual C++ (no shared libs)
50588bd17e5fSmrg	# Anyone wants to do a port?
50598bd17e5fSmrg	;;
50608bd17e5fSmrg      irix5* | irix6* | nonstopux*)
50618bd17e5fSmrg	case $cc_basename in
50628bd17e5fSmrg	  CC*)
50638bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
50648bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
50658bd17e5fSmrg	    # CC pic flag -KPIC is the default.
50668bd17e5fSmrg	    ;;
50678bd17e5fSmrg	  *)
50688bd17e5fSmrg	    ;;
50698bd17e5fSmrg	esac
50708bd17e5fSmrg	;;
50718bd17e5fSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
50728bd17e5fSmrg	case $cc_basename in
50738bd17e5fSmrg	  KCC*)
50748bd17e5fSmrg	    # KAI C++ Compiler
50758bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
50768bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
50778bd17e5fSmrg	    ;;
50788bd17e5fSmrg	  ecpc* )
50798bd17e5fSmrg	    # old Intel C++ for x86_64 which still supported -KPIC.
50808bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
50818bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
50828bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
50838bd17e5fSmrg	    ;;
50848bd17e5fSmrg	  icpc* )
50858bd17e5fSmrg	    # Intel C++, used to be incompatible with GCC.
50868bd17e5fSmrg	    # ICC 10 doesn't accept -KPIC any more.
50878bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
50888bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
50898bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
50908bd17e5fSmrg	    ;;
50918bd17e5fSmrg	  pgCC* | pgcpp*)
50928bd17e5fSmrg	    # Portland Group C++ compiler
50938bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
50948bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
50958bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
50968bd17e5fSmrg	    ;;
50978bd17e5fSmrg	  cxx*)
50988bd17e5fSmrg	    # Compaq C++
50998bd17e5fSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
51008bd17e5fSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
51018bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
51028bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
51038bd17e5fSmrg	    ;;
51048bd17e5fSmrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
51058bd17e5fSmrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
51068bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
51078bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
51088bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
51098bd17e5fSmrg	    ;;
51108bd17e5fSmrg	  *)
51118bd17e5fSmrg	    case `$CC -V 2>&1 | sed 5q` in
51128bd17e5fSmrg	    *Sun\ C*)
51138bd17e5fSmrg	      # Sun C++ 5.9
51148bd17e5fSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
51158bd17e5fSmrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
51168bd17e5fSmrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
51178bd17e5fSmrg	      ;;
51188bd17e5fSmrg	    esac
51198bd17e5fSmrg	    ;;
51208bd17e5fSmrg	esac
51218bd17e5fSmrg	;;
51228bd17e5fSmrg      lynxos*)
51238bd17e5fSmrg	;;
51248bd17e5fSmrg      m88k*)
51258bd17e5fSmrg	;;
51268bd17e5fSmrg      mvs*)
51278bd17e5fSmrg	case $cc_basename in
51288bd17e5fSmrg	  cxx*)
51298bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
51308bd17e5fSmrg	    ;;
51318bd17e5fSmrg	  *)
51328bd17e5fSmrg	    ;;
51338bd17e5fSmrg	esac
51348bd17e5fSmrg	;;
51358bd17e5fSmrg      netbsd*)
51360597fb56Smrg	;;
51378bd17e5fSmrg      *qnx* | *nto*)
51388bd17e5fSmrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
51398bd17e5fSmrg        # it will coredump.
51408bd17e5fSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
51410597fb56Smrg        ;;
51428bd17e5fSmrg      osf3* | osf4* | osf5*)
51438bd17e5fSmrg	case $cc_basename in
51448bd17e5fSmrg	  KCC*)
51458bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
51468bd17e5fSmrg	    ;;
51478bd17e5fSmrg	  RCC*)
51488bd17e5fSmrg	    # Rational C++ 2.4.1
51498bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
51508bd17e5fSmrg	    ;;
51518bd17e5fSmrg	  cxx*)
51528bd17e5fSmrg	    # Digital/Compaq C++
51538bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
51548bd17e5fSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
51558bd17e5fSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
51568bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
51578bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
51588bd17e5fSmrg	    ;;
51598bd17e5fSmrg	  *)
51608bd17e5fSmrg	    ;;
51618bd17e5fSmrg	esac
51620597fb56Smrg	;;
51638bd17e5fSmrg      psos*)
51648bd17e5fSmrg	;;
51658bd17e5fSmrg      solaris*)
51668bd17e5fSmrg	case $cc_basename in
51678bd17e5fSmrg	  CC* | sunCC*)
51688bd17e5fSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
51698bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
51708bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
51718bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
51728bd17e5fSmrg	    ;;
51738bd17e5fSmrg	  gcx*)
51748bd17e5fSmrg	    # Green Hills C++ Compiler
51758bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
51768bd17e5fSmrg	    ;;
51778bd17e5fSmrg	  *)
51788bd17e5fSmrg	    ;;
51798bd17e5fSmrg	esac
51808bd17e5fSmrg	;;
51818bd17e5fSmrg      sunos4*)
51828bd17e5fSmrg	case $cc_basename in
51838bd17e5fSmrg	  CC*)
51848bd17e5fSmrg	    # Sun C++ 4.x
51858bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
51868bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
51878bd17e5fSmrg	    ;;
51888bd17e5fSmrg	  lcc*)
51898bd17e5fSmrg	    # Lucid
51908bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
51918bd17e5fSmrg	    ;;
51928bd17e5fSmrg	  *)
51938bd17e5fSmrg	    ;;
51948bd17e5fSmrg	esac
51958bd17e5fSmrg	;;
51968bd17e5fSmrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
51978bd17e5fSmrg	case $cc_basename in
51988bd17e5fSmrg	  CC*)
51998bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
52008bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
52018bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
52028bd17e5fSmrg	    ;;
52038bd17e5fSmrg	esac
52048bd17e5fSmrg	;;
52058bd17e5fSmrg      tandem*)
52068bd17e5fSmrg	case $cc_basename in
52078bd17e5fSmrg	  NCC*)
52088bd17e5fSmrg	    # NonStop-UX NCC 3.20
52098bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
52108bd17e5fSmrg	    ;;
52118bd17e5fSmrg	  *)
52128bd17e5fSmrg	    ;;
52138bd17e5fSmrg	esac
52148bd17e5fSmrg	;;
52158bd17e5fSmrg      vxworks*)
52168bd17e5fSmrg	;;
52178bd17e5fSmrg      *)
52188bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
52190597fb56Smrg	;;
52208c4a8e55Smrg    esac
52218c4a8e55Smrg  fi
52228bd17e5fSmrg],
52238bd17e5fSmrg[
52248bd17e5fSmrg  if test "$GCC" = yes; then
52258bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
52268bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
5227b042e37fSmrg
52288bd17e5fSmrg    case $host_os in
52298bd17e5fSmrg      aix*)
52308bd17e5fSmrg      # All AIX code is PIC.
52318bd17e5fSmrg      if test "$host_cpu" = ia64; then
52328bd17e5fSmrg	# AIX 5 now supports IA64 processor
52338bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
52348bd17e5fSmrg      fi
52358bd17e5fSmrg      ;;
52360597fb56Smrg
52378bd17e5fSmrg    amigaos*)
52388bd17e5fSmrg      case $host_cpu in
52398bd17e5fSmrg      powerpc)
52408bd17e5fSmrg            # see comment about AmigaOS4 .so support
52418bd17e5fSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
52428bd17e5fSmrg        ;;
52438bd17e5fSmrg      m68k)
52448bd17e5fSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
52458bd17e5fSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
52468bd17e5fSmrg            # like `-m68040'.
52478bd17e5fSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
52488bd17e5fSmrg        ;;
52498bd17e5fSmrg      esac
52508bd17e5fSmrg      ;;
5251b042e37fSmrg
52528bd17e5fSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
52538bd17e5fSmrg      # PIC is the default for these OSes.
52548bd17e5fSmrg      ;;
5255b042e37fSmrg
52568bd17e5fSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
52578bd17e5fSmrg      # This hack is so that the source file can tell whether it is being
52588bd17e5fSmrg      # built for inclusion in a dll (and should export symbols for example).
52598bd17e5fSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
52608bd17e5fSmrg      # (--disable-auto-import) libraries
52618bd17e5fSmrg      m4_if([$1], [GCJ], [],
52628bd17e5fSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
52638bd17e5fSmrg      ;;
52648c4a8e55Smrg
52658bd17e5fSmrg    darwin* | rhapsody*)
52668bd17e5fSmrg      # PIC is the default on this platform
52678bd17e5fSmrg      # Common symbols not allowed in MH_DYLIB files
52688bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
52698bd17e5fSmrg      ;;
5270b042e37fSmrg
52718bd17e5fSmrg    haiku*)
52728bd17e5fSmrg      # PIC is the default for Haiku.
52738bd17e5fSmrg      # The "-static" flag exists, but is broken.
52748bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
52758bd17e5fSmrg      ;;
5276b042e37fSmrg
52778bd17e5fSmrg    hpux*)
52788bd17e5fSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
52798bd17e5fSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
52808bd17e5fSmrg      # sets the default TLS model and affects inlining.
52818bd17e5fSmrg      case $host_cpu in
52828bd17e5fSmrg      hppa*64*)
52838bd17e5fSmrg	# +Z the default
52848bd17e5fSmrg	;;
52858bd17e5fSmrg      *)
52868bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
52878bd17e5fSmrg	;;
52888bd17e5fSmrg      esac
52898bd17e5fSmrg      ;;
52908c4a8e55Smrg
52918bd17e5fSmrg    interix[[3-9]]*)
52928bd17e5fSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
52938bd17e5fSmrg      # Instead, we relocate shared libraries at runtime.
52948bd17e5fSmrg      ;;
52958c4a8e55Smrg
52968bd17e5fSmrg    msdosdjgpp*)
52978bd17e5fSmrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
52988bd17e5fSmrg      # on systems that don't support them.
52998bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
53008bd17e5fSmrg      enable_shared=no
53018bd17e5fSmrg      ;;
53028c4a8e55Smrg
53038bd17e5fSmrg    *nto* | *qnx*)
53048bd17e5fSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
53058bd17e5fSmrg      # it will coredump.
53068bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
53078bd17e5fSmrg      ;;
53088c4a8e55Smrg
53098bd17e5fSmrg    sysv4*MP*)
53108bd17e5fSmrg      if test -d /usr/nec; then
53118bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
53128bd17e5fSmrg      fi
53138bd17e5fSmrg      ;;
53148c4a8e55Smrg
53158bd17e5fSmrg    *)
53168bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
53178bd17e5fSmrg      ;;
53188bd17e5fSmrg    esac
53198bd17e5fSmrg
53208bd17e5fSmrg    case $cc_basename in
53218bd17e5fSmrg    nvcc*) # Cuda Compiler Driver 2.2
53228bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
53238bd17e5fSmrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
53248bd17e5fSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
53258bd17e5fSmrg      fi
53268bd17e5fSmrg      ;;
53278bd17e5fSmrg    esac
53280597fb56Smrg  else
53298bd17e5fSmrg    # PORTME Check for flag to pass linker flags through the system compiler.
53308bd17e5fSmrg    case $host_os in
53318bd17e5fSmrg    aix*)
53328bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
53338bd17e5fSmrg      if test "$host_cpu" = ia64; then
53348bd17e5fSmrg	# AIX 5 now supports IA64 processor
53358bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
53368bd17e5fSmrg      else
53378bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
53388bd17e5fSmrg      fi
53398bd17e5fSmrg      ;;
5340b042e37fSmrg
53418bd17e5fSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
53428bd17e5fSmrg      # This hack is so that the source file can tell whether it is being
53438bd17e5fSmrg      # built for inclusion in a dll (and should export symbols for example).
53448bd17e5fSmrg      m4_if([$1], [GCJ], [],
53458bd17e5fSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
53468bd17e5fSmrg      ;;
5347bd23fbfaSmrg
53488bd17e5fSmrg    hpux9* | hpux10* | hpux11*)
53498bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
53508bd17e5fSmrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
53518bd17e5fSmrg      # not for PA HP-UX.
53528bd17e5fSmrg      case $host_cpu in
53538bd17e5fSmrg      hppa*64*|ia64*)
53548bd17e5fSmrg	# +Z the default
53558bd17e5fSmrg	;;
53568bd17e5fSmrg      *)
53578bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
53588bd17e5fSmrg	;;
53598bd17e5fSmrg      esac
53608bd17e5fSmrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
53618bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
53628bd17e5fSmrg      ;;
5363b042e37fSmrg
53648bd17e5fSmrg    irix5* | irix6* | nonstopux*)
53658bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
53668bd17e5fSmrg      # PIC (with -KPIC) is the default.
53678bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
53688bd17e5fSmrg      ;;
5369b042e37fSmrg
53708bd17e5fSmrg    linux* | k*bsd*-gnu | kopensolaris*-gnu)
53718bd17e5fSmrg      case $cc_basename in
53728bd17e5fSmrg      # old Intel for x86_64 which still supported -KPIC.
53738bd17e5fSmrg      ecc*)
53748bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
53758bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
53768bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
53778bd17e5fSmrg        ;;
53788bd17e5fSmrg      # icc used to be incompatible with GCC.
53798bd17e5fSmrg      # ICC 10 doesn't accept -KPIC any more.
53808bd17e5fSmrg      icc* | ifort*)
53818bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
53828bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
53838bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
53848bd17e5fSmrg        ;;
53858bd17e5fSmrg      # Lahey Fortran 8.1.
53868bd17e5fSmrg      lf95*)
53878bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
53888bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
53898bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
53908bd17e5fSmrg	;;
53918bd17e5fSmrg      nagfor*)
53928bd17e5fSmrg	# NAG Fortran compiler
53938bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
53948bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
53958bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
53968bd17e5fSmrg	;;
53978bd17e5fSmrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
53988bd17e5fSmrg        # Portland Group compilers (*not* the Pentium gcc compiler,
53998bd17e5fSmrg	# which looks to be a dead project)
54008bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54018bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
54028bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54038bd17e5fSmrg        ;;
54048bd17e5fSmrg      ccc*)
54058bd17e5fSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54068bd17e5fSmrg        # All Alpha code is PIC.
54078bd17e5fSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
54088bd17e5fSmrg        ;;
54098bd17e5fSmrg      xl* | bgxl* | bgf* | mpixl*)
54108bd17e5fSmrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
54118bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54128bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
54138bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
54148bd17e5fSmrg	;;
54158bd17e5fSmrg      *)
54168bd17e5fSmrg	case `$CC -V 2>&1 | sed 5q` in
54178bd17e5fSmrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
54188bd17e5fSmrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
54198bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
54208bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54218bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
54228bd17e5fSmrg	  ;;
54238bd17e5fSmrg	*Sun\ F* | *Sun*Fortran*)
54248bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
54258bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54268bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
54278bd17e5fSmrg	  ;;
54288bd17e5fSmrg	*Sun\ C*)
54298bd17e5fSmrg	  # Sun C 5.9
54308bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
54318bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54328bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54338bd17e5fSmrg	  ;;
54348bd17e5fSmrg        *Intel*\ [[CF]]*Compiler*)
54358bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54368bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
54378bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
54388bd17e5fSmrg	  ;;
54398bd17e5fSmrg	*Portland\ Group*)
54408bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54418bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
54428bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54438bd17e5fSmrg	  ;;
54448bd17e5fSmrg	esac
54458bd17e5fSmrg	;;
54468bd17e5fSmrg      esac
54478bd17e5fSmrg      ;;
5448b042e37fSmrg
54498bd17e5fSmrg    newsos6)
54508bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
54518bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54528bd17e5fSmrg      ;;
5453b042e37fSmrg
54548bd17e5fSmrg    *nto* | *qnx*)
54558bd17e5fSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
54568bd17e5fSmrg      # it will coredump.
54578bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
54588bd17e5fSmrg      ;;
5459b042e37fSmrg
54608bd17e5fSmrg    osf3* | osf4* | osf5*)
54618bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54628bd17e5fSmrg      # All OSF/1 code is PIC.
54638bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
54648bd17e5fSmrg      ;;
54658bd17e5fSmrg
54668bd17e5fSmrg    rdos*)
54678bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
54688bd17e5fSmrg      ;;
54690597fb56Smrg
54708bd17e5fSmrg    solaris*)
54718bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
54728bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54738bd17e5fSmrg      case $cc_basename in
54748bd17e5fSmrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
54758bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
54768bd17e5fSmrg      *)
54778bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
54788bd17e5fSmrg      esac
54798bd17e5fSmrg      ;;
54800597fb56Smrg
54818bd17e5fSmrg    sunos4*)
54828bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
54838bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
54848bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54858bd17e5fSmrg      ;;
54860597fb56Smrg
54878bd17e5fSmrg    sysv4 | sysv4.2uw2* | sysv4.3*)
54888bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
54898bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
54908bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54918bd17e5fSmrg      ;;
5492b042e37fSmrg
54938bd17e5fSmrg    sysv4*MP*)
54948bd17e5fSmrg      if test -d /usr/nec ;then
54958bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
54968bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
54978bd17e5fSmrg      fi
54988bd17e5fSmrg      ;;
5499bd23fbfaSmrg
55008bd17e5fSmrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
55018bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
55028bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
55038bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
55048bd17e5fSmrg      ;;
5505b042e37fSmrg
55068bd17e5fSmrg    unicos*)
55078bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
55088bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
55098bd17e5fSmrg      ;;
55108c4a8e55Smrg
55118bd17e5fSmrg    uts4*)
55128bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
55138bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
55148bd17e5fSmrg      ;;
55158c4a8e55Smrg
55168bd17e5fSmrg    *)
55178bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
55188bd17e5fSmrg      ;;
55198bd17e5fSmrg    esac
55208bd17e5fSmrg  fi
55218bd17e5fSmrg])
55228bd17e5fSmrgcase $host_os in
55238bd17e5fSmrg  # For platforms which do not support PIC, -DPIC is meaningless:
55248bd17e5fSmrg  *djgpp*)
55258bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
55268bd17e5fSmrg    ;;
55278bd17e5fSmrg  *)
55288bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
55298bd17e5fSmrg    ;;
55308bd17e5fSmrgesac
5531b042e37fSmrg
55328bd17e5fSmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
55338bd17e5fSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
55348bd17e5fSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
55358bd17e5fSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
55368c4a8e55Smrg
55378bd17e5fSmrg#
55388bd17e5fSmrg# Check to make sure the PIC flag actually works.
55398bd17e5fSmrg#
55408bd17e5fSmrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
55418bd17e5fSmrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
55428bd17e5fSmrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
55438bd17e5fSmrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
55448bd17e5fSmrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
55458bd17e5fSmrg     "" | " "*) ;;
55468bd17e5fSmrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
55478bd17e5fSmrg     esac],
55488bd17e5fSmrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
55498bd17e5fSmrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
55508bd17e5fSmrgfi
55518bd17e5fSmrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
55528bd17e5fSmrg	[Additional compiler flags for building library objects])
55530597fb56Smrg
55548bd17e5fSmrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
55558bd17e5fSmrg	[How to pass a linker flag through the compiler])
55568bd17e5fSmrg#
55578bd17e5fSmrg# Check to make sure the static flag actually works.
55588bd17e5fSmrg#
55598bd17e5fSmrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
55608bd17e5fSmrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
55618bd17e5fSmrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
55628bd17e5fSmrg  $lt_tmp_static_flag,
55638bd17e5fSmrg  [],
55648bd17e5fSmrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
55658bd17e5fSmrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
55668bd17e5fSmrg	[Compiler flag to prevent dynamic linking])
55678bd17e5fSmrg])# _LT_COMPILER_PIC
5568b042e37fSmrg
55690597fb56Smrg
55708bd17e5fSmrg# _LT_LINKER_SHLIBS([TAGNAME])
55718bd17e5fSmrg# ----------------------------
55728bd17e5fSmrg# See if the linker supports building shared libraries.
55738bd17e5fSmrgm4_defun([_LT_LINKER_SHLIBS],
55748bd17e5fSmrg[AC_REQUIRE([LT_PATH_LD])dnl
55758bd17e5fSmrgAC_REQUIRE([LT_PATH_NM])dnl
55768bd17e5fSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
55778bd17e5fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
55788bd17e5fSmrgm4_require([_LT_DECL_EGREP])dnl
55798bd17e5fSmrgm4_require([_LT_DECL_SED])dnl
55808bd17e5fSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
55818bd17e5fSmrgm4_require([_LT_TAG_COMPILER])dnl
55828bd17e5fSmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
55838bd17e5fSmrgm4_if([$1], [CXX], [
55848bd17e5fSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
55858bd17e5fSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
55868bd17e5fSmrg  case $host_os in
55878bd17e5fSmrg  aix[[4-9]]*)
55888bd17e5fSmrg    # If we're using GNU nm, then we don't want the "-C" option.
55898bd17e5fSmrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
55908bd17e5fSmrg    # Also, AIX nm treats weak defined symbols like other global defined
55918bd17e5fSmrg    # symbols, whereas GNU nm marks them as "W".
55928bd17e5fSmrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
55938bd17e5fSmrg      _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'
55948bd17e5fSmrg    else
55958bd17e5fSmrg      _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'
55968bd17e5fSmrg    fi
55978bd17e5fSmrg    ;;
55988bd17e5fSmrg  pw32*)
55998bd17e5fSmrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
56008bd17e5fSmrg    ;;
56018bd17e5fSmrg  cygwin* | mingw* | cegcc*)
56028bd17e5fSmrg    case $cc_basename in
56038bd17e5fSmrg    cl*)
56048bd17e5fSmrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
56058bd17e5fSmrg      ;;
56068bd17e5fSmrg    *)
56078bd17e5fSmrg      _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'
56088bd17e5fSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
56098bd17e5fSmrg      ;;
56108bd17e5fSmrg    esac
56118bd17e5fSmrg    ;;
56128bd17e5fSmrg  *)
56138bd17e5fSmrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
56148bd17e5fSmrg    ;;
56158bd17e5fSmrg  esac
56168bd17e5fSmrg], [
56178bd17e5fSmrg  runpath_var=
56188bd17e5fSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=
56198bd17e5fSmrg  _LT_TAGVAR(always_export_symbols, $1)=no
56208bd17e5fSmrg  _LT_TAGVAR(archive_cmds, $1)=
56218bd17e5fSmrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
56228bd17e5fSmrg  _LT_TAGVAR(compiler_needs_object, $1)=no
56238bd17e5fSmrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
56248bd17e5fSmrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
56258bd17e5fSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
56268bd17e5fSmrg  _LT_TAGVAR(hardcode_automatic, $1)=no
56278bd17e5fSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
56288bd17e5fSmrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
56298bd17e5fSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
56308bd17e5fSmrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
56318bd17e5fSmrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
56328bd17e5fSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
56338bd17e5fSmrg  _LT_TAGVAR(inherit_rpath, $1)=no
56348bd17e5fSmrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
56358bd17e5fSmrg  _LT_TAGVAR(module_cmds, $1)=
56368bd17e5fSmrg  _LT_TAGVAR(module_expsym_cmds, $1)=
56378bd17e5fSmrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
56388bd17e5fSmrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
56398bd17e5fSmrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
56408bd17e5fSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
56418bd17e5fSmrg  # include_expsyms should be a list of space-separated symbols to be *always*
56428bd17e5fSmrg  # included in the symbol list
56438bd17e5fSmrg  _LT_TAGVAR(include_expsyms, $1)=
56448bd17e5fSmrg  # exclude_expsyms can be an extended regexp of symbols to exclude
56458bd17e5fSmrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
56468bd17e5fSmrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
56478bd17e5fSmrg  # as well as any symbol that contains `d'.
56488bd17e5fSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
56498bd17e5fSmrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
56508bd17e5fSmrg  # platforms (ab)use it in PIC code, but their linkers get confused if
56518bd17e5fSmrg  # the symbol is explicitly referenced.  Since portable code cannot
56528bd17e5fSmrg  # rely on this symbol name, it's probably fine to never include it in
56538bd17e5fSmrg  # preloaded symbol tables.
56548bd17e5fSmrg  # Exclude shared library initialization/finalization symbols.
56558bd17e5fSmrgdnl Note also adjust exclude_expsyms for C++ above.
56568bd17e5fSmrg  extract_expsyms_cmds=
56578bd17e5fSmrg
56588bd17e5fSmrg  case $host_os in
56598bd17e5fSmrg  cygwin* | mingw* | pw32* | cegcc*)
56608bd17e5fSmrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
56618bd17e5fSmrg    # When not using gcc, we currently assume that we are using
56628bd17e5fSmrg    # Microsoft Visual C++.
56638bd17e5fSmrg    if test "$GCC" != yes; then
56648bd17e5fSmrg      with_gnu_ld=no
56658bd17e5fSmrg    fi
56668bd17e5fSmrg    ;;
56678bd17e5fSmrg  interix*)
56688bd17e5fSmrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
56698bd17e5fSmrg    with_gnu_ld=yes
56708bd17e5fSmrg    ;;
56718bd17e5fSmrg  openbsd*)
56728bd17e5fSmrg    with_gnu_ld=no
56738bd17e5fSmrg    ;;
56748bd17e5fSmrg  esac
56750597fb56Smrg
56768bd17e5fSmrg  _LT_TAGVAR(ld_shlibs, $1)=yes
56770597fb56Smrg
56788bd17e5fSmrg  # On some targets, GNU ld is compatible enough with the native linker
56798bd17e5fSmrg  # that we're better off using the native interface for both.
56808bd17e5fSmrg  lt_use_gnu_ld_interface=no
56818bd17e5fSmrg  if test "$with_gnu_ld" = yes; then
56828bd17e5fSmrg    case $host_os in
56838bd17e5fSmrg      aix*)
56848bd17e5fSmrg	# The AIX port of GNU ld has always aspired to compatibility
56858bd17e5fSmrg	# with the native linker.  However, as the warning in the GNU ld
56868bd17e5fSmrg	# block says, versions before 2.19.5* couldn't really create working
56878bd17e5fSmrg	# shared libraries, regardless of the interface used.
56888bd17e5fSmrg	case `$LD -v 2>&1` in
56898bd17e5fSmrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
56908bd17e5fSmrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
56918bd17e5fSmrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
56928bd17e5fSmrg	  *)
56938bd17e5fSmrg	    lt_use_gnu_ld_interface=yes
56948bd17e5fSmrg	    ;;
5695706b6b52Smrg	esac
56968c4a8e55Smrg	;;
56978bd17e5fSmrg      *)
56988bd17e5fSmrg	lt_use_gnu_ld_interface=yes
5699bd23fbfaSmrg	;;
57008bd17e5fSmrg    esac
57018bd17e5fSmrg  fi
57020597fb56Smrg
57038bd17e5fSmrg  if test "$lt_use_gnu_ld_interface" = yes; then
57048bd17e5fSmrg    # If archive_cmds runs LD, not CC, wlarc should be empty
57058bd17e5fSmrg    wlarc='${wl}'
57060597fb56Smrg
57078bd17e5fSmrg    # Set some defaults for GNU ld with shared library support. These
57088bd17e5fSmrg    # are reset later if shared libraries are not supported. Putting them
57098bd17e5fSmrg    # here allows them to be overridden if necessary.
57108bd17e5fSmrg    runpath_var=LD_RUN_PATH
57118bd17e5fSmrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
57128bd17e5fSmrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
57138bd17e5fSmrg    # ancient GNU ld didn't support --whole-archive et. al.
57148bd17e5fSmrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
57158bd17e5fSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
57168bd17e5fSmrg    else
57178bd17e5fSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
57188bd17e5fSmrg    fi
57198bd17e5fSmrg    supports_anon_versioning=no
57208bd17e5fSmrg    case `$LD -v 2>&1` in
57218bd17e5fSmrg      *GNU\ gold*) supports_anon_versioning=yes ;;
57228bd17e5fSmrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
57238bd17e5fSmrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
57248bd17e5fSmrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
57258bd17e5fSmrg      *\ 2.11.*) ;; # other 2.11 versions
57268bd17e5fSmrg      *) supports_anon_versioning=yes ;;
57278bd17e5fSmrg    esac
57280597fb56Smrg
57298bd17e5fSmrg    # See if GNU ld supports shared libraries.
57308bd17e5fSmrg    case $host_os in
57318bd17e5fSmrg    aix[[3-9]]*)
57328bd17e5fSmrg      # On AIX/PPC, the GNU linker is very broken
57338bd17e5fSmrg      if test "$host_cpu" != ia64; then
57348bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
57358bd17e5fSmrg	cat <<_LT_EOF 1>&2
57368bd17e5fSmrg
57378bd17e5fSmrg*** Warning: the GNU linker, at least up to release 2.19, is reported
57388bd17e5fSmrg*** to be unable to reliably create shared libraries on AIX.
57398bd17e5fSmrg*** Therefore, libtool is disabling shared libraries support.  If you
57408bd17e5fSmrg*** really care for shared libraries, you may want to install binutils
57418bd17e5fSmrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
57428bd17e5fSmrg*** You will then need to restart the configuration process.
57438bd17e5fSmrg
57448bd17e5fSmrg_LT_EOF
57458bd17e5fSmrg      fi
57468bd17e5fSmrg      ;;
57470597fb56Smrg
57488bd17e5fSmrg    amigaos*)
57498bd17e5fSmrg      case $host_cpu in
57508bd17e5fSmrg      powerpc)
57518bd17e5fSmrg            # see comment about AmigaOS4 .so support
57528bd17e5fSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
57538bd17e5fSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
57540597fb56Smrg        ;;
57558bd17e5fSmrg      m68k)
57568bd17e5fSmrg            _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)'
57578bd17e5fSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
57588bd17e5fSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
57590597fb56Smrg        ;;
57608bd17e5fSmrg      esac
57618bd17e5fSmrg      ;;
57620597fb56Smrg
57638bd17e5fSmrg    beos*)
57648bd17e5fSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
57658bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
57668bd17e5fSmrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
57678bd17e5fSmrg	# support --undefined.  This deserves some investigation.  FIXME
57688bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
57698bd17e5fSmrg      else
57708bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
57718bd17e5fSmrg      fi
57728bd17e5fSmrg      ;;
57730597fb56Smrg
57748bd17e5fSmrg    cygwin* | mingw* | pw32* | cegcc*)
57758bd17e5fSmrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
57768bd17e5fSmrg      # as there is no search path for DLLs.
57778bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
57788bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
57798bd17e5fSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
57808bd17e5fSmrg      _LT_TAGVAR(always_export_symbols, $1)=no
57818bd17e5fSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
57828bd17e5fSmrg      _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'
57838bd17e5fSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
57840597fb56Smrg
57858bd17e5fSmrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
57868bd17e5fSmrg        _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'
57878bd17e5fSmrg	# If the export-symbols file already is a .def file (1st line
57888bd17e5fSmrg	# is EXPORTS), use it as is; otherwise, prepend...
57898bd17e5fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
57908bd17e5fSmrg	  cp $export_symbols $output_objdir/$soname.def;
57918bd17e5fSmrg	else
57928bd17e5fSmrg	  echo EXPORTS > $output_objdir/$soname.def;
57938bd17e5fSmrg	  cat $export_symbols >> $output_objdir/$soname.def;
57948bd17e5fSmrg	fi~
57958bd17e5fSmrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
57968bd17e5fSmrg      else
57978bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
57988bd17e5fSmrg      fi
57998bd17e5fSmrg      ;;
58000597fb56Smrg
58018bd17e5fSmrg    haiku*)
58028bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
58038bd17e5fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
58048bd17e5fSmrg      ;;
58050597fb56Smrg
58068bd17e5fSmrg    interix[[3-9]]*)
58078bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=no
58088bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
58098bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
58108bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
58118bd17e5fSmrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
58128bd17e5fSmrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
58138bd17e5fSmrg      # default) and relocated if they conflict, which is a slow very memory
58148bd17e5fSmrg      # consuming and fragmenting process.  To avoid this, we pick a random,
58158bd17e5fSmrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
58168bd17e5fSmrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
58178bd17e5fSmrg      _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'
58188bd17e5fSmrg      _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'
58198bd17e5fSmrg      ;;
58200597fb56Smrg
58218bd17e5fSmrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
58228bd17e5fSmrg      tmp_diet=no
58238bd17e5fSmrg      if test "$host_os" = linux-dietlibc; then
58248bd17e5fSmrg	case $cc_basename in
58258bd17e5fSmrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
58268bd17e5fSmrg	esac
58278bd17e5fSmrg      fi
58288bd17e5fSmrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
58298bd17e5fSmrg	 && test "$tmp_diet" = no
58308bd17e5fSmrg      then
58318bd17e5fSmrg	tmp_addflag=' $pic_flag'
58328bd17e5fSmrg	tmp_sharedflag='-shared'
58338bd17e5fSmrg	case $cc_basename,$host_cpu in
58348bd17e5fSmrg        pgcc*)				# Portland Group C compiler
58358bd17e5fSmrg	  _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'
58368bd17e5fSmrg	  tmp_addflag=' $pic_flag'
58378bd17e5fSmrg	  ;;
58388bd17e5fSmrg	pgf77* | pgf90* | pgf95* | pgfortran*)
58398bd17e5fSmrg					# Portland Group f77 and f90 compilers
58408bd17e5fSmrg	  _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'
58418bd17e5fSmrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
58428bd17e5fSmrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
58438bd17e5fSmrg	  tmp_addflag=' -i_dynamic' ;;
58448bd17e5fSmrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
58458bd17e5fSmrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
58468bd17e5fSmrg	ifc* | ifort*)			# Intel Fortran compiler
58478bd17e5fSmrg	  tmp_addflag=' -nofor_main' ;;
58488bd17e5fSmrg	lf95*)				# Lahey Fortran 8.1
58498bd17e5fSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
58508bd17e5fSmrg	  tmp_sharedflag='--shared' ;;
58518bd17e5fSmrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
58528bd17e5fSmrg	  tmp_sharedflag='-qmkshrobj'
58538bd17e5fSmrg	  tmp_addflag= ;;
58548bd17e5fSmrg	nvcc*)	# Cuda Compiler Driver 2.2
58558bd17e5fSmrg	  _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'
58568bd17e5fSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
58578bd17e5fSmrg	  ;;
58588bd17e5fSmrg	esac
58598bd17e5fSmrg	case `$CC -V 2>&1 | sed 5q` in
58608bd17e5fSmrg	*Sun\ C*)			# Sun C 5.9
58618bd17e5fSmrg	  _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'
58628bd17e5fSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
58638bd17e5fSmrg	  tmp_sharedflag='-G' ;;
58648bd17e5fSmrg	*Sun\ F*)			# Sun Fortran 8.3
58658bd17e5fSmrg	  tmp_sharedflag='-G' ;;
58668bd17e5fSmrg	esac
58678bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
58680597fb56Smrg
58698bd17e5fSmrg        if test "x$supports_anon_versioning" = xyes; then
58708bd17e5fSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
58718bd17e5fSmrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
58728bd17e5fSmrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
58738bd17e5fSmrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
58748bd17e5fSmrg        fi
58750597fb56Smrg
58768bd17e5fSmrg	case $cc_basename in
58778bd17e5fSmrg	xlf* | bgf* | bgxlf* | mpixlf*)
58788bd17e5fSmrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
58798bd17e5fSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
58808bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
58818bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
58828bd17e5fSmrg	  if test "x$supports_anon_versioning" = xyes; then
58838bd17e5fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
58848bd17e5fSmrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
58858bd17e5fSmrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
58868bd17e5fSmrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
58878bd17e5fSmrg	  fi
58888bd17e5fSmrg	  ;;
58898bd17e5fSmrg	esac
58908bd17e5fSmrg      else
58918bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
58928bd17e5fSmrg      fi
58938bd17e5fSmrg      ;;
58940597fb56Smrg
58958bd17e5fSmrg    netbsd*)
58968bd17e5fSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
58978bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
58988bd17e5fSmrg	wlarc=
58998bd17e5fSmrg      else
59008bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
59018bd17e5fSmrg	_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'
59028bd17e5fSmrg      fi
59038bd17e5fSmrg      ;;
59040597fb56Smrg
59058bd17e5fSmrg    solaris*)
59068bd17e5fSmrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
59078bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
59088bd17e5fSmrg	cat <<_LT_EOF 1>&2
59090597fb56Smrg
59108bd17e5fSmrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
59118bd17e5fSmrg*** create shared libraries on Solaris systems.  Therefore, libtool
59128bd17e5fSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
59138bd17e5fSmrg*** binutils to release 2.9.1 or newer.  Another option is to modify
59148bd17e5fSmrg*** your PATH or compiler configuration so that the native linker is
59158bd17e5fSmrg*** used, and then restart.
59160597fb56Smrg
59178bd17e5fSmrg_LT_EOF
59188bd17e5fSmrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
59198bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
59208bd17e5fSmrg	_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'
59218bd17e5fSmrg      else
59228bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
59238bd17e5fSmrg      fi
59248bd17e5fSmrg      ;;
59250597fb56Smrg
59268bd17e5fSmrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
59278bd17e5fSmrg      case `$LD -v 2>&1` in
59288bd17e5fSmrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
59298bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
59308bd17e5fSmrg	cat <<_LT_EOF 1>&2
59310597fb56Smrg
59328bd17e5fSmrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
59338bd17e5fSmrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
59348bd17e5fSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
59358bd17e5fSmrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
59368bd17e5fSmrg*** your PATH or compiler configuration so that the native linker is
59378bd17e5fSmrg*** used, and then restart.
59380597fb56Smrg
59398bd17e5fSmrg_LT_EOF
59408bd17e5fSmrg	;;
59418bd17e5fSmrg	*)
59428bd17e5fSmrg	  # For security reasons, it is highly recommended that you always
59438bd17e5fSmrg	  # use absolute paths for naming shared libraries, and exclude the
59448bd17e5fSmrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
59458bd17e5fSmrg	  # requires that you compile everything twice, which is a pain.
59468bd17e5fSmrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
59470597fb56Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
59488bd17e5fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
59498bd17e5fSmrg	    _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'
59508bd17e5fSmrg	  else
59518bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
59528bd17e5fSmrg	  fi
59538bd17e5fSmrg	;;
59548bd17e5fSmrg      esac
59558bd17e5fSmrg      ;;
59560597fb56Smrg
59578bd17e5fSmrg    sunos4*)
59588bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
59598bd17e5fSmrg      wlarc=
59608bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
59618bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
59628bd17e5fSmrg      ;;
59638bd17e5fSmrg
59648bd17e5fSmrg    *)
59658bd17e5fSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
59668bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
59678bd17e5fSmrg	_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'
59688bd17e5fSmrg      else
59698bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
59708bd17e5fSmrg      fi
59718bd17e5fSmrg      ;;
59728bd17e5fSmrg    esac
59738bd17e5fSmrg
59748bd17e5fSmrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
59758bd17e5fSmrg      runpath_var=
59768bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
59778bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
59788bd17e5fSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
59798bd17e5fSmrg    fi
59808bd17e5fSmrg  else
59818bd17e5fSmrg    # PORTME fill in a description of your system's linker (not GNU ld)
59828bd17e5fSmrg    case $host_os in
59838bd17e5fSmrg    aix3*)
59848bd17e5fSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
59858bd17e5fSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
59868bd17e5fSmrg      _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'
59878bd17e5fSmrg      # Note: this linker hardcodes the directories in LIBPATH if there
59888bd17e5fSmrg      # are no directories specified by -L.
59898bd17e5fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
59908bd17e5fSmrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
59918bd17e5fSmrg	# Neither direct hardcoding nor static linking is supported with a
59928bd17e5fSmrg	# broken collect2.
59938bd17e5fSmrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
59948bd17e5fSmrg      fi
59958bd17e5fSmrg      ;;
59968bd17e5fSmrg
59978bd17e5fSmrg    aix[[4-9]]*)
59988bd17e5fSmrg      if test "$host_cpu" = ia64; then
59998bd17e5fSmrg	# On IA64, the linker does run time linking by default, so we don't
60008bd17e5fSmrg	# have to do anything special.
60018bd17e5fSmrg	aix_use_runtimelinking=no
60028bd17e5fSmrg	exp_sym_flag='-Bexport'
60038bd17e5fSmrg	no_entry_flag=""
60048bd17e5fSmrg      else
60058bd17e5fSmrg	# If we're using GNU nm, then we don't want the "-C" option.
60068bd17e5fSmrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
60078bd17e5fSmrg	# Also, AIX nm treats weak defined symbols like other global
60088bd17e5fSmrg	# defined symbols, whereas GNU nm marks them as "W".
60098bd17e5fSmrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
60108bd17e5fSmrg	  _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'
60118bd17e5fSmrg	else
60128bd17e5fSmrg	  _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'
60138bd17e5fSmrg	fi
60148bd17e5fSmrg	aix_use_runtimelinking=no
60150597fb56Smrg
60168bd17e5fSmrg	# Test if we are trying to use run time linking or normal
60178bd17e5fSmrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
60188bd17e5fSmrg	# need to do runtime linking.
60198bd17e5fSmrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
60208bd17e5fSmrg	  for ld_flag in $LDFLAGS; do
60218bd17e5fSmrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
60228bd17e5fSmrg	    aix_use_runtimelinking=yes
60238bd17e5fSmrg	    break
60248bd17e5fSmrg	  fi
60258bd17e5fSmrg	  done
60268bd17e5fSmrg	  ;;
60278c4a8e55Smrg	esac
60280597fb56Smrg
60298bd17e5fSmrg	exp_sym_flag='-bexport'
60308bd17e5fSmrg	no_entry_flag='-bnoentry'
60318bd17e5fSmrg      fi
60320597fb56Smrg
60338bd17e5fSmrg      # When large executables or shared objects are built, AIX ld can
60348bd17e5fSmrg      # have problems creating the table of contents.  If linking a library
60358bd17e5fSmrg      # or program results in "error TOC overflow" add -mminimal-toc to
60368bd17e5fSmrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
60378bd17e5fSmrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
60380597fb56Smrg
60398bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)=''
60408bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
60418bd17e5fSmrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
60428bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
60438bd17e5fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
60448bd17e5fSmrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
60458bd17e5fSmrg
60468bd17e5fSmrg      if test "$GCC" = yes; then
60478bd17e5fSmrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
60488bd17e5fSmrg	# We only want to do this on AIX 4.2 and lower, the check
60498bd17e5fSmrg	# below for broken collect2 doesn't work under 4.3+
60508bd17e5fSmrg	  collect2name=`${CC} -print-prog-name=collect2`
60518bd17e5fSmrg	  if test -f "$collect2name" &&
60528bd17e5fSmrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
60538bd17e5fSmrg	  then
60548bd17e5fSmrg	  # We have reworked collect2
60558bd17e5fSmrg	  :
60568bd17e5fSmrg	  else
60578bd17e5fSmrg	  # We have old collect2
60588bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
60598bd17e5fSmrg	  # It fails to find uninstalled libraries when the uninstalled
60608bd17e5fSmrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
60618bd17e5fSmrg	  # to unsupported forces relinking
60628bd17e5fSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
60638bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
60648bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
60658bd17e5fSmrg	  fi
60668bd17e5fSmrg	  ;;
60678c4a8e55Smrg	esac
60688bd17e5fSmrg	shared_flag='-shared'
60698bd17e5fSmrg	if test "$aix_use_runtimelinking" = yes; then
60708bd17e5fSmrg	  shared_flag="$shared_flag "'${wl}-G'
60718bd17e5fSmrg	fi
60728bd17e5fSmrg      else
60738bd17e5fSmrg	# not using gcc
60748bd17e5fSmrg	if test "$host_cpu" = ia64; then
60758bd17e5fSmrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
60768bd17e5fSmrg	# chokes on -Wl,-G. The following line is correct:
60778bd17e5fSmrg	  shared_flag='-G'
60788bd17e5fSmrg	else
60798bd17e5fSmrg	  if test "$aix_use_runtimelinking" = yes; then
60808bd17e5fSmrg	    shared_flag='${wl}-G'
60818bd17e5fSmrg	  else
60828bd17e5fSmrg	    shared_flag='${wl}-bM:SRE'
60838bd17e5fSmrg	  fi
60848bd17e5fSmrg	fi
60858bd17e5fSmrg      fi
60860597fb56Smrg
60878bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
60888bd17e5fSmrg      # It seems that -bexpall does not export symbols beginning with
60898bd17e5fSmrg      # underscore (_), so it is better to generate a list of symbols to export.
60908bd17e5fSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
60918bd17e5fSmrg      if test "$aix_use_runtimelinking" = yes; then
60928bd17e5fSmrg	# Warning - without using the other runtime loading flags (-brtl),
60938bd17e5fSmrg	# -berok will link without error, but may produce a broken library.
60948bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
60958bd17e5fSmrg        # Determine the default libpath from the value encoded in an
60968bd17e5fSmrg        # empty executable.
60978bd17e5fSmrg        _LT_SYS_MODULE_PATH_AIX([$1])
60988bd17e5fSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
60998bd17e5fSmrg        _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"
61008bd17e5fSmrg      else
61018bd17e5fSmrg	if test "$host_cpu" = ia64; then
61028bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
61038bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
61048bd17e5fSmrg	  _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"
61058bd17e5fSmrg	else
61068bd17e5fSmrg	 # Determine the default libpath from the value encoded in an
61078bd17e5fSmrg	 # empty executable.
61088bd17e5fSmrg	 _LT_SYS_MODULE_PATH_AIX([$1])
61098bd17e5fSmrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
61108bd17e5fSmrg	  # Warning - without using the other run time loading flags,
61118bd17e5fSmrg	  # -berok will link without error, but may produce a broken library.
61128bd17e5fSmrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
61138bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
61148bd17e5fSmrg	  if test "$with_gnu_ld" = yes; then
61158bd17e5fSmrg	    # We only use this code for GNU lds that support --whole-archive.
61168bd17e5fSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
61178bd17e5fSmrg	  else
61188bd17e5fSmrg	    # Exported symbols can be pulled into shared objects from archives
61198bd17e5fSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
61208bd17e5fSmrg	  fi
61218bd17e5fSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
61228bd17e5fSmrg	  # This is similar to how AIX traditionally builds its shared libraries.
61238bd17e5fSmrg	  _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'
61240597fb56Smrg	fi
61258bd17e5fSmrg      fi
61268bd17e5fSmrg      ;;
61270597fb56Smrg
61288bd17e5fSmrg    amigaos*)
61298bd17e5fSmrg      case $host_cpu in
61308bd17e5fSmrg      powerpc)
61318bd17e5fSmrg            # see comment about AmigaOS4 .so support
61328bd17e5fSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
61338bd17e5fSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
61348bd17e5fSmrg        ;;
61358bd17e5fSmrg      m68k)
61368bd17e5fSmrg            _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)'
61378bd17e5fSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
61388bd17e5fSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
61398bd17e5fSmrg        ;;
61408bd17e5fSmrg      esac
61418bd17e5fSmrg      ;;
61420597fb56Smrg
61438bd17e5fSmrg    bsdi[[45]]*)
61448bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
61458bd17e5fSmrg      ;;
61460597fb56Smrg
61478bd17e5fSmrg    cygwin* | mingw* | pw32* | cegcc*)
61488bd17e5fSmrg      # When not using gcc, we currently assume that we are using
61498bd17e5fSmrg      # Microsoft Visual C++.
61508bd17e5fSmrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
61518bd17e5fSmrg      # no search path for DLLs.
61528bd17e5fSmrg      case $cc_basename in
61538bd17e5fSmrg      cl*)
61548bd17e5fSmrg	# Native MSVC
61558bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
61568bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
61578bd17e5fSmrg	_LT_TAGVAR(always_export_symbols, $1)=yes
61588bd17e5fSmrg	_LT_TAGVAR(file_list_spec, $1)='@'
61598bd17e5fSmrg	# Tell ltmain to make .lib files, not .a files.
61608bd17e5fSmrg	libext=lib
61618bd17e5fSmrg	# Tell ltmain to make .dll files, not .so files.
61628bd17e5fSmrg	shrext_cmds=".dll"
61638bd17e5fSmrg	# FIXME: Setting linknames here is a bad hack.
61648bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
61658bd17e5fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
61668bd17e5fSmrg	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
61678bd17e5fSmrg	  else
61688bd17e5fSmrg	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
61698bd17e5fSmrg	  fi~
61708bd17e5fSmrg	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
61718bd17e5fSmrg	  linknames='
61728bd17e5fSmrg	# The linker will not automatically build a static lib if we build a DLL.
61738bd17e5fSmrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
61748bd17e5fSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
61758bd17e5fSmrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
61768bd17e5fSmrg	_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'
61778bd17e5fSmrg	# Don't use ranlib
61788bd17e5fSmrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
61798bd17e5fSmrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
61808bd17e5fSmrg	  lt_tool_outputfile="@TOOL_OUTPUT@"~
61818bd17e5fSmrg	  case $lt_outputfile in
61828bd17e5fSmrg	    *.exe|*.EXE) ;;
61838bd17e5fSmrg	    *)
61848bd17e5fSmrg	      lt_outputfile="$lt_outputfile.exe"
61858bd17e5fSmrg	      lt_tool_outputfile="$lt_tool_outputfile.exe"
61868bd17e5fSmrg	      ;;
61878bd17e5fSmrg	  esac~
61888bd17e5fSmrg	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
61898bd17e5fSmrg	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
61908bd17e5fSmrg	    $RM "$lt_outputfile.manifest";
61918bd17e5fSmrg	  fi'
61928bd17e5fSmrg	;;
61938bd17e5fSmrg      *)
61948bd17e5fSmrg	# Assume MSVC wrapper
61958bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
61968bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
61978bd17e5fSmrg	# Tell ltmain to make .lib files, not .a files.
61988bd17e5fSmrg	libext=lib
61998bd17e5fSmrg	# Tell ltmain to make .dll files, not .so files.
62008bd17e5fSmrg	shrext_cmds=".dll"
62018bd17e5fSmrg	# FIXME: Setting linknames here is a bad hack.
62028bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
62038bd17e5fSmrg	# The linker will automatically build a .lib file if we build a DLL.
62048bd17e5fSmrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
62058bd17e5fSmrg	# FIXME: Should let the user specify the lib program.
62068bd17e5fSmrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
62078bd17e5fSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6208706b6b52Smrg	;;
62098bd17e5fSmrg      esac
62108bd17e5fSmrg      ;;
6211706b6b52Smrg
62128bd17e5fSmrg    darwin* | rhapsody*)
62138bd17e5fSmrg      _LT_DARWIN_LINKER_FEATURES($1)
62148bd17e5fSmrg      ;;
6215706b6b52Smrg
62168bd17e5fSmrg    dgux*)
62178bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
62188bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
62198bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
62208bd17e5fSmrg      ;;
6221706b6b52Smrg
62228bd17e5fSmrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
62238bd17e5fSmrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
62248bd17e5fSmrg    # does not break anything, and helps significantly (at the cost of a little
62258bd17e5fSmrg    # extra space).
62268bd17e5fSmrg    freebsd2.2*)
62278bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
62288bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
62298bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
62308bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
62318bd17e5fSmrg      ;;
62320597fb56Smrg
62338bd17e5fSmrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
62348bd17e5fSmrg    freebsd2.*)
62358bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
62368bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
62378bd17e5fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
62388bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
62398bd17e5fSmrg      ;;
6240706b6b52Smrg
62418bd17e5fSmrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
62428bd17e5fSmrg    freebsd* | dragonfly*)
62438bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
62448bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
62458bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
62468bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
62478bd17e5fSmrg      ;;
6248706b6b52Smrg
62498bd17e5fSmrg    hpux9*)
62508bd17e5fSmrg      if test "$GCC" = yes; then
62518bd17e5fSmrg	_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'
62528bd17e5fSmrg      else
62538bd17e5fSmrg	_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'
62548bd17e5fSmrg      fi
62558bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
62568bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
62578bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
6258706b6b52Smrg
62598bd17e5fSmrg      # hardcode_minus_L: Not really in the search PATH,
62608bd17e5fSmrg      # but as the default location of the library.
62618bd17e5fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
62628bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
62638bd17e5fSmrg      ;;
6264706b6b52Smrg
62658bd17e5fSmrg    hpux10*)
62668bd17e5fSmrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
62678bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
62688bd17e5fSmrg      else
62698bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
62708bd17e5fSmrg      fi
62718bd17e5fSmrg      if test "$with_gnu_ld" = no; then
62728bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
62738bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
62748bd17e5fSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
62758bd17e5fSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
62768bd17e5fSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
62778bd17e5fSmrg	# hardcode_minus_L: Not really in the search PATH,
62788bd17e5fSmrg	# but as the default location of the library.
62798bd17e5fSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
62808bd17e5fSmrg      fi
62818bd17e5fSmrg      ;;
6282b042e37fSmrg
62838bd17e5fSmrg    hpux11*)
62848bd17e5fSmrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
62858bd17e5fSmrg	case $host_cpu in
62868bd17e5fSmrg	hppa*64*)
62878bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
62888bd17e5fSmrg	  ;;
62898bd17e5fSmrg	ia64*)
62908bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
62918bd17e5fSmrg	  ;;
62928bd17e5fSmrg	*)
62938bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
62948bd17e5fSmrg	  ;;
62958bd17e5fSmrg	esac
62968bd17e5fSmrg      else
62978bd17e5fSmrg	case $host_cpu in
62988bd17e5fSmrg	hppa*64*)
62998bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
63008bd17e5fSmrg	  ;;
63018bd17e5fSmrg	ia64*)
63028bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
63038bd17e5fSmrg	  ;;
63048bd17e5fSmrg	*)
63058bd17e5fSmrg	m4_if($1, [], [
63068bd17e5fSmrg	  # Older versions of the 11.00 compiler do not understand -b yet
63078bd17e5fSmrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
63088bd17e5fSmrg	  _LT_LINKER_OPTION([if $CC understands -b],
63098bd17e5fSmrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
63108bd17e5fSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
63118bd17e5fSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
63128bd17e5fSmrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
63138bd17e5fSmrg	  ;;
63148bd17e5fSmrg	esac
63158bd17e5fSmrg      fi
63168bd17e5fSmrg      if test "$with_gnu_ld" = no; then
63178bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
63188bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
63198c4a8e55Smrg
63208bd17e5fSmrg	case $host_cpu in
63218bd17e5fSmrg	hppa*64*|ia64*)
63228bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
63238bd17e5fSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
63248bd17e5fSmrg	  ;;
63258bd17e5fSmrg	*)
63268bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
63278bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
63288bd17e5fSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6329b042e37fSmrg
63308bd17e5fSmrg	  # hardcode_minus_L: Not really in the search PATH,
63318bd17e5fSmrg	  # but as the default location of the library.
63328bd17e5fSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
63338bd17e5fSmrg	  ;;
63348bd17e5fSmrg	esac
63358bd17e5fSmrg      fi
63368bd17e5fSmrg      ;;
6337b042e37fSmrg
63388bd17e5fSmrg    irix5* | irix6* | nonstopux*)
63398bd17e5fSmrg      if test "$GCC" = yes; then
63408bd17e5fSmrg	_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'
63418bd17e5fSmrg	# Try to use the -exported_symbol ld option, if it does not
63428bd17e5fSmrg	# work, assume that -exports_file does not work either and
63438bd17e5fSmrg	# implicitly export all symbols.
63448bd17e5fSmrg	# This should be the same for all languages, so no per-tag cache variable.
63458bd17e5fSmrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
63468bd17e5fSmrg	  [lt_cv_irix_exported_symbol],
63478bd17e5fSmrg	  [save_LDFLAGS="$LDFLAGS"
63488bd17e5fSmrg	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
63498bd17e5fSmrg	   AC_LINK_IFELSE(
63508bd17e5fSmrg	     [AC_LANG_SOURCE(
63518bd17e5fSmrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
63528bd17e5fSmrg			      [C++], [[int foo (void) { return 0; }]],
63538bd17e5fSmrg			      [Fortran 77], [[
63548bd17e5fSmrg      subroutine foo
63558bd17e5fSmrg      end]],
63568bd17e5fSmrg			      [Fortran], [[
63578bd17e5fSmrg      subroutine foo
63588bd17e5fSmrg      end]])])],
63598bd17e5fSmrg	      [lt_cv_irix_exported_symbol=yes],
63608bd17e5fSmrg	      [lt_cv_irix_exported_symbol=no])
63618bd17e5fSmrg           LDFLAGS="$save_LDFLAGS"])
63628bd17e5fSmrg	if test "$lt_cv_irix_exported_symbol" = yes; then
63638bd17e5fSmrg          _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'
63648bd17e5fSmrg	fi
63658bd17e5fSmrg      else
63668bd17e5fSmrg	_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'
63678bd17e5fSmrg	_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'
63688bd17e5fSmrg      fi
63698bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
63708bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
63718bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
63728bd17e5fSmrg      _LT_TAGVAR(inherit_rpath, $1)=yes
63738bd17e5fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
63748bd17e5fSmrg      ;;
6375b042e37fSmrg
63768bd17e5fSmrg    netbsd*)
63778bd17e5fSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
63788bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
63798bd17e5fSmrg      else
63808bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
63818bd17e5fSmrg      fi
63828bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
63838bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
63848bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
63858bd17e5fSmrg      ;;
63868c4a8e55Smrg
63878bd17e5fSmrg    newsos6)
63888bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
63898bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
63908bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
63918bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
63928bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
63938bd17e5fSmrg      ;;
63948c4a8e55Smrg
63958bd17e5fSmrg    *nto* | *qnx*)
63968bd17e5fSmrg      ;;
63978c4a8e55Smrg
63988bd17e5fSmrg    openbsd*)
63998bd17e5fSmrg      if test -f /usr/libexec/ld.so; then
64008bd17e5fSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
64018bd17e5fSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
64028bd17e5fSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
64038bd17e5fSmrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
64048bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
64058bd17e5fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
64068bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
64078bd17e5fSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
64088bd17e5fSmrg	else
64098bd17e5fSmrg	  case $host_os in
64108bd17e5fSmrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
64118bd17e5fSmrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
64128bd17e5fSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
64138bd17e5fSmrg	     ;;
64148bd17e5fSmrg	   *)
64158bd17e5fSmrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
64168bd17e5fSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
64178bd17e5fSmrg	     ;;
64188bd17e5fSmrg	  esac
64198bd17e5fSmrg	fi
64208bd17e5fSmrg      else
64218bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
64228bd17e5fSmrg      fi
64238bd17e5fSmrg      ;;
6424b042e37fSmrg
64258bd17e5fSmrg    os2*)
64268bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
64278bd17e5fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
64288bd17e5fSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
64298bd17e5fSmrg      _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'
64308bd17e5fSmrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
64318bd17e5fSmrg      ;;
6432b042e37fSmrg
64338bd17e5fSmrg    osf3*)
64348bd17e5fSmrg      if test "$GCC" = yes; then
64358bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
64368bd17e5fSmrg	_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'
64378bd17e5fSmrg      else
64388bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
64398bd17e5fSmrg	_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'
64408bd17e5fSmrg      fi
64418bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
64428bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
64438bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
64448bd17e5fSmrg      ;;
64450597fb56Smrg
64468bd17e5fSmrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
64478bd17e5fSmrg      if test "$GCC" = yes; then
64488bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
64498bd17e5fSmrg	_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'
64508bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
64518bd17e5fSmrg      else
64528bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
64538bd17e5fSmrg	_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'
64548bd17e5fSmrg	_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~
64558bd17e5fSmrg	$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'
64560597fb56Smrg
64578bd17e5fSmrg	# Both c and cxx compiler support -rpath directly
64588bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
64598bd17e5fSmrg      fi
64608bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
64618bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
64628bd17e5fSmrg      ;;
64630597fb56Smrg
64648bd17e5fSmrg    solaris*)
64658bd17e5fSmrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
64668bd17e5fSmrg      if test "$GCC" = yes; then
64678bd17e5fSmrg	wlarc='${wl}'
64688bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
64698bd17e5fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
64708bd17e5fSmrg	  $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'
64718bd17e5fSmrg      else
64728bd17e5fSmrg	case `$CC -V 2>&1` in
64738bd17e5fSmrg	*"Compilers 5.0"*)
64748bd17e5fSmrg	  wlarc=''
64758bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
64768bd17e5fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
64778bd17e5fSmrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
64788c4a8e55Smrg	  ;;
64790597fb56Smrg	*)
64808bd17e5fSmrg	  wlarc='${wl}'
64818bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
64828bd17e5fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
64838bd17e5fSmrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
64848c4a8e55Smrg	  ;;
64858bd17e5fSmrg	esac
64868bd17e5fSmrg      fi
64878bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
64888bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
64898bd17e5fSmrg      case $host_os in
64908bd17e5fSmrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
64918bd17e5fSmrg      *)
64928bd17e5fSmrg	# The compiler driver will combine and reorder linker options,
64938bd17e5fSmrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
64948bd17e5fSmrg	# but is careful enough not to reorder.
64958bd17e5fSmrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
64968bd17e5fSmrg	if test "$GCC" = yes; then
64978bd17e5fSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
64988bd17e5fSmrg	else
64998bd17e5fSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
65008bd17e5fSmrg	fi
65018bd17e5fSmrg	;;
65028c4a8e55Smrg      esac
65038bd17e5fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
65048c4a8e55Smrg      ;;
6505b042e37fSmrg
65068bd17e5fSmrg    sunos4*)
65078bd17e5fSmrg      if test "x$host_vendor" = xsequent; then
65088bd17e5fSmrg	# Use $CC to link under sequent, because it throws in some extra .o
65098bd17e5fSmrg	# files that make .init and .fini sections work.
65108bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
65118bd17e5fSmrg      else
65128bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
65138bd17e5fSmrg      fi
65148bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
65158bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
65168bd17e5fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
65178bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65188bd17e5fSmrg      ;;
6519b042e37fSmrg
65208bd17e5fSmrg    sysv4)
65218bd17e5fSmrg      case $host_vendor in
65228bd17e5fSmrg	sni)
65238bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
65248bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
65258bd17e5fSmrg	;;
65268bd17e5fSmrg	siemens)
65278bd17e5fSmrg	  ## LD is ld it makes a PLAMLIB
65288bd17e5fSmrg	  ## CC just makes a GrossModule.
65298bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
65308bd17e5fSmrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
65318bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
65328bd17e5fSmrg        ;;
65338bd17e5fSmrg	motorola)
65348bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
65358bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
65368bd17e5fSmrg	;;
65378bd17e5fSmrg      esac
65388bd17e5fSmrg      runpath_var='LD_RUN_PATH'
65398bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6540706b6b52Smrg      ;;
6541b042e37fSmrg
65428bd17e5fSmrg    sysv4.3*)
65438bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
65448bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65458bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
65468bd17e5fSmrg      ;;
65478c4a8e55Smrg
65488bd17e5fSmrg    sysv4*MP*)
65498bd17e5fSmrg      if test -d /usr/nec; then
65508bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
65518bd17e5fSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65528bd17e5fSmrg	runpath_var=LD_RUN_PATH
65538bd17e5fSmrg	hardcode_runpath_var=yes
65548bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
65558bd17e5fSmrg      fi
65568bd17e5fSmrg      ;;
65578c4a8e55Smrg
65588bd17e5fSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
65598bd17e5fSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
65608bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
65618bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65628bd17e5fSmrg      runpath_var='LD_RUN_PATH'
65630597fb56Smrg
65648bd17e5fSmrg      if test "$GCC" = yes; then
65658bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
65668bd17e5fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
65678bd17e5fSmrg      else
65688bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
65698bd17e5fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
65708bd17e5fSmrg      fi
65718bd17e5fSmrg      ;;
65720597fb56Smrg
65738bd17e5fSmrg    sysv5* | sco3.2v5* | sco5v6*)
65748bd17e5fSmrg      # Note: We can NOT use -z defs as we might desire, because we do not
65758bd17e5fSmrg      # link with -lc, and that would cause any symbols used from libc to
65768bd17e5fSmrg      # always be unresolved, which means just about no library would
65778bd17e5fSmrg      # ever link correctly.  If we're not using GNU ld we use -z text
65788bd17e5fSmrg      # though, which does catch some bad symbols but isn't as heavy-handed
65798bd17e5fSmrg      # as -z defs.
65808bd17e5fSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
65818bd17e5fSmrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
65828bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
65838bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65848bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
65858bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
65868bd17e5fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
65878bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
65888bd17e5fSmrg      runpath_var='LD_RUN_PATH'
65890597fb56Smrg
65908bd17e5fSmrg      if test "$GCC" = yes; then
65918bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
65928bd17e5fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
65938bd17e5fSmrg      else
65948bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
65958bd17e5fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
65968bd17e5fSmrg      fi
65978bd17e5fSmrg      ;;
65980597fb56Smrg
65998bd17e5fSmrg    uts4*)
66008bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
66018bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
66028bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
66038bd17e5fSmrg      ;;
66040597fb56Smrg
66058bd17e5fSmrg    *)
66068bd17e5fSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
66078bd17e5fSmrg      ;;
66088bd17e5fSmrg    esac
66090597fb56Smrg
66108bd17e5fSmrg    if test x$host_vendor = xsni; then
66118bd17e5fSmrg      case $host in
66128bd17e5fSmrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
66138bd17e5fSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
66148bd17e5fSmrg	;;
66158bd17e5fSmrg      esac
66168bd17e5fSmrg    fi
66178bd17e5fSmrg  fi
66188bd17e5fSmrg])
66198bd17e5fSmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
66208bd17e5fSmrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
66210597fb56Smrg
66228bd17e5fSmrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
66230597fb56Smrg
66248bd17e5fSmrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
66258bd17e5fSmrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
66268bd17e5fSmrg_LT_DECL([], [extract_expsyms_cmds], [2],
66278bd17e5fSmrg    [The commands to extract the exported symbol list from a shared archive])
66280597fb56Smrg
66298bd17e5fSmrg#
66308bd17e5fSmrg# Do we need to explicitly link libc?
66318bd17e5fSmrg#
66328bd17e5fSmrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
66338bd17e5fSmrgx|xyes)
66348bd17e5fSmrg  # Assume -lc should be added
66358bd17e5fSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
66360597fb56Smrg
66378bd17e5fSmrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
66388bd17e5fSmrg    case $_LT_TAGVAR(archive_cmds, $1) in
66398bd17e5fSmrg    *'~'*)
66408bd17e5fSmrg      # FIXME: we may have to deal with multi-command sequences.
66418bd17e5fSmrg      ;;
66428bd17e5fSmrg    '$CC '*)
66438bd17e5fSmrg      # Test whether the compiler implicitly links with -lc since on some
66448bd17e5fSmrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
66458bd17e5fSmrg      # to ld, don't add -lc before -lgcc.
66468bd17e5fSmrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
66478bd17e5fSmrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
66488bd17e5fSmrg	[$RM conftest*
66498bd17e5fSmrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
66500597fb56Smrg
66518bd17e5fSmrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
66528bd17e5fSmrg	  soname=conftest
66538bd17e5fSmrg	  lib=conftest
66548bd17e5fSmrg	  libobjs=conftest.$ac_objext
66558bd17e5fSmrg	  deplibs=
66568bd17e5fSmrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
66578bd17e5fSmrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
66588bd17e5fSmrg	  compiler_flags=-v
66598bd17e5fSmrg	  linker_flags=-v
66608bd17e5fSmrg	  verstring=
66618bd17e5fSmrg	  output_objdir=.
66628bd17e5fSmrg	  libname=conftest
66638bd17e5fSmrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
66648bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
66658bd17e5fSmrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
66668bd17e5fSmrg	  then
66678bd17e5fSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
66688bd17e5fSmrg	  else
66698bd17e5fSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
66708bd17e5fSmrg	  fi
66718bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
66728bd17e5fSmrg	else
66738bd17e5fSmrg	  cat conftest.err 1>&5
66748bd17e5fSmrg	fi
66758bd17e5fSmrg	$RM conftest*
66768bd17e5fSmrg	])
66778bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
66788bd17e5fSmrg      ;;
66798bd17e5fSmrg    esac
66808bd17e5fSmrg  fi
66818bd17e5fSmrg  ;;
66820597fb56Smrgesac
66830597fb56Smrg
66848bd17e5fSmrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
66858bd17e5fSmrg    [Whether or not to add -lc for building shared libraries])
66868bd17e5fSmrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
66878bd17e5fSmrg    [enable_shared_with_static_runtimes], [0],
66888bd17e5fSmrg    [Whether or not to disallow shared libs when runtime libs are static])
66898bd17e5fSmrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
66908bd17e5fSmrg    [Compiler flag to allow reflexive dlopens])
66918bd17e5fSmrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
66928bd17e5fSmrg    [Compiler flag to generate shared objects directly from archives])
66938bd17e5fSmrg_LT_TAGDECL([], [compiler_needs_object], [1],
66948bd17e5fSmrg    [Whether the compiler copes with passing no objects directly])
66958bd17e5fSmrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
66968bd17e5fSmrg    [Create an old-style archive from a shared archive])
66978bd17e5fSmrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
66988bd17e5fSmrg    [Create a temporary old-style archive to link instead of a shared archive])
66998bd17e5fSmrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
67008bd17e5fSmrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
67018bd17e5fSmrg_LT_TAGDECL([], [module_cmds], [2],
67028bd17e5fSmrg    [Commands used to build a loadable module if different from building
67038bd17e5fSmrg    a shared archive.])
67048bd17e5fSmrg_LT_TAGDECL([], [module_expsym_cmds], [2])
67058bd17e5fSmrg_LT_TAGDECL([], [with_gnu_ld], [1],
67068bd17e5fSmrg    [Whether we are building with GNU ld or not])
67078bd17e5fSmrg_LT_TAGDECL([], [allow_undefined_flag], [1],
67088bd17e5fSmrg    [Flag that allows shared libraries with undefined symbols to be built])
67098bd17e5fSmrg_LT_TAGDECL([], [no_undefined_flag], [1],
67108bd17e5fSmrg    [Flag that enforces no undefined symbols])
67118bd17e5fSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
67128bd17e5fSmrg    [Flag to hardcode $libdir into a binary during linking.
67138bd17e5fSmrg    This must work even if $libdir does not exist])
67148bd17e5fSmrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
67158bd17e5fSmrg    [Whether we need a single "-rpath" flag with a separated argument])
67168bd17e5fSmrg_LT_TAGDECL([], [hardcode_direct], [0],
67178bd17e5fSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
67188bd17e5fSmrg    DIR into the resulting binary])
67198bd17e5fSmrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
67208bd17e5fSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
67218bd17e5fSmrg    DIR into the resulting binary and the resulting library dependency is
67228bd17e5fSmrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
67238bd17e5fSmrg    library is relocated])
67248bd17e5fSmrg_LT_TAGDECL([], [hardcode_minus_L], [0],
67258bd17e5fSmrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
67268bd17e5fSmrg    into the resulting binary])
67278bd17e5fSmrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
67288bd17e5fSmrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
67298bd17e5fSmrg    into the resulting binary])
67308bd17e5fSmrg_LT_TAGDECL([], [hardcode_automatic], [0],
67318bd17e5fSmrg    [Set to "yes" if building a shared library automatically hardcodes DIR
67328bd17e5fSmrg    into the library and all subsequent libraries and executables linked
67338bd17e5fSmrg    against it])
67348bd17e5fSmrg_LT_TAGDECL([], [inherit_rpath], [0],
67358bd17e5fSmrg    [Set to yes if linker adds runtime paths of dependent libraries
67368bd17e5fSmrg    to runtime path list])
67378bd17e5fSmrg_LT_TAGDECL([], [link_all_deplibs], [0],
67388bd17e5fSmrg    [Whether libtool must link a program against all its dependency libraries])
67398bd17e5fSmrg_LT_TAGDECL([], [always_export_symbols], [0],
67408bd17e5fSmrg    [Set to "yes" if exported symbols are required])
67418bd17e5fSmrg_LT_TAGDECL([], [export_symbols_cmds], [2],
67428bd17e5fSmrg    [The commands to list exported symbols])
67438bd17e5fSmrg_LT_TAGDECL([], [exclude_expsyms], [1],
67448bd17e5fSmrg    [Symbols that should not be listed in the preloaded symbols])
67458bd17e5fSmrg_LT_TAGDECL([], [include_expsyms], [1],
67468bd17e5fSmrg    [Symbols that must always be exported])
67478bd17e5fSmrg_LT_TAGDECL([], [prelink_cmds], [2],
67488bd17e5fSmrg    [Commands necessary for linking programs (against libraries) with templates])
67498bd17e5fSmrg_LT_TAGDECL([], [postlink_cmds], [2],
67508bd17e5fSmrg    [Commands necessary for finishing linking programs])
67518bd17e5fSmrg_LT_TAGDECL([], [file_list_spec], [1],
67528bd17e5fSmrg    [Specify filename containing input files])
67538bd17e5fSmrgdnl FIXME: Not yet implemented
67548bd17e5fSmrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
67558bd17e5fSmrgdnl    [Compiler flag to generate thread safe objects])
67568bd17e5fSmrg])# _LT_LINKER_SHLIBS
6757b042e37fSmrg
6758b042e37fSmrg
67598bd17e5fSmrg# _LT_LANG_C_CONFIG([TAG])
67608bd17e5fSmrg# ------------------------
67618bd17e5fSmrg# Ensure that the configuration variables for a C compiler are suitably
67628bd17e5fSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
67638bd17e5fSmrg# the compiler configuration to `libtool'.
67648bd17e5fSmrgm4_defun([_LT_LANG_C_CONFIG],
67658bd17e5fSmrg[m4_require([_LT_DECL_EGREP])dnl
67668bd17e5fSmrglt_save_CC="$CC"
67678bd17e5fSmrgAC_LANG_PUSH(C)
6768b042e37fSmrg
67698bd17e5fSmrg# Source file extension for C test sources.
67708bd17e5fSmrgac_ext=c
6771b042e37fSmrg
67728bd17e5fSmrg# Object file extension for compiled C test sources.
67738bd17e5fSmrgobjext=o
67748bd17e5fSmrg_LT_TAGVAR(objext, $1)=$objext
6775bd23fbfaSmrg
67768bd17e5fSmrg# Code to be used in simple compile tests
67778bd17e5fSmrglt_simple_compile_test_code="int some_variable = 0;"
6778b042e37fSmrg
67798bd17e5fSmrg# Code to be used in simple link tests
67808bd17e5fSmrglt_simple_link_test_code='int main(){return(0);}'
6781b042e37fSmrg
67828bd17e5fSmrg_LT_TAG_COMPILER
67838bd17e5fSmrg# Save the default compiler, since it gets overwritten when the other
67848bd17e5fSmrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
67858bd17e5fSmrgcompiler_DEFAULT=$CC
6786b042e37fSmrg
67878bd17e5fSmrg# save warnings/boilerplate of simple test code
67888bd17e5fSmrg_LT_COMPILER_BOILERPLATE
67898bd17e5fSmrg_LT_LINKER_BOILERPLATE
6790b042e37fSmrg
67918bd17e5fSmrgif test -n "$compiler"; then
67928bd17e5fSmrg  _LT_COMPILER_NO_RTTI($1)
67938bd17e5fSmrg  _LT_COMPILER_PIC($1)
67948bd17e5fSmrg  _LT_COMPILER_C_O($1)
67958bd17e5fSmrg  _LT_COMPILER_FILE_LOCKS($1)
67968bd17e5fSmrg  _LT_LINKER_SHLIBS($1)
67978bd17e5fSmrg  _LT_SYS_DYNAMIC_LINKER($1)
67988bd17e5fSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
67998bd17e5fSmrg  LT_SYS_DLOPEN_SELF
68008bd17e5fSmrg  _LT_CMD_STRIPLIB
6801b042e37fSmrg
68028bd17e5fSmrg  # Report which library types will actually be built
68038bd17e5fSmrg  AC_MSG_CHECKING([if libtool supports shared libraries])
68048bd17e5fSmrg  AC_MSG_RESULT([$can_build_shared])
68050597fb56Smrg
68068bd17e5fSmrg  AC_MSG_CHECKING([whether to build shared libraries])
68078bd17e5fSmrg  test "$can_build_shared" = "no" && enable_shared=no
68080597fb56Smrg
68098bd17e5fSmrg  # On AIX, shared libraries and static libraries use the same namespace, and
68108bd17e5fSmrg  # are all built from PIC.
68118bd17e5fSmrg  case $host_os in
68128bd17e5fSmrg  aix3*)
68138bd17e5fSmrg    test "$enable_shared" = yes && enable_static=no
68148bd17e5fSmrg    if test -n "$RANLIB"; then
68158bd17e5fSmrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
68168bd17e5fSmrg      postinstall_cmds='$RANLIB $lib'
68178bd17e5fSmrg    fi
68188bd17e5fSmrg    ;;
68190597fb56Smrg
68208bd17e5fSmrg  aix[[4-9]]*)
68218bd17e5fSmrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
68228bd17e5fSmrg      test "$enable_shared" = yes && enable_static=no
68230597fb56Smrg    fi
6824706b6b52Smrg    ;;
6825706b6b52Smrg  esac
68268bd17e5fSmrg  AC_MSG_RESULT([$enable_shared])
6827b042e37fSmrg
68288bd17e5fSmrg  AC_MSG_CHECKING([whether to build static libraries])
68298bd17e5fSmrg  # Make sure either enable_shared or enable_static is yes.
68308bd17e5fSmrg  test "$enable_shared" = yes || enable_static=yes
68318bd17e5fSmrg  AC_MSG_RESULT([$enable_static])
68328bd17e5fSmrg
68338bd17e5fSmrg  _LT_CONFIG($1)
68340597fb56Smrgfi
68358bd17e5fSmrgAC_LANG_POP
68368bd17e5fSmrgCC="$lt_save_CC"
68378bd17e5fSmrg])# _LT_LANG_C_CONFIG
6838b042e37fSmrg
68390597fb56Smrg
68408bd17e5fSmrg# _LT_LANG_CXX_CONFIG([TAG])
68410597fb56Smrg# --------------------------
68428bd17e5fSmrg# Ensure that the configuration variables for a C++ compiler are suitably
68438bd17e5fSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
68448bd17e5fSmrg# the compiler configuration to `libtool'.
68458bd17e5fSmrgm4_defun([_LT_LANG_CXX_CONFIG],
68468bd17e5fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
68478bd17e5fSmrgm4_require([_LT_DECL_EGREP])dnl
68488bd17e5fSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
68498bd17e5fSmrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
68508bd17e5fSmrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
68518bd17e5fSmrg    (test "X$CXX" != "Xg++"))) ; then
68528bd17e5fSmrg  AC_PROG_CXXCPP
68538bd17e5fSmrgelse
68548bd17e5fSmrg  _lt_caught_CXX_error=yes
68550597fb56Smrgfi
68560597fb56Smrg
68578bd17e5fSmrgAC_LANG_PUSH(C++)
68580597fb56Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
68590597fb56Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
68600597fb56Smrg_LT_TAGVAR(always_export_symbols, $1)=no
68610597fb56Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
68628bd17e5fSmrg_LT_TAGVAR(compiler_needs_object, $1)=no
68630597fb56Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
68640597fb56Smrg_LT_TAGVAR(hardcode_direct, $1)=no
68650597fb56Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
68660597fb56Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
68670597fb56Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
68680597fb56Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
68698bd17e5fSmrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
68700597fb56Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
68710597fb56Smrg_LT_TAGVAR(inherit_rpath, $1)=no
68720597fb56Smrg_LT_TAGVAR(module_cmds, $1)=
68730597fb56Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
68740597fb56Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
68750597fb56Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
68760597fb56Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
68770597fb56Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
68780597fb56Smrg_LT_TAGVAR(no_undefined_flag, $1)=
68790597fb56Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
68800597fb56Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
68810597fb56Smrg
68828bd17e5fSmrg# Source file extension for C++ test sources.
68838bd17e5fSmrgac_ext=cpp
68840597fb56Smrg
68858bd17e5fSmrg# Object file extension for compiled C++ test sources.
68860597fb56Smrgobjext=o
68870597fb56Smrg_LT_TAGVAR(objext, $1)=$objext
68880597fb56Smrg
68890597fb56Smrg# No sense in running all these tests if we already determined that
68908bd17e5fSmrg# the CXX compiler isn't working.  Some variables (like enable_shared)
68910597fb56Smrg# are currently assumed to apply to all compilers on this platform,
68920597fb56Smrg# and will be corrupted by setting them based on a non-working compiler.
68938bd17e5fSmrgif test "$_lt_caught_CXX_error" != yes; then
68940597fb56Smrg  # Code to be used in simple compile tests
68958bd17e5fSmrg  lt_simple_compile_test_code="int some_variable = 0;"
68960597fb56Smrg
68970597fb56Smrg  # Code to be used in simple link tests
68988bd17e5fSmrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
68990597fb56Smrg
69000597fb56Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
69010597fb56Smrg  _LT_TAG_COMPILER
69020597fb56Smrg
69030597fb56Smrg  # save warnings/boilerplate of simple test code
69040597fb56Smrg  _LT_COMPILER_BOILERPLATE
69050597fb56Smrg  _LT_LINKER_BOILERPLATE
69060597fb56Smrg
69070597fb56Smrg  # Allow CC to be a program name with arguments.
69088bd17e5fSmrg  lt_save_CC=$CC
69090597fb56Smrg  lt_save_CFLAGS=$CFLAGS
69108bd17e5fSmrg  lt_save_LD=$LD
69118bd17e5fSmrg  lt_save_GCC=$GCC
69128bd17e5fSmrg  GCC=$GXX
69138bd17e5fSmrg  lt_save_with_gnu_ld=$with_gnu_ld
69148bd17e5fSmrg  lt_save_path_LD=$lt_cv_path_LD
69158bd17e5fSmrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
69168bd17e5fSmrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
69178bd17e5fSmrg  else
69188bd17e5fSmrg    $as_unset lt_cv_prog_gnu_ld
69198bd17e5fSmrg  fi
69208bd17e5fSmrg  if test -n "${lt_cv_path_LDCXX+set}"; then
69218bd17e5fSmrg    lt_cv_path_LD=$lt_cv_path_LDCXX
69228bd17e5fSmrg  else
69238bd17e5fSmrg    $as_unset lt_cv_path_LD
69248bd17e5fSmrg  fi
69258bd17e5fSmrg  test -z "${LDCXX+set}" || LD=$LDCXX
69268bd17e5fSmrg  CC=${CXX-"c++"}
69278bd17e5fSmrg  CFLAGS=$CXXFLAGS
69280597fb56Smrg  compiler=$CC
69290597fb56Smrg  _LT_TAGVAR(compiler, $1)=$CC
69300597fb56Smrg  _LT_CC_BASENAME([$compiler])
69318c4a8e55Smrg
69328bd17e5fSmrg  if test -n "$compiler"; then
69338bd17e5fSmrg    # We don't want -fno-exception when compiling C++ code, so set the
69348bd17e5fSmrg    # no_builtin_flag separately
69358bd17e5fSmrg    if test "$GXX" = yes; then
69368bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
69378bd17e5fSmrg    else
69388bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
69398bd17e5fSmrg    fi
69408c4a8e55Smrg
69418bd17e5fSmrg    if test "$GXX" = yes; then
69428bd17e5fSmrg      # Set up default GNU C++ configuration
6943b042e37fSmrg
69448bd17e5fSmrg      LT_PATH_LD
69458c4a8e55Smrg
69468bd17e5fSmrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
69478bd17e5fSmrg      # archiving commands below assume that GNU ld is being used.
69488bd17e5fSmrg      if test "$with_gnu_ld" = yes; then
69498bd17e5fSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
69508bd17e5fSmrg        _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'
69518c4a8e55Smrg
69528bd17e5fSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
69538bd17e5fSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6954b042e37fSmrg
69558bd17e5fSmrg        # If archive_cmds runs LD, not CC, wlarc should be empty
69568bd17e5fSmrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
69578bd17e5fSmrg        #     investigate it a little bit more. (MM)
69588bd17e5fSmrg        wlarc='${wl}'
6959b042e37fSmrg
69608bd17e5fSmrg        # ancient GNU ld didn't support --whole-archive et. al.
69618bd17e5fSmrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
69628bd17e5fSmrg	  $GREP 'no-whole-archive' > /dev/null; then
69638bd17e5fSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
69648bd17e5fSmrg        else
69658bd17e5fSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
69668bd17e5fSmrg        fi
69678bd17e5fSmrg      else
69688bd17e5fSmrg        with_gnu_ld=no
69698bd17e5fSmrg        wlarc=
6970b042e37fSmrg
69718bd17e5fSmrg        # A generic and very simple default shared library creation
69728bd17e5fSmrg        # command for GNU C++ for the case where it uses the native
69738bd17e5fSmrg        # linker, instead of GNU ld.  If possible, this setting should
69748bd17e5fSmrg        # overridden to take advantage of the native linker features on
69758bd17e5fSmrg        # the platform it is being used on.
69768bd17e5fSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
69778bd17e5fSmrg      fi
6978b042e37fSmrg
69798bd17e5fSmrg      # Commands to make compiler produce verbose output that lists
69808bd17e5fSmrg      # what "hidden" libraries, object files and flags are used when
69818bd17e5fSmrg      # linking a shared library.
69828bd17e5fSmrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6983b042e37fSmrg
69848bd17e5fSmrg    else
69858bd17e5fSmrg      GXX=no
69868bd17e5fSmrg      with_gnu_ld=no
69878bd17e5fSmrg      wlarc=
69888bd17e5fSmrg    fi
6989b042e37fSmrg
69908bd17e5fSmrg    # PORTME: fill in a description of your system's C++ link characteristics
69918bd17e5fSmrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
69928bd17e5fSmrg    _LT_TAGVAR(ld_shlibs, $1)=yes
69930597fb56Smrg    case $host_os in
69940597fb56Smrg      aix3*)
69958bd17e5fSmrg        # FIXME: insert proper C++ library support
69968bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
69970597fb56Smrg        ;;
69980597fb56Smrg      aix[[4-9]]*)
69998bd17e5fSmrg        if test "$host_cpu" = ia64; then
70008bd17e5fSmrg          # On IA64, the linker does run time linking by default, so we don't
70018bd17e5fSmrg          # have to do anything special.
70028bd17e5fSmrg          aix_use_runtimelinking=no
70038bd17e5fSmrg          exp_sym_flag='-Bexport'
70048bd17e5fSmrg          no_entry_flag=""
70058bd17e5fSmrg        else
70068bd17e5fSmrg          aix_use_runtimelinking=no
7007b042e37fSmrg
70088bd17e5fSmrg          # Test if we are trying to use run time linking or normal
70098bd17e5fSmrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
70108bd17e5fSmrg          # need to do runtime linking.
70118bd17e5fSmrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
70128bd17e5fSmrg	    for ld_flag in $LDFLAGS; do
70138bd17e5fSmrg	      case $ld_flag in
70148bd17e5fSmrg	      *-brtl*)
70158bd17e5fSmrg	        aix_use_runtimelinking=yes
70168bd17e5fSmrg	        break
70178bd17e5fSmrg	        ;;
70188bd17e5fSmrg	      esac
70198bd17e5fSmrg	    done
70208bd17e5fSmrg	    ;;
70218bd17e5fSmrg          esac
7022b042e37fSmrg
70238bd17e5fSmrg          exp_sym_flag='-bexport'
70248bd17e5fSmrg          no_entry_flag='-bnoentry'
70258bd17e5fSmrg        fi
7026b042e37fSmrg
70278bd17e5fSmrg        # When large executables or shared objects are built, AIX ld can
70288bd17e5fSmrg        # have problems creating the table of contents.  If linking a library
70298bd17e5fSmrg        # or program results in "error TOC overflow" add -mminimal-toc to
70308bd17e5fSmrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
70318bd17e5fSmrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
7032b042e37fSmrg
70338bd17e5fSmrg        _LT_TAGVAR(archive_cmds, $1)=''
70348bd17e5fSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
70358bd17e5fSmrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
70368bd17e5fSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
70378bd17e5fSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
70388bd17e5fSmrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
7039b042e37fSmrg
70408bd17e5fSmrg        if test "$GXX" = yes; then
70418bd17e5fSmrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
70428bd17e5fSmrg          # We only want to do this on AIX 4.2 and lower, the check
70438bd17e5fSmrg          # below for broken collect2 doesn't work under 4.3+
70448bd17e5fSmrg	  collect2name=`${CC} -print-prog-name=collect2`
70458bd17e5fSmrg	  if test -f "$collect2name" &&
70468bd17e5fSmrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
70478bd17e5fSmrg	  then
70488bd17e5fSmrg	    # We have reworked collect2
70498bd17e5fSmrg	    :
70508bd17e5fSmrg	  else
70518bd17e5fSmrg	    # We have old collect2
70528bd17e5fSmrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
70538bd17e5fSmrg	    # It fails to find uninstalled libraries when the uninstalled
70548bd17e5fSmrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
70558bd17e5fSmrg	    # to unsupported forces relinking
70568bd17e5fSmrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
70578bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
70588bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
70598bd17e5fSmrg	  fi
70608bd17e5fSmrg          esac
70618bd17e5fSmrg          shared_flag='-shared'
70628bd17e5fSmrg	  if test "$aix_use_runtimelinking" = yes; then
70638bd17e5fSmrg	    shared_flag="$shared_flag "'${wl}-G'
70648bd17e5fSmrg	  fi
70658bd17e5fSmrg        else
70668bd17e5fSmrg          # not using gcc
70678bd17e5fSmrg          if test "$host_cpu" = ia64; then
70688bd17e5fSmrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
70698bd17e5fSmrg	  # chokes on -Wl,-G. The following line is correct:
70708bd17e5fSmrg	  shared_flag='-G'
70718bd17e5fSmrg          else
70728bd17e5fSmrg	    if test "$aix_use_runtimelinking" = yes; then
70738bd17e5fSmrg	      shared_flag='${wl}-G'
70748bd17e5fSmrg	    else
70758bd17e5fSmrg	      shared_flag='${wl}-bM:SRE'
70768bd17e5fSmrg	    fi
70778bd17e5fSmrg          fi
70788bd17e5fSmrg        fi
7079706b6b52Smrg
70808bd17e5fSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
70818bd17e5fSmrg        # It seems that -bexpall does not export symbols beginning with
70828bd17e5fSmrg        # underscore (_), so it is better to generate a list of symbols to
70838bd17e5fSmrg	# export.
70848bd17e5fSmrg        _LT_TAGVAR(always_export_symbols, $1)=yes
70858bd17e5fSmrg        if test "$aix_use_runtimelinking" = yes; then
70868bd17e5fSmrg          # Warning - without using the other runtime loading flags (-brtl),
70878bd17e5fSmrg          # -berok will link without error, but may produce a broken library.
70888bd17e5fSmrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
70898bd17e5fSmrg          # Determine the default libpath from the value encoded in an empty
70908bd17e5fSmrg          # executable.
70918bd17e5fSmrg          _LT_SYS_MODULE_PATH_AIX([$1])
70928bd17e5fSmrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
70938c4a8e55Smrg
70948bd17e5fSmrg          _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"
70958bd17e5fSmrg        else
70968bd17e5fSmrg          if test "$host_cpu" = ia64; then
70978bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
70988bd17e5fSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
70998bd17e5fSmrg	    _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"
71008bd17e5fSmrg          else
71018bd17e5fSmrg	    # Determine the default libpath from the value encoded in an
71028bd17e5fSmrg	    # empty executable.
71038bd17e5fSmrg	    _LT_SYS_MODULE_PATH_AIX([$1])
71048bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
71058bd17e5fSmrg	    # Warning - without using the other run time loading flags,
71068bd17e5fSmrg	    # -berok will link without error, but may produce a broken library.
71078bd17e5fSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
71088bd17e5fSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
71098bd17e5fSmrg	    if test "$with_gnu_ld" = yes; then
71108bd17e5fSmrg	      # We only use this code for GNU lds that support --whole-archive.
71118bd17e5fSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
71128bd17e5fSmrg	    else
71138bd17e5fSmrg	      # Exported symbols can be pulled into shared objects from archives
71148bd17e5fSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
71158bd17e5fSmrg	    fi
71168bd17e5fSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
71178bd17e5fSmrg	    # This is similar to how AIX traditionally builds its shared
71188bd17e5fSmrg	    # libraries.
71198bd17e5fSmrg	    _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'
71208bd17e5fSmrg          fi
71218bd17e5fSmrg        fi
71228bd17e5fSmrg        ;;
71238c4a8e55Smrg
71248bd17e5fSmrg      beos*)
71258bd17e5fSmrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
71268bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
71278bd17e5fSmrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
71288bd17e5fSmrg	  # support --undefined.  This deserves some investigation.  FIXME
71298bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
71308bd17e5fSmrg	else
71318bd17e5fSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
71328bd17e5fSmrg	fi
71338bd17e5fSmrg	;;
71348c4a8e55Smrg
71358bd17e5fSmrg      chorus*)
71368bd17e5fSmrg        case $cc_basename in
71378bd17e5fSmrg          *)
71388bd17e5fSmrg	  # FIXME: insert proper C++ library support
71398bd17e5fSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
71408bd17e5fSmrg	  ;;
71418bd17e5fSmrg        esac
71428bd17e5fSmrg        ;;
71438c4a8e55Smrg
71448bd17e5fSmrg      cygwin* | mingw* | pw32* | cegcc*)
71458bd17e5fSmrg	case $GXX,$cc_basename in
71468bd17e5fSmrg	,cl* | no,cl*)
71478bd17e5fSmrg	  # Native MSVC
71488bd17e5fSmrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
71498bd17e5fSmrg	  # no search path for DLLs.
71508bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
71518bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
71528bd17e5fSmrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
71538bd17e5fSmrg	  _LT_TAGVAR(file_list_spec, $1)='@'
71548bd17e5fSmrg	  # Tell ltmain to make .lib files, not .a files.
71558bd17e5fSmrg	  libext=lib
71568bd17e5fSmrg	  # Tell ltmain to make .dll files, not .so files.
71578bd17e5fSmrg	  shrext_cmds=".dll"
71588bd17e5fSmrg	  # FIXME: Setting linknames here is a bad hack.
71598bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
71608bd17e5fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
71618bd17e5fSmrg	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
71628bd17e5fSmrg	    else
71638bd17e5fSmrg	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
71648bd17e5fSmrg	    fi~
71658bd17e5fSmrg	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
71668bd17e5fSmrg	    linknames='
71678bd17e5fSmrg	  # The linker will not automatically build a static lib if we build a DLL.
71688bd17e5fSmrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
71698bd17e5fSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
71708bd17e5fSmrg	  # Don't use ranlib
71718bd17e5fSmrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
71728bd17e5fSmrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
71738bd17e5fSmrg	    lt_tool_outputfile="@TOOL_OUTPUT@"~
71748bd17e5fSmrg	    case $lt_outputfile in
71758bd17e5fSmrg	      *.exe|*.EXE) ;;
71768bd17e5fSmrg	      *)
71778bd17e5fSmrg		lt_outputfile="$lt_outputfile.exe"
71788bd17e5fSmrg		lt_tool_outputfile="$lt_tool_outputfile.exe"
71798bd17e5fSmrg		;;
71808bd17e5fSmrg	    esac~
71818bd17e5fSmrg	    func_to_tool_file "$lt_outputfile"~
71828bd17e5fSmrg	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
71838bd17e5fSmrg	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
71848bd17e5fSmrg	      $RM "$lt_outputfile.manifest";
71858bd17e5fSmrg	    fi'
71868bd17e5fSmrg	  ;;
71878bd17e5fSmrg	*)
71888bd17e5fSmrg	  # g++
71898bd17e5fSmrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
71908bd17e5fSmrg	  # as there is no search path for DLLs.
71918bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
71928bd17e5fSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
71938bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
71948bd17e5fSmrg	  _LT_TAGVAR(always_export_symbols, $1)=no
71958bd17e5fSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
71968c4a8e55Smrg
71978bd17e5fSmrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
71988bd17e5fSmrg	    _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'
71998bd17e5fSmrg	    # If the export-symbols file already is a .def file (1st line
72008bd17e5fSmrg	    # is EXPORTS), use it as is; otherwise, prepend...
72018bd17e5fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
72028bd17e5fSmrg	      cp $export_symbols $output_objdir/$soname.def;
72038bd17e5fSmrg	    else
72048bd17e5fSmrg	      echo EXPORTS > $output_objdir/$soname.def;
72058bd17e5fSmrg	      cat $export_symbols >> $output_objdir/$soname.def;
72068bd17e5fSmrg	    fi~
72078bd17e5fSmrg	    $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'
72088bd17e5fSmrg	  else
72098bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72108bd17e5fSmrg	  fi
72118bd17e5fSmrg	  ;;
72128bd17e5fSmrg	esac
72138bd17e5fSmrg	;;
72148bd17e5fSmrg      darwin* | rhapsody*)
72158bd17e5fSmrg        _LT_DARWIN_LINKER_FEATURES($1)
72168bd17e5fSmrg	;;
7217b042e37fSmrg
72188bd17e5fSmrg      dgux*)
72198bd17e5fSmrg        case $cc_basename in
72208bd17e5fSmrg          ec++*)
72218bd17e5fSmrg	    # FIXME: insert proper C++ library support
72228bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72238bd17e5fSmrg	    ;;
72248bd17e5fSmrg          ghcx*)
72258bd17e5fSmrg	    # Green Hills C++ Compiler
72268bd17e5fSmrg	    # FIXME: insert proper C++ library support
72278bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72288bd17e5fSmrg	    ;;
72298bd17e5fSmrg          *)
72308bd17e5fSmrg	    # FIXME: insert proper C++ library support
72318bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72328bd17e5fSmrg	    ;;
72338bd17e5fSmrg        esac
72348bd17e5fSmrg        ;;
72358c4a8e55Smrg
72368bd17e5fSmrg      freebsd2.*)
72378bd17e5fSmrg        # C++ shared libraries reported to be fairly broken before
72388bd17e5fSmrg	# switch to ELF
72398bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
72408bd17e5fSmrg        ;;
72418c4a8e55Smrg
72428bd17e5fSmrg      freebsd-elf*)
72438bd17e5fSmrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
72448bd17e5fSmrg        ;;
7245b042e37fSmrg
72468bd17e5fSmrg      freebsd* | dragonfly*)
72478bd17e5fSmrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
72488bd17e5fSmrg        # conventions
72498bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
72508bd17e5fSmrg        ;;
7251b042e37fSmrg
72528bd17e5fSmrg      gnu*)
72538bd17e5fSmrg        ;;
7254b042e37fSmrg
72558bd17e5fSmrg      haiku*)
72568bd17e5fSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
72578bd17e5fSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
72588bd17e5fSmrg        ;;
72598c4a8e55Smrg
72608bd17e5fSmrg      hpux9*)
72618bd17e5fSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
72628bd17e5fSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
72638bd17e5fSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
72648bd17e5fSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
72658bd17e5fSmrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
72668bd17e5fSmrg				             # but as the default
72678bd17e5fSmrg				             # location of the library.
72688c4a8e55Smrg
72698bd17e5fSmrg        case $cc_basename in
72708bd17e5fSmrg          CC*)
72718bd17e5fSmrg            # FIXME: insert proper C++ library support
72728bd17e5fSmrg            _LT_TAGVAR(ld_shlibs, $1)=no
72738bd17e5fSmrg            ;;
72748bd17e5fSmrg          aCC*)
72758bd17e5fSmrg            _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'
72768bd17e5fSmrg            # Commands to make compiler produce verbose output that lists
72778bd17e5fSmrg            # what "hidden" libraries, object files and flags are used when
72788bd17e5fSmrg            # linking a shared library.
72798bd17e5fSmrg            #
72808bd17e5fSmrg            # There doesn't appear to be a way to prevent this compiler from
72818bd17e5fSmrg            # explicitly linking system object files so we need to strip them
72828bd17e5fSmrg            # from the output so that they don't get included in the library
72838bd17e5fSmrg            # dependencies.
72848bd17e5fSmrg            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"'
72858bd17e5fSmrg            ;;
72868bd17e5fSmrg          *)
72878bd17e5fSmrg            if test "$GXX" = yes; then
72888bd17e5fSmrg              _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'
72898bd17e5fSmrg            else
72908bd17e5fSmrg              # FIXME: insert proper C++ library support
72918bd17e5fSmrg              _LT_TAGVAR(ld_shlibs, $1)=no
72928bd17e5fSmrg            fi
72938bd17e5fSmrg            ;;
72948bd17e5fSmrg        esac
72958bd17e5fSmrg        ;;
72968c4a8e55Smrg
72978bd17e5fSmrg      hpux10*|hpux11*)
72988bd17e5fSmrg        if test $with_gnu_ld = no; then
72998bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
73008bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
73018c4a8e55Smrg
73028bd17e5fSmrg          case $host_cpu in
73038bd17e5fSmrg            hppa*64*|ia64*)
73048bd17e5fSmrg              ;;
73058bd17e5fSmrg            *)
73068bd17e5fSmrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
73078bd17e5fSmrg              ;;
73088bd17e5fSmrg          esac
73098bd17e5fSmrg        fi
73108bd17e5fSmrg        case $host_cpu in
73118bd17e5fSmrg          hppa*64*|ia64*)
73128bd17e5fSmrg            _LT_TAGVAR(hardcode_direct, $1)=no
73138bd17e5fSmrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
73148bd17e5fSmrg            ;;
73158bd17e5fSmrg          *)
73168bd17e5fSmrg            _LT_TAGVAR(hardcode_direct, $1)=yes
73178bd17e5fSmrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
73188bd17e5fSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
73198bd17e5fSmrg					         # but as the default
73208bd17e5fSmrg					         # location of the library.
73218bd17e5fSmrg            ;;
73228bd17e5fSmrg        esac
7323706b6b52Smrg
73248bd17e5fSmrg        case $cc_basename in
73258bd17e5fSmrg          CC*)
73268bd17e5fSmrg	    # FIXME: insert proper C++ library support
73278bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
73288bd17e5fSmrg	    ;;
73298bd17e5fSmrg          aCC*)
73308bd17e5fSmrg	    case $host_cpu in
73318bd17e5fSmrg	      hppa*64*)
73328bd17e5fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
73338bd17e5fSmrg	        ;;
73348bd17e5fSmrg	      ia64*)
73358bd17e5fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
73368bd17e5fSmrg	        ;;
73378bd17e5fSmrg	      *)
73388bd17e5fSmrg	        _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'
73398bd17e5fSmrg	        ;;
73408bd17e5fSmrg	    esac
73418bd17e5fSmrg	    # Commands to make compiler produce verbose output that lists
73428bd17e5fSmrg	    # what "hidden" libraries, object files and flags are used when
73438bd17e5fSmrg	    # linking a shared library.
73448bd17e5fSmrg	    #
73458bd17e5fSmrg	    # There doesn't appear to be a way to prevent this compiler from
73468bd17e5fSmrg	    # explicitly linking system object files so we need to strip them
73478bd17e5fSmrg	    # from the output so that they don't get included in the library
73488bd17e5fSmrg	    # dependencies.
73498bd17e5fSmrg	    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"'
73508bd17e5fSmrg	    ;;
73518bd17e5fSmrg          *)
73528bd17e5fSmrg	    if test "$GXX" = yes; then
73538bd17e5fSmrg	      if test $with_gnu_ld = no; then
73548bd17e5fSmrg	        case $host_cpu in
73558bd17e5fSmrg	          hppa*64*)
73568bd17e5fSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
73578bd17e5fSmrg	            ;;
73588bd17e5fSmrg	          ia64*)
73598bd17e5fSmrg	            _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'
73608bd17e5fSmrg	            ;;
73618bd17e5fSmrg	          *)
73628bd17e5fSmrg	            _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'
73638bd17e5fSmrg	            ;;
73648bd17e5fSmrg	        esac
73658bd17e5fSmrg	      fi
73668bd17e5fSmrg	    else
73678bd17e5fSmrg	      # FIXME: insert proper C++ library support
73688bd17e5fSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
73698bd17e5fSmrg	    fi
73708bd17e5fSmrg	    ;;
73718bd17e5fSmrg        esac
73728bd17e5fSmrg        ;;
7373b042e37fSmrg
73748bd17e5fSmrg      interix[[3-9]]*)
73758bd17e5fSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
73768bd17e5fSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
73778bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
73788bd17e5fSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
73798bd17e5fSmrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
73808bd17e5fSmrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
73818bd17e5fSmrg	# default) and relocated if they conflict, which is a slow very memory
73828bd17e5fSmrg	# consuming and fragmenting process.  To avoid this, we pick a random,
73838bd17e5fSmrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
73848bd17e5fSmrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
73858bd17e5fSmrg	_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'
73868bd17e5fSmrg	_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'
73878bd17e5fSmrg	;;
73888bd17e5fSmrg      irix5* | irix6*)
73898bd17e5fSmrg        case $cc_basename in
73908bd17e5fSmrg          CC*)
73918bd17e5fSmrg	    # SGI C++
73928bd17e5fSmrg	    _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'
73938c4a8e55Smrg
73948bd17e5fSmrg	    # Archives containing C++ object files must be created using
73958bd17e5fSmrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
73968bd17e5fSmrg	    # necessary to make sure instantiated templates are included
73978bd17e5fSmrg	    # in the archive.
73988bd17e5fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
73998bd17e5fSmrg	    ;;
74008bd17e5fSmrg          *)
74018bd17e5fSmrg	    if test "$GXX" = yes; then
74028bd17e5fSmrg	      if test "$with_gnu_ld" = no; then
74038bd17e5fSmrg	        _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'
74048bd17e5fSmrg	      else
74058bd17e5fSmrg	        _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'
74068bd17e5fSmrg	      fi
74078bd17e5fSmrg	    fi
74088bd17e5fSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
74098bd17e5fSmrg	    ;;
74108bd17e5fSmrg        esac
74118bd17e5fSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
74128bd17e5fSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
74138bd17e5fSmrg        _LT_TAGVAR(inherit_rpath, $1)=yes
74148bd17e5fSmrg        ;;
74158c4a8e55Smrg
74168bd17e5fSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
74178bd17e5fSmrg        case $cc_basename in
74188bd17e5fSmrg          KCC*)
74198bd17e5fSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
74208c4a8e55Smrg
74218bd17e5fSmrg	    # KCC will only create a shared library if the output file
74228bd17e5fSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
74238bd17e5fSmrg	    # to its proper name (with version) after linking.
74248bd17e5fSmrg	    _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'
74258bd17e5fSmrg	    _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'
74268bd17e5fSmrg	    # Commands to make compiler produce verbose output that lists
74278bd17e5fSmrg	    # what "hidden" libraries, object files and flags are used when
74288bd17e5fSmrg	    # linking a shared library.
74298bd17e5fSmrg	    #
74308bd17e5fSmrg	    # There doesn't appear to be a way to prevent this compiler from
74318bd17e5fSmrg	    # explicitly linking system object files so we need to strip them
74328bd17e5fSmrg	    # from the output so that they don't get included in the library
74338bd17e5fSmrg	    # dependencies.
74348bd17e5fSmrg	    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"'
74358c4a8e55Smrg
74368bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
74378bd17e5fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
74388c4a8e55Smrg
74398bd17e5fSmrg	    # Archives containing C++ object files must be created using
74408bd17e5fSmrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
74418bd17e5fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
74428bd17e5fSmrg	    ;;
74438bd17e5fSmrg	  icpc* | ecpc* )
74448bd17e5fSmrg	    # Intel C++
74458bd17e5fSmrg	    with_gnu_ld=yes
74468bd17e5fSmrg	    # version 8.0 and above of icpc choke on multiply defined symbols
74478bd17e5fSmrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
74488bd17e5fSmrg	    # earlier do not add the objects themselves.
74498bd17e5fSmrg	    case `$CC -V 2>&1` in
74508bd17e5fSmrg	      *"Version 7."*)
74518bd17e5fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
74528bd17e5fSmrg		_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'
74538bd17e5fSmrg		;;
74548bd17e5fSmrg	      *)  # Version 8.0 or newer
74558bd17e5fSmrg	        tmp_idyn=
74568bd17e5fSmrg	        case $host_cpu in
74578bd17e5fSmrg		  ia64*) tmp_idyn=' -i_dynamic';;
74588bd17e5fSmrg		esac
74598bd17e5fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
74608bd17e5fSmrg		_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'
74618bd17e5fSmrg		;;
74628bd17e5fSmrg	    esac
74638bd17e5fSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
74648bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
74658bd17e5fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
74668bd17e5fSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
74678bd17e5fSmrg	    ;;
74688bd17e5fSmrg          pgCC* | pgcpp*)
74698bd17e5fSmrg            # Portland Group C++ compiler
74708bd17e5fSmrg	    case `$CC -V` in
74718bd17e5fSmrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
74728bd17e5fSmrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
74738bd17e5fSmrg		rm -rf $tpldir~
74748bd17e5fSmrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
74758bd17e5fSmrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
74768bd17e5fSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
74778bd17e5fSmrg		rm -rf $tpldir~
74788bd17e5fSmrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
74798bd17e5fSmrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
74808bd17e5fSmrg		$RANLIB $oldlib'
74818bd17e5fSmrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
74828bd17e5fSmrg		rm -rf $tpldir~
74838bd17e5fSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
74848bd17e5fSmrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
74858bd17e5fSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
74868bd17e5fSmrg		rm -rf $tpldir~
74878bd17e5fSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
74888bd17e5fSmrg		$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'
74898bd17e5fSmrg	      ;;
74908bd17e5fSmrg	    *) # Version 6 and above use weak symbols
74918bd17e5fSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
74928bd17e5fSmrg	      _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'
74938bd17e5fSmrg	      ;;
74948bd17e5fSmrg	    esac
74958c4a8e55Smrg
74968bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
74978bd17e5fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
74988bd17e5fSmrg	    _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'
74998bd17e5fSmrg            ;;
75008bd17e5fSmrg	  cxx*)
75018bd17e5fSmrg	    # Compaq C++
75028bd17e5fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
75038bd17e5fSmrg	    _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'
75048c4a8e55Smrg
75058bd17e5fSmrg	    runpath_var=LD_RUN_PATH
75068bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
75078bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7508706b6b52Smrg
75098bd17e5fSmrg	    # Commands to make compiler produce verbose output that lists
75108bd17e5fSmrg	    # what "hidden" libraries, object files and flags are used when
75118bd17e5fSmrg	    # linking a shared library.
75128bd17e5fSmrg	    #
75138bd17e5fSmrg	    # There doesn't appear to be a way to prevent this compiler from
75148bd17e5fSmrg	    # explicitly linking system object files so we need to strip them
75158bd17e5fSmrg	    # from the output so that they don't get included in the library
75168bd17e5fSmrg	    # dependencies.
75178bd17e5fSmrg	    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'
75188bd17e5fSmrg	    ;;
75198bd17e5fSmrg	  xl* | mpixl* | bgxl*)
75208bd17e5fSmrg	    # IBM XL 8.0 on PPC, with GNU ld
75218bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
75228bd17e5fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
75238bd17e5fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
75248bd17e5fSmrg	    if test "x$supports_anon_versioning" = xyes; then
75258bd17e5fSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
75268bd17e5fSmrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
75278bd17e5fSmrg		echo "local: *; };" >> $output_objdir/$libname.ver~
75288bd17e5fSmrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
75298bd17e5fSmrg	    fi
75308bd17e5fSmrg	    ;;
75318bd17e5fSmrg	  *)
75328bd17e5fSmrg	    case `$CC -V 2>&1 | sed 5q` in
75338bd17e5fSmrg	    *Sun\ C*)
75348bd17e5fSmrg	      # Sun C++ 5.9
75358bd17e5fSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
75368bd17e5fSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
75378bd17e5fSmrg	      _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'
75388bd17e5fSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
75398bd17e5fSmrg	      _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'
75408bd17e5fSmrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
7541706b6b52Smrg
75428bd17e5fSmrg	      # Not sure whether something based on
75438bd17e5fSmrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
75448bd17e5fSmrg	      # would be better.
75458bd17e5fSmrg	      output_verbose_link_cmd='func_echo_all'
75468c4a8e55Smrg
75478bd17e5fSmrg	      # Archives containing C++ object files must be created using
75488bd17e5fSmrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
75498bd17e5fSmrg	      # necessary to make sure instantiated templates are included
75508bd17e5fSmrg	      # in the archive.
75518bd17e5fSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
75528bd17e5fSmrg	      ;;
75538bd17e5fSmrg	    esac
75548bd17e5fSmrg	    ;;
75558bd17e5fSmrg	esac
75568bd17e5fSmrg	;;
75578c4a8e55Smrg
75588bd17e5fSmrg      lynxos*)
75598bd17e5fSmrg        # FIXME: insert proper C++ library support
75608bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
75618bd17e5fSmrg	;;
75628c4a8e55Smrg
75638bd17e5fSmrg      m88k*)
75648bd17e5fSmrg        # FIXME: insert proper C++ library support
75658bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
75668bd17e5fSmrg	;;
75678c4a8e55Smrg
75688bd17e5fSmrg      mvs*)
75698bd17e5fSmrg        case $cc_basename in
75708bd17e5fSmrg          cxx*)
75718bd17e5fSmrg	    # FIXME: insert proper C++ library support
75728bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
75738bd17e5fSmrg	    ;;
75748bd17e5fSmrg	  *)
75758bd17e5fSmrg	    # FIXME: insert proper C++ library support
75768bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
75778bd17e5fSmrg	    ;;
75788bd17e5fSmrg	esac
75798bd17e5fSmrg	;;
75808c4a8e55Smrg
75818bd17e5fSmrg      netbsd*)
75828bd17e5fSmrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
75838bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
75848bd17e5fSmrg	  wlarc=
75858bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
75868bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
75878bd17e5fSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
75888bd17e5fSmrg	fi
75898bd17e5fSmrg	# Workaround some broken pre-1.5 toolchains
75908bd17e5fSmrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
75918bd17e5fSmrg	;;
7592b042e37fSmrg
75938bd17e5fSmrg      *nto* | *qnx*)
75948bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
75958bd17e5fSmrg	;;
7596b042e37fSmrg
75978bd17e5fSmrg      openbsd2*)
75988bd17e5fSmrg        # C++ shared libraries are fairly broken
75998bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
76008bd17e5fSmrg	;;
7601b042e37fSmrg
76028bd17e5fSmrg      openbsd*)
76038bd17e5fSmrg	if test -f /usr/libexec/ld.so; then
76048bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
76058bd17e5fSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
76068bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
76078bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
76088bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
76098bd17e5fSmrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
76108bd17e5fSmrg	    _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'
76118bd17e5fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
76128bd17e5fSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
76138bd17e5fSmrg	  fi
76148bd17e5fSmrg	  output_verbose_link_cmd=func_echo_all
76158bd17e5fSmrg	else
76168bd17e5fSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
76178bd17e5fSmrg	fi
76188bd17e5fSmrg	;;
7619b042e37fSmrg
76208bd17e5fSmrg      osf3* | osf4* | osf5*)
76218bd17e5fSmrg        case $cc_basename in
76228bd17e5fSmrg          KCC*)
76238bd17e5fSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
76240597fb56Smrg
76258bd17e5fSmrg	    # KCC will only create a shared library if the output file
76268bd17e5fSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
76278bd17e5fSmrg	    # to its proper name (with version) after linking.
76288bd17e5fSmrg	    _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'
76290597fb56Smrg
76308bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
76318bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
76320597fb56Smrg
76338bd17e5fSmrg	    # Archives containing C++ object files must be created using
76348bd17e5fSmrg	    # the KAI C++ compiler.
76358bd17e5fSmrg	    case $host in
76368bd17e5fSmrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
76378bd17e5fSmrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
76388bd17e5fSmrg	    esac
76398bd17e5fSmrg	    ;;
76408bd17e5fSmrg          RCC*)
76418bd17e5fSmrg	    # Rational C++ 2.4.1
76428bd17e5fSmrg	    # FIXME: insert proper C++ library support
76438bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
76448bd17e5fSmrg	    ;;
76458bd17e5fSmrg          cxx*)
76468bd17e5fSmrg	    case $host in
76478bd17e5fSmrg	      osf3*)
76488bd17e5fSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
76498bd17e5fSmrg	        _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'
76508bd17e5fSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
76518bd17e5fSmrg		;;
76528bd17e5fSmrg	      *)
76538bd17e5fSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
76548bd17e5fSmrg	        _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'
76558bd17e5fSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
76568bd17e5fSmrg	          echo "-hidden">> $lib.exp~
76578bd17e5fSmrg	          $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~
76588bd17e5fSmrg	          $RM $lib.exp'
76598bd17e5fSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
76608bd17e5fSmrg		;;
76618bd17e5fSmrg	    esac
76620597fb56Smrg
76638bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
76640597fb56Smrg
76658bd17e5fSmrg	    # Commands to make compiler produce verbose output that lists
76668bd17e5fSmrg	    # what "hidden" libraries, object files and flags are used when
76678bd17e5fSmrg	    # linking a shared library.
76688bd17e5fSmrg	    #
76698bd17e5fSmrg	    # There doesn't appear to be a way to prevent this compiler from
76708bd17e5fSmrg	    # explicitly linking system object files so we need to strip them
76718bd17e5fSmrg	    # from the output so that they don't get included in the library
76728bd17e5fSmrg	    # dependencies.
76738bd17e5fSmrg	    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"'
76748bd17e5fSmrg	    ;;
76758bd17e5fSmrg	  *)
76768bd17e5fSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
76778bd17e5fSmrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
76788bd17e5fSmrg	      case $host in
76798bd17e5fSmrg	        osf3*)
76808bd17e5fSmrg	          _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'
76818bd17e5fSmrg		  ;;
76828bd17e5fSmrg	        *)
76838bd17e5fSmrg	          _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'
76848bd17e5fSmrg		  ;;
76858bd17e5fSmrg	      esac
76860597fb56Smrg
76878bd17e5fSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
76888bd17e5fSmrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
76890597fb56Smrg
76908bd17e5fSmrg	      # Commands to make compiler produce verbose output that lists
76918bd17e5fSmrg	      # what "hidden" libraries, object files and flags are used when
76928bd17e5fSmrg	      # linking a shared library.
76938bd17e5fSmrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7694b042e37fSmrg
76958bd17e5fSmrg	    else
76968bd17e5fSmrg	      # FIXME: insert proper C++ library support
76978bd17e5fSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
76988bd17e5fSmrg	    fi
76998bd17e5fSmrg	    ;;
77008bd17e5fSmrg        esac
77018bd17e5fSmrg        ;;
7702b042e37fSmrg
77038bd17e5fSmrg      psos*)
77048bd17e5fSmrg        # FIXME: insert proper C++ library support
77058bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
77068bd17e5fSmrg        ;;
7707b042e37fSmrg
77088bd17e5fSmrg      sunos4*)
77098bd17e5fSmrg        case $cc_basename in
77108bd17e5fSmrg          CC*)
77118bd17e5fSmrg	    # Sun C++ 4.x
77128bd17e5fSmrg	    # FIXME: insert proper C++ library support
77138bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
77148bd17e5fSmrg	    ;;
77158bd17e5fSmrg          lcc*)
77168bd17e5fSmrg	    # Lucid
77178bd17e5fSmrg	    # FIXME: insert proper C++ library support
77188bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
77198bd17e5fSmrg	    ;;
77208bd17e5fSmrg          *)
77218bd17e5fSmrg	    # FIXME: insert proper C++ library support
77228bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
77238bd17e5fSmrg	    ;;
77248bd17e5fSmrg        esac
77258bd17e5fSmrg        ;;
7726b042e37fSmrg
77278bd17e5fSmrg      solaris*)
77288bd17e5fSmrg        case $cc_basename in
77298bd17e5fSmrg          CC* | sunCC*)
77308bd17e5fSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
77318bd17e5fSmrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
77328bd17e5fSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
77338bd17e5fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
77348bd17e5fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
77358bd17e5fSmrg	      $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'
7736b042e37fSmrg
77378bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
77388bd17e5fSmrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
77398bd17e5fSmrg	    case $host_os in
77408bd17e5fSmrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
77418bd17e5fSmrg	      *)
77428bd17e5fSmrg		# The compiler driver will combine and reorder linker options,
77438bd17e5fSmrg		# but understands `-z linker_flag'.
77448bd17e5fSmrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
77458bd17e5fSmrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
77468bd17e5fSmrg	        ;;
77478bd17e5fSmrg	    esac
77488bd17e5fSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7749b042e37fSmrg
77508bd17e5fSmrg	    output_verbose_link_cmd='func_echo_all'
7751b042e37fSmrg
77528bd17e5fSmrg	    # Archives containing C++ object files must be created using
77538bd17e5fSmrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
77548bd17e5fSmrg	    # necessary to make sure instantiated templates are included
77558bd17e5fSmrg	    # in the archive.
77568bd17e5fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
77578bd17e5fSmrg	    ;;
77588bd17e5fSmrg          gcx*)
77598bd17e5fSmrg	    # Green Hills C++ Compiler
77608bd17e5fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
7761b042e37fSmrg
77628bd17e5fSmrg	    # The C++ compiler must be used to create the archive.
77638bd17e5fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
77648bd17e5fSmrg	    ;;
77658bd17e5fSmrg          *)
77668bd17e5fSmrg	    # GNU C++ compiler with Solaris linker
77678bd17e5fSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
77688bd17e5fSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
77698bd17e5fSmrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
77708bd17e5fSmrg	        _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'
77718bd17e5fSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
77728bd17e5fSmrg		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7773b042e37fSmrg
77748bd17e5fSmrg	        # Commands to make compiler produce verbose output that lists
77758bd17e5fSmrg	        # what "hidden" libraries, object files and flags are used when
77768bd17e5fSmrg	        # linking a shared library.
77778bd17e5fSmrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
77788bd17e5fSmrg	      else
77798bd17e5fSmrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
77808bd17e5fSmrg	        # platform.
77818bd17e5fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
77828bd17e5fSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
77838bd17e5fSmrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7784b042e37fSmrg
77858bd17e5fSmrg	        # Commands to make compiler produce verbose output that lists
77868bd17e5fSmrg	        # what "hidden" libraries, object files and flags are used when
77878bd17e5fSmrg	        # linking a shared library.
77888bd17e5fSmrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
77898bd17e5fSmrg	      fi
7790b042e37fSmrg
77918bd17e5fSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
77928bd17e5fSmrg	      case $host_os in
77938bd17e5fSmrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
77948bd17e5fSmrg		*)
77958bd17e5fSmrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
77968bd17e5fSmrg		  ;;
77978bd17e5fSmrg	      esac
77988bd17e5fSmrg	    fi
77998bd17e5fSmrg	    ;;
78008bd17e5fSmrg        esac
78018bd17e5fSmrg        ;;
7802706b6b52Smrg
78038bd17e5fSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
78048bd17e5fSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
78058bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
78068bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
78078bd17e5fSmrg      runpath_var='LD_RUN_PATH'
78080597fb56Smrg
78098bd17e5fSmrg      case $cc_basename in
78108bd17e5fSmrg        CC*)
78118bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78128bd17e5fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78138bd17e5fSmrg	  ;;
78148bd17e5fSmrg	*)
78158bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78168bd17e5fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78178bd17e5fSmrg	  ;;
78188bd17e5fSmrg      esac
78198bd17e5fSmrg      ;;
78200597fb56Smrg
78218bd17e5fSmrg      sysv5* | sco3.2v5* | sco5v6*)
78228bd17e5fSmrg	# Note: We can NOT use -z defs as we might desire, because we do not
78238bd17e5fSmrg	# link with -lc, and that would cause any symbols used from libc to
78248bd17e5fSmrg	# always be unresolved, which means just about no library would
78258bd17e5fSmrg	# ever link correctly.  If we're not using GNU ld we use -z text
78268bd17e5fSmrg	# though, which does catch some bad symbols but isn't as heavy-handed
78278bd17e5fSmrg	# as -z defs.
78288bd17e5fSmrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
78298bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
78308bd17e5fSmrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
78318bd17e5fSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
78328bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
78338bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
78348bd17e5fSmrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
78358bd17e5fSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
78368bd17e5fSmrg	runpath_var='LD_RUN_PATH'
78378bd17e5fSmrg
78388bd17e5fSmrg	case $cc_basename in
78398bd17e5fSmrg          CC*)
78408bd17e5fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78418bd17e5fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78428bd17e5fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
78438bd17e5fSmrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
78448bd17e5fSmrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
78458bd17e5fSmrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
78468bd17e5fSmrg	    ;;
78478bd17e5fSmrg	  *)
78488bd17e5fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78498bd17e5fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
78508bd17e5fSmrg	    ;;
78518bd17e5fSmrg	esac
78528bd17e5fSmrg      ;;
78530597fb56Smrg
78548bd17e5fSmrg      tandem*)
78558bd17e5fSmrg        case $cc_basename in
78568bd17e5fSmrg          NCC*)
78578bd17e5fSmrg	    # NonStop-UX NCC 3.20
78588bd17e5fSmrg	    # FIXME: insert proper C++ library support
78598bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
78608bd17e5fSmrg	    ;;
78618bd17e5fSmrg          *)
78628bd17e5fSmrg	    # FIXME: insert proper C++ library support
78638bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
78648bd17e5fSmrg	    ;;
78658bd17e5fSmrg        esac
78668bd17e5fSmrg        ;;
78670597fb56Smrg
78688bd17e5fSmrg      vxworks*)
78698bd17e5fSmrg        # FIXME: insert proper C++ library support
78708bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
78718bd17e5fSmrg        ;;
78720597fb56Smrg
78738bd17e5fSmrg      *)
78748bd17e5fSmrg        # FIXME: insert proper C++ library support
78758bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
78768bd17e5fSmrg        ;;
78778bd17e5fSmrg    esac
78780597fb56Smrg
78798bd17e5fSmrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
78808bd17e5fSmrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
78810597fb56Smrg
78828bd17e5fSmrg    _LT_TAGVAR(GCC, $1)="$GXX"
78838bd17e5fSmrg    _LT_TAGVAR(LD, $1)="$LD"
7884b042e37fSmrg
78858bd17e5fSmrg    ## CAVEAT EMPTOR:
78868bd17e5fSmrg    ## There is no encapsulation within the following macros, do not change
78878bd17e5fSmrg    ## the running order or otherwise move them around unless you know exactly
78888bd17e5fSmrg    ## what you are doing...
78898bd17e5fSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
78908bd17e5fSmrg    _LT_COMPILER_PIC($1)
78918bd17e5fSmrg    _LT_COMPILER_C_O($1)
78928bd17e5fSmrg    _LT_COMPILER_FILE_LOCKS($1)
78938bd17e5fSmrg    _LT_LINKER_SHLIBS($1)
78948bd17e5fSmrg    _LT_SYS_DYNAMIC_LINKER($1)
78958bd17e5fSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7896b042e37fSmrg
78978bd17e5fSmrg    _LT_CONFIG($1)
78988bd17e5fSmrg  fi # test -n "$compiler"
7899b042e37fSmrg
79008bd17e5fSmrg  CC=$lt_save_CC
79018bd17e5fSmrg  CFLAGS=$lt_save_CFLAGS
79028bd17e5fSmrg  LDCXX=$LD
79038bd17e5fSmrg  LD=$lt_save_LD
79048bd17e5fSmrg  GCC=$lt_save_GCC
79058bd17e5fSmrg  with_gnu_ld=$lt_save_with_gnu_ld
79068bd17e5fSmrg  lt_cv_path_LDCXX=$lt_cv_path_LD
79078bd17e5fSmrg  lt_cv_path_LD=$lt_save_path_LD
79088bd17e5fSmrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
79098bd17e5fSmrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
79108bd17e5fSmrgfi # test "$_lt_caught_CXX_error" != yes
7911b042e37fSmrg
79128bd17e5fSmrgAC_LANG_POP
79138bd17e5fSmrg])# _LT_LANG_CXX_CONFIG
7914b042e37fSmrg
7915b042e37fSmrg
79168bd17e5fSmrg# _LT_FUNC_STRIPNAME_CNF
79178bd17e5fSmrg# ----------------------
79188bd17e5fSmrg# func_stripname_cnf prefix suffix name
79198bd17e5fSmrg# strip PREFIX and SUFFIX off of NAME.
79208bd17e5fSmrg# PREFIX and SUFFIX must not contain globbing or regex special
79218bd17e5fSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
79228bd17e5fSmrg# dot (in which case that matches only a dot).
79238bd17e5fSmrg#
79248bd17e5fSmrg# This function is identical to the (non-XSI) version of func_stripname,
79258bd17e5fSmrg# except this one can be used by m4 code that may be executed by configure,
79268bd17e5fSmrg# rather than the libtool script.
79278bd17e5fSmrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
79288bd17e5fSmrgAC_REQUIRE([_LT_DECL_SED])
79298bd17e5fSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
79308bd17e5fSmrgfunc_stripname_cnf ()
79318bd17e5fSmrg{
79328bd17e5fSmrg  case ${2} in
79338bd17e5fSmrg  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
79348bd17e5fSmrg  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
79358bd17e5fSmrg  esac
79368bd17e5fSmrg} # func_stripname_cnf
79378bd17e5fSmrg])# _LT_FUNC_STRIPNAME_CNF
7938b042e37fSmrg
79398bd17e5fSmrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
79408bd17e5fSmrg# ---------------------------------
79418bd17e5fSmrg# Figure out "hidden" library dependencies from verbose
79428bd17e5fSmrg# compiler output when linking a shared library.
79438bd17e5fSmrg# Parse the compiler output and extract the necessary
79448bd17e5fSmrg# objects, libraries and library flags.
79458bd17e5fSmrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
79468bd17e5fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
79478bd17e5fSmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
79488bd17e5fSmrg# Dependencies to place before and after the object being linked:
79498bd17e5fSmrg_LT_TAGVAR(predep_objects, $1)=
79508bd17e5fSmrg_LT_TAGVAR(postdep_objects, $1)=
79518bd17e5fSmrg_LT_TAGVAR(predeps, $1)=
79528bd17e5fSmrg_LT_TAGVAR(postdeps, $1)=
79538bd17e5fSmrg_LT_TAGVAR(compiler_lib_search_path, $1)=
7954b042e37fSmrg
79558bd17e5fSmrgdnl we can't use the lt_simple_compile_test_code here,
79568bd17e5fSmrgdnl because it contains code intended for an executable,
79578bd17e5fSmrgdnl not a library.  It's possible we should let each
79588bd17e5fSmrgdnl tag define a new lt_????_link_test_code variable,
79598bd17e5fSmrgdnl but it's only used here...
79608bd17e5fSmrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
79618bd17e5fSmrgint a;
79628bd17e5fSmrgvoid foo (void) { a = 0; }
79638bd17e5fSmrg_LT_EOF
79648bd17e5fSmrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
79658bd17e5fSmrgclass Foo
79668bd17e5fSmrg{
79678bd17e5fSmrgpublic:
79688bd17e5fSmrg  Foo (void) { a = 0; }
79698bd17e5fSmrgprivate:
79708bd17e5fSmrg  int a;
79718bd17e5fSmrg};
79728bd17e5fSmrg_LT_EOF
79738bd17e5fSmrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
79748bd17e5fSmrg      subroutine foo
79758bd17e5fSmrg      implicit none
79768bd17e5fSmrg      integer*4 a
79778bd17e5fSmrg      a=0
79788bd17e5fSmrg      return
79798bd17e5fSmrg      end
79808bd17e5fSmrg_LT_EOF
79818bd17e5fSmrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
79828bd17e5fSmrg      subroutine foo
79838bd17e5fSmrg      implicit none
79848bd17e5fSmrg      integer a
79858bd17e5fSmrg      a=0
79868bd17e5fSmrg      return
79878bd17e5fSmrg      end
79888bd17e5fSmrg_LT_EOF
79898bd17e5fSmrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
79908bd17e5fSmrgpublic class foo {
79918bd17e5fSmrg  private int a;
79928bd17e5fSmrg  public void bar (void) {
79938bd17e5fSmrg    a = 0;
79948bd17e5fSmrg  }
79958bd17e5fSmrg};
79968bd17e5fSmrg_LT_EOF
79978bd17e5fSmrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
79988bd17e5fSmrgpackage foo
79998bd17e5fSmrgfunc foo() {
80008bd17e5fSmrg}
80018bd17e5fSmrg_LT_EOF
80028bd17e5fSmrg])
8003b042e37fSmrg
80048bd17e5fSmrg_lt_libdeps_save_CFLAGS=$CFLAGS
80058bd17e5fSmrgcase "$CC $CFLAGS " in #(
80068bd17e5fSmrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
80078bd17e5fSmrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
80088bd17e5fSmrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
80098bd17e5fSmrgesac
8010b042e37fSmrg
80118bd17e5fSmrgdnl Parse the compiler output and extract the necessary
80128bd17e5fSmrgdnl objects, libraries and library flags.
80138bd17e5fSmrgif AC_TRY_EVAL(ac_compile); then
80148bd17e5fSmrg  # Parse the compiler output and extract the necessary
80158bd17e5fSmrg  # objects, libraries and library flags.
8016b042e37fSmrg
80178bd17e5fSmrg  # Sentinel used to keep track of whether or not we are before
80188bd17e5fSmrg  # the conftest object file.
80198bd17e5fSmrg  pre_test_object_deps_done=no
8020b042e37fSmrg
80218bd17e5fSmrg  for p in `eval "$output_verbose_link_cmd"`; do
80228bd17e5fSmrg    case ${prev}${p} in
8023b042e37fSmrg
80248bd17e5fSmrg    -L* | -R* | -l*)
80258bd17e5fSmrg       # Some compilers place space between "-{L,R}" and the path.
80268bd17e5fSmrg       # Remove the space.
80278bd17e5fSmrg       if test $p = "-L" ||
80288bd17e5fSmrg          test $p = "-R"; then
80298bd17e5fSmrg	 prev=$p
80308bd17e5fSmrg	 continue
80318bd17e5fSmrg       fi
80320597fb56Smrg
80338bd17e5fSmrg       # Expand the sysroot to ease extracting the directories later.
80348bd17e5fSmrg       if test -z "$prev"; then
80358bd17e5fSmrg         case $p in
80368bd17e5fSmrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
80378bd17e5fSmrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
80388bd17e5fSmrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
80398bd17e5fSmrg         esac
80408bd17e5fSmrg       fi
80418bd17e5fSmrg       case $p in
80428bd17e5fSmrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
80438bd17e5fSmrg       esac
80448bd17e5fSmrg       if test "$pre_test_object_deps_done" = no; then
80458bd17e5fSmrg	 case ${prev} in
80468bd17e5fSmrg	 -L | -R)
80478bd17e5fSmrg	   # Internal compiler library paths should come after those
80488bd17e5fSmrg	   # provided the user.  The postdeps already come after the
80498bd17e5fSmrg	   # user supplied libs so there is no need to process them.
80508bd17e5fSmrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
80518bd17e5fSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
80528bd17e5fSmrg	   else
80538bd17e5fSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
80548bd17e5fSmrg	   fi
80558bd17e5fSmrg	   ;;
80568bd17e5fSmrg	 # The "-l" case would never come before the object being
80578bd17e5fSmrg	 # linked, so don't bother handling this case.
80588bd17e5fSmrg	 esac
80598bd17e5fSmrg       else
80608bd17e5fSmrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
80618bd17e5fSmrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
80628bd17e5fSmrg	 else
80638bd17e5fSmrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
80648bd17e5fSmrg	 fi
80658bd17e5fSmrg       fi
80668bd17e5fSmrg       prev=
80678bd17e5fSmrg       ;;
80680597fb56Smrg
80698bd17e5fSmrg    *.lto.$objext) ;; # Ignore GCC LTO objects
80708bd17e5fSmrg    *.$objext)
80718bd17e5fSmrg       # This assumes that the test object file only shows up
80728bd17e5fSmrg       # once in the compiler output.
80738bd17e5fSmrg       if test "$p" = "conftest.$objext"; then
80748bd17e5fSmrg	 pre_test_object_deps_done=yes
80758bd17e5fSmrg	 continue
80768bd17e5fSmrg       fi
80770597fb56Smrg
80788bd17e5fSmrg       if test "$pre_test_object_deps_done" = no; then
80798bd17e5fSmrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
80808bd17e5fSmrg	   _LT_TAGVAR(predep_objects, $1)="$p"
80818bd17e5fSmrg	 else
80828bd17e5fSmrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
80838bd17e5fSmrg	 fi
80848bd17e5fSmrg       else
80858bd17e5fSmrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
80868bd17e5fSmrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
80878bd17e5fSmrg	 else
80888bd17e5fSmrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
80898bd17e5fSmrg	 fi
80908bd17e5fSmrg       fi
80918bd17e5fSmrg       ;;
80920597fb56Smrg
80938bd17e5fSmrg    *) ;; # Ignore the rest.
80940597fb56Smrg
80950597fb56Smrg    esac
80968bd17e5fSmrg  done
80978bd17e5fSmrg
80988bd17e5fSmrg  # Clean up.
80998bd17e5fSmrg  rm -f a.out a.exe
81008bd17e5fSmrgelse
81018bd17e5fSmrg  echo "libtool.m4: error: problem compiling $1 test program"
81028bd17e5fSmrgfi
81038bd17e5fSmrg
81048bd17e5fSmrg$RM -f confest.$objext
81058bd17e5fSmrgCFLAGS=$_lt_libdeps_save_CFLAGS
81068bd17e5fSmrg
81078bd17e5fSmrg# PORTME: override above test on systems where it is broken
81088bd17e5fSmrgm4_if([$1], [CXX],
81098bd17e5fSmrg[case $host_os in
81108bd17e5fSmrginterix[[3-9]]*)
81118bd17e5fSmrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
81128bd17e5fSmrg  # hack all around it, let's just trust "g++" to DTRT.
81138bd17e5fSmrg  _LT_TAGVAR(predep_objects,$1)=
81148bd17e5fSmrg  _LT_TAGVAR(postdep_objects,$1)=
81158bd17e5fSmrg  _LT_TAGVAR(postdeps,$1)=
81168bd17e5fSmrg  ;;
81178bd17e5fSmrg
81188bd17e5fSmrglinux*)
81198bd17e5fSmrg  case `$CC -V 2>&1 | sed 5q` in
81208bd17e5fSmrg  *Sun\ C*)
81218bd17e5fSmrg    # Sun C++ 5.9
81228bd17e5fSmrg
81238bd17e5fSmrg    # The more standards-conforming stlport4 library is
81248bd17e5fSmrg    # incompatible with the Cstd library. Avoid specifying
81258bd17e5fSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
81268bd17e5fSmrg    # -library=stlport4 depends on it.
81278bd17e5fSmrg    case " $CXX $CXXFLAGS " in
81288bd17e5fSmrg    *" -library=stlport4 "*)
81298bd17e5fSmrg      solaris_use_stlport4=yes
81308bd17e5fSmrg      ;;
81310597fb56Smrg    esac
81328bd17e5fSmrg
81338bd17e5fSmrg    if test "$solaris_use_stlport4" != yes; then
81348bd17e5fSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
81358bd17e5fSmrg    fi
8136706b6b52Smrg    ;;
81378bd17e5fSmrg  esac
81388bd17e5fSmrg  ;;
8139b042e37fSmrg
81408bd17e5fSmrgsolaris*)
81418bd17e5fSmrg  case $cc_basename in
81428bd17e5fSmrg  CC* | sunCC*)
81438bd17e5fSmrg    # The more standards-conforming stlport4 library is
81448bd17e5fSmrg    # incompatible with the Cstd library. Avoid specifying
81458bd17e5fSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
81468bd17e5fSmrg    # -library=stlport4 depends on it.
81478bd17e5fSmrg    case " $CXX $CXXFLAGS " in
81488bd17e5fSmrg    *" -library=stlport4 "*)
81498bd17e5fSmrg      solaris_use_stlport4=yes
81508bd17e5fSmrg      ;;
81510597fb56Smrg    esac
81528bd17e5fSmrg
81538bd17e5fSmrg    # Adding this requires a known-good setup of shared libraries for
81548bd17e5fSmrg    # Sun compiler versions before 5.6, else PIC objects from an old
81558bd17e5fSmrg    # archive will be linked into the output, leading to subtle bugs.
81568bd17e5fSmrg    if test "$solaris_use_stlport4" != yes; then
81578bd17e5fSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
81588bd17e5fSmrg    fi
81590597fb56Smrg    ;;
81608bd17e5fSmrg  esac
81618bd17e5fSmrg  ;;
81620597fb56Smrgesac
81630597fb56Smrg])
8164b042e37fSmrg
81658bd17e5fSmrgcase " $_LT_TAGVAR(postdeps, $1) " in
81668bd17e5fSmrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
81678bd17e5fSmrgesac
81688bd17e5fSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
81698bd17e5fSmrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
81708bd17e5fSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
81718bd17e5fSmrgfi
81728bd17e5fSmrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
81738bd17e5fSmrg    [The directories searched by this compiler when creating a shared library])
81748bd17e5fSmrg_LT_TAGDECL([], [predep_objects], [1],
81758bd17e5fSmrg    [Dependencies to place before and after the objects being linked to
81768bd17e5fSmrg    create a shared library])
81778bd17e5fSmrg_LT_TAGDECL([], [postdep_objects], [1])
81788bd17e5fSmrg_LT_TAGDECL([], [predeps], [1])
81798bd17e5fSmrg_LT_TAGDECL([], [postdeps], [1])
81808bd17e5fSmrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
81818bd17e5fSmrg    [The library search path used internally by the compiler when linking
81828bd17e5fSmrg    a shared library])
81838bd17e5fSmrg])# _LT_SYS_HIDDEN_LIBDEPS
81848c4a8e55Smrg
81858c4a8e55Smrg
81868bd17e5fSmrg# _LT_LANG_F77_CONFIG([TAG])
81878bd17e5fSmrg# --------------------------
81888bd17e5fSmrg# Ensure that the configuration variables for a Fortran 77 compiler are
81898bd17e5fSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
81908bd17e5fSmrg# to write the compiler configuration to `libtool'.
81918bd17e5fSmrgm4_defun([_LT_LANG_F77_CONFIG],
81928bd17e5fSmrg[AC_LANG_PUSH(Fortran 77)
81938bd17e5fSmrgif test -z "$F77" || test "X$F77" = "Xno"; then
81948bd17e5fSmrg  _lt_disable_F77=yes
81958bd17e5fSmrgfi
8196b042e37fSmrg
81978bd17e5fSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
81988bd17e5fSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
81998bd17e5fSmrg_LT_TAGVAR(always_export_symbols, $1)=no
82008bd17e5fSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
82018bd17e5fSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
82028bd17e5fSmrg_LT_TAGVAR(hardcode_direct, $1)=no
82038bd17e5fSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
82048bd17e5fSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
82058bd17e5fSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
82068bd17e5fSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
82078bd17e5fSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
82088bd17e5fSmrg_LT_TAGVAR(inherit_rpath, $1)=no
82098bd17e5fSmrg_LT_TAGVAR(module_cmds, $1)=
82108bd17e5fSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
82118bd17e5fSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
82128bd17e5fSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
82138bd17e5fSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
82148bd17e5fSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
82158bd17e5fSmrg_LT_TAGVAR(no_undefined_flag, $1)=
82168bd17e5fSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
82178bd17e5fSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8218b042e37fSmrg
82198bd17e5fSmrg# Source file extension for f77 test sources.
82208bd17e5fSmrgac_ext=f
8221b042e37fSmrg
82228bd17e5fSmrg# Object file extension for compiled f77 test sources.
82238bd17e5fSmrgobjext=o
82248bd17e5fSmrg_LT_TAGVAR(objext, $1)=$objext
82258c4a8e55Smrg
82268bd17e5fSmrg# No sense in running all these tests if we already determined that
82278bd17e5fSmrg# the F77 compiler isn't working.  Some variables (like enable_shared)
82288bd17e5fSmrg# are currently assumed to apply to all compilers on this platform,
82298bd17e5fSmrg# and will be corrupted by setting them based on a non-working compiler.
82308bd17e5fSmrgif test "$_lt_disable_F77" != yes; then
82318bd17e5fSmrg  # Code to be used in simple compile tests
82328bd17e5fSmrg  lt_simple_compile_test_code="\
82338bd17e5fSmrg      subroutine t
82348bd17e5fSmrg      return
82358bd17e5fSmrg      end
82368bd17e5fSmrg"
82378c4a8e55Smrg
82388bd17e5fSmrg  # Code to be used in simple link tests
82398bd17e5fSmrg  lt_simple_link_test_code="\
82408bd17e5fSmrg      program t
82418bd17e5fSmrg      end
82428bd17e5fSmrg"
82438c4a8e55Smrg
82448bd17e5fSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
82458bd17e5fSmrg  _LT_TAG_COMPILER
8246b042e37fSmrg
82478bd17e5fSmrg  # save warnings/boilerplate of simple test code
82488bd17e5fSmrg  _LT_COMPILER_BOILERPLATE
82498bd17e5fSmrg  _LT_LINKER_BOILERPLATE
8250b042e37fSmrg
82518bd17e5fSmrg  # Allow CC to be a program name with arguments.
82528bd17e5fSmrg  lt_save_CC="$CC"
82538bd17e5fSmrg  lt_save_GCC=$GCC
82548bd17e5fSmrg  lt_save_CFLAGS=$CFLAGS
82558bd17e5fSmrg  CC=${F77-"f77"}
82568bd17e5fSmrg  CFLAGS=$FFLAGS
82578bd17e5fSmrg  compiler=$CC
82588bd17e5fSmrg  _LT_TAGVAR(compiler, $1)=$CC
82598bd17e5fSmrg  _LT_CC_BASENAME([$compiler])
82608bd17e5fSmrg  GCC=$G77
82618bd17e5fSmrg  if test -n "$compiler"; then
82628bd17e5fSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
82638bd17e5fSmrg    AC_MSG_RESULT([$can_build_shared])
82648c4a8e55Smrg
82658bd17e5fSmrg    AC_MSG_CHECKING([whether to build shared libraries])
82668bd17e5fSmrg    test "$can_build_shared" = "no" && enable_shared=no
8267b042e37fSmrg
82688bd17e5fSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
82698bd17e5fSmrg    # are all built from PIC.
82708bd17e5fSmrg    case $host_os in
82718bd17e5fSmrg      aix3*)
82728bd17e5fSmrg        test "$enable_shared" = yes && enable_static=no
82738bd17e5fSmrg        if test -n "$RANLIB"; then
82748bd17e5fSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
82758bd17e5fSmrg          postinstall_cmds='$RANLIB $lib'
82768bd17e5fSmrg        fi
82778bd17e5fSmrg        ;;
82788bd17e5fSmrg      aix[[4-9]]*)
82798bd17e5fSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
82808bd17e5fSmrg	  test "$enable_shared" = yes && enable_static=no
82818bd17e5fSmrg	fi
82828bd17e5fSmrg        ;;
82838bd17e5fSmrg    esac
82848bd17e5fSmrg    AC_MSG_RESULT([$enable_shared])
8285b042e37fSmrg
82868bd17e5fSmrg    AC_MSG_CHECKING([whether to build static libraries])
82878bd17e5fSmrg    # Make sure either enable_shared or enable_static is yes.
82888bd17e5fSmrg    test "$enable_shared" = yes || enable_static=yes
82898bd17e5fSmrg    AC_MSG_RESULT([$enable_static])
8290b042e37fSmrg
82918bd17e5fSmrg    _LT_TAGVAR(GCC, $1)="$G77"
82928bd17e5fSmrg    _LT_TAGVAR(LD, $1)="$LD"
8293b042e37fSmrg
82948bd17e5fSmrg    ## CAVEAT EMPTOR:
82958bd17e5fSmrg    ## There is no encapsulation within the following macros, do not change
82968bd17e5fSmrg    ## the running order or otherwise move them around unless you know exactly
82978bd17e5fSmrg    ## what you are doing...
82988bd17e5fSmrg    _LT_COMPILER_PIC($1)
82998bd17e5fSmrg    _LT_COMPILER_C_O($1)
83008bd17e5fSmrg    _LT_COMPILER_FILE_LOCKS($1)
83018bd17e5fSmrg    _LT_LINKER_SHLIBS($1)
83028bd17e5fSmrg    _LT_SYS_DYNAMIC_LINKER($1)
83038bd17e5fSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
8304b042e37fSmrg
83058bd17e5fSmrg    _LT_CONFIG($1)
83068bd17e5fSmrg  fi # test -n "$compiler"
8307b042e37fSmrg
83088bd17e5fSmrg  GCC=$lt_save_GCC
83098bd17e5fSmrg  CC="$lt_save_CC"
83108bd17e5fSmrg  CFLAGS="$lt_save_CFLAGS"
83118bd17e5fSmrgfi # test "$_lt_disable_F77" != yes
8312b042e37fSmrg
83138bd17e5fSmrgAC_LANG_POP
83148bd17e5fSmrg])# _LT_LANG_F77_CONFIG
8315706b6b52Smrg
8316706b6b52Smrg
83178bd17e5fSmrg# _LT_LANG_FC_CONFIG([TAG])
83188bd17e5fSmrg# -------------------------
83198bd17e5fSmrg# Ensure that the configuration variables for a Fortran compiler are
83208bd17e5fSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
83218bd17e5fSmrg# to write the compiler configuration to `libtool'.
83228bd17e5fSmrgm4_defun([_LT_LANG_FC_CONFIG],
83238bd17e5fSmrg[AC_LANG_PUSH(Fortran)
8324706b6b52Smrg
83258bd17e5fSmrgif test -z "$FC" || test "X$FC" = "Xno"; then
83268bd17e5fSmrg  _lt_disable_FC=yes
83278bd17e5fSmrgfi
8328706b6b52Smrg
83298bd17e5fSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
83308bd17e5fSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
83318bd17e5fSmrg_LT_TAGVAR(always_export_symbols, $1)=no
83328bd17e5fSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
83338bd17e5fSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
83348bd17e5fSmrg_LT_TAGVAR(hardcode_direct, $1)=no
83358bd17e5fSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
83368bd17e5fSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
83378bd17e5fSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
83388bd17e5fSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
83398bd17e5fSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
83408bd17e5fSmrg_LT_TAGVAR(inherit_rpath, $1)=no
83418bd17e5fSmrg_LT_TAGVAR(module_cmds, $1)=
83428bd17e5fSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
83438bd17e5fSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
83448bd17e5fSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
83458bd17e5fSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
83468bd17e5fSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
83478bd17e5fSmrg_LT_TAGVAR(no_undefined_flag, $1)=
83488bd17e5fSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
83498bd17e5fSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
8350b042e37fSmrg
83518bd17e5fSmrg# Source file extension for fc test sources.
83528bd17e5fSmrgac_ext=${ac_fc_srcext-f}
83538c4a8e55Smrg
83548bd17e5fSmrg# Object file extension for compiled fc test sources.
83558bd17e5fSmrgobjext=o
83568bd17e5fSmrg_LT_TAGVAR(objext, $1)=$objext
83578c4a8e55Smrg
83588bd17e5fSmrg# No sense in running all these tests if we already determined that
83598bd17e5fSmrg# the FC compiler isn't working.  Some variables (like enable_shared)
83608bd17e5fSmrg# are currently assumed to apply to all compilers on this platform,
83618bd17e5fSmrg# and will be corrupted by setting them based on a non-working compiler.
83628bd17e5fSmrgif test "$_lt_disable_FC" != yes; then
83638bd17e5fSmrg  # Code to be used in simple compile tests
83648bd17e5fSmrg  lt_simple_compile_test_code="\
83658bd17e5fSmrg      subroutine t
83668bd17e5fSmrg      return
83678bd17e5fSmrg      end
83688bd17e5fSmrg"
8369b042e37fSmrg
83708bd17e5fSmrg  # Code to be used in simple link tests
83718bd17e5fSmrg  lt_simple_link_test_code="\
83728bd17e5fSmrg      program t
83738bd17e5fSmrg      end
83748bd17e5fSmrg"
8375b042e37fSmrg
83768bd17e5fSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
83778bd17e5fSmrg  _LT_TAG_COMPILER
83788c4a8e55Smrg
83798bd17e5fSmrg  # save warnings/boilerplate of simple test code
83808bd17e5fSmrg  _LT_COMPILER_BOILERPLATE
83818bd17e5fSmrg  _LT_LINKER_BOILERPLATE
8382b042e37fSmrg
83838bd17e5fSmrg  # Allow CC to be a program name with arguments.
83848bd17e5fSmrg  lt_save_CC="$CC"
83858bd17e5fSmrg  lt_save_GCC=$GCC
83868bd17e5fSmrg  lt_save_CFLAGS=$CFLAGS
83878bd17e5fSmrg  CC=${FC-"f95"}
83888bd17e5fSmrg  CFLAGS=$FCFLAGS
83898bd17e5fSmrg  compiler=$CC
83908bd17e5fSmrg  GCC=$ac_cv_fc_compiler_gnu
8391b042e37fSmrg
83928bd17e5fSmrg  _LT_TAGVAR(compiler, $1)=$CC
83938bd17e5fSmrg  _LT_CC_BASENAME([$compiler])
8394bd23fbfaSmrg
83958bd17e5fSmrg  if test -n "$compiler"; then
83968bd17e5fSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
83978bd17e5fSmrg    AC_MSG_RESULT([$can_build_shared])
83988bd17e5fSmrg
83998bd17e5fSmrg    AC_MSG_CHECKING([whether to build shared libraries])
84008bd17e5fSmrg    test "$can_build_shared" = "no" && enable_shared=no
84018bd17e5fSmrg
84028bd17e5fSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
84038bd17e5fSmrg    # are all built from PIC.
84048bd17e5fSmrg    case $host_os in
84058bd17e5fSmrg      aix3*)
84068bd17e5fSmrg        test "$enable_shared" = yes && enable_static=no
84078bd17e5fSmrg        if test -n "$RANLIB"; then
84088bd17e5fSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
84098bd17e5fSmrg          postinstall_cmds='$RANLIB $lib'
84108bd17e5fSmrg        fi
84118bd17e5fSmrg        ;;
84128bd17e5fSmrg      aix[[4-9]]*)
84138bd17e5fSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
84148bd17e5fSmrg	  test "$enable_shared" = yes && enable_static=no
84150597fb56Smrg	fi
84168bd17e5fSmrg        ;;
84178bd17e5fSmrg    esac
84188bd17e5fSmrg    AC_MSG_RESULT([$enable_shared])
84190597fb56Smrg
84208bd17e5fSmrg    AC_MSG_CHECKING([whether to build static libraries])
84218bd17e5fSmrg    # Make sure either enable_shared or enable_static is yes.
84228bd17e5fSmrg    test "$enable_shared" = yes || enable_static=yes
84238bd17e5fSmrg    AC_MSG_RESULT([$enable_static])
8424b042e37fSmrg
84258bd17e5fSmrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
84268bd17e5fSmrg    _LT_TAGVAR(LD, $1)="$LD"
8427b042e37fSmrg
84288bd17e5fSmrg    ## CAVEAT EMPTOR:
84298bd17e5fSmrg    ## There is no encapsulation within the following macros, do not change
84308bd17e5fSmrg    ## the running order or otherwise move them around unless you know exactly
84318bd17e5fSmrg    ## what you are doing...
84328bd17e5fSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
84338bd17e5fSmrg    _LT_COMPILER_PIC($1)
84348bd17e5fSmrg    _LT_COMPILER_C_O($1)
84358bd17e5fSmrg    _LT_COMPILER_FILE_LOCKS($1)
84368bd17e5fSmrg    _LT_LINKER_SHLIBS($1)
84378bd17e5fSmrg    _LT_SYS_DYNAMIC_LINKER($1)
84388bd17e5fSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
8439b042e37fSmrg
84408bd17e5fSmrg    _LT_CONFIG($1)
84418bd17e5fSmrg  fi # test -n "$compiler"
8442b042e37fSmrg
84438bd17e5fSmrg  GCC=$lt_save_GCC
84448bd17e5fSmrg  CC=$lt_save_CC
84458bd17e5fSmrg  CFLAGS=$lt_save_CFLAGS
84468bd17e5fSmrgfi # test "$_lt_disable_FC" != yes
8447b042e37fSmrg
84488bd17e5fSmrgAC_LANG_POP
84498bd17e5fSmrg])# _LT_LANG_FC_CONFIG
84508bd17e5fSmrg
84518bd17e5fSmrg
84528bd17e5fSmrg# _LT_LANG_GCJ_CONFIG([TAG])
84538bd17e5fSmrg# --------------------------
84548bd17e5fSmrg# Ensure that the configuration variables for the GNU Java Compiler compiler
84558bd17e5fSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
84568bd17e5fSmrg# to write the compiler configuration to `libtool'.
84578bd17e5fSmrgm4_defun([_LT_LANG_GCJ_CONFIG],
84588bd17e5fSmrg[AC_REQUIRE([LT_PROG_GCJ])dnl
84598bd17e5fSmrgAC_LANG_SAVE
8460b042e37fSmrg
84618bd17e5fSmrg# Source file extension for Java test sources.
84628bd17e5fSmrgac_ext=java
8463706b6b52Smrg
84648bd17e5fSmrg# Object file extension for compiled Java test sources.
84658bd17e5fSmrgobjext=o
84668bd17e5fSmrg_LT_TAGVAR(objext, $1)=$objext
8467b042e37fSmrg
84688bd17e5fSmrg# Code to be used in simple compile tests
84698bd17e5fSmrglt_simple_compile_test_code="class foo {}"
8470b042e37fSmrg
84718bd17e5fSmrg# Code to be used in simple link tests
84728bd17e5fSmrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
8473b042e37fSmrg
84748bd17e5fSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
84758bd17e5fSmrg_LT_TAG_COMPILER
8476b042e37fSmrg
84778bd17e5fSmrg# save warnings/boilerplate of simple test code
84788bd17e5fSmrg_LT_COMPILER_BOILERPLATE
84798bd17e5fSmrg_LT_LINKER_BOILERPLATE
8480b042e37fSmrg
84818bd17e5fSmrg# Allow CC to be a program name with arguments.
84828bd17e5fSmrglt_save_CC=$CC
84838bd17e5fSmrglt_save_CFLAGS=$CFLAGS
84848bd17e5fSmrglt_save_GCC=$GCC
84858bd17e5fSmrgGCC=yes
84868bd17e5fSmrgCC=${GCJ-"gcj"}
84878bd17e5fSmrgCFLAGS=$GCJFLAGS
84888bd17e5fSmrgcompiler=$CC
84898bd17e5fSmrg_LT_TAGVAR(compiler, $1)=$CC
84908bd17e5fSmrg_LT_TAGVAR(LD, $1)="$LD"
84918bd17e5fSmrg_LT_CC_BASENAME([$compiler])
84920597fb56Smrg
84938bd17e5fSmrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
84948bd17e5fSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8495b042e37fSmrg
84968bd17e5fSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
84978bd17e5fSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
84988bd17e5fSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8499b042e37fSmrg
85008bd17e5fSmrgif test -n "$compiler"; then
85018bd17e5fSmrg  _LT_COMPILER_NO_RTTI($1)
85028bd17e5fSmrg  _LT_COMPILER_PIC($1)
85038bd17e5fSmrg  _LT_COMPILER_C_O($1)
85048bd17e5fSmrg  _LT_COMPILER_FILE_LOCKS($1)
85058bd17e5fSmrg  _LT_LINKER_SHLIBS($1)
85068bd17e5fSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8507b042e37fSmrg
85088bd17e5fSmrg  _LT_CONFIG($1)
85098bd17e5fSmrgfi
8510b042e37fSmrg
85118bd17e5fSmrgAC_LANG_RESTORE
8512706b6b52Smrg
85138bd17e5fSmrgGCC=$lt_save_GCC
85148bd17e5fSmrgCC=$lt_save_CC
85158bd17e5fSmrgCFLAGS=$lt_save_CFLAGS
85168bd17e5fSmrg])# _LT_LANG_GCJ_CONFIG
8517b042e37fSmrg
8518b042e37fSmrg
85198bd17e5fSmrg# _LT_LANG_GO_CONFIG([TAG])
85208bd17e5fSmrg# --------------------------
85218bd17e5fSmrg# Ensure that the configuration variables for the GNU Go compiler
85228bd17e5fSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
85238bd17e5fSmrg# to write the compiler configuration to `libtool'.
85248bd17e5fSmrgm4_defun([_LT_LANG_GO_CONFIG],
85258bd17e5fSmrg[AC_REQUIRE([LT_PROG_GO])dnl
85268bd17e5fSmrgAC_LANG_SAVE
85278c4a8e55Smrg
85288bd17e5fSmrg# Source file extension for Go test sources.
85298bd17e5fSmrgac_ext=go
85308c4a8e55Smrg
85318bd17e5fSmrg# Object file extension for compiled Go test sources.
85328bd17e5fSmrgobjext=o
85338bd17e5fSmrg_LT_TAGVAR(objext, $1)=$objext
8534b042e37fSmrg
85358bd17e5fSmrg# Code to be used in simple compile tests
85368bd17e5fSmrglt_simple_compile_test_code="package main; func main() { }"
8537b042e37fSmrg
85388bd17e5fSmrg# Code to be used in simple link tests
85398bd17e5fSmrglt_simple_link_test_code='package main; func main() { }'
85408c4a8e55Smrg
85418bd17e5fSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
85428bd17e5fSmrg_LT_TAG_COMPILER
8543b042e37fSmrg
85448bd17e5fSmrg# save warnings/boilerplate of simple test code
85458bd17e5fSmrg_LT_COMPILER_BOILERPLATE
85468bd17e5fSmrg_LT_LINKER_BOILERPLATE
85470597fb56Smrg
85488bd17e5fSmrg# Allow CC to be a program name with arguments.
85498bd17e5fSmrglt_save_CC=$CC
85508bd17e5fSmrglt_save_CFLAGS=$CFLAGS
85518bd17e5fSmrglt_save_GCC=$GCC
85528bd17e5fSmrgGCC=yes
85538bd17e5fSmrgCC=${GOC-"gccgo"}
85548bd17e5fSmrgCFLAGS=$GOFLAGS
85558bd17e5fSmrgcompiler=$CC
85568bd17e5fSmrg_LT_TAGVAR(compiler, $1)=$CC
85578bd17e5fSmrg_LT_TAGVAR(LD, $1)="$LD"
85588bd17e5fSmrg_LT_CC_BASENAME([$compiler])
85590597fb56Smrg
85608bd17e5fSmrg# Go did not exist at the time GCC didn't implicitly link libc in.
85618bd17e5fSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8562b042e37fSmrg
85638bd17e5fSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
85648bd17e5fSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
85658bd17e5fSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8566b042e37fSmrg
85678bd17e5fSmrgif test -n "$compiler"; then
85688bd17e5fSmrg  _LT_COMPILER_NO_RTTI($1)
85698bd17e5fSmrg  _LT_COMPILER_PIC($1)
85708bd17e5fSmrg  _LT_COMPILER_C_O($1)
85718bd17e5fSmrg  _LT_COMPILER_FILE_LOCKS($1)
85728bd17e5fSmrg  _LT_LINKER_SHLIBS($1)
85738bd17e5fSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8574b042e37fSmrg
85758bd17e5fSmrg  _LT_CONFIG($1)
85768bd17e5fSmrgfi
8577b042e37fSmrg
85788bd17e5fSmrgAC_LANG_RESTORE
8579b042e37fSmrg
85808bd17e5fSmrgGCC=$lt_save_GCC
85818bd17e5fSmrgCC=$lt_save_CC
85828bd17e5fSmrgCFLAGS=$lt_save_CFLAGS
85838bd17e5fSmrg])# _LT_LANG_GO_CONFIG
8584b042e37fSmrg
8585b042e37fSmrg
85868bd17e5fSmrg# _LT_LANG_RC_CONFIG([TAG])
85878bd17e5fSmrg# -------------------------
85888bd17e5fSmrg# Ensure that the configuration variables for the Windows resource compiler
85898bd17e5fSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
85908bd17e5fSmrg# to write the compiler configuration to `libtool'.
85918bd17e5fSmrgm4_defun([_LT_LANG_RC_CONFIG],
85928bd17e5fSmrg[AC_REQUIRE([LT_PROG_RC])dnl
85938bd17e5fSmrgAC_LANG_SAVE
8594b042e37fSmrg
85958bd17e5fSmrg# Source file extension for RC test sources.
85968bd17e5fSmrgac_ext=rc
8597b042e37fSmrg
85988bd17e5fSmrg# Object file extension for compiled RC test sources.
85998bd17e5fSmrgobjext=o
86008bd17e5fSmrg_LT_TAGVAR(objext, $1)=$objext
8601b042e37fSmrg
86028bd17e5fSmrg# Code to be used in simple compile tests
86038bd17e5fSmrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8604b042e37fSmrg
86058bd17e5fSmrg# Code to be used in simple link tests
86068bd17e5fSmrglt_simple_link_test_code="$lt_simple_compile_test_code"
8607b042e37fSmrg
86088bd17e5fSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
86098bd17e5fSmrg_LT_TAG_COMPILER
8610b042e37fSmrg
86118bd17e5fSmrg# save warnings/boilerplate of simple test code
86128bd17e5fSmrg_LT_COMPILER_BOILERPLATE
86138bd17e5fSmrg_LT_LINKER_BOILERPLATE
8614b042e37fSmrg
86158bd17e5fSmrg# Allow CC to be a program name with arguments.
86168bd17e5fSmrglt_save_CC="$CC"
86178bd17e5fSmrglt_save_CFLAGS=$CFLAGS
86188bd17e5fSmrglt_save_GCC=$GCC
86198bd17e5fSmrgGCC=
86208bd17e5fSmrgCC=${RC-"windres"}
86218bd17e5fSmrgCFLAGS=
86228bd17e5fSmrgcompiler=$CC
86238bd17e5fSmrg_LT_TAGVAR(compiler, $1)=$CC
86248bd17e5fSmrg_LT_CC_BASENAME([$compiler])
86258bd17e5fSmrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8626b042e37fSmrg
86278bd17e5fSmrgif test -n "$compiler"; then
86288bd17e5fSmrg  :
86298bd17e5fSmrg  _LT_CONFIG($1)
86308bd17e5fSmrgfi
8631b042e37fSmrg
86328bd17e5fSmrgGCC=$lt_save_GCC
86338bd17e5fSmrgAC_LANG_RESTORE
86348bd17e5fSmrgCC=$lt_save_CC
86358bd17e5fSmrgCFLAGS=$lt_save_CFLAGS
86368bd17e5fSmrg])# _LT_LANG_RC_CONFIG
8637b042e37fSmrg
8638b042e37fSmrg
86398bd17e5fSmrg# LT_PROG_GCJ
86408bd17e5fSmrg# -----------
86418bd17e5fSmrgAC_DEFUN([LT_PROG_GCJ],
86428bd17e5fSmrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
86438bd17e5fSmrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
86448bd17e5fSmrg    [AC_CHECK_TOOL(GCJ, gcj,)
86458bd17e5fSmrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
86468bd17e5fSmrg      AC_SUBST(GCJFLAGS)])])[]dnl
86478bd17e5fSmrg])
8648b042e37fSmrg
86498bd17e5fSmrg# Old name:
86508bd17e5fSmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
86518bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
86528bd17e5fSmrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8653b042e37fSmrg
86540597fb56Smrg
86558bd17e5fSmrg# LT_PROG_GO
86568bd17e5fSmrg# ----------
86578bd17e5fSmrgAC_DEFUN([LT_PROG_GO],
86588bd17e5fSmrg[AC_CHECK_TOOL(GOC, gccgo,)
86598bd17e5fSmrg])
8660b042e37fSmrg
86618c4a8e55Smrg
86628bd17e5fSmrg# LT_PROG_RC
86638bd17e5fSmrg# ----------
86648bd17e5fSmrgAC_DEFUN([LT_PROG_RC],
86658bd17e5fSmrg[AC_CHECK_TOOL(RC, windres,)
86668bd17e5fSmrg])
8667b042e37fSmrg
86688bd17e5fSmrg# Old name:
86698bd17e5fSmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
86708bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
86718bd17e5fSmrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
8672b042e37fSmrg
8673b042e37fSmrg
86748bd17e5fSmrg# _LT_DECL_EGREP
86758bd17e5fSmrg# --------------
86768bd17e5fSmrg# If we don't have a new enough Autoconf to choose the best grep
86778bd17e5fSmrg# available, choose the one first in the user's PATH.
86788bd17e5fSmrgm4_defun([_LT_DECL_EGREP],
86798bd17e5fSmrg[AC_REQUIRE([AC_PROG_EGREP])dnl
86808bd17e5fSmrgAC_REQUIRE([AC_PROG_FGREP])dnl
86818bd17e5fSmrgtest -z "$GREP" && GREP=grep
86828bd17e5fSmrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
86838bd17e5fSmrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
86848bd17e5fSmrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
86858bd17e5fSmrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
86868bd17e5fSmrgAC_SUBST([GREP])
86878bd17e5fSmrg])
8688b042e37fSmrg
8689b042e37fSmrg
86908bd17e5fSmrg# _LT_DECL_OBJDUMP
86918bd17e5fSmrg# --------------
86928bd17e5fSmrg# If we don't have a new enough Autoconf to choose the best objdump
86938bd17e5fSmrg# available, choose the one first in the user's PATH.
86948bd17e5fSmrgm4_defun([_LT_DECL_OBJDUMP],
86958bd17e5fSmrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
86968bd17e5fSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
86978bd17e5fSmrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
86988bd17e5fSmrgAC_SUBST([OBJDUMP])
86990597fb56Smrg])
8700b042e37fSmrg
87018bd17e5fSmrg# _LT_DECL_DLLTOOL
87028bd17e5fSmrg# ----------------
87038bd17e5fSmrg# Ensure DLLTOOL variable is set.
87048bd17e5fSmrgm4_defun([_LT_DECL_DLLTOOL],
87058bd17e5fSmrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
87068bd17e5fSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
87078bd17e5fSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
87088bd17e5fSmrgAC_SUBST([DLLTOOL])
87098bd17e5fSmrg])
8710b042e37fSmrg
87118bd17e5fSmrg# _LT_DECL_SED
87128bd17e5fSmrg# ------------
87138bd17e5fSmrg# Check for a fully-functional sed program, that truncates
87148bd17e5fSmrg# as few characters as possible.  Prefer GNU sed if found.
87158bd17e5fSmrgm4_defun([_LT_DECL_SED],
87168bd17e5fSmrg[AC_PROG_SED
87178bd17e5fSmrgtest -z "$SED" && SED=sed
87188bd17e5fSmrgXsed="$SED -e 1s/^X//"
87198bd17e5fSmrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
87208bd17e5fSmrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
87218bd17e5fSmrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
87228bd17e5fSmrg])# _LT_DECL_SED
8723b042e37fSmrg
87248bd17e5fSmrgm4_ifndef([AC_PROG_SED], [
87258bd17e5fSmrg# NOTE: This macro has been submitted for inclusion into   #
87268bd17e5fSmrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
87278bd17e5fSmrg#  a released version of Autoconf we should remove this    #
87288bd17e5fSmrg#  macro and use it instead.                               #
8729b042e37fSmrg
87308bd17e5fSmrgm4_defun([AC_PROG_SED],
87318bd17e5fSmrg[AC_MSG_CHECKING([for a sed that does not truncate output])
87328bd17e5fSmrgAC_CACHE_VAL(lt_cv_path_SED,
87338bd17e5fSmrg[# Loop through the user's path and test for sed and gsed.
87348bd17e5fSmrg# Then use that list of sed's as ones to test for truncation.
87358bd17e5fSmrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
87368bd17e5fSmrgfor as_dir in $PATH
87378bd17e5fSmrgdo
87388bd17e5fSmrg  IFS=$as_save_IFS
87398bd17e5fSmrg  test -z "$as_dir" && as_dir=.
87408bd17e5fSmrg  for lt_ac_prog in sed gsed; do
87418bd17e5fSmrg    for ac_exec_ext in '' $ac_executable_extensions; do
87428bd17e5fSmrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
87438bd17e5fSmrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
87448bd17e5fSmrg      fi
87458bd17e5fSmrg    done
87468bd17e5fSmrg  done
87478bd17e5fSmrgdone
87488bd17e5fSmrgIFS=$as_save_IFS
87498bd17e5fSmrglt_ac_max=0
87508bd17e5fSmrglt_ac_count=0
87518bd17e5fSmrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
87528bd17e5fSmrg# along with /bin/sed that truncates output.
87538bd17e5fSmrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
87548bd17e5fSmrg  test ! -f $lt_ac_sed && continue
87558bd17e5fSmrg  cat /dev/null > conftest.in
87568bd17e5fSmrg  lt_ac_count=0
87578bd17e5fSmrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
87588bd17e5fSmrg  # Check for GNU sed and select it if it is found.
87598bd17e5fSmrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
87608bd17e5fSmrg    lt_cv_path_SED=$lt_ac_sed
87618bd17e5fSmrg    break
87628bd17e5fSmrg  fi
87638bd17e5fSmrg  while true; do
87648bd17e5fSmrg    cat conftest.in conftest.in >conftest.tmp
87658bd17e5fSmrg    mv conftest.tmp conftest.in
87668bd17e5fSmrg    cp conftest.in conftest.nl
87678bd17e5fSmrg    echo >>conftest.nl
87688bd17e5fSmrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
87698bd17e5fSmrg    cmp -s conftest.out conftest.nl || break
87708bd17e5fSmrg    # 10000 chars as input seems more than enough
87718bd17e5fSmrg    test $lt_ac_count -gt 10 && break
87728bd17e5fSmrg    lt_ac_count=`expr $lt_ac_count + 1`
87738bd17e5fSmrg    if test $lt_ac_count -gt $lt_ac_max; then
87748bd17e5fSmrg      lt_ac_max=$lt_ac_count
87758bd17e5fSmrg      lt_cv_path_SED=$lt_ac_sed
87768bd17e5fSmrg    fi
87778bd17e5fSmrg  done
87788bd17e5fSmrgdone
87790597fb56Smrg])
87808bd17e5fSmrgSED=$lt_cv_path_SED
87818bd17e5fSmrgAC_SUBST([SED])
87828bd17e5fSmrgAC_MSG_RESULT([$SED])
87838bd17e5fSmrg])#AC_PROG_SED
87848bd17e5fSmrg])#m4_ifndef
87858c4a8e55Smrg
87868bd17e5fSmrg# Old name:
87878bd17e5fSmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
87888bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
87898bd17e5fSmrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
87900597fb56Smrg
87910597fb56Smrg
87928bd17e5fSmrg# _LT_CHECK_SHELL_FEATURES
87938bd17e5fSmrg# ------------------------
87948bd17e5fSmrg# Find out whether the shell is Bourne or XSI compatible,
87958bd17e5fSmrg# or has some other useful features.
87968bd17e5fSmrgm4_defun([_LT_CHECK_SHELL_FEATURES],
87978bd17e5fSmrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
87988bd17e5fSmrg# Try some XSI features
87998bd17e5fSmrgxsi_shell=no
88008bd17e5fSmrg( _lt_dummy="a/b/c"
88018bd17e5fSmrg  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
88028bd17e5fSmrg      = c,a/b,b/c, \
88038bd17e5fSmrg    && eval 'test $(( 1 + 1 )) -eq 2 \
88048bd17e5fSmrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
88058bd17e5fSmrg  && xsi_shell=yes
88068bd17e5fSmrgAC_MSG_RESULT([$xsi_shell])
88078bd17e5fSmrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
88080597fb56Smrg
88098bd17e5fSmrgAC_MSG_CHECKING([whether the shell understands "+="])
88108bd17e5fSmrglt_shell_append=no
88118bd17e5fSmrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
88128bd17e5fSmrg    >/dev/null 2>&1 \
88138bd17e5fSmrg  && lt_shell_append=yes
88148bd17e5fSmrgAC_MSG_RESULT([$lt_shell_append])
88158bd17e5fSmrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
88168c4a8e55Smrg
88178bd17e5fSmrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
88188bd17e5fSmrg  lt_unset=unset
88198bd17e5fSmrgelse
88208bd17e5fSmrg  lt_unset=false
88218bd17e5fSmrgfi
88228bd17e5fSmrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
88238c4a8e55Smrg
88248bd17e5fSmrg# test EBCDIC or ASCII
88258bd17e5fSmrgcase `echo X|tr X '\101'` in
88268bd17e5fSmrg A) # ASCII based system
88278bd17e5fSmrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
88288bd17e5fSmrg  lt_SP2NL='tr \040 \012'
88298bd17e5fSmrg  lt_NL2SP='tr \015\012 \040\040'
88308bd17e5fSmrg  ;;
88318bd17e5fSmrg *) # EBCDIC based system
88328bd17e5fSmrg  lt_SP2NL='tr \100 \n'
88338bd17e5fSmrg  lt_NL2SP='tr \r\n \100\100'
88348bd17e5fSmrg  ;;
88358bd17e5fSmrgesac
88368bd17e5fSmrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
88378bd17e5fSmrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
88388bd17e5fSmrg])# _LT_CHECK_SHELL_FEATURES
88398c4a8e55Smrg
88408c4a8e55Smrg
88418bd17e5fSmrg# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
88428bd17e5fSmrg# ------------------------------------------------------
88438bd17e5fSmrg# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
88448bd17e5fSmrg# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
88458bd17e5fSmrgm4_defun([_LT_PROG_FUNCTION_REPLACE],
88468bd17e5fSmrg[dnl {
88478bd17e5fSmrgsed -e '/^$1 ()$/,/^} # $1 /c\
88488bd17e5fSmrg$1 ()\
88498bd17e5fSmrg{\
88508bd17e5fSmrgm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
88518bd17e5fSmrg} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
88528bd17e5fSmrg  && mv -f "$cfgfile.tmp" "$cfgfile" \
88538bd17e5fSmrg    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
88548bd17e5fSmrgtest 0 -eq $? || _lt_function_replace_fail=:
88558bd17e5fSmrg])
8856bd23fbfaSmrg
88578c4a8e55Smrg
88588bd17e5fSmrg# _LT_PROG_REPLACE_SHELLFNS
88598bd17e5fSmrg# -------------------------
88608bd17e5fSmrg# Replace existing portable implementations of several shell functions with
88618bd17e5fSmrg# equivalent extended shell implementations where those features are available..
88628bd17e5fSmrgm4_defun([_LT_PROG_REPLACE_SHELLFNS],
88638bd17e5fSmrg[if test x"$xsi_shell" = xyes; then
88648bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
88658bd17e5fSmrg    case ${1} in
88668bd17e5fSmrg      */*) func_dirname_result="${1%/*}${2}" ;;
88678bd17e5fSmrg      *  ) func_dirname_result="${3}" ;;
88688bd17e5fSmrg    esac])
8869bd23fbfaSmrg
88708bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
88718bd17e5fSmrg    func_basename_result="${1##*/}"])
8872bd23fbfaSmrg
88738bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
88748bd17e5fSmrg    case ${1} in
88758bd17e5fSmrg      */*) func_dirname_result="${1%/*}${2}" ;;
88768bd17e5fSmrg      *  ) func_dirname_result="${3}" ;;
88778bd17e5fSmrg    esac
88788bd17e5fSmrg    func_basename_result="${1##*/}"])
88798c4a8e55Smrg
88808bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
88818bd17e5fSmrg    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
88828bd17e5fSmrg    # positional parameters, so assign one to ordinary parameter first.
88838bd17e5fSmrg    func_stripname_result=${3}
88848bd17e5fSmrg    func_stripname_result=${func_stripname_result#"${1}"}
88858bd17e5fSmrg    func_stripname_result=${func_stripname_result%"${2}"}])
8886b042e37fSmrg
88878bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
88888bd17e5fSmrg    func_split_long_opt_name=${1%%=*}
88898bd17e5fSmrg    func_split_long_opt_arg=${1#*=}])
8890b042e37fSmrg
88918bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
88928bd17e5fSmrg    func_split_short_opt_arg=${1#??}
88938bd17e5fSmrg    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
8894b042e37fSmrg
88958bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
88968bd17e5fSmrg    case ${1} in
88978bd17e5fSmrg      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
88988bd17e5fSmrg      *)    func_lo2o_result=${1} ;;
88998bd17e5fSmrg    esac])
8900b042e37fSmrg
89018bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
8902b042e37fSmrg
89038bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
8904b042e37fSmrg
89058bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
89068bd17e5fSmrgfi
8907b042e37fSmrg
89088bd17e5fSmrgif test x"$lt_shell_append" = xyes; then
89098bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
8910b042e37fSmrg
89118bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
89128bd17e5fSmrg    func_quote_for_eval "${2}"
89138bd17e5fSmrgdnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
89148bd17e5fSmrg    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
89150597fb56Smrg
89168bd17e5fSmrg  # Save a `func_append' function call where possible by direct use of '+='
89178bd17e5fSmrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
89188bd17e5fSmrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
89198bd17e5fSmrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
89208bd17e5fSmrg  test 0 -eq $? || _lt_function_replace_fail=:
8921706b6b52Smrgelse
89228bd17e5fSmrg  # Save a `func_append' function call even when '+=' is not available
89238bd17e5fSmrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
89248bd17e5fSmrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
89258bd17e5fSmrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
89268bd17e5fSmrg  test 0 -eq $? || _lt_function_replace_fail=:
89278bd17e5fSmrgfi
8928b042e37fSmrg
89298bd17e5fSmrgif test x"$_lt_function_replace_fail" = x":"; then
89308bd17e5fSmrg  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
89318bd17e5fSmrgfi
89328bd17e5fSmrg])
8933b042e37fSmrg
89348bd17e5fSmrg# _LT_PATH_CONVERSION_FUNCTIONS
89358bd17e5fSmrg# -----------------------------
89368bd17e5fSmrg# Determine which file name conversion functions should be used by
89378bd17e5fSmrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
89388bd17e5fSmrg# for certain cross-compile configurations and native mingw.
89398bd17e5fSmrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
89408bd17e5fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
89418bd17e5fSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
89428bd17e5fSmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
89438bd17e5fSmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
89448bd17e5fSmrg[case $host in
89458bd17e5fSmrg  *-*-mingw* )
89468bd17e5fSmrg    case $build in
89478bd17e5fSmrg      *-*-mingw* ) # actually msys
89488bd17e5fSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
89498bd17e5fSmrg        ;;
89508bd17e5fSmrg      *-*-cygwin* )
89518bd17e5fSmrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
89528bd17e5fSmrg        ;;
89538bd17e5fSmrg      * ) # otherwise, assume *nix
89548bd17e5fSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
89558bd17e5fSmrg        ;;
89568bd17e5fSmrg    esac
89578bd17e5fSmrg    ;;
89588bd17e5fSmrg  *-*-cygwin* )
89598bd17e5fSmrg    case $build in
89608bd17e5fSmrg      *-*-mingw* ) # actually msys
89618bd17e5fSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
89628bd17e5fSmrg        ;;
89638bd17e5fSmrg      *-*-cygwin* )
89648bd17e5fSmrg        lt_cv_to_host_file_cmd=func_convert_file_noop
89658bd17e5fSmrg        ;;
89668bd17e5fSmrg      * ) # otherwise, assume *nix
89678bd17e5fSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
89688bd17e5fSmrg        ;;
89698bd17e5fSmrg    esac
89708bd17e5fSmrg    ;;
89718bd17e5fSmrg  * ) # unhandled hosts (and "normal" native builds)
89728bd17e5fSmrg    lt_cv_to_host_file_cmd=func_convert_file_noop
89738bd17e5fSmrg    ;;
89748bd17e5fSmrgesac
89758bd17e5fSmrg])
89768bd17e5fSmrgto_host_file_cmd=$lt_cv_to_host_file_cmd
89778bd17e5fSmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
89788bd17e5fSmrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
89798bd17e5fSmrg         [0], [convert $build file names to $host format])dnl
89808bd17e5fSmrg
89818bd17e5fSmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
89828bd17e5fSmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
89838bd17e5fSmrg[#assume ordinary cross tools, or native build.
89848bd17e5fSmrglt_cv_to_tool_file_cmd=func_convert_file_noop
89858bd17e5fSmrgcase $host in
89868bd17e5fSmrg  *-*-mingw* )
89878bd17e5fSmrg    case $build in
89888bd17e5fSmrg      *-*-mingw* ) # actually msys
89898bd17e5fSmrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
89908bd17e5fSmrg        ;;
89918bd17e5fSmrg    esac
89928bd17e5fSmrg    ;;
89938bd17e5fSmrgesac
89948bd17e5fSmrg])
89958bd17e5fSmrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
89968bd17e5fSmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
89978bd17e5fSmrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
89988bd17e5fSmrg         [0], [convert $build files to toolchain format])dnl
89998bd17e5fSmrg])# _LT_PATH_CONVERSION_FUNCTIONS
90008bd17e5fSmrg
90018bd17e5fSmrg# Helper functions for option handling.                    -*- Autoconf -*-
90020597fb56Smrg#
90038bd17e5fSmrg#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
90048bd17e5fSmrg#   Inc.
90058bd17e5fSmrg#   Written by Gary V. Vaughan, 2004
90060597fb56Smrg#
90078bd17e5fSmrg# This file is free software; the Free Software Foundation gives
90088bd17e5fSmrg# unlimited permission to copy and/or distribute it, with or without
90098bd17e5fSmrg# modifications, as long as this notice is preserved.
9010b042e37fSmrg
90118bd17e5fSmrg# serial 7 ltoptions.m4
9012b042e37fSmrg
90138bd17e5fSmrg# This is to help aclocal find these macros, as it can't see m4_define.
90148bd17e5fSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
90158bd17e5fSmrg
90168bd17e5fSmrg
90178bd17e5fSmrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
90188bd17e5fSmrg# ------------------------------------------
90198bd17e5fSmrgm4_define([_LT_MANGLE_OPTION],
90208bd17e5fSmrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
9021b042e37fSmrg
9022706b6b52Smrg
90238bd17e5fSmrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
90248bd17e5fSmrg# ---------------------------------------
90258bd17e5fSmrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
90268bd17e5fSmrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
90278bd17e5fSmrg# saved as a flag.
90288bd17e5fSmrgm4_define([_LT_SET_OPTION],
90298bd17e5fSmrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
90308bd17e5fSmrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
90318bd17e5fSmrg        _LT_MANGLE_DEFUN([$1], [$2]),
90328bd17e5fSmrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
90338bd17e5fSmrg])
9034b042e37fSmrg
9035b042e37fSmrg
90368bd17e5fSmrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
90378bd17e5fSmrg# ------------------------------------------------------------
90388bd17e5fSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
90398bd17e5fSmrgm4_define([_LT_IF_OPTION],
90408bd17e5fSmrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
9041b042e37fSmrg
90428c4a8e55Smrg
90438bd17e5fSmrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
90448bd17e5fSmrg# -------------------------------------------------------
90458bd17e5fSmrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
90468bd17e5fSmrg# are set.
90478bd17e5fSmrgm4_define([_LT_UNLESS_OPTIONS],
90488bd17e5fSmrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
90498bd17e5fSmrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
90508bd17e5fSmrg		      [m4_define([$0_found])])])[]dnl
90518bd17e5fSmrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
90528bd17e5fSmrg])[]dnl
90538bd17e5fSmrg])
90540597fb56Smrg
90558c4a8e55Smrg
90568bd17e5fSmrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
90578bd17e5fSmrg# ----------------------------------------
90588bd17e5fSmrg# OPTION-LIST is a space-separated list of Libtool options associated
90598bd17e5fSmrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
90608bd17e5fSmrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
90618bd17e5fSmrg# the unknown option and exit.
90628bd17e5fSmrgm4_defun([_LT_SET_OPTIONS],
90638bd17e5fSmrg[# Set options
90648bd17e5fSmrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
90658bd17e5fSmrg    [_LT_SET_OPTION([$1], _LT_Option)])
90668c4a8e55Smrg
90678bd17e5fSmrgm4_if([$1],[LT_INIT],[
90688bd17e5fSmrg  dnl
90698bd17e5fSmrg  dnl Simply set some default values (i.e off) if boolean options were not
90708bd17e5fSmrg  dnl specified:
90718bd17e5fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
90728bd17e5fSmrg  ])
90738bd17e5fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
90748bd17e5fSmrg  ])
90758bd17e5fSmrg  dnl
90768bd17e5fSmrg  dnl If no reference was made to various pairs of opposing options, then
90778bd17e5fSmrg  dnl we run the default mode handler for the pair.  For example, if neither
90788bd17e5fSmrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
90798bd17e5fSmrg  dnl archives by default:
90808bd17e5fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
90818bd17e5fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
90828bd17e5fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
90838bd17e5fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
90848bd17e5fSmrg  		   [_LT_ENABLE_FAST_INSTALL])
90858bd17e5fSmrg  ])
90868bd17e5fSmrg])# _LT_SET_OPTIONS
90878c4a8e55Smrg
90888c4a8e55Smrg
90898c4a8e55Smrg
90908bd17e5fSmrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
90918bd17e5fSmrg# -----------------------------------------
90928bd17e5fSmrgm4_define([_LT_MANGLE_DEFUN],
90938bd17e5fSmrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
90948c4a8e55Smrg
90958c4a8e55Smrg
90968bd17e5fSmrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
90978bd17e5fSmrg# -----------------------------------------------
90988bd17e5fSmrgm4_define([LT_OPTION_DEFINE],
90998bd17e5fSmrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
91008bd17e5fSmrg])# LT_OPTION_DEFINE
91018c4a8e55Smrg
91028c4a8e55Smrg
91038bd17e5fSmrg# dlopen
91048bd17e5fSmrg# ------
91058bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
91068bd17e5fSmrg])
91078c4a8e55Smrg
91088bd17e5fSmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
91098bd17e5fSmrg[_LT_SET_OPTION([LT_INIT], [dlopen])
91108bd17e5fSmrgAC_DIAGNOSE([obsolete],
91118bd17e5fSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
91128bd17e5fSmrgput the `dlopen' option into LT_INIT's first parameter.])
91138bd17e5fSmrg])
9114b042e37fSmrg
91158bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
91168bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
9117b042e37fSmrg
9118b042e37fSmrg
91198bd17e5fSmrg# win32-dll
91208bd17e5fSmrg# ---------
91218bd17e5fSmrg# Declare package support for building win32 dll's.
91228bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
91238bd17e5fSmrg[enable_win32_dll=yes
9124b042e37fSmrg
91258bd17e5fSmrgcase $host in
91268bd17e5fSmrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
91278bd17e5fSmrg  AC_CHECK_TOOL(AS, as, false)
91288bd17e5fSmrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
91298bd17e5fSmrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
91308bd17e5fSmrg  ;;
91318bd17e5fSmrgesac
91328bd17e5fSmrg
91338bd17e5fSmrgtest -z "$AS" && AS=as
91348bd17e5fSmrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
91358bd17e5fSmrg
91368bd17e5fSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
91378bd17e5fSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
91388bd17e5fSmrg
91398bd17e5fSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
91408bd17e5fSmrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
91418bd17e5fSmrg])# win32-dll
9142b042e37fSmrg
91438bd17e5fSmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
91448bd17e5fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
91458bd17e5fSmrg_LT_SET_OPTION([LT_INIT], [win32-dll])
91468bd17e5fSmrgAC_DIAGNOSE([obsolete],
91478bd17e5fSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
91488bd17e5fSmrgput the `win32-dll' option into LT_INIT's first parameter.])
91498bd17e5fSmrg])
9150b042e37fSmrg
91518bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
91528bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
9153b042e37fSmrg
9154b042e37fSmrg
91558bd17e5fSmrg# _LT_ENABLE_SHARED([DEFAULT])
91568bd17e5fSmrg# ----------------------------
91578bd17e5fSmrg# implement the --enable-shared flag, and supports the `shared' and
91588bd17e5fSmrg# `disable-shared' LT_INIT options.
91598bd17e5fSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
91608bd17e5fSmrgm4_define([_LT_ENABLE_SHARED],
91618bd17e5fSmrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
91628bd17e5fSmrgAC_ARG_ENABLE([shared],
91638bd17e5fSmrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
91648bd17e5fSmrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
91658bd17e5fSmrg    [p=${PACKAGE-default}
91668bd17e5fSmrg    case $enableval in
91678bd17e5fSmrg    yes) enable_shared=yes ;;
91688bd17e5fSmrg    no) enable_shared=no ;;
91698bd17e5fSmrg    *)
91708bd17e5fSmrg      enable_shared=no
91718bd17e5fSmrg      # Look at the argument we got.  We use all the common list separators.
91728bd17e5fSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
91738bd17e5fSmrg      for pkg in $enableval; do
91748bd17e5fSmrg	IFS="$lt_save_ifs"
91758bd17e5fSmrg	if test "X$pkg" = "X$p"; then
91768bd17e5fSmrg	  enable_shared=yes
91778bd17e5fSmrg	fi
91788bd17e5fSmrg      done
91798bd17e5fSmrg      IFS="$lt_save_ifs"
91808bd17e5fSmrg      ;;
91818bd17e5fSmrg    esac],
91828bd17e5fSmrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
9183b042e37fSmrg
91848bd17e5fSmrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
91858bd17e5fSmrg	[Whether or not to build shared libraries])
91868bd17e5fSmrg])# _LT_ENABLE_SHARED
9187b042e37fSmrg
91888bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
91898bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
91900597fb56Smrg
91918bd17e5fSmrg# Old names:
91928bd17e5fSmrgAC_DEFUN([AC_ENABLE_SHARED],
91938bd17e5fSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
91948bd17e5fSmrg])
9195b042e37fSmrg
91968bd17e5fSmrgAC_DEFUN([AC_DISABLE_SHARED],
91978bd17e5fSmrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
91988bd17e5fSmrg])
9199b042e37fSmrg
92008bd17e5fSmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
92018bd17e5fSmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
9202b042e37fSmrg
92038bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
92048bd17e5fSmrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
92058bd17e5fSmrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
9206b042e37fSmrg
9207b042e37fSmrg
9208b042e37fSmrg
92098bd17e5fSmrg# _LT_ENABLE_STATIC([DEFAULT])
92108bd17e5fSmrg# ----------------------------
92118bd17e5fSmrg# implement the --enable-static flag, and support the `static' and
92128bd17e5fSmrg# `disable-static' LT_INIT options.
92138bd17e5fSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
92148bd17e5fSmrgm4_define([_LT_ENABLE_STATIC],
92158bd17e5fSmrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
92168bd17e5fSmrgAC_ARG_ENABLE([static],
92178bd17e5fSmrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
92188bd17e5fSmrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
92198bd17e5fSmrg    [p=${PACKAGE-default}
92208bd17e5fSmrg    case $enableval in
92218bd17e5fSmrg    yes) enable_static=yes ;;
92228bd17e5fSmrg    no) enable_static=no ;;
92238bd17e5fSmrg    *)
92248bd17e5fSmrg     enable_static=no
92258bd17e5fSmrg      # Look at the argument we got.  We use all the common list separators.
92268bd17e5fSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
92278bd17e5fSmrg      for pkg in $enableval; do
92288bd17e5fSmrg	IFS="$lt_save_ifs"
92298bd17e5fSmrg	if test "X$pkg" = "X$p"; then
92308bd17e5fSmrg	  enable_static=yes
92318bd17e5fSmrg	fi
92328bd17e5fSmrg      done
92338bd17e5fSmrg      IFS="$lt_save_ifs"
92348bd17e5fSmrg      ;;
92358bd17e5fSmrg    esac],
92368bd17e5fSmrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
92378c4a8e55Smrg
92388bd17e5fSmrg    _LT_DECL([build_old_libs], [enable_static], [0],
92398bd17e5fSmrg	[Whether or not to build static libraries])
92408bd17e5fSmrg])# _LT_ENABLE_STATIC
92418c4a8e55Smrg
92428bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
92438bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
9244b042e37fSmrg
92458bd17e5fSmrg# Old names:
92468bd17e5fSmrgAC_DEFUN([AC_ENABLE_STATIC],
92478bd17e5fSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
92488bd17e5fSmrg])
92498c4a8e55Smrg
92508bd17e5fSmrgAC_DEFUN([AC_DISABLE_STATIC],
92518bd17e5fSmrg[_LT_SET_OPTION([LT_INIT], [disable-static])
92528bd17e5fSmrg])
9253706b6b52Smrg
92548bd17e5fSmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
92558bd17e5fSmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
92568c4a8e55Smrg
92578bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
92588bd17e5fSmrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
92598bd17e5fSmrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
92600597fb56Smrg
92610597fb56Smrg
92620597fb56Smrg
92638bd17e5fSmrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
92648bd17e5fSmrg# ----------------------------------
92658bd17e5fSmrg# implement the --enable-fast-install flag, and support the `fast-install'
92668bd17e5fSmrg# and `disable-fast-install' LT_INIT options.
92678bd17e5fSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
92688bd17e5fSmrgm4_define([_LT_ENABLE_FAST_INSTALL],
92698bd17e5fSmrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
92708bd17e5fSmrgAC_ARG_ENABLE([fast-install],
92718bd17e5fSmrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
92728bd17e5fSmrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
92738bd17e5fSmrg    [p=${PACKAGE-default}
92748bd17e5fSmrg    case $enableval in
92758bd17e5fSmrg    yes) enable_fast_install=yes ;;
92768bd17e5fSmrg    no) enable_fast_install=no ;;
92778bd17e5fSmrg    *)
92788bd17e5fSmrg      enable_fast_install=no
92798bd17e5fSmrg      # Look at the argument we got.  We use all the common list separators.
92808bd17e5fSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
92818bd17e5fSmrg      for pkg in $enableval; do
92828bd17e5fSmrg	IFS="$lt_save_ifs"
92838bd17e5fSmrg	if test "X$pkg" = "X$p"; then
92848bd17e5fSmrg	  enable_fast_install=yes
92858bd17e5fSmrg	fi
92868bd17e5fSmrg      done
92878bd17e5fSmrg      IFS="$lt_save_ifs"
92888bd17e5fSmrg      ;;
92898bd17e5fSmrg    esac],
92908bd17e5fSmrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
92918c4a8e55Smrg
92928bd17e5fSmrg_LT_DECL([fast_install], [enable_fast_install], [0],
92938bd17e5fSmrg	 [Whether or not to optimize for fast installation])dnl
92948bd17e5fSmrg])# _LT_ENABLE_FAST_INSTALL
92958c4a8e55Smrg
92968bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
92978bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
92988c4a8e55Smrg
92998bd17e5fSmrg# Old names:
93008bd17e5fSmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
93018bd17e5fSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
93028bd17e5fSmrgAC_DIAGNOSE([obsolete],
93038bd17e5fSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
93048bd17e5fSmrgthe `fast-install' option into LT_INIT's first parameter.])
93058bd17e5fSmrg])
93068c4a8e55Smrg
93078bd17e5fSmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
93088bd17e5fSmrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
93098bd17e5fSmrgAC_DIAGNOSE([obsolete],
93108bd17e5fSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
93118bd17e5fSmrgthe `disable-fast-install' option into LT_INIT's first parameter.])
93128bd17e5fSmrg])
93138c4a8e55Smrg
93148bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
93158bd17e5fSmrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
93168bd17e5fSmrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
93178c4a8e55Smrg
93188c4a8e55Smrg
93198bd17e5fSmrg# _LT_WITH_PIC([MODE])
93208bd17e5fSmrg# --------------------
93218bd17e5fSmrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
93228bd17e5fSmrg# LT_INIT options.
93238bd17e5fSmrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
93248bd17e5fSmrgm4_define([_LT_WITH_PIC],
93258bd17e5fSmrg[AC_ARG_WITH([pic],
93268bd17e5fSmrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
93278bd17e5fSmrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
93288bd17e5fSmrg    [lt_p=${PACKAGE-default}
93298bd17e5fSmrg    case $withval in
93308bd17e5fSmrg    yes|no) pic_mode=$withval ;;
93318bd17e5fSmrg    *)
93328bd17e5fSmrg      pic_mode=default
93338bd17e5fSmrg      # Look at the argument we got.  We use all the common list separators.
93348bd17e5fSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
93358bd17e5fSmrg      for lt_pkg in $withval; do
93368bd17e5fSmrg	IFS="$lt_save_ifs"
93378bd17e5fSmrg	if test "X$lt_pkg" = "X$lt_p"; then
93388bd17e5fSmrg	  pic_mode=yes
93398bd17e5fSmrg	fi
93408bd17e5fSmrg      done
93418bd17e5fSmrg      IFS="$lt_save_ifs"
93428bd17e5fSmrg      ;;
93438bd17e5fSmrg    esac],
93448bd17e5fSmrg    [pic_mode=default])
93458bd17e5fSmrg
93468bd17e5fSmrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
93478bd17e5fSmrg
93488bd17e5fSmrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
93498bd17e5fSmrg])# _LT_WITH_PIC
93508c4a8e55Smrg
93518bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
93528bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
93538c4a8e55Smrg
93548bd17e5fSmrg# Old name:
93558bd17e5fSmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
93568bd17e5fSmrg[_LT_SET_OPTION([LT_INIT], [pic-only])
93578bd17e5fSmrgAC_DIAGNOSE([obsolete],
93588bd17e5fSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
93598bd17e5fSmrgput the `pic-only' option into LT_INIT's first parameter.])
93608bd17e5fSmrg])
93618bd17e5fSmrg
93628bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
93638bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
93648bd17e5fSmrg
93658bd17e5fSmrg
93668bd17e5fSmrgm4_define([_LTDL_MODE], [])
93678bd17e5fSmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
93688bd17e5fSmrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
93698bd17e5fSmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
93708bd17e5fSmrg		 [m4_define([_LTDL_MODE], [recursive])])
93718bd17e5fSmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
93728bd17e5fSmrg		 [m4_define([_LTDL_MODE], [subproject])])
93738bd17e5fSmrg
93748bd17e5fSmrgm4_define([_LTDL_TYPE], [])
93758bd17e5fSmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
93768bd17e5fSmrg		 [m4_define([_LTDL_TYPE], [installable])])
93778bd17e5fSmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
93788bd17e5fSmrg		 [m4_define([_LTDL_TYPE], [convenience])])
93798bd17e5fSmrg
93808bd17e5fSmrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
93810597fb56Smrg#
93828bd17e5fSmrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
93838bd17e5fSmrg# Written by Gary V. Vaughan, 2004
93840597fb56Smrg#
93858bd17e5fSmrg# This file is free software; the Free Software Foundation gives
93868bd17e5fSmrg# unlimited permission to copy and/or distribute it, with or without
93878bd17e5fSmrg# modifications, as long as this notice is preserved.
93888bd17e5fSmrg
93898bd17e5fSmrg# serial 6 ltsugar.m4
93908bd17e5fSmrg
93918bd17e5fSmrg# This is to help aclocal find these macros, as it can't see m4_define.
93928bd17e5fSmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
93938bd17e5fSmrg
93948bd17e5fSmrg
93958bd17e5fSmrg# lt_join(SEP, ARG1, [ARG2...])
93968bd17e5fSmrg# -----------------------------
93978bd17e5fSmrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
93988bd17e5fSmrg# associated separator.
93998bd17e5fSmrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
94008bd17e5fSmrg# versions in m4sugar had bugs.
94018bd17e5fSmrgm4_define([lt_join],
94028bd17e5fSmrg[m4_if([$#], [1], [],
94038bd17e5fSmrg       [$#], [2], [[$2]],
94048bd17e5fSmrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
94058bd17e5fSmrgm4_define([_lt_join],
94068bd17e5fSmrg[m4_if([$#$2], [2], [],
94078bd17e5fSmrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
94088bd17e5fSmrg
94098bd17e5fSmrg
94108bd17e5fSmrg# lt_car(LIST)
94118bd17e5fSmrg# lt_cdr(LIST)
94128bd17e5fSmrg# ------------
94138bd17e5fSmrg# Manipulate m4 lists.
94148bd17e5fSmrg# These macros are necessary as long as will still need to support
94158bd17e5fSmrg# Autoconf-2.59 which quotes differently.
94168bd17e5fSmrgm4_define([lt_car], [[$1]])
94178bd17e5fSmrgm4_define([lt_cdr],
94188bd17e5fSmrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
94198bd17e5fSmrg       [$#], 1, [],
94208bd17e5fSmrg       [m4_dquote(m4_shift($@))])])
94218bd17e5fSmrgm4_define([lt_unquote], $1)
94228bd17e5fSmrg
94238bd17e5fSmrg
94248bd17e5fSmrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
94258bd17e5fSmrg# ------------------------------------------
94268bd17e5fSmrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
94278bd17e5fSmrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
94288bd17e5fSmrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
94298bd17e5fSmrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
94308bd17e5fSmrg# than defined and empty).
94310597fb56Smrg#
94328bd17e5fSmrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
94338bd17e5fSmrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
94348bd17e5fSmrgm4_define([lt_append],
94358bd17e5fSmrg[m4_define([$1],
94368bd17e5fSmrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
94378c4a8e55Smrg
94388c4a8e55Smrg
94398c4a8e55Smrg
94408bd17e5fSmrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
94418bd17e5fSmrg# ----------------------------------------------------------
94428bd17e5fSmrg# Produce a SEP delimited list of all paired combinations of elements of
94438bd17e5fSmrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
94448bd17e5fSmrg# has the form PREFIXmINFIXSUFFIXn.
94458bd17e5fSmrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
94468bd17e5fSmrgm4_define([lt_combine],
94478bd17e5fSmrg[m4_if(m4_eval([$# > 3]), [1],
94488bd17e5fSmrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
94498bd17e5fSmrg[[m4_foreach([_Lt_prefix], [$2],
94508bd17e5fSmrg	     [m4_foreach([_Lt_suffix],
94518bd17e5fSmrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
94528bd17e5fSmrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
94538c4a8e55Smrg
94548c4a8e55Smrg
94558bd17e5fSmrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
94568bd17e5fSmrg# -----------------------------------------------------------------------
94578bd17e5fSmrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
94588bd17e5fSmrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
94598bd17e5fSmrgm4_define([lt_if_append_uniq],
94608bd17e5fSmrg[m4_ifdef([$1],
94618bd17e5fSmrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
94628bd17e5fSmrg		 [lt_append([$1], [$2], [$3])$4],
94638bd17e5fSmrg		 [$5])],
94648bd17e5fSmrg	  [lt_append([$1], [$2], [$3])$4])])
94658c4a8e55Smrg
94668c4a8e55Smrg
94678bd17e5fSmrg# lt_dict_add(DICT, KEY, VALUE)
94688bd17e5fSmrg# -----------------------------
94698bd17e5fSmrgm4_define([lt_dict_add],
94708bd17e5fSmrg[m4_define([$1($2)], [$3])])
94718c4a8e55Smrg
94728c4a8e55Smrg
94738bd17e5fSmrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
94748bd17e5fSmrg# --------------------------------------------
94758bd17e5fSmrgm4_define([lt_dict_add_subkey],
94768bd17e5fSmrg[m4_define([$1($2:$3)], [$4])])
94770597fb56Smrg
94788c4a8e55Smrg
94798bd17e5fSmrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
94808bd17e5fSmrg# ----------------------------------
94818bd17e5fSmrgm4_define([lt_dict_fetch],
94828bd17e5fSmrg[m4_ifval([$3],
94838bd17e5fSmrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
94848bd17e5fSmrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
94858c4a8e55Smrg
94868c4a8e55Smrg
94878bd17e5fSmrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
94888bd17e5fSmrg# -----------------------------------------------------------------
94898bd17e5fSmrgm4_define([lt_if_dict_fetch],
94908bd17e5fSmrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
94918bd17e5fSmrg	[$5],
94928bd17e5fSmrg    [$6])])
94938bd17e5fSmrg
94948c4a8e55Smrg
94958bd17e5fSmrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
94968bd17e5fSmrg# --------------------------------------------------------------
94978bd17e5fSmrgm4_define([lt_dict_filter],
94988bd17e5fSmrg[m4_if([$5], [], [],
94998bd17e5fSmrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
95008bd17e5fSmrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
95018bd17e5fSmrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
95028bd17e5fSmrg])
95038c4a8e55Smrg
95048bd17e5fSmrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
95050597fb56Smrg#
95068bd17e5fSmrg#   Copyright (C) 2004 Free Software Foundation, Inc.
95078bd17e5fSmrg#   Written by Scott James Remnant, 2004
95080597fb56Smrg#
95098bd17e5fSmrg# This file is free software; the Free Software Foundation gives
95108bd17e5fSmrg# unlimited permission to copy and/or distribute it, with or without
95118bd17e5fSmrg# modifications, as long as this notice is preserved.
95128c4a8e55Smrg
95138bd17e5fSmrg# @configure_input@
95148c4a8e55Smrg
95158bd17e5fSmrg# serial 3337 ltversion.m4
95168bd17e5fSmrg# This file is part of GNU Libtool
95178c4a8e55Smrg
95188bd17e5fSmrgm4_define([LT_PACKAGE_VERSION], [2.4.2])
95198bd17e5fSmrgm4_define([LT_PACKAGE_REVISION], [1.3337])
9520706b6b52Smrg
95218bd17e5fSmrgAC_DEFUN([LTVERSION_VERSION],
95228bd17e5fSmrg[macro_version='2.4.2'
95238bd17e5fSmrgmacro_revision='1.3337'
95248bd17e5fSmrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
95258bd17e5fSmrg_LT_DECL(, macro_revision, 0)
95268bd17e5fSmrg])
9527706b6b52Smrg
95288bd17e5fSmrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
95290597fb56Smrg#
95308bd17e5fSmrg#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
95318bd17e5fSmrg#   Written by Scott James Remnant, 2004.
95320597fb56Smrg#
95338bd17e5fSmrg# This file is free software; the Free Software Foundation gives
95348bd17e5fSmrg# unlimited permission to copy and/or distribute it, with or without
95358bd17e5fSmrg# modifications, as long as this notice is preserved.
95368bd17e5fSmrg
95378bd17e5fSmrg# serial 5 lt~obsolete.m4
95388bd17e5fSmrg
95398bd17e5fSmrg# These exist entirely to fool aclocal when bootstrapping libtool.
95400597fb56Smrg#
95418bd17e5fSmrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
95428bd17e5fSmrg# which have later been changed to m4_define as they aren't part of the
95438bd17e5fSmrg# exported API, or moved to Autoconf or Automake where they belong.
95440597fb56Smrg#
95458bd17e5fSmrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
95468bd17e5fSmrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
95478bd17e5fSmrg# using a macro with the same name in our local m4/libtool.m4 it'll
95488bd17e5fSmrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
95498bd17e5fSmrg# and doesn't know about Autoconf macros at all.)
95500597fb56Smrg#
95518bd17e5fSmrg# So we provide this file, which has a silly filename so it's always
95528bd17e5fSmrg# included after everything else.  This provides aclocal with the
95538bd17e5fSmrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
95548bd17e5fSmrg# because those macros already exist, or will be overwritten later.
95558bd17e5fSmrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
95568bd17e5fSmrg#
95578bd17e5fSmrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
95588bd17e5fSmrg# Yes, that means every name once taken will need to remain here until
95598bd17e5fSmrg# we give up compatibility with versions before 1.7, at which point
95608bd17e5fSmrg# we need to keep only those names which we still refer to.
95618bd17e5fSmrg
95628bd17e5fSmrg# This is to help aclocal find these macros, as it can't see m4_define.
95638bd17e5fSmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
95648bd17e5fSmrg
95658bd17e5fSmrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
95668bd17e5fSmrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
95678bd17e5fSmrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
95688bd17e5fSmrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
95698bd17e5fSmrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
95708bd17e5fSmrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
95718bd17e5fSmrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
95728bd17e5fSmrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
95738bd17e5fSmrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
95748bd17e5fSmrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
95758bd17e5fSmrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
95768bd17e5fSmrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
95778bd17e5fSmrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
95788bd17e5fSmrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
95798bd17e5fSmrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
95808bd17e5fSmrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
95818bd17e5fSmrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
95828bd17e5fSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
95838bd17e5fSmrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
95848bd17e5fSmrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
95858bd17e5fSmrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
95868bd17e5fSmrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
95878bd17e5fSmrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
95888bd17e5fSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
95898bd17e5fSmrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
95908bd17e5fSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
95918bd17e5fSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
95928bd17e5fSmrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
95938bd17e5fSmrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
95948bd17e5fSmrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
95958bd17e5fSmrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
95968bd17e5fSmrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
95978bd17e5fSmrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
95988bd17e5fSmrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
95998bd17e5fSmrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
96008bd17e5fSmrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
96018bd17e5fSmrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
96028bd17e5fSmrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
96038bd17e5fSmrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
96048bd17e5fSmrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
96058bd17e5fSmrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
96068bd17e5fSmrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
96078bd17e5fSmrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
96088bd17e5fSmrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
96098bd17e5fSmrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
96108bd17e5fSmrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
96118bd17e5fSmrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
96128bd17e5fSmrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
96138bd17e5fSmrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
96148bd17e5fSmrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
96158bd17e5fSmrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
96168bd17e5fSmrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
96178bd17e5fSmrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
96188bd17e5fSmrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
96198bd17e5fSmrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
96208bd17e5fSmrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
96218bd17e5fSmrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
96228bd17e5fSmrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
96238bd17e5fSmrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
96248bd17e5fSmrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
96258bd17e5fSmrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
96268c4a8e55Smrg
96278bd17e5fSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
96288bd17e5fSmrg# 
96298bd17e5fSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
96300597fb56Smrg#
96318bd17e5fSmrg# This program is free software; you can redistribute it and/or modify
96328bd17e5fSmrg# it under the terms of the GNU General Public License as published by
96338bd17e5fSmrg# the Free Software Foundation; either version 2 of the License, or
96348bd17e5fSmrg# (at your option) any later version.
96350597fb56Smrg#
96368bd17e5fSmrg# This program is distributed in the hope that it will be useful, but
96378bd17e5fSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
96388bd17e5fSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
96398bd17e5fSmrg# General Public License for more details.
96400597fb56Smrg#
96418bd17e5fSmrg# You should have received a copy of the GNU General Public License
96428bd17e5fSmrg# along with this program; if not, write to the Free Software
96438bd17e5fSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
96440597fb56Smrg#
96458bd17e5fSmrg# As a special exception to the GNU General Public License, if you
96468bd17e5fSmrg# distribute this file as part of a program that contains a
96478bd17e5fSmrg# configuration script generated by Autoconf, you may include it under
96488bd17e5fSmrg# the same distribution terms that you use for the rest of that program.
96498bd17e5fSmrg
96508bd17e5fSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
96518bd17e5fSmrg# ----------------------------------
96528bd17e5fSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
96538bd17e5fSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
96548bd17e5fSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
96558bd17e5fSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
96568bd17e5fSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
96578bd17e5fSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
9658706b6b52Smrgfi
96598bd17e5fSmrgif test -n "$PKG_CONFIG"; then
96608bd17e5fSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
96618bd17e5fSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
96628bd17e5fSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
96638bd17e5fSmrg		AC_MSG_RESULT([yes])
96648bd17e5fSmrg	else
96658bd17e5fSmrg		AC_MSG_RESULT([no])
96668bd17e5fSmrg		PKG_CONFIG=""
96678bd17e5fSmrg	fi
96688bd17e5fSmrg		
96698bd17e5fSmrgfi[]dnl
96708bd17e5fSmrg])# PKG_PROG_PKG_CONFIG
96718c4a8e55Smrg
96728bd17e5fSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
96730597fb56Smrg#
96748bd17e5fSmrg# Check to see whether a particular set of modules exists.  Similar
96758bd17e5fSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
96760597fb56Smrg#
96770597fb56Smrg#
96788bd17e5fSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
96798bd17e5fSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
96808bd17e5fSmrg# PKG_CHECK_EXISTS manually
96818bd17e5fSmrg# --------------------------------------------------------------
96828bd17e5fSmrgAC_DEFUN([PKG_CHECK_EXISTS],
96838bd17e5fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
96848bd17e5fSmrgif test -n "$PKG_CONFIG" && \
96858bd17e5fSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
96868bd17e5fSmrg  m4_ifval([$2], [$2], [:])
96878bd17e5fSmrgm4_ifvaln([$3], [else
96888bd17e5fSmrg  $3])dnl
96898bd17e5fSmrgfi])
96908c4a8e55Smrg
96918c4a8e55Smrg
96928bd17e5fSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
96938bd17e5fSmrg# ---------------------------------------------
96948bd17e5fSmrgm4_define([_PKG_CONFIG],
96958bd17e5fSmrg[if test -n "$$1"; then
96968bd17e5fSmrg    pkg_cv_[]$1="$$1"
96978bd17e5fSmrg elif test -n "$PKG_CONFIG"; then
96988bd17e5fSmrg    PKG_CHECK_EXISTS([$3],
96998bd17e5fSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
97008bd17e5fSmrg		     [pkg_failed=yes])
97018bd17e5fSmrg else
97028bd17e5fSmrg    pkg_failed=untried
97038bd17e5fSmrgfi[]dnl
97048bd17e5fSmrg])# _PKG_CONFIG
97058c4a8e55Smrg
97068bd17e5fSmrg# _PKG_SHORT_ERRORS_SUPPORTED
97078bd17e5fSmrg# -----------------------------
97088bd17e5fSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
97098bd17e5fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
97108bd17e5fSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
97118bd17e5fSmrg        _pkg_short_errors_supported=yes
97120597fb56Smrgelse
97138bd17e5fSmrg        _pkg_short_errors_supported=no
97148bd17e5fSmrgfi[]dnl
97158bd17e5fSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
97168c4a8e55Smrg
97178c4a8e55Smrg
97188bd17e5fSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
97198bd17e5fSmrg# [ACTION-IF-NOT-FOUND])
97200597fb56Smrg#
97210597fb56Smrg#
97228bd17e5fSmrg# Note that if there is a possibility the first call to
97238bd17e5fSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
97248bd17e5fSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
97250597fb56Smrg#
97268bd17e5fSmrg#
97278bd17e5fSmrg# --------------------------------------------------------------
97288bd17e5fSmrgAC_DEFUN([PKG_CHECK_MODULES],
97298bd17e5fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
97308bd17e5fSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
97318bd17e5fSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
97328c4a8e55Smrg
97338bd17e5fSmrgpkg_failed=no
97348bd17e5fSmrgAC_MSG_CHECKING([for $1])
97358c4a8e55Smrg
97368bd17e5fSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
97378bd17e5fSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
97388c4a8e55Smrg
97398bd17e5fSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
97408bd17e5fSmrgand $1[]_LIBS to avoid the need to call pkg-config.
97418bd17e5fSmrgSee the pkg-config man page for more details.])
97428c4a8e55Smrg
97438bd17e5fSmrgif test $pkg_failed = yes; then
97448bd17e5fSmrg        _PKG_SHORT_ERRORS_SUPPORTED
97458bd17e5fSmrg        if test $_pkg_short_errors_supported = yes; then
97468bd17e5fSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
97478bd17e5fSmrg        else 
97488bd17e5fSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
97498bd17e5fSmrg        fi
97508bd17e5fSmrg	# Put the nasty error message in config.log where it belongs
97518bd17e5fSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
97528c4a8e55Smrg
97538bd17e5fSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
97548bd17e5fSmrg[Package requirements ($2) were not met:
97558c4a8e55Smrg
97568bd17e5fSmrg$$1_PKG_ERRORS
97578c4a8e55Smrg
97588bd17e5fSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
97598bd17e5fSmrginstalled software in a non-standard prefix.
97608c4a8e55Smrg
97618bd17e5fSmrg_PKG_TEXT
97628bd17e5fSmrg])],
97638bd17e5fSmrg		[AC_MSG_RESULT([no])
97648bd17e5fSmrg                $4])
97658bd17e5fSmrgelif test $pkg_failed = untried; then
97668bd17e5fSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
97678bd17e5fSmrg[The pkg-config script could not be found or is too old.  Make sure it
97688bd17e5fSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
97698bd17e5fSmrgpath to pkg-config.
9770bd23fbfaSmrg
97718bd17e5fSmrg_PKG_TEXT
9772bd23fbfaSmrg
97738bd17e5fSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
97748bd17e5fSmrg		[$4])
97758bd17e5fSmrgelse
97768bd17e5fSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
97778bd17e5fSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
97788bd17e5fSmrg        AC_MSG_RESULT([yes])
97798bd17e5fSmrg	ifelse([$3], , :, [$3])
97808bd17e5fSmrgfi[]dnl
97818bd17e5fSmrg])# PKG_CHECK_MODULES
97828c4a8e55Smrg
97838bd17e5fSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
97848bd17e5fSmrgdnl
97858bd17e5fSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
97868bd17e5fSmrgdnl 
97878bd17e5fSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
97888bd17e5fSmrgdnl copy of this software and associated documentation files (the "Software"),
97898bd17e5fSmrgdnl to deal in the Software without restriction, including without limitation
97908bd17e5fSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
97918bd17e5fSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
97928bd17e5fSmrgdnl Software is furnished to do so, subject to the following conditions:
97938bd17e5fSmrgdnl
97948bd17e5fSmrgdnl The above copyright notice and this permission notice (including the next
97958bd17e5fSmrgdnl paragraph) shall be included in all copies or substantial portions of the
97968bd17e5fSmrgdnl Software.
97978bd17e5fSmrgdnl
97988bd17e5fSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
97998bd17e5fSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
98008bd17e5fSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
98018bd17e5fSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
98028bd17e5fSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
98038bd17e5fSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
98048bd17e5fSmrgdnl DEALINGS IN THE SOFTWARE.
98058c4a8e55Smrg
98068bd17e5fSmrg# XORG_MACROS_VERSION(required-version)
98078bd17e5fSmrg# -------------------------------------
98088bd17e5fSmrg# Minimum version: 1.1.0
98090597fb56Smrg#
98108bd17e5fSmrg# If you're using a macro added in Version 1.1 or newer, include this in
98118bd17e5fSmrg# your configure.ac with the minimum required version, such as:
98128bd17e5fSmrg# XORG_MACROS_VERSION(1.1)
98130597fb56Smrg#
98148bd17e5fSmrg# To ensure that this macro is defined, also add:
98158bd17e5fSmrg# m4_ifndef([XORG_MACROS_VERSION],
98168bd17e5fSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
98170597fb56Smrg#
98180597fb56Smrg#
98198bd17e5fSmrg# See the "minimum version" comment for each macro you use to see what 
98208bd17e5fSmrg# version you require.
98218bd17e5fSmrgm4_defun([XORG_MACROS_VERSION],[
98228bd17e5fSmrgm4_define([vers_have], [1.17])
98238bd17e5fSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
98248bd17e5fSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
98258bd17e5fSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
98268bd17e5fSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
98278bd17e5fSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
98288bd17e5fSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
98298bd17e5fSmrgm4_undefine([vers_have])
98308bd17e5fSmrgm4_undefine([maj_have])
98318bd17e5fSmrgm4_undefine([maj_needed])
98328bd17e5fSmrg]) # XORG_MACROS_VERSION
98338bd17e5fSmrg
98348bd17e5fSmrg# XORG_PROG_RAWCPP()
98358bd17e5fSmrg# ------------------
98368bd17e5fSmrg# Minimum version: 1.0.0
98370597fb56Smrg#
98388bd17e5fSmrg# Find cpp program and necessary flags for use in pre-processing text files
98398bd17e5fSmrg# such as man pages and config files
98408bd17e5fSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
98418bd17e5fSmrgAC_REQUIRE([AC_PROG_CPP])
98428bd17e5fSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
98438bd17e5fSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
98440597fb56Smrg
98458bd17e5fSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
98468bd17e5fSmrg# which is not the best choice for supporting other OS'es, but covers most
98478bd17e5fSmrg# of the ones we need for now.
98488bd17e5fSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
98498bd17e5fSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
98508bd17e5fSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
98518bd17e5fSmrg	AC_MSG_RESULT([no])
98528bd17e5fSmrgelse
98538bd17e5fSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
98548bd17e5fSmrg		RAWCPPFLAGS=-undef
98558bd17e5fSmrg		AC_MSG_RESULT([yes])
98568bd17e5fSmrg	# under Cygwin unix is still defined even with -undef
98578bd17e5fSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
98588bd17e5fSmrg		RAWCPPFLAGS="-undef -ansi"
98598bd17e5fSmrg		AC_MSG_RESULT([yes, with -ansi])
98608bd17e5fSmrg	else
98618bd17e5fSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
98628bd17e5fSmrg	fi
98638bd17e5fSmrgfi
98648bd17e5fSmrgrm -f conftest.$ac_ext
98650597fb56Smrg
98668bd17e5fSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
98678bd17e5fSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
98688bd17e5fSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
98698bd17e5fSmrg	AC_MSG_RESULT([no])
98708bd17e5fSmrgelse
98718bd17e5fSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
98728bd17e5fSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
98738bd17e5fSmrg		AC_MSG_RESULT([yes])
98748bd17e5fSmrg	else
98758bd17e5fSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
98768bd17e5fSmrg	fi
98778bd17e5fSmrgfi
98788bd17e5fSmrgrm -f conftest.$ac_ext
98798bd17e5fSmrgAC_SUBST(RAWCPPFLAGS)
98808bd17e5fSmrg]) # XORG_PROG_RAWCPP
98818bd17e5fSmrg
98828bd17e5fSmrg# XORG_MANPAGE_SECTIONS()
98838bd17e5fSmrg# -----------------------
98848bd17e5fSmrg# Minimum version: 1.0.0
98858bd17e5fSmrg#
98868bd17e5fSmrg# Determine which sections man pages go in for the different man page types
98878bd17e5fSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
98888bd17e5fSmrg# Not sure if there's any better way than just hardcoding by OS name.
98898bd17e5fSmrg# Override default settings by setting environment variables
98908bd17e5fSmrg# Added MAN_SUBSTS in version 1.8
98918bd17e5fSmrg# Added AC_PROG_SED in version 1.8
98928c4a8e55Smrg
98938bd17e5fSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
98948bd17e5fSmrgAC_REQUIRE([AC_CANONICAL_HOST])
98958bd17e5fSmrgAC_REQUIRE([AC_PROG_SED])
98960597fb56Smrg
98978bd17e5fSmrgif test x$APP_MAN_SUFFIX = x    ; then
98988bd17e5fSmrg    APP_MAN_SUFFIX=1
98998bd17e5fSmrgfi
99008bd17e5fSmrgif test x$APP_MAN_DIR = x    ; then
99018bd17e5fSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
99020597fb56Smrgfi
99038c4a8e55Smrg
99048bd17e5fSmrgif test x$LIB_MAN_SUFFIX = x    ; then
99058bd17e5fSmrg    LIB_MAN_SUFFIX=3
99068bd17e5fSmrgfi
99078bd17e5fSmrgif test x$LIB_MAN_DIR = x    ; then
99088bd17e5fSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
99090597fb56Smrgfi
9910706b6b52Smrg
99118bd17e5fSmrgif test x$FILE_MAN_SUFFIX = x    ; then
99128bd17e5fSmrg    case $host_os in
99138bd17e5fSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
99148bd17e5fSmrg	*)		FILE_MAN_SUFFIX=5  ;;
99158bd17e5fSmrg    esac
99168bd17e5fSmrgfi
99178bd17e5fSmrgif test x$FILE_MAN_DIR = x    ; then
99188bd17e5fSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
99198bd17e5fSmrgfi
99200597fb56Smrg
99218bd17e5fSmrgif test x$MISC_MAN_SUFFIX = x    ; then
99228bd17e5fSmrg    case $host_os in
99238bd17e5fSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
99248bd17e5fSmrg	*)		MISC_MAN_SUFFIX=7  ;;
99258bd17e5fSmrg    esac
99268bd17e5fSmrgfi
99278bd17e5fSmrgif test x$MISC_MAN_DIR = x    ; then
99288bd17e5fSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
99298bd17e5fSmrgfi
99300597fb56Smrg
99318bd17e5fSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
99328bd17e5fSmrg    case $host_os in
99338bd17e5fSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
99348bd17e5fSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
99358bd17e5fSmrg    esac
99368bd17e5fSmrgfi
99378bd17e5fSmrgif test x$DRIVER_MAN_DIR = x    ; then
99388bd17e5fSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
99398bd17e5fSmrgfi
99400597fb56Smrg
99418bd17e5fSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
99428bd17e5fSmrg    case $host_os in
99438bd17e5fSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
99448bd17e5fSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
99458bd17e5fSmrg    esac
99468bd17e5fSmrgfi
99478bd17e5fSmrgif test x$ADMIN_MAN_DIR = x    ; then
99488bd17e5fSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
99498bd17e5fSmrgfi
99500597fb56Smrg
99510597fb56Smrg
99528bd17e5fSmrgAC_SUBST([APP_MAN_SUFFIX])
99538bd17e5fSmrgAC_SUBST([LIB_MAN_SUFFIX])
99548bd17e5fSmrgAC_SUBST([FILE_MAN_SUFFIX])
99558bd17e5fSmrgAC_SUBST([MISC_MAN_SUFFIX])
99568bd17e5fSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
99578bd17e5fSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
99588bd17e5fSmrgAC_SUBST([APP_MAN_DIR])
99598bd17e5fSmrgAC_SUBST([LIB_MAN_DIR])
99608bd17e5fSmrgAC_SUBST([FILE_MAN_DIR])
99618bd17e5fSmrgAC_SUBST([MISC_MAN_DIR])
99628bd17e5fSmrgAC_SUBST([DRIVER_MAN_DIR])
99638bd17e5fSmrgAC_SUBST([ADMIN_MAN_DIR])
99648c4a8e55Smrg
99658bd17e5fSmrgXORG_MAN_PAGE="X Version 11"
99668bd17e5fSmrgAC_SUBST([XORG_MAN_PAGE])
99678bd17e5fSmrgMAN_SUBSTS="\
99688bd17e5fSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
99698bd17e5fSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
99708bd17e5fSmrg	-e 's|__xservername__|Xorg|g' \
99718bd17e5fSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
99728bd17e5fSmrg	-e 's|__projectroot__|\$(prefix)|g' \
99738bd17e5fSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
99748bd17e5fSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
99758bd17e5fSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
99768bd17e5fSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
99778bd17e5fSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
99788bd17e5fSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
99798bd17e5fSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
99808bd17e5fSmrgAC_SUBST([MAN_SUBSTS])
99818c4a8e55Smrg
99828bd17e5fSmrg]) # XORG_MANPAGE_SECTIONS
99830597fb56Smrg
99848bd17e5fSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
99858bd17e5fSmrg# ------------------------
99868bd17e5fSmrg# Minimum version: 1.7.0
99878bd17e5fSmrg#
99888bd17e5fSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
99898bd17e5fSmrg# provided by xorg-sgml-doctools, if installed.
99908bd17e5fSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
99918bd17e5fSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
99928bd17e5fSmrgXORG_SGML_PATH=
99938bd17e5fSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
99948bd17e5fSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
99958bd17e5fSmrg    [m4_ifval([$1],[:],
99968bd17e5fSmrg        [if test x"$cross_compiling" != x"yes" ; then
99978bd17e5fSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
99988bd17e5fSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
99998bd17e5fSmrg         fi])
100008bd17e5fSmrg    ])
100018bd17e5fSmrg
100028bd17e5fSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
100038bd17e5fSmrg# the path and the name of the doc stylesheet
100048bd17e5fSmrgif test "x$XORG_SGML_PATH" != "x" ; then
100058bd17e5fSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
100068bd17e5fSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
100078bd17e5fSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
100080597fb56Smrgelse
100098bd17e5fSmrg   AC_MSG_RESULT([no])
100100597fb56Smrgfi
100118c4a8e55Smrg
100128bd17e5fSmrgAC_SUBST(XORG_SGML_PATH)
100138bd17e5fSmrgAC_SUBST(STYLESHEET_SRCDIR)
100148bd17e5fSmrgAC_SUBST(XSL_STYLESHEET)
100158bd17e5fSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
100168bd17e5fSmrg]) # XORG_CHECK_SGML_DOCTOOLS
100170597fb56Smrg
100188bd17e5fSmrg# XORG_CHECK_LINUXDOC
100198bd17e5fSmrg# -------------------
100208bd17e5fSmrg# Minimum version: 1.0.0
100218bd17e5fSmrg#
100228bd17e5fSmrg# Defines the variable MAKE_TEXT if the necessary tools and
100238bd17e5fSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
100248bd17e5fSmrg# Whether or not the necessary tools and files are found can be checked
100258bd17e5fSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
100268bd17e5fSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
100278bd17e5fSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
100288bd17e5fSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
100298c4a8e55Smrg
100308bd17e5fSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
100310597fb56Smrg
100328bd17e5fSmrgAC_MSG_CHECKING([whether to build documentation])
100330597fb56Smrg
100348bd17e5fSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
100358bd17e5fSmrg   BUILDDOC=yes
100368bd17e5fSmrgelse
100378bd17e5fSmrg   BUILDDOC=no
100388bd17e5fSmrgfi
100390597fb56Smrg
100408bd17e5fSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
100418bd17e5fSmrg
100428bd17e5fSmrgAC_MSG_RESULT([$BUILDDOC])
100438bd17e5fSmrg
100448bd17e5fSmrgAC_MSG_CHECKING([whether to build pdf documentation])
100458bd17e5fSmrg
100468bd17e5fSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
100478bd17e5fSmrg   BUILDPDFDOC=yes
10048bd23fbfaSmrgelse
100498bd17e5fSmrg   BUILDPDFDOC=no
10050bd23fbfaSmrgfi
100518c4a8e55Smrg
100528bd17e5fSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
100530597fb56Smrg
100548bd17e5fSmrgAC_MSG_RESULT([$BUILDPDFDOC])
100550597fb56Smrg
100568bd17e5fSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
100578bd17e5fSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
100588bd17e5fSmrgMAKE_PDF="$PS2PDF"
100598bd17e5fSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
100608bd17e5fSmrg
100618bd17e5fSmrgAC_SUBST(MAKE_TEXT)
100628bd17e5fSmrgAC_SUBST(MAKE_PS)
100638bd17e5fSmrgAC_SUBST(MAKE_PDF)
100648bd17e5fSmrgAC_SUBST(MAKE_HTML)
100658bd17e5fSmrg]) # XORG_CHECK_LINUXDOC
100668bd17e5fSmrg
100678bd17e5fSmrg# XORG_CHECK_DOCBOOK
100688bd17e5fSmrg# -------------------
100698bd17e5fSmrg# Minimum version: 1.0.0
100700597fb56Smrg#
100718bd17e5fSmrg# Checks for the ability to build output formats from SGML DocBook source.
100728bd17e5fSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
100738bd17e5fSmrg# indicates whether the necessary tools and files are found and, if set,
100748bd17e5fSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
100758bd17e5fSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
100768bd17e5fSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
100770597fb56Smrg
100788bd17e5fSmrgBUILDTXTDOC=no
100798bd17e5fSmrgBUILDPDFDOC=no
100808bd17e5fSmrgBUILDPSDOC=no
100818bd17e5fSmrgBUILDHTMLDOC=no
100820597fb56Smrg
100838bd17e5fSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
100848bd17e5fSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
100858bd17e5fSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
100868bd17e5fSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
100870597fb56Smrg
100888bd17e5fSmrgAC_MSG_CHECKING([whether to build text documentation])
100898bd17e5fSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
100908bd17e5fSmrg   test x$BUILD_TXTDOC != xno; then
100918bd17e5fSmrg	BUILDTXTDOC=yes
100928bd17e5fSmrgfi
100938bd17e5fSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
100948bd17e5fSmrgAC_MSG_RESULT([$BUILDTXTDOC])
100950597fb56Smrg
100968bd17e5fSmrgAC_MSG_CHECKING([whether to build PDF documentation])
100978bd17e5fSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
100988bd17e5fSmrg   test x$BUILD_PDFDOC != xno; then
100998bd17e5fSmrg	BUILDPDFDOC=yes
101008bd17e5fSmrgfi
101018bd17e5fSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
101028bd17e5fSmrgAC_MSG_RESULT([$BUILDPDFDOC])
101030597fb56Smrg
101048bd17e5fSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
101058bd17e5fSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
101068bd17e5fSmrg   test x$BUILD_PSDOC != xno; then
101078bd17e5fSmrg	BUILDPSDOC=yes
10108bd23fbfaSmrgfi
101098bd17e5fSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
101108bd17e5fSmrgAC_MSG_RESULT([$BUILDPSDOC])
101118c4a8e55Smrg
101128bd17e5fSmrgAC_MSG_CHECKING([whether to build HTML documentation])
101138bd17e5fSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
101148bd17e5fSmrg   test x$BUILD_HTMLDOC != xno; then
101158bd17e5fSmrg	BUILDHTMLDOC=yes
101168bd17e5fSmrgfi
101178bd17e5fSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
101188bd17e5fSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
10119bd23fbfaSmrg
101208bd17e5fSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
101218bd17e5fSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
101228bd17e5fSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
101238bd17e5fSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
101240597fb56Smrg
101258bd17e5fSmrgAC_SUBST(MAKE_TEXT)
101268bd17e5fSmrgAC_SUBST(MAKE_PS)
101278bd17e5fSmrgAC_SUBST(MAKE_PDF)
101288bd17e5fSmrgAC_SUBST(MAKE_HTML)
101298bd17e5fSmrg]) # XORG_CHECK_DOCBOOK
101308c4a8e55Smrg
101318bd17e5fSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
101320597fb56Smrg# ----------------
101338bd17e5fSmrg# Minimum version: 1.5.0
101348bd17e5fSmrg# Minimum version for optional DEFAULT argument: 1.11.0
101358c4a8e55Smrg#
101368bd17e5fSmrg# Documentation tools are not always available on all platforms and sometimes
101378bd17e5fSmrg# not at the appropriate level. This macro enables a module to test for the
101388bd17e5fSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
101398bd17e5fSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
101408bd17e5fSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
101418bd17e5fSmrg# --with-xmlto assumes 'auto'.
10142706b6b52Smrg#
101438bd17e5fSmrg# Interface to module:
101448bd17e5fSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
101458bd17e5fSmrg# XMLTO:	returns the path of the xmlto program found
101468bd17e5fSmrg#		returns the path set by the user in the environment
101478bd17e5fSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
101488bd17e5fSmrg#		'no' user instructs the module not to use xmlto
101498bd17e5fSmrg#
101508bd17e5fSmrg# Added in version 1.10.0
101518bd17e5fSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
101528bd17e5fSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
101530597fb56Smrg#
101548bd17e5fSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
101550597fb56Smrg#
101568bd17e5fSmrgAC_DEFUN([XORG_WITH_XMLTO],[
101578bd17e5fSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
101588bd17e5fSmrgm4_define([_defopt], m4_default([$2], [auto]))
101598bd17e5fSmrgAC_ARG_WITH(xmlto,
101608bd17e5fSmrg	AS_HELP_STRING([--with-xmlto],
101618bd17e5fSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
101628bd17e5fSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
101638bd17e5fSmrgm4_undefine([_defopt])
101648c4a8e55Smrg
101658bd17e5fSmrgif test "x$use_xmlto" = x"auto"; then
101668bd17e5fSmrg   AC_PATH_PROG([XMLTO], [xmlto])
101678bd17e5fSmrg   if test "x$XMLTO" = "x"; then
101688bd17e5fSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
101698bd17e5fSmrg	have_xmlto=no
101708bd17e5fSmrg   else
101718bd17e5fSmrg        have_xmlto=yes
101728bd17e5fSmrg   fi
101738bd17e5fSmrgelif test "x$use_xmlto" = x"yes" ; then
101748bd17e5fSmrg   AC_PATH_PROG([XMLTO], [xmlto])
101758bd17e5fSmrg   if test "x$XMLTO" = "x"; then
101768bd17e5fSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
101778bd17e5fSmrg   fi
101788bd17e5fSmrg   have_xmlto=yes
101798bd17e5fSmrgelif test "x$use_xmlto" = x"no" ; then
101808bd17e5fSmrg   if test "x$XMLTO" != "x"; then
101818bd17e5fSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
101828bd17e5fSmrg   fi
101838bd17e5fSmrg   have_xmlto=no
101848bd17e5fSmrgelse
101858bd17e5fSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
101868bd17e5fSmrgfi
101878c4a8e55Smrg
101888bd17e5fSmrg# Test for a minimum version of xmlto, if provided.
101898bd17e5fSmrgm4_ifval([$1],
101908bd17e5fSmrg[if test "$have_xmlto" = yes; then
101918bd17e5fSmrg    # scrape the xmlto version
101928bd17e5fSmrg    AC_MSG_CHECKING([the xmlto version])
101938bd17e5fSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
101948bd17e5fSmrg    AC_MSG_RESULT([$xmlto_version])
101958bd17e5fSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
101968bd17e5fSmrg        [if test "x$use_xmlto" = xauto; then
101978bd17e5fSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
101988bd17e5fSmrg            have_xmlto=no
101998bd17e5fSmrg        else
102008bd17e5fSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
102018bd17e5fSmrg        fi])
102028bd17e5fSmrgfi])
102038c4a8e55Smrg
102048bd17e5fSmrg# Test for the ability of xmlto to generate a text target
102058bd17e5fSmrghave_xmlto_text=no
102068bd17e5fSmrgcat > conftest.xml << "EOF"
102078bd17e5fSmrgEOF
102088bd17e5fSmrgAS_IF([test "$have_xmlto" = yes],
102098bd17e5fSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
102108bd17e5fSmrg             [have_xmlto_text=yes],
102118bd17e5fSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
102128bd17e5fSmrgrm -f conftest.xml
102138bd17e5fSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
102148bd17e5fSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
102158bd17e5fSmrg]) # XORG_WITH_XMLTO
102168c4a8e55Smrg
102178bd17e5fSmrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
102188bd17e5fSmrg# --------------------------------------------
102198bd17e5fSmrg# Minimum version: 1.12.0
102208bd17e5fSmrg# Minimum version for optional DEFAULT argument: 1.12.0
102210597fb56Smrg#
102228bd17e5fSmrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
102238bd17e5fSmrg# XML-based language used for the transformation of XML documents.
102248bd17e5fSmrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
102258bd17e5fSmrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
102268bd17e5fSmrg# The XSLT processor is often used as a standalone tool for transformations.
102278bd17e5fSmrg# It should not be assumed that this tool is used only to work with documnetation.
102288bd17e5fSmrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
102298bd17e5fSmrg#
102308bd17e5fSmrg# Interface to module:
102318bd17e5fSmrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
102328bd17e5fSmrg# XSLTPROC:	 returns the path of the xsltproc program found
102338bd17e5fSmrg#		 returns the path set by the user in the environment
102348bd17e5fSmrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
102358bd17e5fSmrg#		  'no' user instructs the module not to use xsltproc
102368bd17e5fSmrg# have_xsltproc: returns yes if xsltproc found in PATH or no
102378bd17e5fSmrg#
102388bd17e5fSmrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
102398bd17e5fSmrg#
102408bd17e5fSmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
102418bd17e5fSmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
102428bd17e5fSmrg# Preserves the interface, should it be implemented later
102438bd17e5fSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
102448bd17e5fSmrgm4_define([_defopt], m4_default([$2], [auto]))
102458bd17e5fSmrgAC_ARG_WITH(xsltproc,
102468bd17e5fSmrg	AS_HELP_STRING([--with-xsltproc],
102478bd17e5fSmrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
102488bd17e5fSmrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
102498bd17e5fSmrgm4_undefine([_defopt])
102508bd17e5fSmrg
102518bd17e5fSmrgif test "x$use_xsltproc" = x"auto"; then
102528bd17e5fSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
102538bd17e5fSmrg   if test "x$XSLTPROC" = "x"; then
102548bd17e5fSmrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
102558bd17e5fSmrg	have_xsltproc=no
102568bd17e5fSmrg   else
102578bd17e5fSmrg        have_xsltproc=yes
102588bd17e5fSmrg   fi
102598bd17e5fSmrgelif test "x$use_xsltproc" = x"yes" ; then
102608bd17e5fSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
102618bd17e5fSmrg   if test "x$XSLTPROC" = "x"; then
102628bd17e5fSmrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
102638bd17e5fSmrg   fi
102648bd17e5fSmrg   have_xsltproc=yes
102658bd17e5fSmrgelif test "x$use_xsltproc" = x"no" ; then
102668bd17e5fSmrg   if test "x$XSLTPROC" != "x"; then
102678bd17e5fSmrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
102688bd17e5fSmrg   fi
102698bd17e5fSmrg   have_xsltproc=no
102708bd17e5fSmrgelse
102718bd17e5fSmrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
102728bd17e5fSmrgfi
102738c4a8e55Smrg
102748bd17e5fSmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
102758bd17e5fSmrg]) # XORG_WITH_XSLTPROC
102768c4a8e55Smrg
102778bd17e5fSmrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
102788bd17e5fSmrg# ----------------------------------------
102798bd17e5fSmrg# Minimum version: 1.15.0
102800597fb56Smrg#
102818bd17e5fSmrg# PERL (Practical Extraction and Report Language) is a language optimized for
102828bd17e5fSmrg# scanning arbitrary text files, extracting information from those text files,
102838bd17e5fSmrg# and printing reports based on that information.
102840597fb56Smrg#
102858bd17e5fSmrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
102860597fb56Smrg#
102878bd17e5fSmrg# Interface to module:
102888bd17e5fSmrg# HAVE_PERL: used in makefiles to conditionally scan text files
102898bd17e5fSmrg# PERL:	     returns the path of the perl program found
102908bd17e5fSmrg#	     returns the path set by the user in the environment
102918bd17e5fSmrg# --with-perl: 'yes' user instructs the module to use perl
102928bd17e5fSmrg#	       'no' user instructs the module not to use perl
102938bd17e5fSmrg# have_perl: returns yes if perl found in PATH or no
102940597fb56Smrg#
102958bd17e5fSmrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
102960597fb56Smrg#
102978bd17e5fSmrgAC_DEFUN([XORG_WITH_PERL],[
102988bd17e5fSmrgAC_ARG_VAR([PERL], [Path to perl command])
102998bd17e5fSmrg# Preserves the interface, should it be implemented later
103008bd17e5fSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
103018bd17e5fSmrgm4_define([_defopt], m4_default([$2], [auto]))
103028bd17e5fSmrgAC_ARG_WITH(perl,
103038bd17e5fSmrg	AS_HELP_STRING([--with-perl],
103048bd17e5fSmrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
103058bd17e5fSmrg	   [use_perl=$withval], [use_perl=]_defopt)
103068bd17e5fSmrgm4_undefine([_defopt])
103078c4a8e55Smrg
103088bd17e5fSmrgif test "x$use_perl" = x"auto"; then
103098bd17e5fSmrg   AC_PATH_PROG([PERL], [perl])
103108bd17e5fSmrg   if test "x$PERL" = "x"; then
103118bd17e5fSmrg        AC_MSG_WARN([perl not found - cannot extract information and report])
103128bd17e5fSmrg	have_perl=no
103138bd17e5fSmrg   else
103148bd17e5fSmrg        have_perl=yes
103158bd17e5fSmrg   fi
103168bd17e5fSmrgelif test "x$use_perl" = x"yes" ; then
103178bd17e5fSmrg   AC_PATH_PROG([PERL], [perl])
103188bd17e5fSmrg   if test "x$PERL" = "x"; then
103198bd17e5fSmrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
103208bd17e5fSmrg   fi
103218bd17e5fSmrg   have_perl=yes
103228bd17e5fSmrgelif test "x$use_perl" = x"no" ; then
103238bd17e5fSmrg   if test "x$PERL" != "x"; then
103248bd17e5fSmrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
103258bd17e5fSmrg   fi
103268bd17e5fSmrg   have_perl=no
103278bd17e5fSmrgelse
103288bd17e5fSmrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
103298bd17e5fSmrgfi
103308c4a8e55Smrg
103318bd17e5fSmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
103328bd17e5fSmrg]) # XORG_WITH_PERL
103338c4a8e55Smrg
103348bd17e5fSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
103358bd17e5fSmrg# ----------------
103368bd17e5fSmrg# Minimum version: 1.5.0
103378bd17e5fSmrg# Minimum version for optional DEFAULT argument: 1.11.0
103388bd17e5fSmrg#
103398bd17e5fSmrg# Documentation tools are not always available on all platforms and sometimes
103408bd17e5fSmrg# not at the appropriate level. This macro enables a module to test for the
103418bd17e5fSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
103428bd17e5fSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
103438bd17e5fSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
103448bd17e5fSmrg# --with-asciidoc assumes 'auto'.
103458bd17e5fSmrg#
103468bd17e5fSmrg# Interface to module:
103478bd17e5fSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
103488bd17e5fSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
103498bd17e5fSmrg#		 returns the path set by the user in the environment
103508bd17e5fSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
103518bd17e5fSmrg#		  'no' user instructs the module not to use asciidoc
103520597fb56Smrg#
103538bd17e5fSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
103548bd17e5fSmrg#
103558bd17e5fSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
103568bd17e5fSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
103578bd17e5fSmrgm4_define([_defopt], m4_default([$2], [auto]))
103588bd17e5fSmrgAC_ARG_WITH(asciidoc,
103598bd17e5fSmrg	AS_HELP_STRING([--with-asciidoc],
103608bd17e5fSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
103618bd17e5fSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
103628bd17e5fSmrgm4_undefine([_defopt])
103638c4a8e55Smrg
103648bd17e5fSmrgif test "x$use_asciidoc" = x"auto"; then
103658bd17e5fSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
103668bd17e5fSmrg   if test "x$ASCIIDOC" = "x"; then
103678bd17e5fSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
103688bd17e5fSmrg	have_asciidoc=no
103698bd17e5fSmrg   else
103708bd17e5fSmrg        have_asciidoc=yes
103718bd17e5fSmrg   fi
103728bd17e5fSmrgelif test "x$use_asciidoc" = x"yes" ; then
103738bd17e5fSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
103748bd17e5fSmrg   if test "x$ASCIIDOC" = "x"; then
103758bd17e5fSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
103768bd17e5fSmrg   fi
103778bd17e5fSmrg   have_asciidoc=yes
103788bd17e5fSmrgelif test "x$use_asciidoc" = x"no" ; then
103798bd17e5fSmrg   if test "x$ASCIIDOC" != "x"; then
103808bd17e5fSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
103818bd17e5fSmrg   fi
103828bd17e5fSmrg   have_asciidoc=no
103830597fb56Smrgelse
103848bd17e5fSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
103850597fb56Smrgfi
103868bd17e5fSmrgm4_ifval([$1],
103878bd17e5fSmrg[if test "$have_asciidoc" = yes; then
103888bd17e5fSmrg    # scrape the asciidoc version
103898bd17e5fSmrg    AC_MSG_CHECKING([the asciidoc version])
103908bd17e5fSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
103918bd17e5fSmrg    AC_MSG_RESULT([$asciidoc_version])
103928bd17e5fSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
103938bd17e5fSmrg        [if test "x$use_asciidoc" = xauto; then
103948bd17e5fSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
103958bd17e5fSmrg            have_asciidoc=no
103968bd17e5fSmrg        else
103978bd17e5fSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
103988bd17e5fSmrg        fi])
103998bd17e5fSmrgfi])
104008bd17e5fSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
104018bd17e5fSmrg]) # XORG_WITH_ASCIIDOC
104028c4a8e55Smrg
104038bd17e5fSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
104048bd17e5fSmrg# --------------------------------
104058bd17e5fSmrg# Minimum version: 1.5.0
104068bd17e5fSmrg# Minimum version for optional DEFAULT argument: 1.11.0
104070597fb56Smrg#
104088bd17e5fSmrg# Documentation tools are not always available on all platforms and sometimes
104098bd17e5fSmrg# not at the appropriate level. This macro enables a module to test for the
104108bd17e5fSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
104118bd17e5fSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
104128bd17e5fSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
104138bd17e5fSmrg# --with-doxygen assumes 'auto'.
104140597fb56Smrg#
104158bd17e5fSmrg# Interface to module:
104168bd17e5fSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
104178bd17e5fSmrg# DOXYGEN:	 returns the path of the doxygen program found
104188bd17e5fSmrg#		 returns the path set by the user in the environment
104198bd17e5fSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
104208bd17e5fSmrg#		  'no' user instructs the module not to use doxygen
104218bd17e5fSmrg#
104228bd17e5fSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
104238bd17e5fSmrg#
104248bd17e5fSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
104258bd17e5fSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
104268bd17e5fSmrgm4_define([_defopt], m4_default([$2], [auto]))
104278bd17e5fSmrgAC_ARG_WITH(doxygen,
104288bd17e5fSmrg	AS_HELP_STRING([--with-doxygen],
104298bd17e5fSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
104308bd17e5fSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
104318bd17e5fSmrgm4_undefine([_defopt])
104328c4a8e55Smrg
104338bd17e5fSmrgif test "x$use_doxygen" = x"auto"; then
104348bd17e5fSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
104358bd17e5fSmrg   if test "x$DOXYGEN" = "x"; then
104368bd17e5fSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
104378bd17e5fSmrg	have_doxygen=no
104388bd17e5fSmrg   else
104398bd17e5fSmrg        have_doxygen=yes
104408bd17e5fSmrg   fi
104418bd17e5fSmrgelif test "x$use_doxygen" = x"yes" ; then
104428bd17e5fSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
104438bd17e5fSmrg   if test "x$DOXYGEN" = "x"; then
104448bd17e5fSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
104458bd17e5fSmrg   fi
104468bd17e5fSmrg   have_doxygen=yes
104478bd17e5fSmrgelif test "x$use_doxygen" = x"no" ; then
104488bd17e5fSmrg   if test "x$DOXYGEN" != "x"; then
104498bd17e5fSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
104508bd17e5fSmrg   fi
104518bd17e5fSmrg   have_doxygen=no
104528bd17e5fSmrgelse
104538bd17e5fSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
104548bd17e5fSmrgfi
104558bd17e5fSmrgm4_ifval([$1],
104568bd17e5fSmrg[if test "$have_doxygen" = yes; then
104578bd17e5fSmrg    # scrape the doxygen version
104588bd17e5fSmrg    AC_MSG_CHECKING([the doxygen version])
104598bd17e5fSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
104608bd17e5fSmrg    AC_MSG_RESULT([$doxygen_version])
104618bd17e5fSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
104628bd17e5fSmrg        [if test "x$use_doxygen" = xauto; then
104638bd17e5fSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
104648bd17e5fSmrg            have_doxygen=no
104658bd17e5fSmrg        else
104668bd17e5fSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
104678bd17e5fSmrg        fi])
104688bd17e5fSmrgfi])
104698bd17e5fSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
104708bd17e5fSmrg]) # XORG_WITH_DOXYGEN
104718c4a8e55Smrg
104728bd17e5fSmrg# XORG_WITH_GROFF([DEFAULT])
104738bd17e5fSmrg# ----------------
104748bd17e5fSmrg# Minimum version: 1.6.0
104758bd17e5fSmrg# Minimum version for optional DEFAULT argument: 1.11.0
104768bd17e5fSmrg#
104778bd17e5fSmrg# Documentation tools are not always available on all platforms and sometimes
104788bd17e5fSmrg# not at the appropriate level. This macro enables a module to test for the
104798bd17e5fSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
104808bd17e5fSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
104818bd17e5fSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
104828bd17e5fSmrg# --with-groff assumes 'auto'.
104838bd17e5fSmrg#
104848bd17e5fSmrg# Interface to module:
104858bd17e5fSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
104868bd17e5fSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
104878bd17e5fSmrg# HAVE_GROFF_MS: the -ms macros package
104888bd17e5fSmrg# GROFF:	 returns the path of the groff program found
104898bd17e5fSmrg#		 returns the path set by the user in the environment
104908bd17e5fSmrg# --with-groff:	 'yes' user instructs the module to use groff
104918bd17e5fSmrg#		 'no' user instructs the module not to use groff
104928bd17e5fSmrg#
104938bd17e5fSmrg# Added in version 1.9.0:
104948bd17e5fSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
104958bd17e5fSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
104968bd17e5fSmrg#		   psselect from the psutils package.
104978bd17e5fSmrg#		   the ghostcript package. Refer to the grohtml man pages
104988bd17e5fSmrg#
104998bd17e5fSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
105008bd17e5fSmrg#
105018bd17e5fSmrg# OS and distros often splits groff in a basic and full package, the former
105028bd17e5fSmrg# having the groff program and the later having devices, fonts and macros
105038bd17e5fSmrg# Checking for the groff executable is not enough.
105048bd17e5fSmrg#
105058bd17e5fSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
105068bd17e5fSmrg# unset HAVE_GROFF or GROFF env variables.
105078bd17e5fSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
105088bd17e5fSmrg#
105098bd17e5fSmrgAC_DEFUN([XORG_WITH_GROFF],[
105108bd17e5fSmrgAC_ARG_VAR([GROFF], [Path to groff command])
105118bd17e5fSmrgm4_define([_defopt], m4_default([$1], [auto]))
105128bd17e5fSmrgAC_ARG_WITH(groff,
105138bd17e5fSmrg	AS_HELP_STRING([--with-groff],
105148bd17e5fSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
105158bd17e5fSmrg	   [use_groff=$withval], [use_groff=]_defopt)
105168bd17e5fSmrgm4_undefine([_defopt])
105178bd17e5fSmrg
105188bd17e5fSmrgif test "x$use_groff" = x"auto"; then
105198bd17e5fSmrg   AC_PATH_PROG([GROFF], [groff])
105208bd17e5fSmrg   if test "x$GROFF" = "x"; then
105218bd17e5fSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
105228bd17e5fSmrg	have_groff=no
105238bd17e5fSmrg   else
105248bd17e5fSmrg        have_groff=yes
105258bd17e5fSmrg   fi
105268bd17e5fSmrgelif test "x$use_groff" = x"yes" ; then
105278bd17e5fSmrg   AC_PATH_PROG([GROFF], [groff])
105288bd17e5fSmrg   if test "x$GROFF" = "x"; then
105298bd17e5fSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
105308bd17e5fSmrg   fi
105318bd17e5fSmrg   have_groff=yes
105328bd17e5fSmrgelif test "x$use_groff" = x"no" ; then
105338bd17e5fSmrg   if test "x$GROFF" != "x"; then
105348bd17e5fSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
105358bd17e5fSmrg   fi
105368bd17e5fSmrg   have_groff=no
105370597fb56Smrgelse
105388bd17e5fSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
105390597fb56Smrgfi
105408c4a8e55Smrg
105418bd17e5fSmrg# We have groff, test for the presence of the macro packages
105428bd17e5fSmrgif test "x$have_groff" = x"yes"; then
105438bd17e5fSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
105448bd17e5fSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
105458bd17e5fSmrg        groff_ms_works=yes
105468bd17e5fSmrg    else
105478bd17e5fSmrg        groff_ms_works=no
105488bd17e5fSmrg    fi
105498bd17e5fSmrg    AC_MSG_RESULT([$groff_ms_works])
105508bd17e5fSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
105518bd17e5fSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
105528bd17e5fSmrg        groff_mm_works=yes
105538bd17e5fSmrg    else
105548bd17e5fSmrg        groff_mm_works=no
105558bd17e5fSmrg    fi
105568bd17e5fSmrg    AC_MSG_RESULT([$groff_mm_works])
105578bd17e5fSmrgfi
105588c4a8e55Smrg
105598bd17e5fSmrg# We have groff, test for HTML dependencies, one command per package
105608bd17e5fSmrgif test "x$have_groff" = x"yes"; then
105618bd17e5fSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
105628bd17e5fSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
105638bd17e5fSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
105648bd17e5fSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
105658bd17e5fSmrg      have_groff_html=yes
105668bd17e5fSmrg   else
105678bd17e5fSmrg      have_groff_html=no
105688bd17e5fSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
105698bd17e5fSmrg   fi
105700597fb56Smrgfi
105718c4a8e55Smrg
105728bd17e5fSmrg# Set Automake conditionals for Makefiles
105738bd17e5fSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
105748bd17e5fSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
105758bd17e5fSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
105768bd17e5fSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
105778bd17e5fSmrg]) # XORG_WITH_GROFF
105788c4a8e55Smrg
105798bd17e5fSmrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
105808bd17e5fSmrg# ---------------------------------------
105818bd17e5fSmrg# Minimum version: 1.6.0
105828bd17e5fSmrg# Minimum version for optional DEFAULT argument: 1.11.0
105838bd17e5fSmrg# Minimum version for optional MIN-VERSION argument: 1.15.0
105840597fb56Smrg#
105858bd17e5fSmrg# Documentation tools are not always available on all platforms and sometimes
105868bd17e5fSmrg# not at the appropriate level. This macro enables a module to test for the
105878bd17e5fSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
105888bd17e5fSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
105898bd17e5fSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
105908bd17e5fSmrg# --with-fop assumes 'auto'.
105918bd17e5fSmrg#
105928bd17e5fSmrg# Interface to module:
105938bd17e5fSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
105948bd17e5fSmrg# FOP:	 	returns the path of the fop program found
105958bd17e5fSmrg#		returns the path set by the user in the environment
105968bd17e5fSmrg# --with-fop: 	'yes' user instructs the module to use fop
105978bd17e5fSmrg#		'no' user instructs the module not to use fop
105988bd17e5fSmrg#
105998bd17e5fSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
106008bd17e5fSmrg#
106018bd17e5fSmrgAC_DEFUN([XORG_WITH_FOP],[
106028bd17e5fSmrgAC_ARG_VAR([FOP], [Path to fop command])
106038bd17e5fSmrgm4_define([_defopt], m4_default([$2], [auto]))
106048bd17e5fSmrgAC_ARG_WITH(fop,
106058bd17e5fSmrg	AS_HELP_STRING([--with-fop],
106068bd17e5fSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
106078bd17e5fSmrg	   [use_fop=$withval], [use_fop=]_defopt)
106088bd17e5fSmrgm4_undefine([_defopt])
10609b042e37fSmrg
106108bd17e5fSmrgif test "x$use_fop" = x"auto"; then
106118bd17e5fSmrg   AC_PATH_PROG([FOP], [fop])
106128bd17e5fSmrg   if test "x$FOP" = "x"; then
106138bd17e5fSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
106148bd17e5fSmrg	have_fop=no
106158bd17e5fSmrg   else
106168bd17e5fSmrg        have_fop=yes
106178bd17e5fSmrg   fi
106188bd17e5fSmrgelif test "x$use_fop" = x"yes" ; then
106198bd17e5fSmrg   AC_PATH_PROG([FOP], [fop])
106208bd17e5fSmrg   if test "x$FOP" = "x"; then
106218bd17e5fSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
106228bd17e5fSmrg   fi
106238bd17e5fSmrg   have_fop=yes
106248bd17e5fSmrgelif test "x$use_fop" = x"no" ; then
106258bd17e5fSmrg   if test "x$FOP" != "x"; then
106268bd17e5fSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
106278bd17e5fSmrg   fi
106288bd17e5fSmrg   have_fop=no
106298bd17e5fSmrgelse
106308bd17e5fSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
106318bd17e5fSmrgfi
10632706b6b52Smrg
106338bd17e5fSmrg# Test for a minimum version of fop, if provided.
106348bd17e5fSmrgm4_ifval([$1],
106358bd17e5fSmrg[if test "$have_fop" = yes; then
106368bd17e5fSmrg    # scrape the fop version
106378bd17e5fSmrg    AC_MSG_CHECKING([for fop minimum version])
106388bd17e5fSmrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
106398bd17e5fSmrg    AC_MSG_RESULT([$fop_version])
106408bd17e5fSmrg    AS_VERSION_COMPARE([$fop_version], [$1],
106418bd17e5fSmrg        [if test "x$use_fop" = xauto; then
106428bd17e5fSmrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
106438bd17e5fSmrg            have_fop=no
106448bd17e5fSmrg        else
106458bd17e5fSmrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
106468bd17e5fSmrg        fi])
106478bd17e5fSmrgfi])
106488bd17e5fSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
106498bd17e5fSmrg]) # XORG_WITH_FOP
106508bd17e5fSmrg
106518bd17e5fSmrg# XORG_WITH_PS2PDF([DEFAULT])
106528bd17e5fSmrg# ----------------
106538bd17e5fSmrg# Minimum version: 1.6.0
106548bd17e5fSmrg# Minimum version for optional DEFAULT argument: 1.11.0
106558bd17e5fSmrg#
106568bd17e5fSmrg# Documentation tools are not always available on all platforms and sometimes
106578bd17e5fSmrg# not at the appropriate level. This macro enables a module to test for the
106588bd17e5fSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
106598bd17e5fSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
106608bd17e5fSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
106618bd17e5fSmrg# --with-ps2pdf assumes 'auto'.
106628bd17e5fSmrg#
106638bd17e5fSmrg# Interface to module:
106648bd17e5fSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
106658bd17e5fSmrg# PS2PDF:	returns the path of the ps2pdf program found
106668bd17e5fSmrg#		returns the path set by the user in the environment
106678bd17e5fSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
106688bd17e5fSmrg#		 'no' user instructs the module not to use ps2pdf
106698bd17e5fSmrg#
106708bd17e5fSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
106718bd17e5fSmrg#
106728bd17e5fSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
106738bd17e5fSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
106748bd17e5fSmrgm4_define([_defopt], m4_default([$1], [auto]))
106758bd17e5fSmrgAC_ARG_WITH(ps2pdf,
106768bd17e5fSmrg	AS_HELP_STRING([--with-ps2pdf],
106778bd17e5fSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
106788bd17e5fSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
106798bd17e5fSmrgm4_undefine([_defopt])
106808c4a8e55Smrg
106818bd17e5fSmrgif test "x$use_ps2pdf" = x"auto"; then
106828bd17e5fSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
106838bd17e5fSmrg   if test "x$PS2PDF" = "x"; then
106848bd17e5fSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
106858bd17e5fSmrg	have_ps2pdf=no
106868bd17e5fSmrg   else
106878bd17e5fSmrg        have_ps2pdf=yes
106888bd17e5fSmrg   fi
106898bd17e5fSmrgelif test "x$use_ps2pdf" = x"yes" ; then
106908bd17e5fSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
106918bd17e5fSmrg   if test "x$PS2PDF" = "x"; then
106928bd17e5fSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
106938bd17e5fSmrg   fi
106948bd17e5fSmrg   have_ps2pdf=yes
106958bd17e5fSmrgelif test "x$use_ps2pdf" = x"no" ; then
106968bd17e5fSmrg   if test "x$PS2PDF" != "x"; then
106978bd17e5fSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
106988bd17e5fSmrg   fi
106998bd17e5fSmrg   have_ps2pdf=no
107008bd17e5fSmrgelse
107018bd17e5fSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
107028bd17e5fSmrgfi
107038bd17e5fSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
107048bd17e5fSmrg]) # XORG_WITH_PS2PDF
107058c4a8e55Smrg
107068bd17e5fSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
107078bd17e5fSmrg# ----------------
107088bd17e5fSmrg# Minimum version: 1.6.0
107090597fb56Smrg#
107108bd17e5fSmrg# Documentation tools are not always available on all platforms and sometimes
107118bd17e5fSmrg# not at the appropriate level. This macro enables a builder to skip all
107128bd17e5fSmrg# documentation targets except traditional man pages.
107138bd17e5fSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
107148bd17e5fSmrg# maximum flexibilty in controlling documentation building.
107158bd17e5fSmrg# Refer to:
107168bd17e5fSmrg# XORG_WITH_XMLTO         --with-xmlto
107178bd17e5fSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
107188bd17e5fSmrg# XORG_WITH_DOXYGEN       --with-doxygen
107198bd17e5fSmrg# XORG_WITH_FOP           --with-fop
107208bd17e5fSmrg# XORG_WITH_GROFF         --with-groff
107218bd17e5fSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
107228bd17e5fSmrg#
107238bd17e5fSmrg# Interface to module:
107248bd17e5fSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
107258bd17e5fSmrg# --enable-docs: 'yes' user instructs the module to generate docs
107268bd17e5fSmrg#		 'no' user instructs the module not to generate docs
107278bd17e5fSmrg# parm1:	specify the default value, yes or no.
107288bd17e5fSmrg#
107298bd17e5fSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
107308bd17e5fSmrgm4_define([docs_default], m4_default([$1], [yes]))
107318bd17e5fSmrgAC_ARG_ENABLE(docs,
107328bd17e5fSmrg	AS_HELP_STRING([--enable-docs],
107338bd17e5fSmrg	   [Enable building the documentation (default: ]docs_default[)]),
107348bd17e5fSmrg	   [build_docs=$enableval], [build_docs=]docs_default)
107358bd17e5fSmrgm4_undefine([docs_default])
107368bd17e5fSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
107378bd17e5fSmrgAC_MSG_CHECKING([whether to build documentation])
107388bd17e5fSmrgAC_MSG_RESULT([$build_docs])
107398bd17e5fSmrg]) # XORG_ENABLE_DOCS
107408c4a8e55Smrg
107418bd17e5fSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
107428bd17e5fSmrg# ----------------
107438bd17e5fSmrg# Minimum version: 1.6.0
107448bd17e5fSmrg#
107458bd17e5fSmrg# This macro enables a builder to skip all developer documentation.
107468bd17e5fSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
107478bd17e5fSmrg# maximum flexibilty in controlling documentation building.
107488bd17e5fSmrg# Refer to:
107498bd17e5fSmrg# XORG_WITH_XMLTO         --with-xmlto
107508bd17e5fSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
107518bd17e5fSmrg# XORG_WITH_DOXYGEN       --with-doxygen
107528bd17e5fSmrg# XORG_WITH_FOP           --with-fop
107538bd17e5fSmrg# XORG_WITH_GROFF         --with-groff
107548bd17e5fSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
107558bd17e5fSmrg#
107568bd17e5fSmrg# Interface to module:
107578bd17e5fSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
107588bd17e5fSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
107598bd17e5fSmrg#			'no' user instructs the module not to generate developer docs
107608bd17e5fSmrg# parm1:		specify the default value, yes or no.
107618bd17e5fSmrg#
107628bd17e5fSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
107638bd17e5fSmrgm4_define([devel_default], m4_default([$1], [yes]))
107648bd17e5fSmrgAC_ARG_ENABLE(devel-docs,
107658bd17e5fSmrg	AS_HELP_STRING([--enable-devel-docs],
107668bd17e5fSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
107678bd17e5fSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
107688bd17e5fSmrgm4_undefine([devel_default])
107698bd17e5fSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
107708bd17e5fSmrgAC_MSG_CHECKING([whether to build developer documentation])
107718bd17e5fSmrgAC_MSG_RESULT([$build_devel_docs])
107728bd17e5fSmrg]) # XORG_ENABLE_DEVEL_DOCS
107738c4a8e55Smrg
107748bd17e5fSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
107758bd17e5fSmrg# ----------------
107768bd17e5fSmrg# Minimum version: 1.6.0
107770597fb56Smrg#
107788bd17e5fSmrg# This macro enables a builder to skip all functional specification targets.
107798bd17e5fSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
107808bd17e5fSmrg# maximum flexibilty in controlling documentation building.
107818bd17e5fSmrg# Refer to:
107828bd17e5fSmrg# XORG_WITH_XMLTO         --with-xmlto
107838bd17e5fSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
107848bd17e5fSmrg# XORG_WITH_DOXYGEN       --with-doxygen
107858bd17e5fSmrg# XORG_WITH_FOP           --with-fop
107868bd17e5fSmrg# XORG_WITH_GROFF         --with-groff
107878bd17e5fSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
107888bd17e5fSmrg#
107898bd17e5fSmrg# Interface to module:
107908bd17e5fSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
107918bd17e5fSmrg# --enable-specs:	'yes' user instructs the module to generate specs
107928bd17e5fSmrg#			'no' user instructs the module not to generate specs
107938bd17e5fSmrg# parm1:		specify the default value, yes or no.
107948bd17e5fSmrg#
107958bd17e5fSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
107968bd17e5fSmrgm4_define([spec_default], m4_default([$1], [yes]))
107978bd17e5fSmrgAC_ARG_ENABLE(specs,
107988bd17e5fSmrg	AS_HELP_STRING([--enable-specs],
107998bd17e5fSmrg	   [Enable building the specs (default: ]spec_default[)]),
108008bd17e5fSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
108018bd17e5fSmrgm4_undefine([spec_default])
108028bd17e5fSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
108038bd17e5fSmrgAC_MSG_CHECKING([whether to build functional specifications])
108048bd17e5fSmrgAC_MSG_RESULT([$build_specs])
108058bd17e5fSmrg]) # XORG_ENABLE_SPECS
108068c4a8e55Smrg
108078bd17e5fSmrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
108088bd17e5fSmrg# ----------------------------------------------
108098bd17e5fSmrg# Minimum version: 1.13.0
108108bd17e5fSmrg#
108118bd17e5fSmrg# This macro enables a builder to enable/disable unit testing
108128bd17e5fSmrg# It makes no assumption about the test cases implementation
108138bd17e5fSmrg# Test cases may or may not use Automake "Support for test suites"
108148bd17e5fSmrg# They may or may not use the software utility library GLib
108158bd17e5fSmrg#
108168bd17e5fSmrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
108178bd17e5fSmrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
108188bd17e5fSmrg# The variable enable_unit_tests is used by other macros in this file.
108198bd17e5fSmrg#
108208bd17e5fSmrg# Interface to module:
108218bd17e5fSmrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
108228bd17e5fSmrg# enable_unit_tests:    used in configure.ac for additional configuration
108238bd17e5fSmrg# --enable-unit-tests:	'yes' user instructs the module to build tests
108248bd17e5fSmrg#			'no' user instructs the module not to build tests
108258bd17e5fSmrg# parm1:		specify the default value, yes or no.
108268bd17e5fSmrg#
108278bd17e5fSmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
108288bd17e5fSmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
108298bd17e5fSmrgAC_BEFORE([$0], [XORG_LD_WRAP])
108308bd17e5fSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
108318bd17e5fSmrgm4_define([_defopt], m4_default([$1], [auto]))
108328bd17e5fSmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
108338bd17e5fSmrg	[Enable building unit test cases (default: ]_defopt[)]),
108348bd17e5fSmrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
108358bd17e5fSmrgm4_undefine([_defopt])
108368bd17e5fSmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
108378bd17e5fSmrgAC_MSG_CHECKING([whether to build unit test cases])
108388bd17e5fSmrgAC_MSG_RESULT([$enable_unit_tests])
108398bd17e5fSmrg]) # XORG_ENABLE_UNIT_TESTS
108400597fb56Smrg
108418bd17e5fSmrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
108428bd17e5fSmrg# ------------------------------------------------------
108438bd17e5fSmrg# Minimum version: 1.17.0
108448bd17e5fSmrg#
108458bd17e5fSmrg# This macro enables a builder to enable/disable integration testing
108468bd17e5fSmrg# It makes no assumption about the test cases' implementation
108478bd17e5fSmrg# Test cases may or may not use Automake "Support for test suites"
108488bd17e5fSmrg#
108498bd17e5fSmrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
108508bd17e5fSmrg# usually requires less dependencies and may be built and run under less
108518bd17e5fSmrg# stringent environments than integration tests.
108528bd17e5fSmrg#
108538bd17e5fSmrg# Interface to module:
108548bd17e5fSmrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
108558bd17e5fSmrg# enable_integration_tests:   used in configure.ac for additional configuration
108568bd17e5fSmrg# --enable-integration-tests: 'yes' user instructs the module to build tests
108578bd17e5fSmrg#                             'no' user instructs the module not to build tests
108588bd17e5fSmrg# parm1:                      specify the default value, yes or no.
108598bd17e5fSmrg#
108608bd17e5fSmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
108618bd17e5fSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
108628bd17e5fSmrgm4_define([_defopt], m4_default([$1], [auto]))
108638bd17e5fSmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
108648bd17e5fSmrg	[Enable building integration test cases (default: ]_defopt[)]),
108658bd17e5fSmrg	[enable_integration_tests=$enableval],
108668bd17e5fSmrg	[enable_integration_tests=]_defopt)
108678bd17e5fSmrgm4_undefine([_defopt])
108688bd17e5fSmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
108698bd17e5fSmrg	[test "x$enable_integration_tests" != xno])
108708bd17e5fSmrgAC_MSG_CHECKING([whether to build unit test cases])
108718bd17e5fSmrgAC_MSG_RESULT([$enable_integration_tests])
108728bd17e5fSmrg]) # XORG_ENABLE_INTEGRATION_TESTS
108730597fb56Smrg
108748bd17e5fSmrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
108758bd17e5fSmrg# ----------------------------------------
108768bd17e5fSmrg# Minimum version: 1.13.0
108778bd17e5fSmrg#
108788bd17e5fSmrg# GLib is a library which provides advanced data structures and functions.
108798bd17e5fSmrg# This macro enables a module to test for the presence of Glib.
108808bd17e5fSmrg#
108818bd17e5fSmrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
108828bd17e5fSmrg# Otherwise the value of $enable_unit_tests is blank.
108838bd17e5fSmrg#
108848bd17e5fSmrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
108858bd17e5fSmrg# test support usually requires less dependencies and may be built and run under
108868bd17e5fSmrg# less stringent environments than integration tests.
108878bd17e5fSmrg#
108888bd17e5fSmrg# Interface to module:
108898bd17e5fSmrg# HAVE_GLIB: used in makefiles to conditionally build targets
108908bd17e5fSmrg# with_glib: used in configure.ac to know if GLib has been found
108918bd17e5fSmrg# --with-glib:	'yes' user instructs the module to use glib
108928bd17e5fSmrg#		'no' user instructs the module not to use glib
108938bd17e5fSmrg#
108948bd17e5fSmrgAC_DEFUN([XORG_WITH_GLIB],[
108958bd17e5fSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
108968bd17e5fSmrgm4_define([_defopt], m4_default([$2], [auto]))
108978bd17e5fSmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
108988bd17e5fSmrg	[Use GLib library for unit testing (default: ]_defopt[)]),
108998bd17e5fSmrg	[with_glib=$withval], [with_glib=]_defopt)
109008bd17e5fSmrgm4_undefine([_defopt])
109018bd17e5fSmrg
109028bd17e5fSmrghave_glib=no
109038bd17e5fSmrg# Do not probe GLib if user explicitly disabled unit testing
109048bd17e5fSmrgif test "x$enable_unit_tests" != x"no"; then
109058bd17e5fSmrg  # Do not probe GLib if user explicitly disabled it
109068bd17e5fSmrg  if test "x$with_glib" != x"no"; then
109078bd17e5fSmrg    m4_ifval(
109088bd17e5fSmrg      [$1],
109098bd17e5fSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
109108bd17e5fSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
109118bd17e5fSmrg    )
109120597fb56Smrg  fi
109130597fb56Smrgfi
109148c4a8e55Smrg
109158bd17e5fSmrg# Not having GLib when unit testing has been explicitly requested is an error
109168bd17e5fSmrgif test "x$enable_unit_tests" = x"yes"; then
109178bd17e5fSmrg  if test "x$have_glib" = x"no"; then
109188bd17e5fSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
109190597fb56Smrg  fi
109200597fb56Smrgfi
109218c4a8e55Smrg
109228bd17e5fSmrg# Having unit testing disabled when GLib has been explicitly requested is an error
109238bd17e5fSmrgif test "x$enable_unit_tests" = x"no"; then
109248bd17e5fSmrg  if test "x$with_glib" = x"yes"; then
109258bd17e5fSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
109268bd17e5fSmrg  fi
109278bd17e5fSmrgfi
109288c4a8e55Smrg
109298bd17e5fSmrg# Not having GLib when it has been explicitly requested is an error
109308bd17e5fSmrgif test "x$with_glib" = x"yes"; then
109318bd17e5fSmrg  if test "x$have_glib" = x"no"; then
109328bd17e5fSmrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
109338bd17e5fSmrg  fi
109348bd17e5fSmrgfi
109358c4a8e55Smrg
109368bd17e5fSmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
109378bd17e5fSmrg]) # XORG_WITH_GLIB
109388c4a8e55Smrg
109398bd17e5fSmrg# XORG_LD_WRAP([required|optional])
109408bd17e5fSmrg# ---------------------------------
109418bd17e5fSmrg# Minimum version: 1.13.0
109428bd17e5fSmrg#
109438bd17e5fSmrg# Check if linker supports -wrap, passed via compiler flags
109448bd17e5fSmrg#
109458bd17e5fSmrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
109468bd17e5fSmrg# Otherwise the value of $enable_unit_tests is blank.
109478bd17e5fSmrg#
109488bd17e5fSmrg# Argument added in 1.16.0 - default is "required", to match existing behavior
109498bd17e5fSmrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
109508bd17e5fSmrg# available, an argument of "optional" allows use when some unit tests require
109518bd17e5fSmrg# ld -wrap and others do not.
109528bd17e5fSmrg#
109538bd17e5fSmrgAC_DEFUN([XORG_LD_WRAP],[
109548bd17e5fSmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
109558bd17e5fSmrg    [AC_LANG_PROGRAM([#include <stdlib.h>
109568bd17e5fSmrg                      void __wrap_exit(int status) { return; }],
109578bd17e5fSmrg                     [exit(0);])])
109588bd17e5fSmrg# Not having ld wrap when unit testing has been explicitly requested is an error
109598bd17e5fSmrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
109608bd17e5fSmrg  if test "x$have_ld_wrap" = x"no"; then
109618bd17e5fSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
109628bd17e5fSmrg  fi
109638bd17e5fSmrgfi
109648bd17e5fSmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
109658bd17e5fSmrg#
109668bd17e5fSmrg]) # XORG_LD_WRAP
109678c4a8e55Smrg
109688bd17e5fSmrg# XORG_CHECK_LINKER_FLAGS
109698bd17e5fSmrg# -----------------------
109708bd17e5fSmrg# SYNOPSIS
109718bd17e5fSmrg#
109728bd17e5fSmrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
109738bd17e5fSmrg#
109748bd17e5fSmrg# DESCRIPTION
109758bd17e5fSmrg#
109768bd17e5fSmrg#   Check whether the given linker FLAGS work with the current language's
109778bd17e5fSmrg#   linker, or whether they give an error.
109788bd17e5fSmrg#
109798bd17e5fSmrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
109808bd17e5fSmrg#   success/failure.
109818bd17e5fSmrg#
109828bd17e5fSmrg#   PROGRAM-SOURCE is the program source to link with, if needed
109838bd17e5fSmrg#
109848bd17e5fSmrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
109858bd17e5fSmrg#
109868bd17e5fSmrg# LICENSE
109878bd17e5fSmrg#
109888bd17e5fSmrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
109898bd17e5fSmrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
109908bd17e5fSmrg#   Copyright (c) 2009 Matteo Frigo
109918bd17e5fSmrg#
109928bd17e5fSmrg#   This program is free software: you can redistribute it and/or modify it
109938bd17e5fSmrg#   under the terms of the GNU General Public License as published by the
109948bd17e5fSmrg#   Free Software Foundation, either version 3 of the License, or (at your
109958bd17e5fSmrg#   option) any later version.
109968bd17e5fSmrg#
109978bd17e5fSmrg#   This program is distributed in the hope that it will be useful, but
109988bd17e5fSmrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
109998bd17e5fSmrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
110008bd17e5fSmrg#   Public License for more details.
110018bd17e5fSmrg#
110028bd17e5fSmrg#   You should have received a copy of the GNU General Public License along
110038bd17e5fSmrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
110048bd17e5fSmrg#
110058bd17e5fSmrg#   As a special exception, the respective Autoconf Macro's copyright owner
110068bd17e5fSmrg#   gives unlimited permission to copy, distribute and modify the configure
110078bd17e5fSmrg#   scripts that are the output of Autoconf when processing the Macro. You
110088bd17e5fSmrg#   need not follow the terms of the GNU General Public License when using
110098bd17e5fSmrg#   or distributing such scripts, even though portions of the text of the
110108bd17e5fSmrg#   Macro appear in them. The GNU General Public License (GPL) does govern
110118bd17e5fSmrg#   all other use of the material that constitutes the Autoconf Macro.
110128bd17e5fSmrg#
110138bd17e5fSmrg#   This special exception to the GPL applies to versions of the Autoconf
110148bd17e5fSmrg#   Macro released by the Autoconf Archive. When you make and distribute a
110158bd17e5fSmrg#   modified version of the Autoconf Macro, you may extend this special
110168bd17e5fSmrg#   exception to the GPL to apply to your modified version as well.#
110178bd17e5fSmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
110188bd17e5fSmrg[AC_MSG_CHECKING([whether the linker accepts $1])
110198bd17e5fSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
110208bd17e5fSmrgAS_LITERAL_IF([$1],
110218bd17e5fSmrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
110228bd17e5fSmrg      ax_save_FLAGS=$LDFLAGS
110238bd17e5fSmrg      LDFLAGS="$1"
110248bd17e5fSmrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
110258bd17e5fSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
110268bd17e5fSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
110278bd17e5fSmrg      LDFLAGS=$ax_save_FLAGS])],
110288bd17e5fSmrg  [ax_save_FLAGS=$LDFLAGS
110298bd17e5fSmrg   LDFLAGS="$1"
110308bd17e5fSmrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
110318bd17e5fSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
110328bd17e5fSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
110338bd17e5fSmrg   LDFLAGS=$ax_save_FLAGS])
110348bd17e5fSmrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
110358bd17e5fSmrgAC_MSG_RESULT($xorg_check_linker_flags)
110368bd17e5fSmrgif test "x$xorg_check_linker_flags" = xyes; then
110378bd17e5fSmrg	m4_default([$2], :)
110388bd17e5fSmrgelse
110398bd17e5fSmrg	m4_default([$3], :)
110408bd17e5fSmrgfi
110418bd17e5fSmrg]) # XORG_CHECK_LINKER_FLAGS
110428c4a8e55Smrg
110438bd17e5fSmrg# XORG_MEMORY_CHECK_FLAGS
110448bd17e5fSmrg# -----------------------
110458bd17e5fSmrg# Minimum version: 1.16.0
110460597fb56Smrg#
110478bd17e5fSmrg# This macro attempts to find appropriate memory checking functionality
110488bd17e5fSmrg# for various platforms which unit testing code may use to catch various
110498bd17e5fSmrg# forms of memory allocation and access errors in testing.
110508bd17e5fSmrg#
110518bd17e5fSmrg# Interface to module:
110528bd17e5fSmrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
110538bd17e5fSmrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
110548bd17e5fSmrg#
110558bd17e5fSmrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
110568bd17e5fSmrg#
110578bd17e5fSmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
110588bd17e5fSmrg
110598bd17e5fSmrgAC_REQUIRE([AC_CANONICAL_HOST])
110608bd17e5fSmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
110618bd17e5fSmrg           [Environment variables to enable memory checking in tests])
110628c4a8e55Smrg
110638bd17e5fSmrg# Check for different types of support on different platforms
110648bd17e5fSmrgcase $host_os in
110658bd17e5fSmrg    solaris*)
110668bd17e5fSmrg        AC_CHECK_LIB([umem], [umem_alloc],
110678bd17e5fSmrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
110688bd17e5fSmrg        ;;
110698bd17e5fSmrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
110708bd17e5fSmrg        # both directly and inverted, so should not be 0 or 255.
110718bd17e5fSmrg        malloc_debug_env='MALLOC_PERTURB_=15'
110728bd17e5fSmrg        ;;
110738bd17e5fSmrg    darwin*)
110748bd17e5fSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
110758bd17e5fSmrg        ;;
110768bd17e5fSmrg    *bsd*)
110778bd17e5fSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
110788bd17e5fSmrg        ;;
110798bd17e5fSmrgesac
110808c4a8e55Smrg
110818bd17e5fSmrg# User supplied flags override default flags
110828bd17e5fSmrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
110838bd17e5fSmrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
110840597fb56Smrgfi
110858c4a8e55Smrg
110868bd17e5fSmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
110878bd17e5fSmrg]) # XORG_WITH_LINT
110888bd17e5fSmrg
110898bd17e5fSmrg# XORG_CHECK_MALLOC_ZERO
110908bd17e5fSmrg# ----------------------
110918bd17e5fSmrg# Minimum version: 1.0.0
110920597fb56Smrg#
110938bd17e5fSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
110948bd17e5fSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
110958bd17e5fSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
110968bd17e5fSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
110978bd17e5fSmrgAC_ARG_ENABLE(malloc0returnsnull,
110988bd17e5fSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
110998bd17e5fSmrg		       [malloc(0) returns NULL (default: auto)]),
111008bd17e5fSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
111018bd17e5fSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
11102706b6b52Smrg
111038bd17e5fSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
111048bd17e5fSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
111058bd17e5fSmrg	AC_RUN_IFELSE([AC_LANG_PROGRAM([
111068bd17e5fSmrg#include <stdlib.h>
111078bd17e5fSmrg],[
111088bd17e5fSmrg    char *m0, *r0, *c0, *p;
111098bd17e5fSmrg    m0 = malloc(0);
111108bd17e5fSmrg    p = malloc(10);
111118bd17e5fSmrg    r0 = realloc(p,0);
111128bd17e5fSmrg    c0 = calloc(0,10);
111138bd17e5fSmrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
111148bd17e5fSmrg])],
111158bd17e5fSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
111168bd17e5fSmrg		[MALLOC_ZERO_RETURNS_NULL=no],
111178bd17e5fSmrg		[MALLOC_ZERO_RETURNS_NULL=yes])
111188bd17e5fSmrgfi
111198bd17e5fSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
111208c4a8e55Smrg
111218bd17e5fSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
111228bd17e5fSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
111238bd17e5fSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
111248bd17e5fSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
111250597fb56Smrgelse
111268bd17e5fSmrg	MALLOC_ZERO_CFLAGS=""
111278bd17e5fSmrg	XMALLOC_ZERO_CFLAGS=""
111288bd17e5fSmrg	XTMALLOC_ZERO_CFLAGS=""
111290597fb56Smrgfi
111308c4a8e55Smrg
111318bd17e5fSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
111328bd17e5fSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
111338bd17e5fSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
111348bd17e5fSmrg]) # XORG_CHECK_MALLOC_ZERO
111358c4a8e55Smrg
111368bd17e5fSmrg# XORG_WITH_LINT()
111378bd17e5fSmrg# ----------------
111388bd17e5fSmrg# Minimum version: 1.1.0
111390597fb56Smrg#
111408bd17e5fSmrg# This macro enables the use of a tool that flags some suspicious and
111418bd17e5fSmrg# non-portable constructs (likely to be bugs) in C language source code.
111428bd17e5fSmrg# It will attempt to locate the tool and use appropriate options.
111438bd17e5fSmrg# There are various lint type tools on different platforms.
111440597fb56Smrg#
111458bd17e5fSmrg# Interface to module:
111468bd17e5fSmrg# LINT:		returns the path to the tool found on the platform
111478bd17e5fSmrg#		or the value set to LINT on the configure cmd line
111488bd17e5fSmrg#		also an Automake conditional
111498bd17e5fSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
111508bd17e5fSmrg#
111518bd17e5fSmrg# --with-lint:	'yes' user instructs the module to use lint
111528bd17e5fSmrg#		'no' user instructs the module not to use lint (default)
111538bd17e5fSmrg#
111548bd17e5fSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
111558bd17e5fSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
111568bd17e5fSmrg#
111578bd17e5fSmrgAC_DEFUN([XORG_WITH_LINT],[
111588c4a8e55Smrg
111598bd17e5fSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
111608bd17e5fSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
111618bd17e5fSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
111628bd17e5fSmrg		[Use a lint-style source code checker (default: disabled)])],
111638bd17e5fSmrg		[use_lint=$withval], [use_lint=no])
111648c4a8e55Smrg
111658bd17e5fSmrg# Obtain platform specific info like program name and options
111668bd17e5fSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
111678bd17e5fSmrgcase $host_os in
111688bd17e5fSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
111698bd17e5fSmrg	lint_name=splint
111708bd17e5fSmrg	lint_options="-badflag"
111718bd17e5fSmrg	;;
111728bd17e5fSmrg  *freebsd* | *netbsd*)
111738bd17e5fSmrg	lint_name=lint
111748bd17e5fSmrg	lint_options="-u -b"
111758bd17e5fSmrg	;;
111768bd17e5fSmrg  *solaris*)
111778bd17e5fSmrg	lint_name=lint
111788bd17e5fSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
111798bd17e5fSmrg	;;
111800597fb56Smrgesac
111818bd17e5fSmrg
111828bd17e5fSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
111838bd17e5fSmrgif test "x$use_lint" = x"yes" ; then
111848bd17e5fSmrg   AC_PATH_PROG([LINT], [$lint_name])
111858bd17e5fSmrg   if test "x$LINT" = "x"; then
111868bd17e5fSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
111878bd17e5fSmrg   fi
111888bd17e5fSmrgelif test "x$use_lint" = x"no" ; then
111898bd17e5fSmrg   if test "x$LINT" != "x"; then
111908bd17e5fSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
111918bd17e5fSmrg   fi
111928bd17e5fSmrgelse
111938bd17e5fSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
111940597fb56Smrgfi
111958c4a8e55Smrg
111968bd17e5fSmrg# User supplied flags override default flags
111978bd17e5fSmrgif test "x$LINT_FLAGS" != "x"; then
111988bd17e5fSmrg   lint_options=$LINT_FLAGS
111998bd17e5fSmrgfi
112008c4a8e55Smrg
112018bd17e5fSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
112028bd17e5fSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
112038c4a8e55Smrg
112048bd17e5fSmrg]) # XORG_WITH_LINT
112058c4a8e55Smrg
112068bd17e5fSmrg# XORG_LINT_LIBRARY(LIBNAME)
112078bd17e5fSmrg# --------------------------
112088bd17e5fSmrg# Minimum version: 1.1.0
112098bd17e5fSmrg#
112108bd17e5fSmrg# Sets up flags for building lint libraries for checking programs that call
112118bd17e5fSmrg# functions in the library.
112128bd17e5fSmrg#
112138bd17e5fSmrg# Interface to module:
112148bd17e5fSmrg# LINTLIB		- Automake variable with the name of lint library file to make
112158bd17e5fSmrg# MAKE_LINT_LIB		- Automake conditional
112168bd17e5fSmrg#
112178bd17e5fSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
112188bd17e5fSmrg#			  - 'no' user instructs the module not to create a lint library (default)
11219b042e37fSmrg
112208bd17e5fSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
112218bd17e5fSmrgAC_REQUIRE([XORG_WITH_LINT])
112228bd17e5fSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
112238bd17e5fSmrg	[Create lint library (default: disabled)])],
112248bd17e5fSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
11225b042e37fSmrg
112268bd17e5fSmrgif test "x$make_lint_lib" = x"yes" ; then
112278bd17e5fSmrg   LINTLIB=llib-l$1.ln
112288bd17e5fSmrg   if test "x$LINT" = "x"; then
112298bd17e5fSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
112308bd17e5fSmrg   fi
112318bd17e5fSmrgelif test "x$make_lint_lib" != x"no" ; then
112328bd17e5fSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
112330597fb56Smrgfi
112340597fb56Smrg
112358bd17e5fSmrgAC_SUBST(LINTLIB)
112368bd17e5fSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
112378bd17e5fSmrg
112388bd17e5fSmrg]) # XORG_LINT_LIBRARY
112398bd17e5fSmrg
112408bd17e5fSmrg# XORG_COMPILER_BRAND
112418bd17e5fSmrg# -------------------
112428bd17e5fSmrg# Minimum version: 1.14.0
112438bd17e5fSmrg#
112448bd17e5fSmrg# Checks for various brands of compilers and sets flags as appropriate:
112458bd17e5fSmrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
112468bd17e5fSmrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
112478bd17e5fSmrg#   clang compiler - sets CLANGCC to "yes"
112488bd17e5fSmrg#   Intel compiler - sets INTELCC to "yes"
112498bd17e5fSmrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
112508bd17e5fSmrg#
112518bd17e5fSmrgAC_DEFUN([XORG_COMPILER_BRAND], [
112528bd17e5fSmrgAC_LANG_CASE(
112538bd17e5fSmrg	[C], [
112548bd17e5fSmrg		AC_REQUIRE([AC_PROG_CC_C99])
112558bd17e5fSmrg	],
112568bd17e5fSmrg	[C++], [
112578bd17e5fSmrg		AC_REQUIRE([AC_PROG_CXX])
112588bd17e5fSmrg	]
112598bd17e5fSmrg)
112608bd17e5fSmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
112618bd17e5fSmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
112628bd17e5fSmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
112638bd17e5fSmrg]) # XORG_COMPILER_BRAND
112648bd17e5fSmrg
112658bd17e5fSmrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
112668bd17e5fSmrg# ---------------
112678bd17e5fSmrg# Minimum version: 1.16.0
112680597fb56Smrg#
112698bd17e5fSmrg# Test if the compiler works when passed the given flag as a command line argument.
112708bd17e5fSmrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
112718bd17e5fSmrg# next flag in the list until there are no more options.
112728bd17e5fSmrg#
112738bd17e5fSmrg# Note that this does not guarantee that the compiler supports the flag as some
112748bd17e5fSmrg# compilers will simply ignore arguments that they do not understand, but we do
112758bd17e5fSmrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
112768bd17e5fSmrg# -Werror=unused-command-line-argument
112778bd17e5fSmrg#
112788bd17e5fSmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
112798bd17e5fSmrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
112808bd17e5fSmrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
112818c4a8e55Smrg
112828bd17e5fSmrgAC_LANG_COMPILER_REQUIRE
112838c4a8e55Smrg
112848bd17e5fSmrgAC_LANG_CASE(
112858bd17e5fSmrg	[C], [
112868bd17e5fSmrg		AC_REQUIRE([AC_PROG_CC_C99])
112878bd17e5fSmrg		define([PREFIX], [C])
112888bd17e5fSmrg		define([CACHE_PREFIX], [cc])
112898bd17e5fSmrg		define([COMPILER], [$CC])
112908bd17e5fSmrg	],
112918bd17e5fSmrg	[C++], [
112928bd17e5fSmrg		define([PREFIX], [CXX])
112938bd17e5fSmrg		define([CACHE_PREFIX], [cxx])
112948bd17e5fSmrg		define([COMPILER], [$CXX])
112958bd17e5fSmrg	]
112968bd17e5fSmrg)
112978c4a8e55Smrg
112988bd17e5fSmrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
112998c4a8e55Smrg
113008bd17e5fSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
113018bd17e5fSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
113028bd17e5fSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
113038bd17e5fSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
113048bd17e5fSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
113058bd17e5fSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
113068bd17e5fSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
113078bd17e5fSmrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
113088bd17e5fSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
113098bd17e5fSmrgfi
113108c4a8e55Smrg
113118bd17e5fSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
113128bd17e5fSmrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
113138bd17e5fSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
113148bd17e5fSmrg	fi
113158bd17e5fSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
113168bd17e5fSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
113178bd17e5fSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
113188bd17e5fSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
113198bd17e5fSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
113208bd17e5fSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
113218bd17e5fSmrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
113228bd17e5fSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
113238bd17e5fSmrgfi
113248c4a8e55Smrg
113258bd17e5fSmrgfound="no"
113268bd17e5fSmrgm4_foreach([flag], m4_cdr($@), [
113278bd17e5fSmrg	if test $found = "no" ; then
113288bd17e5fSmrg		if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
113298bd17e5fSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
113308bd17e5fSmrg		fi
11331706b6b52Smrg
113328bd17e5fSmrg		if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
113338bd17e5fSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
113348bd17e5fSmrg		fi
11335706b6b52Smrg
113368bd17e5fSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
11337706b6b52Smrg
113388bd17e5fSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
113398bd17e5fSmrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
113408bd17e5fSmrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
113418bd17e5fSmrg		AC_CACHE_VAL($cacheid,
113428bd17e5fSmrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
113438bd17e5fSmrg					     [eval $cacheid=yes],
113448bd17e5fSmrg					     [eval $cacheid=no])])
11345706b6b52Smrg
113468bd17e5fSmrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
113478c4a8e55Smrg
113488bd17e5fSmrg		eval supported=\$$cacheid
113498bd17e5fSmrg		AC_MSG_RESULT([$supported])
113508bd17e5fSmrg		if test "$supported" = "yes" ; then
113518bd17e5fSmrg			$1="$$1 ]flag["
113528bd17e5fSmrg			found="yes"
113538bd17e5fSmrg		fi
113548bd17e5fSmrg	fi
113558bd17e5fSmrg])
113568bd17e5fSmrg]) # XORG_TESTSET_CFLAG
113578c4a8e55Smrg
113588bd17e5fSmrg# XORG_COMPILER_FLAGS
113590597fb56Smrg# ---------------
113608bd17e5fSmrg# Minimum version: 1.16.0
113618bd17e5fSmrg#
113628bd17e5fSmrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
113638bd17e5fSmrg# arguments supported by the selected compiler which do NOT alter the generated
113648bd17e5fSmrg# code.  These arguments will cause the compiler to print various warnings
113658bd17e5fSmrg# during compilation AND turn a conservative set of warnings into errors.
113668bd17e5fSmrg#
113678bd17e5fSmrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
113688bd17e5fSmrg# future versions of util-macros as options are added to new compilers.
113698bd17e5fSmrg#
113708bd17e5fSmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
113718bd17e5fSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
113728c4a8e55Smrg
113738bd17e5fSmrgAC_ARG_ENABLE(selective-werror,
113748bd17e5fSmrg              AS_HELP_STRING([--disable-selective-werror],
113758bd17e5fSmrg                             [Turn off selective compiler errors. (default: enabled)]),
113768bd17e5fSmrg              [SELECTIVE_WERROR=$enableval],
113778bd17e5fSmrg              [SELECTIVE_WERROR=yes])
113788c4a8e55Smrg
113798bd17e5fSmrgAC_LANG_CASE(
113808bd17e5fSmrg        [C], [
113818bd17e5fSmrg                define([PREFIX], [C])
113828bd17e5fSmrg        ],
113838bd17e5fSmrg        [C++], [
113848bd17e5fSmrg                define([PREFIX], [CXX])
113858bd17e5fSmrg        ]
113868bd17e5fSmrg)
113878bd17e5fSmrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
113888bd17e5fSmrgif test "x$SUNCC" = "xyes"; then
113898bd17e5fSmrg    [BASE_]PREFIX[FLAGS]="-v"
113900597fb56Smrgelse
113918bd17e5fSmrg    [BASE_]PREFIX[FLAGS]=""
113920597fb56Smrgfi
11393706b6b52Smrg
113948bd17e5fSmrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
113958bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
113968bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
113978bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
113988bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
11399706b6b52Smrg
114008bd17e5fSmrgAC_LANG_CASE(
114018bd17e5fSmrg	[C], [
114028bd17e5fSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
114038bd17e5fSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
114048bd17e5fSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
114058bd17e5fSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
114068bd17e5fSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
114078bd17e5fSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
114088bd17e5fSmrg	]
114098bd17e5fSmrg)
11410706b6b52Smrg
114118bd17e5fSmrg# This chunk adds additional warnings that could catch undesired effects.
114128bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
114138bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
114148bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
114158bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
114168bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
114178bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
114188bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
11419706b6b52Smrg
114208bd17e5fSmrg# These are currently disabled because they are noisy.  They will be enabled
114218bd17e5fSmrg# in the future once the codebase is sufficiently modernized to silence
114228bd17e5fSmrg# them.  For now, I don't want them to drown out the other warnings.
114238bd17e5fSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
114248bd17e5fSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
114258bd17e5fSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
114260597fb56Smrg
114278bd17e5fSmrg# Turn some warnings into errors, so we don't accidently get successful builds
114288bd17e5fSmrg# when there are problems that should be fixed.
114290597fb56Smrg
114308bd17e5fSmrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
114318bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
114328bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
114338bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
114348bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
114358bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
114368bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
114378bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
114388bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
114398bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
114408bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
114418bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
114428bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
114438bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
114448bd17e5fSmrgelse
114458bd17e5fSmrgAC_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])
114468bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
114478bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
114488bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
114498bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
114508bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
114518bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
114528bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
114538bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
114548bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
114558bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
114568bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
114578bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
114588bd17e5fSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
114590597fb56Smrgfi
114600597fb56Smrg
114618bd17e5fSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
114628bd17e5fSmrg]) # XORG_COMPILER_FLAGS
114638bd17e5fSmrg
114648bd17e5fSmrg# XORG_CWARNFLAGS
114658bd17e5fSmrg# ---------------
114668bd17e5fSmrg# Minimum version: 1.2.0
114678bd17e5fSmrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
114688c4a8e55Smrg#
114698bd17e5fSmrg# Defines CWARNFLAGS to enable C compiler warnings.
114708bd17e5fSmrg#
114718bd17e5fSmrg# This function is deprecated because it defines -fno-strict-aliasing
114728bd17e5fSmrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
114738bd17e5fSmrg# is needed, then it should be added explicitly in the module when
114748bd17e5fSmrg# it is updated to use BASE_CFLAGS.
114758bd17e5fSmrg#
114768bd17e5fSmrgAC_DEFUN([XORG_CWARNFLAGS], [
114778bd17e5fSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
114788bd17e5fSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
114798bd17e5fSmrgAC_LANG_CASE(
114808bd17e5fSmrg	[C], [
114818bd17e5fSmrg		CWARNFLAGS="$BASE_CFLAGS"
114828bd17e5fSmrg		if  test "x$GCC" = xyes ; then
114838bd17e5fSmrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
114848bd17e5fSmrg		fi
114858bd17e5fSmrg		AC_SUBST(CWARNFLAGS)
114868bd17e5fSmrg	]
114878bd17e5fSmrg)
114888bd17e5fSmrg]) # XORG_CWARNFLAGS
114898c4a8e55Smrg
114908bd17e5fSmrg# XORG_STRICT_OPTION
114918bd17e5fSmrg# -----------------------
114928bd17e5fSmrg# Minimum version: 1.3.0
114938bd17e5fSmrg#
114948bd17e5fSmrg# Add configure option to enable strict compilation flags, such as treating
114958bd17e5fSmrg# warnings as fatal errors.
114968bd17e5fSmrg# If --enable-strict-compilation is passed to configure, adds strict flags to
114978bd17e5fSmrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
114988bd17e5fSmrg#
114998bd17e5fSmrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
115008bd17e5fSmrg# when strict compilation is unconditionally desired.
115018bd17e5fSmrgAC_DEFUN([XORG_STRICT_OPTION], [
115028bd17e5fSmrgAC_REQUIRE([XORG_CWARNFLAGS])
115038bd17e5fSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
115048c4a8e55Smrg
115058bd17e5fSmrgAC_ARG_ENABLE(strict-compilation,
115068bd17e5fSmrg			  AS_HELP_STRING([--enable-strict-compilation],
115078bd17e5fSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
115088bd17e5fSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
115098c4a8e55Smrg
115108bd17e5fSmrgAC_LANG_CASE(
115118bd17e5fSmrg        [C], [
115128bd17e5fSmrg                define([PREFIX], [C])
115138bd17e5fSmrg        ],
115148bd17e5fSmrg        [C++], [
115158bd17e5fSmrg                define([PREFIX], [CXX])
115168bd17e5fSmrg        ]
115178bd17e5fSmrg)
11518706b6b52Smrg
115198bd17e5fSmrg[STRICT_]PREFIX[FLAGS]=""
115208bd17e5fSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
115218bd17e5fSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
11522706b6b52Smrg
115238bd17e5fSmrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
115248bd17e5fSmrg# activate it with -Werror, so we add it here explicitly.
115258bd17e5fSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
115268c4a8e55Smrg
115278bd17e5fSmrgif test "x$STRICT_COMPILE" = "xyes"; then
115288bd17e5fSmrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
115298bd17e5fSmrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
115308bd17e5fSmrgfi
115318bd17e5fSmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
115328bd17e5fSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
115338bd17e5fSmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
115348bd17e5fSmrg]) # XORG_STRICT_OPTION
115358c4a8e55Smrg
115368bd17e5fSmrg# XORG_DEFAULT_OPTIONS
115370597fb56Smrg# --------------------
115388bd17e5fSmrg# Minimum version: 1.3.0
115398c4a8e55Smrg#
115408bd17e5fSmrg# Defines default options for X.Org modules.
11541706b6b52Smrg#
115428bd17e5fSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
115438bd17e5fSmrgAC_REQUIRE([AC_PROG_INSTALL])
115448bd17e5fSmrgXORG_COMPILER_FLAGS
115458bd17e5fSmrgXORG_CWARNFLAGS
115468bd17e5fSmrgXORG_STRICT_OPTION
115478bd17e5fSmrgXORG_RELEASE_VERSION
115488bd17e5fSmrgXORG_CHANGELOG
115498bd17e5fSmrgXORG_INSTALL
115508bd17e5fSmrgXORG_MANPAGE_SECTIONS
115518bd17e5fSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
115528bd17e5fSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
115538bd17e5fSmrg]) # XORG_DEFAULT_OPTIONS
11554706b6b52Smrg
115558bd17e5fSmrg# XORG_INSTALL()
115568bd17e5fSmrg# ----------------
115578bd17e5fSmrg# Minimum version: 1.4.0
115588bd17e5fSmrg#
115598bd17e5fSmrg# Defines the variable INSTALL_CMD as the command to copy
115608bd17e5fSmrg# INSTALL from $prefix/share/util-macros.
115618bd17e5fSmrg#
115628bd17e5fSmrgAC_DEFUN([XORG_INSTALL], [
115638bd17e5fSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
115648bd17e5fSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
115658bd17e5fSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
115668bd17e5fSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
115678bd17e5fSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
115688bd17e5fSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
115698bd17e5fSmrgAC_SUBST([INSTALL_CMD])
115708bd17e5fSmrg]) # XORG_INSTALL
115718bd17e5fSmrgdnl Copyright 2005 Red Hat, Inc
115728bd17e5fSmrgdnl
115738bd17e5fSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
115748bd17e5fSmrgdnl documentation for any purpose is hereby granted without fee, provided that
115758bd17e5fSmrgdnl the above copyright notice appear in all copies and that both that
115768bd17e5fSmrgdnl copyright notice and this permission notice appear in supporting
115778bd17e5fSmrgdnl documentation.
115788bd17e5fSmrgdnl
115798bd17e5fSmrgdnl The above copyright notice and this permission notice shall be included
115808bd17e5fSmrgdnl in all copies or substantial portions of the Software.
115818bd17e5fSmrgdnl
115828bd17e5fSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
115838bd17e5fSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
115848bd17e5fSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
115858bd17e5fSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
115868bd17e5fSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
115878bd17e5fSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
115888bd17e5fSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
115898bd17e5fSmrgdnl
115908bd17e5fSmrgdnl Except as contained in this notice, the name of the copyright holders shall
115918bd17e5fSmrgdnl not be used in advertising or otherwise to promote the sale, use or
115928bd17e5fSmrgdnl other dealings in this Software without prior written authorization
115938bd17e5fSmrgdnl from the copyright holders.
115948bd17e5fSmrgdnl
11595706b6b52Smrg
115968bd17e5fSmrg# XORG_RELEASE_VERSION
115978bd17e5fSmrg# --------------------
115988bd17e5fSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
115998bd17e5fSmrg 
116008bd17e5fSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
116018bd17e5fSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
116028bd17e5fSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
116038bd17e5fSmrg		[Major version of this package])
116048bd17e5fSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
116058bd17e5fSmrg	if test "x$PVM" = "x"; then
116068bd17e5fSmrg		PVM="0"
116078bd17e5fSmrg	fi
116088bd17e5fSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
116098bd17e5fSmrg		[$PVM],
116108bd17e5fSmrg		[Minor version of this package])
116118bd17e5fSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
116128bd17e5fSmrg	if test "x$PVP" = "x"; then
116138bd17e5fSmrg		PVP="0"
116148bd17e5fSmrg	fi
116158bd17e5fSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
116168bd17e5fSmrg		[$PVP],
116178bd17e5fSmrg		[Patch version of this package])
116188bd17e5fSmrg])
116190597fb56Smrg
116208bd17e5fSmrg# XORG_CHANGELOG()
116218bd17e5fSmrg# ----------------
116228bd17e5fSmrg# Minimum version: 1.2.0
116238bd17e5fSmrg#
116248bd17e5fSmrg# Defines the variable CHANGELOG_CMD as the command to generate
116258bd17e5fSmrg# ChangeLog from git.
116268bd17e5fSmrg#
116278bd17e5fSmrg#
116288bd17e5fSmrgAC_DEFUN([XORG_CHANGELOG], [
116298bd17e5fSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
116308bd17e5fSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
116318bd17e5fSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
116328bd17e5fSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
116338bd17e5fSmrgAC_SUBST([CHANGELOG_CMD])
116348bd17e5fSmrg]) # XORG_CHANGELOG
11635b042e37fSmrg
11636